agave-systems/systems-core/src/main/java/org/iplantc/service/systems/manager/SystemManager.java
/**
	 * Updates the existing system with the values from the new one. The revision flag will
	 * be updated and all passwords will be reencrypted. The id and system id will remain unchanged.
	 * 
	 * @param existingSystem
	 * @param newSystem
	 * @return
	 * @throws SystemException
	 */
Updates the existing system with the values from the new one. The revision flag will
be updated and all passwords will be reencrypted. The id and system id will remain unchanged.

@param existingSystem
@param newSystem
@return
@throws SystemException
Updates the existing system with the values from the new one . The revision flag will be updated and all passwords will be reencrypted . The id and system id will remain unchanged . @param existingSystem @param newSystem @return @throws SystemException
public RemoteSystem udpateExistingSystem(RemoteSystem existingSystem, RemoteSystem newSystem) throws SystemException
	{
		if (existingSystem == null) {
			throw new SystemException("No existing system provided.");
		}
		if (newSystem == null) {
			throw new SystemException("No new system provided.");
		}
		if (existingSystem.getType().equals(RemoteSystemType.EXECUTION)) {
			AuthConfig loginAuthConfig = ((ExecutionSystem)existingSystem).getLoginConfig().getDefaultAuthConfig();
			if (loginAuthConfig.getCredentialServer() != null) {
				((ExecutionSystem)existingSystem).getLoginConfig().getAuthConfigs().remove(loginAuthConfig);
			}
			AuthConfig storageAuthConfig = existingSystem.getStorageConfig().getDefaultAuthConfig();
			if (storageAuthConfig.getCredentialServer() != null) {
				existingSystem.getStorageConfig().getAuthConfigs().remove(storageAuthConfig);
			}
			getDao().persist(existingSystem);
		} else if (existingSystem.getType().equals(RemoteSystemType.STORAGE)) {
			AuthConfig storageAuthConfig = existingSystem.getStorageConfig().getDefaultAuthConfig();
			if (storageAuthConfig.getCredentialServer() != null) {
				existingSystem.getStorageConfig().getAuthConfigs().remove(storageAuthConfig);
			}
			getDao().persist(existingSystem);
		}
		newSystem.setId(existingSystem.getId());
 		newSystem.setRevision(existingSystem.getRevision() + 1);
 		newSystem.setCreated(existingSystem.getCreated());
 		newSystem.setPubliclyAvailable(existingSystem.isPubliclyAvailable());
 		newSystem.setLastUpdated(new Date());
 		getDao().merge(newSystem);
 		getEventProcessor().processSystemUpdateEvent(newSystem, SystemEventType.UPDATED, newSystem.getOwner());
 		return newSystem;
	}
public RemoteSystem udpateExistingSystem ( RemoteSystem existingSystem , RemoteSystem newSystem ) throws SystemException { if ( existingSystem == null ) { throw new SystemException ( "No existing system provided." ) ; } if ( newSystem == null ) { throw new SystemException ( "No new system provided." ) ; } if ( existingSystem . getType ( ) . equals ( RemoteSystemType . EXECUTION ) ) { AuthConfig loginAuthConfig = ( ( ExecutionSystem ) existingSystem ) . getLoginConfig ( ) . getDefaultAuthConfig ( ) ; if ( loginAuthConfig . getCredentialServer ( ) != null ) { ( ( ExecutionSystem ) existingSystem ) . getLoginConfig ( ) . getAuthConfigs ( ) . remove ( loginAuthConfig ) ; } AuthConfig storageAuthConfig = existingSystem . getStorageConfig ( ) . getDefaultAuthConfig ( ) ; if ( storageAuthConfig . getCredentialServer ( ) != null ) { existingSystem . getStorageConfig ( ) . getAuthConfigs ( ) . remove ( storageAuthConfig ) ; } getDao ( ) . persist ( existingSystem ) ; } else if ( existingSystem . getType ( ) . equals ( RemoteSystemType . STORAGE ) ) { AuthConfig storageAuthConfig = existingSystem . getStorageConfig ( ) . getDefaultAuthConfig ( ) ; if ( storageAuthConfig . getCredentialServer ( ) != null ) { existingSystem . getStorageConfig ( ) . getAuthConfigs ( ) . remove ( storageAuthConfig ) ; } getDao ( ) . persist ( existingSystem ) ; } newSystem . setId ( existingSystem . getId ( ) ) ; newSystem . setRevision ( existingSystem . getRevision ( ) + 1 ) ; newSystem . setCreated ( existingSystem . getCreated ( ) ) ; newSystem . setPubliclyAvailable ( existingSystem . isPubliclyAvailable ( ) ) ; newSystem . setLastUpdated ( new Date ( ) ) ; getDao ( ) . merge ( newSystem ) ; getEventProcessor ( ) . processSystemUpdateEvent ( newSystem , SystemEventType . UPDATED , newSystem . getOwner ( ) ) ; return newSystem ; }
Updates the existing system with the values from the new one.
Updates the existing system with the values from the new one .
// 		NotificationManager.process(newSystem.getUuid(), "UPDATE", newSystem.getOwner());