agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/events/MetadataEventProcessor.java
/**
	 * Generates notification events for permission-related changes to a {@link MetadataItem}. This could be a CRUD
	 * operation or a change to the permissions.
	 * 
	 * @param uuid the uuid of the {@link MetadataItem} on which the permission event is triggered
	 * @param permission the {@link MetadataPermission} triggering this event
	 * @param eventType the {@link MetadataEventType} being triggered
	 * @param createdBy the user who caused this event
	 */
Generates notification events for permission-related changes to a  MetadataItem. This could be a CRUD
operation or a change to the permissions.

@param uuid the uuid of the  MetadataItem on which the permission event is triggered
@param permission the  MetadataPermission triggering this event
@param eventType the  MetadataEventType being triggered
@param createdBy the user who caused this event
Generates notification events for permission - related changes to a MetadataItem . This could be a CRUD operation or a change to the permissions . @param uuid the uuid of the MetadataItem on which the permission event is triggered @param permission the MetadataPermission triggering this event @param eventType the MetadataEventType being triggered @param createdBy the user who caused this event
public void processPermissionEvent(String uuid, MetadataPermission permission, MetadataEventType eventType, String createdBy, String serializedMetadataItem) {
		try {
			if (StringUtils.isEmpty(uuid)) {
				throw new EntityEventProcessingException("Valid metadata uuid must be provided to process event.");
			}
			if (permission == null) {
				throw new EntityEventProcessingException("Valid permission grant must be provided to process event.");
			}
			if (eventType == null) {
				throw new EntityEventProcessingException("Valid metadata event type must be provided to process event.");
			}
			if (StringUtils.isEmpty(createdBy)) {
				throw new EntityEventProcessingException("Valid metadata creator username must be provided to process event.");
			}
			if (StringUtils.isEmpty(serializedMetadataItem)) {
				throw new EntityEventProcessingException("Unable to serialize metadata item for processing.");
			}
			String sJson = null;
			try {
				sJson = "{\"metadata\":" + serializedMetadataItem + ", \"permission\":" + permission.toJSON(uuid) + "}";
			} catch (Throwable e) {
			    log.error(String.format("Failed to serialize metadata "
			            + "%s to json for %s event notification", 
			            uuid, eventType.name()), e);
			}
			processNotification(uuid, eventType.name(), createdBy, sJson);
		}
		catch (EntityEventProcessingException e) {
			log.error(e.getMessage());
		}
	}
public void processPermissionEvent ( String uuid , MetadataPermission permission , MetadataEventType eventType , String createdBy , String serializedMetadataItem ) { try { if ( StringUtils . isEmpty ( uuid ) ) { throw new EntityEventProcessingException ( "Valid metadata uuid must be provided to process event." ) ; } if ( permission == null ) { throw new EntityEventProcessingException ( "Valid permission grant must be provided to process event." ) ; } if ( eventType == null ) { throw new EntityEventProcessingException ( "Valid metadata event type must be provided to process event." ) ; } if ( StringUtils . isEmpty ( createdBy ) ) { throw new EntityEventProcessingException ( "Valid metadata creator username must be provided to process event." ) ; } if ( StringUtils . isEmpty ( serializedMetadataItem ) ) { throw new EntityEventProcessingException ( "Unable to serialize metadata item for processing." ) ; } String sJson = null ; try { sJson = "{\"metadata\":" + serializedMetadataItem + ", \"permission\":" + permission . toJSON ( uuid ) + "}" ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to serialize metadata " + "%s to json for %s event notification" , uuid , eventType . name ( ) ) , e ) ; } processNotification ( uuid , eventType . name ( ) , createdBy , sJson ) ; } catch ( EntityEventProcessingException e ) { log . error ( e . getMessage ( ) ) ; } }
Generates notification events for permission-related changes to a {@link MetadataItem}.
Generates notification events for permission - related changes to a { @link MetadataItem } .
// fire event on monitor //			// We fire delegated monitor chec events on the system being monitored. // hold on propagation events until they're useful. //			for (String associatedUuid: metadata.getAssociations().getRawUuid()) { //				processNotification(associatedUuid, "METADATA_" + eventType.name(), createdBy, sJson); //			}