| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.admin.client.cli; |
| | | import org.opends.messages.Message; |
| | |
| | | subCommands.add(registerServerSubCmd); |
| | | |
| | | registerServerServerIdArg = new StringArgument("serverID", null, |
| | | OPTION_LONG_SERVERID, false, true, OPTION_VALUE_SERVERID, |
| | | OPTION_LONG_SERVERID, false, true, INFO_SERVERID_PLACEHOLDER.get(), |
| | | INFO_ADMIN_ARG_SERVERID_DESCRIPTION.get()); |
| | | registerServerSubCmd.addArgument(registerServerServerIdArg); |
| | | |
| | | registerServerSetArg = new StringArgument(OPTION_LONG_SET, |
| | | OPTION_SHORT_SET, OPTION_LONG_SET, false, true, true, |
| | | OPTION_VALUE_SET, null, null, INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | INFO_VALUE_SET_PLACEHOLDER.get(), null, null, |
| | | INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | registerServerSubCmd.addArgument(registerServerSetArg); |
| | | |
| | | // unregister-server subcommand |
| | |
| | | subCommands.add(unregisterServerSubCmd); |
| | | |
| | | unregisterServerServerIDArg = new StringArgument("serverID", null, |
| | | OPTION_LONG_SERVERID, false, true, OPTION_VALUE_SERVERID, |
| | | OPTION_LONG_SERVERID, false, true, INFO_SERVERID_PLACEHOLDER.get(), |
| | | INFO_ADMIN_ARG_SERVERID_DESCRIPTION.get()); |
| | | unregisterServerSubCmd.addArgument(unregisterServerServerIDArg); |
| | | |
| | |
| | | subCommands.add(getServerPropertiesSubCmd); |
| | | |
| | | getServerPropertiesServerIdArg = new StringArgument("serverID", null, |
| | | OPTION_LONG_SERVERID, false, true, OPTION_VALUE_SERVERID, |
| | | OPTION_LONG_SERVERID, false, true, INFO_SERVERID_PLACEHOLDER.get(), |
| | | INFO_ADMIN_ARG_SERVERID_DESCRIPTION.get()); |
| | | getServerPropertiesServerIdArg.setMultiValued(true); |
| | | getServerPropertiesSubCmd.addArgument(getServerPropertiesServerIdArg); |
| | |
| | | subCommands.add(setServerPropertiesSubCmd); |
| | | |
| | | setServerPropertiesServerIdArg = new StringArgument("serverID", null, |
| | | OPTION_LONG_SERVERID, true, true, OPTION_VALUE_SERVERID, |
| | | OPTION_LONG_SERVERID, true, true, INFO_SERVERID_PLACEHOLDER.get(), |
| | | INFO_ADMIN_ARG_SERVERID_DESCRIPTION.get()); |
| | | setServerPropertiesSubCmd.addArgument(setServerPropertiesServerIdArg); |
| | | |
| | | setServerPropertiesSetArg = new StringArgument(OPTION_LONG_SET, |
| | | OPTION_SHORT_SET, OPTION_LONG_SET, false, true, true, |
| | | OPTION_VALUE_SET, null, null, INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | INFO_VALUE_SET_PLACEHOLDER.get(), null, null, |
| | | INFO_DSCFG_DESCRIPTION_PROP_VAL.get()); |
| | | setServerPropertiesSubCmd.addArgument(setServerPropertiesSetArg); |
| | | |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.ID; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, |
| | | prop.getAttributeName(), false, false, true, "", null, null, null); |
| | | prop.getAttributeName(), false, false, true, Message.raw(""), null, |
| | | null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | String attName = prop.getAttributeName(); |
| | | readonlyServerProperties.add(prop); |
| | | StringArgument arg = new StringArgument(attName, null, attName, true, |
| | | false, true, "", "localhost", null, null); |
| | | false, true, Message.raw(""), "localhost", null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.LDAP_PORT; |
| | | String attName = prop.getAttributeName(); |
| | | IntegerArgument arg = new IntegerArgument(attName, null, attName, true, |
| | | true, true, attName, 389, null, null); |
| | | true, true, Message.raw(attName), 389, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.JMX_PORT; |
| | | String attName = prop.getAttributeName(); |
| | | IntegerArgument arg = new IntegerArgument(attName, null, attName, |
| | | false, true, attName, null); |
| | | false, true, Message.raw(attName), null); |
| | | arg.setMultiValued(true); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | |
| | | ServerProperty prop = ServerProperty.JMXS_PORT; |
| | | String attName = prop.getAttributeName(); |
| | | IntegerArgument arg = new IntegerArgument(attName, null, attName, |
| | | false, true, attName, null); |
| | | false, true, Message.raw(attName), null); |
| | | arg.setMultiValued(true); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | |
| | | ServerProperty prop = ServerProperty.LDAPS_PORT; |
| | | String attName = prop.getAttributeName(); |
| | | IntegerArgument arg = new IntegerArgument(attName, null, attName, |
| | | false, true, attName, null); |
| | | false, true, Message.raw(attName), null); |
| | | arg.setMultiValued(true); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | |
| | | ServerProperty prop = ServerProperty.CERTIFICATE; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | false, true, attName, null, null, null); |
| | | false, true, Message.raw(attName), null, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.INSTANCE_PATH; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | false, true, attName, null, null, null); |
| | | false, true, Message.raw(attName), null, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.DESCRIPTION; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | false, true, attName, null, null, null); |
| | | false, true, Message.raw(attName), null, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.HOST_OS; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | false, true, attName, null, null, null); |
| | | false, true, Message.raw(attName), null, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.LOCATION; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | false, true, attName, null, null, null); |
| | | false, true, Message.raw(attName), null, null, null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.GROUPS; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, attName, false, |
| | | true, true, attName, null, null, null); |
| | | true, true, Message.raw(attName), null, null, null); |
| | | arg.setHidden(true); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | |
| | | ServerProperty prop = ServerProperty.INSTANCE_KEY_ID; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, prop |
| | | .getAttributeName(), false, false, true, "", null, null, null); |
| | | .getAttributeName(), false, false, true, Message.raw(""), null, null, |
| | | null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | |
| | |
| | | ServerProperty prop = ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE; |
| | | String attName = prop.getAttributeName(); |
| | | StringArgument arg = new StringArgument(attName, null, prop |
| | | .getAttributeName(), false, false, true, "", null, null, null); |
| | | .getAttributeName(), false, false, true, Message.raw(""), null, null, |
| | | null); |
| | | serverProperties.put(prop, arg); |
| | | } |
| | | } |
| | |
| | | Set<Map<ServerProperty, Object>> serverList = |
| | | adsCtx.readServerRegistry(); |
| | | boolean found = false; |
| | | Map<ServerProperty,Object> serverProperties = null ; |
| | | for (Map<ServerProperty,Object> elm : serverList) |
| | | { |
| | | if (serverId.equals(elm.get(ServerProperty.ID))) |
| | | { |
| | | found = true ; |
| | | serverProperties = elm ; |
| | | break ; |
| | | } |
| | | } |