agave-tags/tags-core/src/main/java/org/iplantc/service/tags/managers/TaggedResourceManager.java
/**
	 * Removes all associationIds from the given tag.
	 * 
	 * @param username
	 * @throws TagException
	 */
Removes all associationIds from the given tag.

@param username
@throws TagException
Removes all associationIds from the given tag . @param username @throws TagException
public void clearAllFromTag(String username) 
	throws TagException 
	{
		if (tag == null) {
			throw new TagException("No tag specifed");
		}
		List<TaggedResource> oldTaggedResources = getTag().getTaggedResources();
		getTag().getTaggedResources().clear();
		getDao().persist(getTag());
		try {
			eventProcessor.processAssociatedUuidUpdateEvent(getTag(), oldTaggedResources,  
					new TagEvent(getTag().getUuid(),
							TagEventType.UPDATED,
							"The following resources were untagged: " + 
									StringUtils.join(getTag().getTaggedResourcesAsArray()),
							username));
		} catch (TagEventProcessingException e) {
			log.error("Failed to send tag resource removal event for " + getTag().getUuid(), e);
		}
	}
public void clearAllFromTag ( String username ) throws TagException { if ( tag == null ) { throw new TagException ( "No tag specifed" ) ; } List < TaggedResource > oldTaggedResources = getTag ( ) . getTaggedResources ( ) ; getTag ( ) . getTaggedResources ( ) . clear ( ) ; getDao ( ) . persist ( getTag ( ) ) ; try { eventProcessor . processAssociatedUuidUpdateEvent ( getTag ( ) , oldTaggedResources , new TagEvent ( getTag ( ) . getUuid ( ) , TagEventType . UPDATED , "The following resources were untagged: " + StringUtils . join ( getTag ( ) . getTaggedResourcesAsArray ( ) ) , username ) ) ; } catch ( TagEventProcessingException e ) { log . error ( "Failed to send tag resource removal event for " + getTag ( ) . getUuid ( ) , e ) ; } }
Removes all associationIds from the given tag.
Removes all associationIds from the given tag .
// remember old TaggedResource for event propagation after delete // clear all TaggedResource for the tag and save the empty list with the tag // process the events for the new associated UUIDS