|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.admin.ads.ADSContext
public class ADSContext
Class used to update and read the contents of the Administration Data.
Nested Class Summary | |
---|---|
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. |
Field Summary | |
---|---|
static java.lang.String |
ALL_SERVERGROUP_NAME
The default server group which will contain all registered servers. |
static java.lang.String |
GLOBAL_ADMIN_UID
Default global admin UID. |
Constructor Summary | |
---|---|
ADSContext(javax.naming.ldap.InitialLdapContext dirContext)
Constructor of the ADSContext. |
Method Summary | |
---|---|
void |
createAdminData(java.lang.String backendName)
Creates the Administration Data in the server. |
void |
createAdministrationSuffix(java.lang.String backendName)
Creates the Administration Suffix. |
void |
createAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties)
Creates an Administrator in the ADS. |
void |
createServerGroup(java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties)
Creates a Server Group in the ADS. |
void |
deleteAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties)
Deletes the administrator in the ADS. |
void |
deleteServerGroup(java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties)
Deletes a Server Group in the ADS. |
static java.lang.String |
getAdministrationSuffixDN()
Returns the DN of the suffix that contains the administration data. |
static java.lang.String |
getAdministratorContainerDN()
Returns the parent entry of the administrator entries. |
static java.lang.String |
getAdministratorDN(java.lang.String uid)
Returns the DN of the administrator for a given UID. |
static java.lang.String |
getAdminLDIFFile()
Returns the LDIF file of the administration data. |
static ADSContext.AdministratorProperty |
getAdminUserPropFromName(java.lang.String name)
Get a AdministratorProperty associated to a name. |
static java.lang.String |
getDefaultBackendName()
Returns the default backend name of the administration data. |
javax.naming.ldap.InitialLdapContext |
getDirContext()
Returns the DirContext used to retrieve information by this ADSContext. |
static java.lang.String |
getInstanceKeysContainerDN()
Returns the parent entry of the server key entries in ADS. |
static java.lang.String |
getSecretKeysContainerDN()
Returns the parent entry of the secret key entries in ADS. |
java.util.Set<java.lang.String> |
getServerGroupMemberList(java.lang.String serverGroupId)
Returns the member list of a group of server. |
static java.lang.String |
getServerIdFromServerProperties(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties)
This method returns the DN of the entry that corresponds to the given server properties. |
static ADSContext.ServerProperty |
getServerPropFromName(java.lang.String name)
Get a ServerProperty associated to a name. |
java.util.Map<java.lang.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(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties)
Returns whether a given administrator is already registered or not. |
boolean |
isServerAlreadyRegistered(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties)
Returns whether a given server is already registered or not. |
java.util.Set<java.util.Map<ADSContext.AdministratorProperty,java.lang.Object>> |
readAdministratorRegistry()
Returns a set containing the administrators that are defined in the ADS. |
java.util.Set<java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object>> |
readServerGroupRegistry()
Returns a set containing the server groups that are defined in the ADS. |
java.util.Set<java.util.Map<ADSContext.ServerProperty,java.lang.Object>> |
readServerRegistry()
Returns a set containing the servers that are registered in the ADS. |
int |
registerOrUpdateServer(java.util.Map<ADSContext.ServerProperty,java.lang.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(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties)
Method called to register a server in the ADS. |
void |
removeAdminData()
Removes the administration data. |
void |
removeServerGroupProp(java.lang.String groupID,
java.util.Set<ADSContext.ServerGroupProperty> serverGroupProperties)
Updates the properties of a Server Group in the ADS. |
void |
unregisterServer(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties)
Method called to unregister a server in the ADS. |
void |
updateAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties,
java.lang.String newAdminUserId)
Updates and administrator registered in the ADS. |
void |
updateServer(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties,
java.lang.String newServerId)
Method called to udpate the properties of a server in the ADS. |
void |
updateServerGroup(java.lang.String groupID,
java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties)
Updates the properties of a Server Group in the ADS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GLOBAL_ADMIN_UID
public static final java.lang.String ALL_SERVERGROUP_NAME
Constructor Detail |
---|
public ADSContext(javax.naming.ldap.InitialLdapContext dirContext)
dirContext
- the DirContext that must be used to retrieve information.Method Detail |
---|
public static ADSContext.ServerProperty getServerPropFromName(java.lang.String name)
name
- The name of the property to retrieve.
public static ADSContext.AdministratorProperty getAdminUserPropFromName(java.lang.String name)
name
- The name of the property to retrieve.
public javax.naming.ldap.InitialLdapContext getDirContext()
public void registerServer(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties) throws ADSContextException
serverProperties
- the properties of the server.
ADSContextException
- if the server could not be registered.public void updateServer(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties, java.lang.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(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties) throws ADSContextException
serverProperties
- the properties of the server.
ADSContextException
- if the server could not be unregistered.public boolean isServerAlreadyRegistered(java.util.Map<ADSContext.ServerProperty,java.lang.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(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties) throws ADSContextException
adminProperties
- the administrator properties.
true
if the administrator was registered and
false
otherwise.
ADSContextException
- if something went wrong.public int registerOrUpdateServer(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.
ADSContextException
- if something goes wrong.public java.util.Set<java.lang.String> getServerGroupMemberList(java.lang.String serverGroupId) throws ADSContextException
serverGroupId
- The group name.
ADSContextException
- if something goes wrong.public java.util.Set<java.util.Map<ADSContext.ServerProperty,java.lang.Object>> readServerRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public void createServerGroup(java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the properties of the server group to be
created.
ADSContextException
- if somethings goes wrong.public void updateServerGroup(java.lang.String groupID, java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the new properties of the server group to be
updated.groupID
- The group name.
ADSContextException
- if somethings goes wrong.public void removeServerGroupProp(java.lang.String groupID, java.util.Set<ADSContext.ServerGroupProperty> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the new properties of the server group to be
updated.groupID
- The group name.
ADSContextException
- if somethings goes wrong.public void deleteServerGroup(java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object> serverGroupProperties) throws ADSContextException
serverGroupProperties
- the properties of the server group to be
deleted.
ADSContextException
- if somethings goes wrong.public java.util.Set<java.util.Map<ADSContext.ServerGroupProperty,java.lang.Object>> readServerGroupRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public java.util.Set<java.util.Map<ADSContext.AdministratorProperty,java.lang.Object>> readAdministratorRegistry() throws ADSContextException
ADSContextException
- if something goes wrong.public void createAdminData(java.lang.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() 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 static java.lang.String getAdministratorDN(java.lang.String uid)
uid
- the UID to be used to generate the DN.
public void createAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties) throws ADSContextException
adminProperties
- the properties of the administrator to be created.
ADSContextException
- if something goes wrong.public void deleteAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties) throws ADSContextException
adminProperties
- the properties of the administrator to be deleted.
ADSContextException
- if something goes wrong.public void updateAdministrator(java.util.Map<ADSContext.AdministratorProperty,java.lang.Object> adminProperties, java.lang.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 java.lang.String getAdministrationSuffixDN()
public static java.lang.String getServerIdFromServerProperties(java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties) throws ADSContextException
serverProperties
- the server properties.
ADSContextException
- if something goes wrong.public static java.lang.String getAdministratorContainerDN()
public void createAdministrationSuffix(java.lang.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 java.lang.String getDefaultBackendName()
public static java.lang.String getAdminLDIFFile()
public static java.lang.String getInstanceKeysContainerDN()
public static java.lang.String getSecretKeysContainerDN()
public java.util.Map<java.lang.String,byte[]> getTrustedCertificates() throws ADSContextException
ADSContextException
- in case of problems with the entry search.CryptoManagerImpl.getTrustedCertificates()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |