public class ServerDescriptor extends Object implements Comparable<ServerDescriptor>
It can represent either a DS-only, a RS-only or a combined DS-RS.
Modifier and Type | Class and Description |
---|---|
static class |
ServerDescriptor.ServerProperty
Enumeration containing the different server properties that we can keep in
the ServerProperty object.
|
Modifier | Constructor and Description |
---|---|
protected |
ServerDescriptor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ServerDescriptor o) |
static ServerDescriptor |
createStandalone(ConnectionWrapper conn,
TopologyCacheFilter filter)
Creates a ServerDescriptor object based on the configuration that we read
using the provided connection.
|
static ServerDescriptor |
createStandalone(Map<ADSContext.ServerProperty,Object> adsProperties)
Creates a ServerDescriptor object based on some ADS properties provided.
|
HostPort |
getAdminConnectorHostPort()
Returns the HostPort to access this server using the administration connector.
|
Map<ADSContext.ServerProperty,Object> |
getAdsProperties()
Returns a Map containing the ADS properties of the server.
|
List<Integer> |
getConfiguredAdministrationPorts()
Returns the list of configured administration ports.
|
String |
getHostName()
Returns the host name of the server.
|
HostPort |
getHostPort(boolean securePreferred)
Returns a String of type host-name:port-number for the server.
|
String |
getId()
Returns an Id that is unique for this server.
|
byte[] |
getInstancePublicKeyCertificate()
Returns the instance-key public-key certificate retrieved from the
truststore backend of the instance referenced through this descriptor.
|
TopologyCacheException |
getLastException()
Returns the last exception that was encountered reading the configuration
of the server.
|
HostPort |
getLdapHostPort()
Returns the HostPort to access this server using LDAP.
|
HostPort |
getLdapsHostPort()
Returns the HostPort to access this server using LDAPS.
|
Set<ReplicaDescriptor> |
getReplicas()
Returns the replicas contained on the server.
|
HostPort |
getReplicationServerHostPort()
Returns the String representation of this replication server based
on the information we have ("hostname":"replication port") and
null if this is not a replication server. |
int |
getReplicationServerId()
Returns the replication server ID of this server and -1 if this is not a
replications server.
|
int |
getReplicationServerPort()
Returns the replication port of this server and -1 if this is not a
replications server.
|
String |
getSchemaReplicationID()
Returns the schema generation ID of the server.
|
Map<ServerDescriptor.ServerProperty,Object> |
getServerProperties()
Returns a Map containing the properties of the server.
|
static String |
getSuffixDisplay(org.forgerock.opendj.ldap.Dn baseDN,
Set<ServerDescriptor> servers)
Returns a representation of a base DN for a set of servers.
|
boolean |
isRegistered()
Tells whether this server is registered in the ADS.
|
boolean |
isReplicationEnabled()
Tells whether replication is enabled on this server.
|
boolean |
isReplicationSecure()
Returns whether the communication with the replication port on the server is encrypted.
|
boolean |
isReplicationServer()
Tells whether this server is a replication server.
|
boolean |
isSameServer(ServerDescriptor server)
Tells whether the provided server descriptor represents the same server
as this object.
|
static void |
seedAdsTrustStore(ConnectionWrapper connWrapper,
Map<String,byte[]> keyEntryMap)
Seeds the bound instance's local ads-truststore with a set of instance
key-pair public key certificates.
|
void |
setAdsProperties(Map<ADSContext.ServerProperty,Object> adsProperties)
Sets the ADS properties of the server.
|
void |
setLastException(TopologyCacheException lastException)
Sets the last exception that occurred while reading the configuration of
the server.
|
void |
setReplicas(Set<ReplicaDescriptor> replicas)
Sets the replicas contained on the server.
|
String |
toString() |
void |
updateAdsPropertiesWithServerProperties()
This methods updates the ADS properties (the ones that were read from
the ADS) with the contents of the server properties (the ones that were
read directly from the server).
|
protected ServerDescriptor()
public Set<ReplicaDescriptor> getReplicas()
public void setReplicas(Set<ReplicaDescriptor> replicas)
replicas
- the replicas contained on the server.public Map<ADSContext.ServerProperty,Object> getAdsProperties()
public Map<ServerDescriptor.ServerProperty,Object> getServerProperties()
public boolean isRegistered()
true
if the server is registered in the ADS and false
otherwise.public boolean isReplicationServer()
true
if the server is a replication server and false
otherwise.public boolean isReplicationEnabled()
true
if replication is enabled and false
otherwise.public HostPort getReplicationServerHostPort()
null
if this is not a replication server.null
if this is not a replication server.public int getReplicationServerId()
public int getReplicationServerPort()
public boolean isReplicationSecure()
true
if the communication with the replication port on
the server is encrypted and false
otherwise.public void setAdsProperties(Map<ADSContext.ServerProperty,Object> adsProperties)
adsProperties
- a Map containing the ADS properties of the server.public String getHostName()
public HostPort getLdapHostPort()
null
if the server is not configured to listen on an LDAP port.public HostPort getLdapsHostPort()
null
if the server is not configured to listen on an LDAPS port.public HostPort getAdminConnectorHostPort()
null
if the server cannot get the administration connector.public List<Integer> getConfiguredAdministrationPorts()
public HostPort getHostPort(boolean securePreferred)
securePreferred
- whether to try to use the secure port as part
of the returning String.public String getId()
public int compareTo(ServerDescriptor o)
compareTo
in interface Comparable<ServerDescriptor>
public byte[] getInstancePublicKeyCertificate()
public String getSchemaReplicationID()
public TopologyCacheException getLastException()
public void setLastException(TopologyCacheException lastException)
lastException
- the last exception that occurred while reading the
configuration of the server.public void updateAdsPropertiesWithServerProperties()
public static ServerDescriptor createStandalone(Map<ADSContext.ServerProperty,Object> adsProperties)
adsProperties
- the ADS properties of the server.public static ServerDescriptor createStandalone(ConnectionWrapper conn, TopologyCacheFilter filter) throws IOException
conn
- the connection that will be used to read the configuration of the server.filter
- the topology cache filter describing the information that
must be retrieved.IOException
- if a problem occurred reading the server configuration.public static void seedAdsTrustStore(ConnectionWrapper connWrapper, Map<String,byte[]> keyEntryMap) throws org.forgerock.opendj.ldap.LdapException
connWrapper
- The connection to the server.keyEntryMap
- The set of valid (i.e., not tagged as compromised)
instance key-pair public-key certificate entries in ADS represented as a map
from keyID to public-key certificate (binary).org.forgerock.opendj.ldap.LdapException
- in case an error occurs while updating the instance's
ads-truststore via LDAP.public static String getSuffixDisplay(org.forgerock.opendj.ldap.Dn baseDN, Set<ServerDescriptor> servers)
baseDN
- the base DN.servers
- the servers.public boolean isSameServer(ServerDescriptor server)
server
- the server to make the comparison.true
if the provided server descriptor represents the same server
as this object, false
otherwise.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.