agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemManager.java
/**
     * Sets the system availability to true and notifies subscribers
     * @param system the system to make available
     * @param username user who made the request
     * @return the updated system
     */
Sets the system availability to true and notifies subscribers
@param system the system to make available
@param username user who made the request
@return the updated system
Sets the system availability to true and notifies subscribers @param system the system to make available @param username user who made the request @return the updated system
public RemoteSystem enableSystem(RemoteSystem system, String username) 
    throws SystemException, PermissionException
    {
    	if (StringUtils.equals(username, Settings.PUBLIC_USER_USERNAME) ||
    			StringUtils.equals(username, Settings.WORLD_USER_USERNAME)) {
    		throw new PermissionException("Permission denied. Public users may not manage systems.");
    	}
    	else if (system.isPubliclyAvailable() && !ServiceUtils.isAdmin(username)) {
            throw new PermissionException("Permission denied. Only tenant administrators may enable public systems.");
        }
        else if (!system.getUserRole(username).canAdmin()) {
            throw new PermissionException("Permission denied. Only users with the ADMIN role may enable this system.");
        }
        else 
        {
                system.setAvailable(true);
                getDao().persist(system);
                getEventProcessor().processSystemUpdateEvent(system, SystemEventType.ENABLED, username);
                return system;
        }
    }
public RemoteSystem enableSystem ( RemoteSystem system , String username ) throws SystemException , PermissionException { if ( StringUtils . equals ( username , Settings . PUBLIC_USER_USERNAME ) || StringUtils . equals ( username , Settings . WORLD_USER_USERNAME ) ) { throw new PermissionException ( "Permission denied. Public users may not manage systems." ) ; } else if ( system . isPubliclyAvailable ( ) && ! ServiceUtils . isAdmin ( username ) ) { throw new PermissionException ( "Permission denied. Only tenant administrators may enable public systems." ) ; } else if ( ! system . getUserRole ( username ) . canAdmin ( ) ) { throw new PermissionException ( "Permission denied. Only users with the ADMIN role may enable this system." ) ; } else { system . setAvailable ( true ) ; getDao ( ) . persist ( system ) ; getEventProcessor ( ) . processSystemUpdateEvent ( system , SystemEventType . ENABLED , username ) ; return system ; } }
Sets the system availability to true and notifies subscribers
 @param system the system to make available
 @param username user who made the request
 @return the updated system
Sets the system availability to true and notifies subscribers @param system the system to make available @param username user who made the request @return the updated system
//            if (system.isAvailable()) { //                throw new SystemException(system.getSystemId() + " is already available."); //            } else { //            }