public void handleRequest(RequestContext rc) throws CLIException {
  super.handleRequest(rc);
  ldapLogin();
  SSOToken adminSSOToken=getAdminSSOToken();
  String serviceName=getStringOptionValue(IArgument.SERVICE_NAME);
  String interfaceName=getStringOptionValue(ARGUMENT_INTERFACE_NAME);
  String pluginName=getStringOptionValue(ARGUMENT_PLUGIN_NAME);
  String i18nKey=getStringOptionValue(ARGUMENT_I18N_KEY);
  String i18nName=getStringOptionValue(ARGUMENT_I18N_NAME);
  String className=getStringOptionValue(ARGUMENT_CLASS_NAME);
  ServiceManager sm=null;
  try {
    sm=new ServiceManager(adminSSOToken);
  }
 catch (  SMSException smse) {
    throw new CLIException(smse,ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
  }
catch (  SSOException ssoe) {
    throw new CLIException(ssoe,ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
  }
  IOutput outputWriter=getOutputWriter();
  try {
    String[] params={serviceName,interfaceName,pluginName,i18nKey,i18nName,className};
    writeLog(LogWriter.LOG_ACCESS,Level.INFO,"ATTEMPT_ADD_PLUGIN_SCHEMA",params);
    Document pluginDoc=createPluginSchemaXML(serviceName,interfaceName,pluginName,i18nKey,i18nName,className);
    if (pluginDoc != null) {
      sm.addPluginSchema(pluginDoc);
      String[] params2={serviceName,pluginName};
      writeLog(LogWriter.LOG_ACCESS,Level.INFO,"SUCCEED_ADD_PLUGIN_SCHEMA",params2);
      outputWriter.printlnMessage(MessageFormat.format(getResourceString("add-plugin-schema-succeed"),(Object[])params));
    }
 else {
      String[] args={serviceName,pluginName,"Null XML Document"};
      debugError("AddPluginSchema.handleRequest:: Null XML Document");
      writeLog(LogWriter.LOG_ERROR,Level.INFO,"FAILED_ADD_PLUGIN_SCHEMA",args);
      throw new CLIException("Null XML Document",ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
    }
  }
 catch (  SSOException ssoe) {
    String[] args={serviceName,pluginName,ssoe.getMessage()};
    debugError("AddPluginSchema.handleRequest",ssoe);
    writeLog(LogWriter.LOG_ERROR,Level.INFO,"FAILED_ADD_PLUGIN_SCHEMA",args);
    outputWriter.printlnMessage(MessageFormat.format(getResourceString("add-plugin-schema-failed"),(Object[])args));
    throw new CLIException(ssoe,ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
  }
catch (  SMSException smse) {
    String[] args={serviceName,pluginName,smse.getMessage()};
    debugError("AddPluginSchema.handleRequest",smse);
    writeLog(LogWriter.LOG_ERROR,Level.INFO,"FAILED_ADD_PLUGIN_SCHEMA",args);
    outputWriter.printlnMessage(MessageFormat.format(getResourceString("add-plugin-schema-failed"),(Object[])args));
    throw new CLIException(smse,ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
  }
}

public void handleRequest ( RequestContext rc ) throws CLIException { super . handleRequest ( rc ) ; ldapLogin ( ) ; SSOToken adminSSOToken = getAdminSSOToken ( ) ; String serviceName = getStringOptionValue ( IArgument . SERVICE_NAME ) ; String interfaceName = getStringOptionValue ( ARGUMENT_INTERFACE_NAME ) ; String pluginName = getStringOptionValue ( ARGUMENT_PLUGIN_NAME ) ; String i18nKey = getStringOptionValue ( ARGUMENT_I18N_KEY ) ; String i18nName = getStringOptionValue ( ARGUMENT_I18N_NAME ) ; String className = getStringOptionValue ( ARGUMENT_CLASS_NAME ) ; ServiceManager sm = null ; try { sm = new ServiceManager ( adminSSOToken ) ; } catch ( SMSException smse ) { throw new CLIException ( smse , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } catch ( SSOException ssoe ) { throw new CLIException ( ssoe , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } IOutput outputWriter = getOutputWriter ( ) ; try { String [ ] params = { serviceName , interfaceName , pluginName , i18nKey , i18nName , className } ; writeLog ( LogWriter . LOG_ACCESS , Level . INFO , "ATTEMPT_ADD_PLUGIN_SCHEMA" , params ) ; Document pluginDoc = createPluginSchemaXML ( serviceName , interfaceName , pluginName , i18nKey , i18nName , className ) ; if ( pluginDoc != null ) { sm . addPluginSchema ( pluginDoc ) ; String [ ] params2 = { serviceName , pluginName } ; writeLog ( LogWriter . LOG_ACCESS , Level . INFO , "SUCCEED_ADD_PLUGIN_SCHEMA" , params2 ) ; outputWriter . printlnMessage ( MessageFormat . format ( getResourceString ( "add-plugin-schema-succeed" ) , ( Object [ ] ) params ) ) ; } else { String [ ] args = { serviceName , pluginName , "Null XML Document" } ; debugError ( "AddPluginSchema.handleRequest:: Null XML Document" ) ; writeLog ( LogWriter . LOG_ERROR , Level . INFO , "FAILED_ADD_PLUGIN_SCHEMA" , args ) ; throw new CLIException ( "Null XML Document" , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } } catch ( SSOException ssoe ) { String [ ] args = { serviceName , pluginName , ssoe . getMessage ( ) } ; debugError ( "AddPluginSchema.handleRequest" , ssoe ) ; writeLog ( LogWriter . LOG_ERROR , Level . INFO , "FAILED_ADD_PLUGIN_SCHEMA" , args ) ; outputWriter . printlnMessage ( MessageFormat . format ( getResourceString ( "add-plugin-schema-failed" ) , ( Object [ ] ) args ) ) ; throw new CLIException ( ssoe , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } catch ( SMSException smse ) { String [ ] args = { serviceName , pluginName , smse . getMessage ( ) } ; debugError ( "AddPluginSchema.handleRequest" , smse ) ; writeLog ( LogWriter . LOG_ERROR , Level . INFO , "FAILED_ADD_PLUGIN_SCHEMA" , args ) ; outputWriter . printlnMessage ( MessageFormat . format ( getResourceString ( "add-plugin-schema-failed" ) , ( Object [ ] ) args ) ) ; throw new CLIException ( smse , ExitCodes . REQUEST_CANNOT_BE_PROCESSED ) ; } }
services a commandline request .
