public class ADSContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ADSContext.AdministratorProperty
The enumeration containing the different Administrator properties.
|
static class |
ADSContext.ADSPropertySyntax
Enumeration containing the different server properties syntaxes that could be stored in the ADS.
|
static class |
ADSContext.ServerGroupProperty
Enumeration containing the different server group properties that are stored in the ADS.
|
static class |
ADSContext.ServerProperty
Enumeration containing the different server properties that are stored in the ADS.
|
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_DATA_BACKEND_NAME
The default backend name of the administration data.
|
static org.forgerock.opendj.ldap.Dn |
ADMINISTRATORS_ADMIN_DATA_DN
The parent entry of the administrator entries.
|
static org.forgerock.opendj.ldap.Dn |
ALL_SERVER_GROUP_ADMIN_DATA_DN
The all server group entry DN.
|
static String |
ALL_SERVER_GROUP_NAME
The default server group which will contain all registered servers.
|
static org.forgerock.opendj.ldap.Dn |
INSTANCE_KEYS_ADMIN_DATA_DN
The parent entry of the server key entries in admin data.
|
static org.forgerock.opendj.ldap.Dn |
SECRET_KEYS_ADMIN_DATA_DN
The parent entry of the secret key entries in admin data.
|
static org.forgerock.opendj.ldap.Dn |
SERVERS_ADMIN_DATA_DN
The parent entry of the server entries.
|
Constructor and Description |
---|
ADSContext(ConnectionWrapper connectionWrapper)
Constructor of the ADSContext.
|
Modifier and Type | Method and Description |
---|---|
void |
createAdminData()
Creates the Administration Data in the server.
|
void |
createAdministrator(String adminUid,
String adminPwd)
Creates the global administrator entry in the ADS.
|
static org.forgerock.opendj.ldap.messages.AddRequest |
createGlobalAdministratorAddRequest(String adminUid,
String adminPwd)
Builds and returns an
AddRequest to add the global administrator entry in the admin data backend. |
ConnectionWrapper |
getConnection()
Returns the connection used to retrieve information by this ADSContext.
|
HostPort |
getHostPort()
Returns the host name and port number of this connection.
|
Map<String,byte[]> |
getTrustedCertificates()
Return the set of valid (i.e., not tagged as compromised) instance key-pair public-key certificate entries in
ADS.
|
boolean |
hasAdminData()
Returns
true if the server contains Administration Data and false otherwise. |
static boolean |
isRegistered(ServerDescriptor server,
Set<Map<ADSContext.ServerProperty,Object>> registry)
Tells whether the provided server is registered in the registry.
|
void |
mergeWithRegistry(ADSContext adsCtx)
Merge the contents of this ADSContext with the contents of the provided ADSContext.
|
Set<Map<ADSContext.AdministratorProperty,Object>> |
readAdministratorRegistry()
Returns a set containing the administrators that are defined in the ADS.
|
Set<Map<ADSContext.ServerProperty,Object>> |
readServerRegistry()
Returns a set containing the servers that are registered in the ADS.
|
void |
registerServer(ServerDescriptor serverDesc)
Method called to register a server in the ADS.
|
void |
removeAdminData()
Removes the administration data.
|
String |
toString() |
void |
unregisterAllServers()
Unregisters all the servers from this ADS.
|
void |
unregisterServer(ServerDescriptor serverDesc)
Unregisters a server in the ADS.
|
public static final String ADMIN_DATA_BACKEND_NAME
public static final String ALL_SERVER_GROUP_NAME
public static final org.forgerock.opendj.ldap.Dn SERVERS_ADMIN_DATA_DN
public static final org.forgerock.opendj.ldap.Dn ALL_SERVER_GROUP_ADMIN_DATA_DN
public static final org.forgerock.opendj.ldap.Dn ADMINISTRATORS_ADMIN_DATA_DN
public static final org.forgerock.opendj.ldap.Dn INSTANCE_KEYS_ADMIN_DATA_DN
public static final org.forgerock.opendj.ldap.Dn SECRET_KEYS_ADMIN_DATA_DN
public ADSContext(ConnectionWrapper connectionWrapper)
connectionWrapper
- provide an Ldap Connectionpublic ConnectionWrapper getConnection()
public HostPort getHostPort()
public void registerServer(ServerDescriptor serverDesc) throws ADSContextException
serverDesc
- the server to register.ADSContextException
- if the server could not be registered.public void unregisterAllServers() throws ADSContextException
ADSContextException
- if the server could not be unregistered.public void unregisterServer(ServerDescriptor serverDesc) throws ADSContextException
Note: the server's instance key-pair public-key certificate entry (created in registerServer(Map)
) is
left untouched.
serverDesc
- the server to unregisterADSContextException
- if the server could not be unregistered.public Set<Map<ADSContext.ServerProperty,Object>> readServerRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public Set<Map<ADSContext.AdministratorProperty,Object>> readAdministratorRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public void createAdminData() throws ADSContextException
ADSContextException
- if something goes wrong.public void removeAdminData() throws ADSContextException
ADSContextException
- if something goes wrong.public boolean hasAdminData() throws ADSContextException
true
if the server contains Administration Data and false
otherwise.true
if the server contains Administration Data and false
otherwise.ADSContextException
- if something goes wrong.public void createAdministrator(String adminUid, String adminPwd) throws ADSContextException
adminUid
- The global administrator UID.adminPwd
- The global administrator password.ADSContextException
- if something goes wrong.public static org.forgerock.opendj.ldap.messages.AddRequest createGlobalAdministratorAddRequest(String adminUid, String adminPwd) throws ADSContextException
AddRequest
to add the global administrator entry in the admin data backend.adminUid
- The global administrator UID.adminPwd
- The global administrator password.AddRequest
to add the global administrator entry in the admin data backend.ADSContextException
- if something goes wrong.public static boolean isRegistered(ServerDescriptor server, Set<Map<ADSContext.ServerProperty,Object>> registry)
server
- the server.registry
- the registry.true
if the server is registered in the registry and false
otherwise.public Map<String,byte[]> getTrustedCertificates() throws ADSContextException
ADSContextException
- in case of problems with the entry search.CryptoManagerImpl.getTrustedCertificates()
public void mergeWithRegistry(ADSContext adsCtx) throws ADSContextException
adsCtx
- the other ADSContext to merge the contents with.ADSContextException
- if there was an error during the merge.Copyright © 2010–2017 ForgeRock AS. All rights reserved.