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.ServerProperty
Enumeration containing the different server properties that are stored in the ADS.
|
Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_ADMIN_UID
Default global admin UID.
|
Constructor and Description |
---|
ADSContext(ConnectionWrapper connectionWrapper)
Constructor of the ADSContext.
|
Modifier and Type | Method and Description |
---|---|
void |
createAdminData(String backendName)
Creates the Administration Data in the server.
|
void |
createAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties)
Creates an Administrator in the ADS.
|
void |
deleteAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties)
Deletes the administrator in the ADS.
|
static org.forgerock.opendj.ldap.Dn |
getAdministrationSuffixDN()
Returns the DN of the suffix that contains the administration data.
|
static org.forgerock.opendj.ldap.Dn |
getAdministratorContainerDN()
Returns the parent entry of the administrator entries.
|
static org.forgerock.opendj.ldap.Dn |
getAdministratorDN(String uid)
Returns the DN of the administrator for a given UID.
|
ConnectionWrapper |
getConnection()
Returns the connection used to retrieve information by this ADSContext.
|
static String |
getDefaultBackendName()
Returns the default backend name of the administration data.
|
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.
|
int |
registerOrUpdateServer(Map<ADSContext.ServerProperty,Object> serverProperties)
A convenience method that takes some server properties as parameter and if
there is no server registered associated with those properties, registers
it and if it is already registered, updates it.
|
void |
registerServer(Map<ADSContext.ServerProperty,Object> serverProperties)
Method called to register a server in the ADS.
|
void |
removeAdminData(boolean removeAdministrators)
Removes the administration data.
|
String |
toString() |
void |
unregisterServer(Map<ADSContext.ServerProperty,Object> serverProperties)
Method called to unregister a server in the ADS.
|
public static final String GLOBAL_ADMIN_UID
public ADSContext(ConnectionWrapper connectionWrapper)
connectionWrapper
- provide an Ldap Connectionpublic ConnectionWrapper getConnection()
public HostPort getHostPort()
public void registerServer(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the properties of the server.ADSContextException
- if the server could not be registered.public void unregisterServer(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the properties of the server.ADSContextException
- if the server could not be unregistered.public int registerOrUpdateServer(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.ADSContextException
- if something goes wrong.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(String backendName) throws ADSContextException
backendName
- the backend name which will handle admin information.
null
to use the default backend name for the admin
information.ADSContextException
- if something goes wrong.public void removeAdminData(boolean removeAdministrators) throws ADSContextException
removeAdministrators
- true
if administrators should be removed. It may not be
possible to remove administrators if the operation is being
performed by one of the administrators because it will cause the
administrator to be disconnected.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 static org.forgerock.opendj.ldap.Dn getAdministratorDN(String uid)
uid
- the UID to be used to generate the DN.public void createAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties) throws ADSContextException
adminProperties
- the properties of the administrator to be created.ADSContextException
- if something goes wrong.public void deleteAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties) throws ADSContextException
adminProperties
- the properties of the administrator to be deleted.ADSContextException
- if something goes wrong.public static org.forgerock.opendj.ldap.Dn getAdministrationSuffixDN()
public static org.forgerock.opendj.ldap.Dn getAdministratorContainerDN()
public static String getDefaultBackendName()
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.