DN ldapListenerDN = DN.decode(DN_LDAP_CONNECTION_HANDLER);
ConfigEntry configEntry =
configHandler.getConfigEntry(ldapListenerDN);
IntegerConfigAttribute portAttr =
new IntegerConfigAttribute(ATTR_LISTEN_PORT,
INFO_LDAP_CONNHANDLER_DESCRIPTION_LISTEN_PORT.get(),
true, false, true, true, 1, true,
65535, ldapPort.getIntValue());
configEntry.putConfigAttribute(portAttr);
}
catch (Exception e)
{
Message message = ERR_CONFIGDS_CANNOT_UPDATE_LDAP_PORT.get(
String.valueOf(e));
err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
// If an Admin Connector port was specified, then update the config
// accordingly.
if (adminConnectorPort.isPresent())
{
try
{
DN adminConnectorDN = DN.decode(DN_ADMIN_CONNECTOR);
ConfigEntry configEntry =
configHandler.getConfigEntry(adminConnectorDN);
IntegerConfigAttribute portAttr =
new IntegerConfigAttribute(ATTR_LISTEN_PORT,
INFO_LDAP_CONNHANDLER_DESCRIPTION_LISTEN_PORT.get(),
true, false, true, true, 1, true,
65535,
adminConnectorPort.getIntValue());
configEntry.putConfigAttribute(portAttr);
}
catch (Exception e)
{
Message message = ERR_CONFIGDS_CANNOT_UPDATE_ADMIN_CONNECTOR_PORT.get(
String.valueOf(e));
err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
// If an LDAPS port was specified, then update the config accordingly.
if (ldapsPort.isPresent())
{
try
{
DN ldapListenerDN = DN.decode(DN_LDAPS_CONNECTION_HANDLER);
ConfigEntry configEntry =
configHandler.getConfigEntry(ldapListenerDN);
IntegerConfigAttribute portAttr =
new IntegerConfigAttribute(ATTR_LISTEN_PORT,
INFO_LDAP_CONNHANDLER_DESCRIPTION_LISTEN_PORT.get(),
true, false, true, true, 1, true,
65535, ldapsPort.getIntValue());
configEntry.putConfigAttribute(portAttr);
BooleanConfigAttribute enablePortAttr =
new BooleanConfigAttribute(ATTR_CONNECTION_HANDLER_ENABLED,
INFO_LDAPS_CONNHANDLER_DESCRIPTION_ENABLE.get(),
true, true);
configEntry.putConfigAttribute(enablePortAttr);
}
catch (Exception e)
{
Message message = ERR_CONFIGDS_CANNOT_UPDATE_LDAPS_PORT.get(
String.valueOf(e));
err.println(wrapText(message, MAX_LINE_WIDTH));
return 1;
}
}
// If an JMX port was specified, then update the config accordingly.
if (jmxPort.isPresent())
{
try
{
DN jmxListenerDN = DN.decode(DN_JMX_CONNECTION_HANDLER);
ConfigEntry configEntry =
configHandler.getConfigEntry(jmxListenerDN);
IntegerConfigAttribute portAttr =
new IntegerConfigAttribute(
ATTR_LISTEN_PORT,
INFO_JMX_CONNHANDLER_DESCRIPTION_LISTEN_PORT.get(),
true, false, true, true, 1, true,
65535, jmxPort.getIntValue());
configEntry.putConfigAttribute(portAttr);