agave-tags/tags-core/src/main/java/org/iplantc/service/tags/events/TagEventProcessor.java
/**
	 * Generates notification events for permission-related changes to a 
	 * {@link Tag}. Permission changes are not propagated to the associated
	 * resources.
	 * 
	 * @param tag
	 * @param permission
	 * @param event
	 * @return the {@link TagEvent}
	 * 
	 * @throws TagEventProcessingException
	 */
Generates notification events for permission-related changes to a
Tag. Permission changes are not propagated to the associated
resources.




Generates notification events for permission - related changes to a Tag . Permission changes are not propagated to the associated resources .
public TagEvent processPermissionEvent(Tag tag, TagPermission permission, TagEvent event) 
	throws TagEventProcessingException 
	{
		if (tag == null) {
			throw new TagEventProcessingException("Validtage must be provided to process event.");
		}
		if (permission == null) {
			throw new TagEventProcessingException("Valid tag permission must be provided to process event.");
		}
		if (event == null) {
			throw new TagEventProcessingException("Valid tag event must be provided to process event.");
		}
		ObjectNode json = null;
		try {
		    json = mapper.createObjectNode();
	    	json.set("tag", tag.toJSON());
		    json.set("permission", mapper.readTree(permission.toJSON()));
		} catch (Throwable e) {
		    log.error(String.format("Failed to serialize tag "
		            + "%s to json for %s event notification", 
		            tag.getUuid(), event.getStatus()), e);
		    json = null;
		}
		try {
			dao.persist(event);
		}
		catch (TagEventPersistenceException e) {
			log.error("Failed to save tag event " + event.getStatus() + " on tag " + tag.getUuid(), e);
		}
		NotificationManager.process(tag.getUuid(), event.getStatus(), event.getCreatedBy(), json.toString());
		return event;
	}
public TagEvent processPermissionEvent ( Tag tag , TagPermission permission , TagEvent event ) throws TagEventProcessingException { if ( tag == null ) { throw new TagEventProcessingException ( "Validtage must be provided to process event." ) ; } if ( permission == null ) { throw new TagEventProcessingException ( "Valid tag permission must be provided to process event." ) ; } if ( event == null ) { throw new TagEventProcessingException ( "Valid tag event must be provided to process event." ) ; } ObjectNode json = null ; try { json = mapper . createObjectNode ( ) ; json . set ( "tag" , tag . toJSON ( ) ) ; json . set ( "permission" , mapper . readTree ( permission . toJSON ( ) ) ) ; } catch ( Throwable e ) { log . error ( String . format ( "Failed to serialize tag " + "%s to json for %s event notification" , tag . getUuid ( ) , event . getStatus ( ) ) , e ) ; json = null ; } try { dao . persist ( event ) ; } catch ( TagEventPersistenceException e ) { log . error ( "Failed to save tag event " + event . getStatus ( ) + " on tag " + tag . getUuid ( ) , e ) ; } NotificationManager . process ( tag . getUuid ( ) , event . getStatus ( ) , event . getCreatedBy ( ) , json . toString ( ) ) ; return event ; }
Generates notification events for permission-related changes to a
 {@link Tag}.
Generates notification events for permission - related changes to a { @link Tag } .
// We do not fire delegated tag permission events on associated uuids 