agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemManager.java
/**
	 * Sets a system as the global default and unsets the previous default. If the system 
	 * is not public, an exception is thrown.
	 * 
	 * @param system
	 * @return
	 * @throws SystemException
	 */
Sets a system as the global default and unsets the previous default. If the system
is not public, an exception is thrown.

@param system
@return
@throws SystemException
Sets a system as the global default and unsets the previous default . If the system is not public an exception is thrown . @param system @return @throws SystemException
public RemoteSystem unsetGlobalDefault(RemoteSystem currentDefault, String apiUsername)
	throws SystemException, PermissionException
	{
		if (currentDefault == null) {
			throw new SystemException("No system provided.");
		} 
		else if (!currentDefault.isGlobalDefault()) {
			throw new SystemException("System " + currentDefault.getSystemId() + 
					" is not currently the global default " + currentDefault.getType() + " system.");
		} 
		else if (!ServiceUtils.isAdmin(apiUsername)) {
			throw new PermissionException("User does not have permission to configure global default");
		}
		currentDefault.setGlobalDefault(false);
		currentDefault.setRevision(currentDefault.getRevision() + 1);
		currentDefault.setLastUpdated(new Date());
		getDao().persist(currentDefault);
		getEventProcessor().processSystemUpdateEvent(currentDefault, SystemEventType.UNSET_PUBLIC_DEFAULT, apiUsername);
		return currentDefault;
	}
public RemoteSystem unsetGlobalDefault ( RemoteSystem currentDefault , String apiUsername ) throws SystemException , PermissionException { if ( currentDefault == null ) { throw new SystemException ( "No system provided." ) ; } else if ( ! currentDefault . isGlobalDefault ( ) ) { throw new SystemException ( "System " + currentDefault . getSystemId ( ) + " is not currently the global default " + currentDefault . getType ( ) + " system." ) ; } else if ( ! ServiceUtils . isAdmin ( apiUsername ) ) { throw new PermissionException ( "User does not have permission to configure global default" ) ; } currentDefault . setGlobalDefault ( false ) ; currentDefault . setRevision ( currentDefault . getRevision ( ) + 1 ) ; currentDefault . setLastUpdated ( new Date ( ) ) ; getDao ( ) . persist ( currentDefault ) ; getEventProcessor ( ) . processSystemUpdateEvent ( currentDefault , SystemEventType . UNSET_PUBLIC_DEFAULT , apiUsername ) ; return currentDefault ; }
Sets a system as the global default and unsets the previous default.
Sets a system as the global default and unsets the previous default .
// unset current default //		NotificationManager.process(currentDefault.getUuid(), "UNSET_PUBLIC_DEFAULT", apiUsername);