agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemManager.java
/**
	 * Clears all internal user credentials for the given RemoteConfig type stored 
	 * on any system. The defaults will be preserved.
	 * 
	 * @param apiUsername
	 * @param remoteConfigType The config type for which you want to remove credentials "login" or "storage"
	 * @throws SystemArgumentException
	 */
Clears all internal user credentials for the given RemoteConfig type stored
on any system. The defaults will be preserved.

@param apiUsername
@param remoteConfigType The config type for which you want to remove credentials "login" or "storage"
@throws SystemArgumentException
Clears all internal user credentials for the given RemoteConfig type stored on any system . The defaults will be preserved . @param apiUsername @param remoteConfigType The config type for which you want to remove credentials " login " or " storage " @throws SystemArgumentException
public void clearAllInternalUserAuthConfigOfType(String apiUsername,
			String remoteConfigType) throws SystemArgumentException
	{
		if (StringUtils.isEmpty(apiUsername)) {
			throw new SystemArgumentException("No username provided.");
		}
		if (remoteConfigType == null) {
			throw new SystemArgumentException("No credential type provided. " +
					"Please specify either 'login' or 'storage'");
		} else if (!(remoteConfigType.equalsIgnoreCase("storage") || 
				remoteConfigType.equalsIgnoreCase("login"))) {
			throw new SystemArgumentException("Invalid credential type '" + 
				remoteConfigType + "'. Please specify either 'login' or 'storage'");
		}
		for(RemoteSystem system: getDao().getUserSystems(apiUsername, false)) 
		{
			if (!system.getUserRole(apiUsername).getRole().canAdmin()) continue;
			if (remoteConfigType.equalsIgnoreCase("storage"))
			{
				AuthConfig defaultStorageAuthConfig = system.getStorageConfig().getDefaultAuthConfig();
				system.getStorageConfig().getAuthConfigs().clear();
				system.getStorageConfig().addAuthConfig(defaultStorageAuthConfig);
				getDao().persist(system);
			} 
			else if (system instanceof ExecutionSystem) 
			{
				AuthConfig defaultLoginAuthConfig = ((ExecutionSystem)system).getLoginConfig().getDefaultAuthConfig();
				((ExecutionSystem)system).getLoginConfig().getAuthConfigs().clear();
				((ExecutionSystem)system).getLoginConfig().addAuthConfig(defaultLoginAuthConfig);
				getDao().persist(system);
			}
			getEventProcessor().processSystemUpdateEvent(system, SystemEventType.CLEAR_CREDENTIALS, apiUsername);
		}
	}
public void clearAllInternalUserAuthConfigOfType ( String apiUsername , String remoteConfigType ) throws SystemArgumentException { if ( StringUtils . isEmpty ( apiUsername ) ) { throw new SystemArgumentException ( "No username provided." ) ; } if ( remoteConfigType == null ) { throw new SystemArgumentException ( "No credential type provided. " + "Please specify either 'login' or 'storage'" ) ; } else if ( ! ( remoteConfigType . equalsIgnoreCase ( "storage" ) || remoteConfigType . equalsIgnoreCase ( "login" ) ) ) { throw new SystemArgumentException ( "Invalid credential type '" + remoteConfigType + "'. Please specify either 'login' or 'storage'" ) ; } for ( RemoteSystem system : getDao ( ) . getUserSystems ( apiUsername , false ) ) { if ( ! system . getUserRole ( apiUsername ) . getRole ( ) . canAdmin ( ) ) continue ; if ( remoteConfigType . equalsIgnoreCase ( "storage" ) ) { AuthConfig defaultStorageAuthConfig = system . getStorageConfig ( ) . getDefaultAuthConfig ( ) ; system . getStorageConfig ( ) . getAuthConfigs ( ) . clear ( ) ; system . getStorageConfig ( ) . addAuthConfig ( defaultStorageAuthConfig ) ; getDao ( ) . persist ( system ) ; } else if ( system instanceof ExecutionSystem ) { AuthConfig defaultLoginAuthConfig = ( ( ExecutionSystem ) system ) . getLoginConfig ( ) . getDefaultAuthConfig ( ) ; ( ( ExecutionSystem ) system ) . getLoginConfig ( ) . getAuthConfigs ( ) . clear ( ) ; ( ( ExecutionSystem ) system ) . getLoginConfig ( ) . addAuthConfig ( defaultLoginAuthConfig ) ; getDao ( ) . persist ( system ) ; } getEventProcessor ( ) . processSystemUpdateEvent ( system , SystemEventType . CLEAR_CREDENTIALS , apiUsername ) ; } }
Clears all internal user credentials for the given RemoteConfig type stored
 on any system.
Clears all internal user credentials for the given RemoteConfig type stored on any system .
// make sure they're requesting a valid config type for this auth config //			NotificationManager.process(system.getUuid(), "CLEAR_CREDENTIALS", system.getOwner());