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 |
ALL_SERVERGROUP_NAME
The default server group which will contain all registered servers.
|
static String |
GLOBAL_ADMIN_UID
Default global admin UID.
|
Constructor and Description |
---|
ADSContext(InitialLdapContext dirContext)
Constructor of the ADSContext.
|
Modifier and Type | Method and Description |
---|---|
void |
createAdminData(String backendName)
Creates the Administration Data in the server.
|
void |
createAdministrationSuffix(String backendName)
Creates the Administration Suffix.
|
void |
createAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties)
Creates an Administrator in the ADS.
|
void |
createServerGroup(Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties)
Creates a Server Group in the ADS.
|
void |
deleteAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties)
Deletes the administrator in the ADS.
|
void |
deleteServerGroup(Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties)
Deletes a Server Group in the ADS.
|
static String |
getAdministrationSuffixDN()
Returns the DN of the suffix that contains the administration data.
|
static String |
getAdministratorContainerDN()
Returns the parent entry of the administrator entries.
|
static String |
getAdministratorDN(String uid)
Returns the DN of the administrator for a given UID.
|
static String |
getAdminLDIFFile()
Returns the LDIF file of the administration data.
|
static ADSContext.AdministratorProperty |
getAdminUserPropFromName(String name)
Get a AdministratorProperty associated to a name.
|
static String |
getDefaultBackendName()
Returns the default backend name of the administration data.
|
InitialLdapContext |
getDirContext()
Returns the DirContext used to retrieve information by this ADSContext.
|
static String |
getInstanceKeysContainerDN()
Returns the parent entry of the server key entries in ADS.
|
static String |
getSecretKeysContainerDN()
Returns the parent entry of the secret key entries in ADS.
|
static String |
getServerContainerDN()
Returns the parent entry of the server entries.
|
static String |
getServerGroupContainerDN()
Returns the parent entry of the server group entries.
|
Set<String> |
getServerGroupMemberList(String serverGroupId)
Returns the member list of a group of server.
|
static String |
getServerIdFromServerProperties(Map<ADSContext.ServerProperty,Object> serverProperties)
This method returns the DN of the entry that corresponds to the given
server properties.
|
static ADSContext.ServerProperty |
getServerPropFromName(String name)
Get a ServerProperty associated to a name.
|
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. |
boolean |
isAdministratorAlreadyRegistered(String uid)
Returns whether a given administrator is already registered or not.
|
static boolean |
isRegistered(ServerDescriptor server,
Set<Map<ADSContext.ServerProperty,Object>> registry)
Tells whether the provided server is registered in the registry.
|
boolean |
isServerAlreadyRegistered(Map<ADSContext.ServerProperty,Object> serverProperties)
Returns whether a given server is already registered or not.
|
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.ServerGroupProperty,Object>> |
readServerGroupRegistry()
Returns a set containing the server groups 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.
|
void |
removeServerGroupProp(String groupID,
Set<ADSContext.ServerGroupProperty> serverGroupProperties)
Updates the properties of a Server Group in the ADS.
|
void |
unregisterServer(Map<ADSContext.ServerProperty,Object> serverProperties)
Method called to unregister a server in the ADS.
|
void |
updateAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties,
String newAdminUserId)
Updates and administrator registered in the ADS.
|
void |
updateServer(Map<ADSContext.ServerProperty,Object> serverProperties,
String newServerId)
Method called to update the properties of a server in the ADS.
|
void |
updateServerGroup(String groupID,
Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties)
Updates the properties of a Server Group in the ADS.
|
public static final String GLOBAL_ADMIN_UID
public static final String ALL_SERVERGROUP_NAME
public ADSContext(InitialLdapContext dirContext)
dirContext
- the DirContext that must be used to retrieve information.public static ADSContext.ServerProperty getServerPropFromName(String name)
name
- The name of the property to retrieve.public static ADSContext.AdministratorProperty getAdminUserPropFromName(String name)
name
- The name of the property to retrieve.public InitialLdapContext getDirContext()
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 updateServer(Map<ADSContext.ServerProperty,Object> serverProperties, String newServerId) throws ADSContextException
serverProperties
- the new properties of the server.newServerId
- The new server Identifier, or null.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 boolean isServerAlreadyRegistered(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.true
if the server was registered and
false
otherwise.ADSContextException
- if something went wrong.public boolean isAdministratorAlreadyRegistered(String uid) throws ADSContextException
uid
- the administrator UID.true
if the administrator was registered and
false
otherwise.ADSContextException
- if something went wrong.public int registerOrUpdateServer(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.ADSContextException
- if something goes wrong.public Set<String> getServerGroupMemberList(String serverGroupId) throws ADSContextException
serverGroupId
- The group name.ADSContextException
- if something goes wrong.public Set<Map<ADSContext.ServerProperty,Object>> readServerRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public void createServerGroup(Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the properties of the server group to be created.ADSContextException
- if something goes wrong.public void updateServerGroup(String groupID, Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the new properties of the server group to be updated.groupID
- The group name.ADSContextException
- if something goes wrong.public void removeServerGroupProp(String groupID, Set<ADSContext.ServerGroupProperty> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the new properties of the server group to be updated.groupID
- The group name.ADSContextException
- if something goes wrong.public void deleteServerGroup(Map<ADSContext.ServerGroupProperty,Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the properties of the server group to be deleted.ADSContextException
- if something goes wrong.public Set<Map<ADSContext.ServerGroupProperty,Object>> readServerGroupRegistry() 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 String 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 void updateAdministrator(Map<ADSContext.AdministratorProperty,Object> adminProperties, String newAdminUserId) throws ADSContextException
adminProperties
- the new properties of the administrator.newAdminUserId
- The new admin user Identifier, or null.ADSContextException
- if something goes wrong.public static String getAdministrationSuffixDN()
public static String getServerIdFromServerProperties(Map<ADSContext.ServerProperty,Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.ADSContextException
- if something goes wrong.public static String getServerContainerDN()
public static String getAdministratorContainerDN()
public static String getServerGroupContainerDN()
public void createAdministrationSuffix(String backendName) throws ADSContextException
backendName
- the backend name to be used for the Administration Suffix. If this
value is null the default backendName for the Administration
Suffix will be used.ADSContextException
- if something goes wrong.public static String getDefaultBackendName()
public static String getAdminLDIFFile()
public static String getInstanceKeysContainerDN()
public static String getSecretKeysContainerDN()
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-2016 ForgeRock AS. All Rights Reserved.