| | |
| | | private String hostName; |
| | | private Integer ldapPort; |
| | | private Integer ldapsPort; |
| | | private boolean enableStartTLS; |
| | | |
| | | private ConnectionParameters() |
| | | { |
| | |
| | | return new ConnectionParameters(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return "ConnectionParameters [" |
| | | + "host name=" + hostName |
| | | + ", ldap port=" + ldapPort |
| | | + ", ldaps port=" + ldapsPort |
| | | + ", admin port=" + adminPort |
| | | + ", bind DN=" + bindDn |
| | | + ", admin uid=" + adminUid |
| | | + "]"; |
| | | |
| | | } |
| | | |
| | | String getAdminPassword() |
| | | { |
| | | return adminPassword; |
| | |
| | | return ldapsPort; |
| | | } |
| | | |
| | | boolean isStartTLSEnabled() |
| | | { |
| | | return enableStartTLS; |
| | | } |
| | | |
| | | /** |
| | | * Sets the password of the Global Administrator to use to bind to the server. |
| | | * |
| | |
| | | } |
| | | |
| | | /** |
| | | * Sets the start TLS indicator. |
| | | * |
| | | * @param startTLS |
| | | * the indicator which should be {@code true} to enable StartTLS, {@code false} otherwise |
| | | * @return this builder |
| | | */ |
| | | public ConnectionParameters enableStartTLS(boolean startTLS) |
| | | { |
| | | enableStartTLS = startTLS; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * Sets the the fully-qualified directory server host name. |
| | | * |
| | | * @param hostName |
| | |
| | | { |
| | | throw new EmbeddedDirectoryServerException(ERR_EMBEDDED_SERVER_CONFIGURE_REPLICATION.get( |
| | | configParams.getServerRootDirectory(), parameters.getReplicationPortSource(), |
| | | parameters.getHostnameDestination(), parameters.getReplicationPortDestination(), returnCode)); |
| | | parameters.getHostNameDestination(), parameters.getReplicationPortDestination(), returnCode)); |
| | | } |
| | | } |
| | | |
| | |
| | | if (returnCode != 0) |
| | | { |
| | | throw new EmbeddedDirectoryServerException(ERR_EMBEDDED_SERVER_INITIALIZE_REPLICATION.get( |
| | | configParams.getServerRootDirectory(), connectionParams.getAdminPort(), parameters.getHostnameDestination(), |
| | | configParams.getServerRootDirectory(), connectionParams.getAdminPort(), parameters.getHostNameDestination(), |
| | | parameters.getAdminPortDestination(), returnCode)); |
| | | } |
| | | } |
| | |
| | | "--noPropertiesFile" }; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return "ReplicationParameters [baseDn=" + baseDn |
| | | + ", source replication port=" + replicationPortSource |
| | | + ", destination host name=" + getHostNameDestination() |
| | | + ", destination replication port=" + replicationPortDestination |
| | | + ", destination admin port=" + getAdminPortDestination() |
| | | + "]"; |
| | | } |
| | | |
| | | int getReplicationPortSource() |
| | | { |
| | | return replicationPortSource; |
| | |
| | | return replicationPortDestination; |
| | | } |
| | | |
| | | String getHostnameDestination() |
| | | String getHostNameDestination() |
| | | { |
| | | return connParamsForDestination.getHostName(); |
| | | } |
| | |
| | | { |
| | | args.add("--ldapsPort"); |
| | | args.add(s(connParams.getLdapSecurePort())); |
| | | } |
| | | if (connParams.isStartTLSEnabled()) |
| | | { |
| | | args.add("--enableStartTLS"); |
| | | } |
| | | if (connParams.getLdapSecurePort() != null || connParams.isStartTLSEnabled()) |
| | | { |
| | | args.add("--generateSelfSignedCertificate"); |
| | | } |
| | | return args.toArray(new String[args.size()]); |