private boolean isASystemEvent( Object _event ) { ResourceUpdatedEvent event = (ResourceUpdatedEvent) _event; final String user = event.getSessionInfo().getIdentity().getIdentifier(); if ( user.equalsIgnoreCase( "system" ) || user.equalsIgnoreCase( "<system>" ) ) { return true; } return false; }
void onResourceUpdated(@Observes final ResourceUpdatedEvent updatedEvent) { if (path != null && path.equals(updatedEvent.getPath())) { if (sessionInfo.getId().equals(updatedEvent.getSessionInfo().getId())) { executeUpdateCommands(); } else { executeConcurrentUpdateCommand(updatedEvent.getPath(), updatedEvent.getSessionInfo().getId(), updatedEvent.getSessionInfo().getIdentity()); } } }
void onResourceUpdated(@Observes ResourceUpdatedEvent res) { if (lockTarget != null && res.getPath().equals(lockTarget.getPath())) { if (!res.getSessionInfo().getIdentity().equals(user)) { reload(); } releaseLock(); } }
public void processResourceUpdate(@Observes final ResourceUpdatedEvent resourceUpdatedEvent) { processResourceChange(resourceUpdatedEvent.getSessionInfo(), resourceUpdatedEvent.getPath(), ResourceChangeType.UPDATE); incrementalBuilder.updateResource(resourceUpdatedEvent.getPath()); }
public void processResourceUpdate(@Observes final ResourceUpdatedEvent resourceUpdatedEvent) { processResourceChange(resourceUpdatedEvent.getSessionInfo(), resourceUpdatedEvent.getPath(), ResourceChangeType.UPDATE); incrementalBuilder.updateResource(resourceUpdatedEvent.getPath()); }
public void onResourceUpdate( @Observes final ResourceUpdatedEvent resourceUpdatedEvent ) { if ( defChangeHandler != null && isProcessable( resourceUpdatedEvent.getPath( ) ) ) { defChangeHandler.processResourceUpdate( resourceUpdatedEvent.getPath( ), resourceUpdatedEvent.getSessionInfo( ) ); } }
public void processResourceUpdate(@Observes final ResourceUpdatedEvent resourceUpdatedEvent) { processResourceChange(resourceUpdatedEvent.getSessionInfo(), resourceUpdatedEvent.getPath(), ResourceChangeType.UPDATE); incrementalBuilder.updateResource(resourceUpdatedEvent.getPath()); }
public void recordUserEditEvent( @Observes final ResourceUpdatedEvent event ) { checkNotNull( "event", event ); try { ioService.startBatch( bootstrapFS.getRootDirectories().iterator().next().getFileSystem() ); recordUserEditEvent( event.getPath().toURI(), event.getPath().getFileName(), event.getSessionInfo().getIdentity().getIdentifier() ); } finally { ioService.endBatch(); } }
private void verifyResourceUpdatedEvent(String file, String sessionId, String userId, String commitMessage) { verify(resourceUpdatedEvent, times(1)).fire(resourceUpdatedEventCaptor.capture()); assertEquals(file, resourceUpdatedEventCaptor.getValue().getPath().toURI()); assertEquals(sessionId, resourceUpdatedEventCaptor.getValue().getSessionInfo().getId()); assertEquals(userId, resourceUpdatedEventCaptor.getValue().getSessionInfo().getIdentity().getIdentifier()); assertEquals(commitMessage, resourceUpdatedEventCaptor.getValue().getMessage()); }
@Override public SocialActivitiesEvent toSocial( Object object ) { ResourceUpdatedEvent event = (ResourceUpdatedEvent) object; SocialUser socialUser = socialUserRepositoryAPI.findSocialUser( event.getSessionInfo().getIdentity().getIdentifier() ); String additionalInfo = "Edited"; String description = getCommitDescription( event ); return new SocialActivitiesEvent( socialUser, HomePageTypes.RESOURCE_UPDATE_EVENT.name(), new Date() ).withLink( event.getPath().getFileName(), event.getPath().toURI() ).withAdicionalInfo( additionalInfo ).withDescription( description ); }
private void verifyResourceUpdatedEvent(String file, String sessionId, String userId, String commitMessage) { verify(resourceUpdatedEvent, times(1)).fire(resourceUpdatedEventCaptor.capture()); assertEquals(file, resourceUpdatedEventCaptor.getValue().getPath().toURI()); assertEquals(sessionId, resourceUpdatedEventCaptor.getValue().getSessionInfo().getId()); assertEquals(userId, resourceUpdatedEventCaptor.getValue().getSessionInfo().getIdentity().getIdentifier()); assertEquals(commitMessage, resourceUpdatedEventCaptor.getValue().getMessage()); }