agave-files/files-core/src/main/java/org/iplantc/service/io/manager/FileEventProcessor.java
/**
	 * Generates notification events for permission-related changes to a 
	 * {@link LogicalFile}. Permission changes are not propagated to the 
	 * parent folder, but they are to the system.
	 * 
	 * @param logicalFile
	 * @param permission
	 * @param event
	 * @return the {@link FileEvent} updated with the association to the {@link LogicalFile}
	 * 
	 * @throws FileEventProcessingException
	 */
Generates notification events for permission-related changes to a
LogicalFile. Permission changes are not propagated to the
parent folder, but they are to the system.

@param logicalFile
@param permission
@param event
@return the  FileEvent updated with the association to the  LogicalFile


Generates notification events for permission - related changes to a LogicalFile . Permission changes are not propagated to the parent folder but they are to the system . @param logicalFile @param permission @param event @return the FileEvent updated with the association to the LogicalFile
public FileEvent processPermissionEvent(LogicalFile logicalFile, RemoteFilePermission permission, FileEvent event) 
	throws FileEventProcessingException 
	{
		if (logicalFile == null) {
			throw new FileEventProcessingException("Valid logical file must be provided to process event.");
		}
		if (permission == null) {
			throw new FileEventProcessingException("Valid remote file permission must be provided to process event.");
		}
		if (event == null) {
			throw new FileEventProcessingException("Valid file event must be provided to process event.");
		}
		event.setLogicalFile(logicalFile);
		ObjectNode json = null;
		try {
		    json = mapper.createObjectNode();
	    	json.set("file", mapper.readTree(logicalFile.toJSON()));
		    json.set("permission", mapper.readTree(permission.toJSON(logicalFile.getAgaveRelativePathFromAbsolutePath(), logicalFile.getSystem().getSystemId())));
		} catch (Throwable e) {
		    String msg = String.format("Failed to serialize logical file "
                                       + "%s to json for %s event notification", 
                                       logicalFile.getUuid(), event.getStatus());
		    log.error(msg, e);
		    throw new FileEventProcessingException(msg, e);
		}
		NotificationManager.process(logicalFile.getUuid(), event.getStatus(), event.getCreatedBy(), json.toString());
		fireSystemNotification(event, json);
		return event;
	}
public FileEvent processPermissionEvent ( LogicalFile logicalFile , RemoteFilePermission permission , FileEvent event ) throws FileEventProcessingException { if ( logicalFile == null ) { throw new FileEventProcessingException ( "Valid logical file must be provided to process event." ) ; } if ( permission == null ) { throw new FileEventProcessingException ( "Valid remote file permission must be provided to process event." ) ; } if ( event == null ) { throw new FileEventProcessingException ( "Valid file event must be provided to process event." ) ; } event . setLogicalFile ( logicalFile ) ; ObjectNode json = null ; try { json = mapper . createObjectNode ( ) ; json . set ( "file" , mapper . readTree ( logicalFile . toJSON ( ) ) ) ; json . set ( "permission" , mapper . readTree ( permission . toJSON ( logicalFile . getAgaveRelativePathFromAbsolutePath ( ) , logicalFile . getSystem ( ) . getSystemId ( ) ) ) ) ; } catch ( Throwable e ) { String msg = String . format ( "Failed to serialize logical file " + "%s to json for %s event notification" , logicalFile . getUuid ( ) , event . getStatus ( ) ) ; log . error ( msg , e ) ; throw new FileEventProcessingException ( msg , e ) ; } NotificationManager . process ( logicalFile . getUuid ( ) , event . getStatus ( ) , event . getCreatedBy ( ) , json . toString ( ) ) ; fireSystemNotification ( event , json ) ; return event ; }
Generates notification events for permission-related changes to a
 {@link LogicalFile}.
Generates notification events for permission - related changes to a { @link LogicalFile } .