public void updateServerConfigInheritance(String serverName,Set toInherit,Set notToInherit) throws AMConsoleException {
  String[] param={serverName};
  logEvent("ATTEMPT_MODIFY_SERVER_INHERITANCE",param);
  try {
    SSOToken ssoToken=getUserSSOToken();
    Map defaultValues=ServerConfiguration.getDefaults(ssoToken);
    Map svrProperties=ServerConfiguration.getServerInstance(ssoToken,serverName);
    if ((toInherit != null) && !toInherit.isEmpty()) {
      Set toRemove=new HashSet();
      for (Iterator i=toInherit.iterator(); i.hasNext(); ) {
        String name=(String)i.next();
        if (svrProperties.containsKey(name)) {
          toRemove.add(name);
        }
      }
      if (!toRemove.isEmpty()) {
        ServerConfiguration.removeServerConfiguration(ssoToken,serverName,toRemove);
      }
    }
    if ((notToInherit != null) && !notToInherit.isEmpty()) {
      Map toAdd=new HashMap();
      for (Iterator i=notToInherit.iterator(); i.hasNext(); ) {
        String name=(String)i.next();
        if (!svrProperties.containsKey(name)) {
          toAdd.put(name,defaultValues.get(name));
        }
      }
      if (!toAdd.isEmpty()) {
        try {
          ServerConfiguration.setServerInstance(ssoToken,serverName,toAdd);
        }
 catch (        UnknownPropertyNameException ex) {
        }
      }
    }
    logEvent("SUCCEED_MODIFY_SERVER_INHERITANCE",param);
  }
 catch (  ConfigurationException e) {
    String[] params={serverName,e.getMessage()};
    logEvent("CONFIGURATION_EXCEPTION_MODIFY_SERVER_INHERITANCE",params);
    throw new AMConsoleException(getErrorString(e));
  }
catch (  IOException e) {
    String[] params={serverName,e.getMessage()};
    logEvent("IO_EXCEPTION_MODIFY_SERVER_INHERITANCE",params);
    throw new AMConsoleException(getErrorString(e));
  }
catch (  SMSException e) {
    String[] params={serverName,e.getMessage()};
    logEvent("SMS_EXCEPTION_MODIFY_SERVER_INHERITANCE",params);
    throw new AMConsoleException(getErrorString(e));
  }
catch (  SSOException e) {
    String[] params={serverName,e.getMessage()};
    logEvent("SSO_EXCEPTION_MODIFY_SERVER_INHERITANCE",params);
    throw new AMConsoleException(getErrorString(e));
  }
}

public void updateServerConfigInheritance ( String serverName , Set toInherit , Set notToInherit ) throws AMConsoleException { String [ ] param = { serverName } ; logEvent ( "ATTEMPT_MODIFY_SERVER_INHERITANCE" , param ) ; try { SSOToken ssoToken = getUserSSOToken ( ) ; Map defaultValues = ServerConfiguration . getDefaults ( ssoToken ) ; Map svrProperties = ServerConfiguration . getServerInstance ( ssoToken , serverName ) ; if ( ( toInherit != null ) && ! toInherit . isEmpty ( ) ) { Set toRemove = new HashSet ( ) ; for ( Iterator i = toInherit . iterator ( ) ; i . hasNext ( ) ; ) { String name = ( String ) i . next ( ) ; if ( svrProperties . containsKey ( name ) ) { toRemove . add ( name ) ; } } if ( ! toRemove . isEmpty ( ) ) { ServerConfiguration . removeServerConfiguration ( ssoToken , serverName , toRemove ) ; } } if ( ( notToInherit != null ) && ! notToInherit . isEmpty ( ) ) { Map toAdd = new HashMap ( ) ; for ( Iterator i = notToInherit . iterator ( ) ; i . hasNext ( ) ; ) { String name = ( String ) i . next ( ) ; if ( ! svrProperties . containsKey ( name ) ) { toAdd . put ( name , defaultValues . get ( name ) ) ; } } if ( ! toAdd . isEmpty ( ) ) { try { ServerConfiguration . setServerInstance ( ssoToken , serverName , toAdd ) ; } catch ( UnknownPropertyNameException ex ) { } } } logEvent ( "SUCCEED_MODIFY_SERVER_INHERITANCE" , param ) ; } catch ( ConfigurationException e ) { String [ ] params = { serverName , e . getMessage ( ) } ; logEvent ( "CONFIGURATION_EXCEPTION_MODIFY_SERVER_INHERITANCE" , params ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } catch ( IOException e ) { String [ ] params = { serverName , e . getMessage ( ) } ; logEvent ( "IO_EXCEPTION_MODIFY_SERVER_INHERITANCE" , params ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } catch ( SMSException e ) { String [ ] params = { serverName , e . getMessage ( ) } ; logEvent ( "SMS_EXCEPTION_MODIFY_SERVER_INHERITANCE" , params ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } catch ( SSOException e ) { String [ ] params = { serverName , e . getMessage ( ) } ; logEvent ( "SSO_EXCEPTION_MODIFY_SERVER_INHERITANCE" , params ) ; throw new AMConsoleException ( getErrorString ( e ) ) ; } }
updates server property inheritance settings .
