private void deleteSubConfigToRoot(String serviceName, String subConfigName) throws CLIException { SSOToken adminSSOToken = getAdminSSOToken(); IOutput outputWriter = getOutputWriter(); String[] params = {subConfigName, serviceName}; writeLog(LogWriter.LOG_ACCESS, Level.INFO, "ATTEMPT_DELETE_SUB_CONFIGURATION", params); try { ServiceConfigManager scm = new ServiceConfigManager(serviceName, adminSSOToken); ServiceConfig sc = scm.getGlobalConfig(null); deleteSubConfig(sc, subConfigName); writeLog(LogWriter.LOG_ACCESS, Level.INFO, "SUCCEED_DELETE_SUB_CONFIGURATION", params); outputWriter.printlnMessage( MessageFormat.format( getResourceString("delete-sub-configuration-succeed"), (Object[]) params)); } catch (SSOException e) { String[] args = {subConfigName, serviceName, e.getMessage()}; debugError("DeleteSubConfiguration.deleteSubConfigToRoot", e); writeLog(LogWriter.LOG_ERROR, Level.INFO, "FAILED_DELETE_SUB_CONFIGURATION", args); throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED); } catch (SMSException e) { String[] args = {subConfigName, serviceName, e.getMessage()}; debugError("DeleteSubConfiguration.deleteSubConfigToRoot", e); writeLog(LogWriter.LOG_ERROR, Level.INFO, "FAILED_DELETE_SUB_CONFIGURATION", args); throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED); } }
private void addSubConfigToRoot( String serviceName, String subConfigName, String subConfigId, Map attrValues, int priority) throws CLIException { SSOToken adminSSOToken = getAdminSSOToken(); IOutput outputWriter = getOutputWriter(); String[] params = {subConfigName, serviceName}; writeLog(LogWriter.LOG_ACCESS, Level.INFO, "ATTEMPT_ADD_SUB_CONFIGURATION", params); try { ServiceConfigManager scm = new ServiceConfigManager(serviceName, adminSSOToken); ServiceConfig sc = scm.getGlobalConfig(null); if (sc == null) { String[] args = {subConfigName, serviceName, "no global configiration"}; writeLog(LogWriter.LOG_ERROR, Level.INFO, "FAILED_ADD_SUB_CONFIGURATION", args); String[] ar = {serviceName}; String message = MessageFormat.format( getResourceString("add-sub-configuration-no-global-config"), (Object[]) ar); throw new CLIException(message, ExitCodes.REQUEST_CANNOT_BE_PROCESSED); } addSubConfig(sc, subConfigName, subConfigId, attrValues, priority); writeLog(LogWriter.LOG_ACCESS, Level.INFO, "SUCCEED_ADD_SUB_CONFIGURATION", params); outputWriter.printlnMessage( MessageFormat.format( getResourceString("add-sub-configuration-succeed"), (Object[]) params)); } catch (SSOException e) { String[] args = {subConfigName, serviceName, e.getMessage()}; debugError("AddSubConfiguration.addSubConfigToRoot", e); writeLog(LogWriter.LOG_ERROR, Level.INFO, "FAILED_ADD_SUB_CONFIGURATION", args); throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED); } catch (SMSException e) { e.printStackTrace(); String[] args = {subConfigName, serviceName, e.getMessage()}; debugError("AddSubConfiguration.addSubConfigToRoot", e); writeLog(LogWriter.LOG_ERROR, Level.INFO, "FAILED_ADD_SUB_CONFIGURATION", args); throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED); } }