org.opends.admin.ads
Class ADSContextHelper

java.lang.Object
  extended by org.opends.admin.ads.ADSContextHelper

public class ADSContextHelper
extends java.lang.Object

This is the only class in the org.opends.admin.ads package that uses the classes from OpenDS.jar (in particular the administration client framework API). Before calling this class OpenDS.jar must be loaded. The goal is basically to centralize in one single place the dependencies of this package on OpenDS.jar. This is done in order the QuickSetup code to be able to use some of the functionalities provided by the ADSContext classes before OpenDS.jar is downloaded.


Constructor Summary
ADSContextHelper()
          Default constructor.
 
Method Summary
 void createAdministrationSuffix(javax.naming.ldap.InitialLdapContext ctx, java.lang.String backendName)
          Creates the Administration Suffix.
 java.lang.String getAttrCryptoKeyCompromisedTime()
          Returns the crypto key compromised time attribute name as defined in ConfigConstants.
 java.lang.String getOcCryptoInstanceKey()
          Returns the crypto instance key objectclass name as defined in ConfigConstants.
 void registerInstanceKeyCertificate(javax.naming.ldap.InitialLdapContext ctx, java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties, javax.naming.ldap.LdapName serverEntryDn)
          Register instance key-pair public-key certificate provided in serverProperties: generate a key-id attribute if one is not provided (as expected); add an instance key public-key certificate entry for the key certificate; and associate the certificate entry with the server entry via the key ID attribute.
 void removeAdministrationSuffix(javax.naming.ldap.InitialLdapContext ctx, java.lang.String backendName)
          Removes the administration suffix.
 void unregisterInstanceKeyCertificate(javax.naming.ldap.InitialLdapContext ctx, java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties, javax.naming.ldap.LdapName serverEntryDn)
          Unregister instance key-pair public-key certificate provided in serverProperties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADSContextHelper

public ADSContextHelper()
Default constructor.

Method Detail

removeAdministrationSuffix

public void removeAdministrationSuffix(javax.naming.ldap.InitialLdapContext ctx,
                                       java.lang.String backendName)
                                throws ADSContextException
Removes the administration suffix.

Parameters:
ctx - the DirContext to be used.
backendName - the name of the backend where the administration suffix is stored.
Throws:
ADSContextException - if the administration suffix could not be removed.

createAdministrationSuffix

public void createAdministrationSuffix(javax.naming.ldap.InitialLdapContext ctx,
                                       java.lang.String backendName)
                                throws ADSContextException
Creates the Administration Suffix.

Parameters:
ctx - the DirContext to be used.
backendName - the name of the backend where the administration suffix is stored.
Throws:
ADSContextException - if the administration suffix could not be created.

registerInstanceKeyCertificate

public void registerInstanceKeyCertificate(javax.naming.ldap.InitialLdapContext ctx,
                                           java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties,
                                           javax.naming.ldap.LdapName serverEntryDn)
                                    throws ADSContextException
Register instance key-pair public-key certificate provided in serverProperties: generate a key-id attribute if one is not provided (as expected); add an instance key public-key certificate entry for the key certificate; and associate the certificate entry with the server entry via the key ID attribute.

Parameters:
ctx - the InitialLdapContext on the server we want to update.
serverProperties - Properties of the server being registered to which the instance key entry belongs.
serverEntryDn - The server's ADS entry DN.
Throws:
ADSContextException - In case some JNDI operation fails or there is a problem getting the instance public key certificate ID.

unregisterInstanceKeyCertificate

public void unregisterInstanceKeyCertificate(javax.naming.ldap.InitialLdapContext ctx,
                                             java.util.Map<ADSContext.ServerProperty,java.lang.Object> serverProperties,
                                             javax.naming.ldap.LdapName serverEntryDn)
                                      throws ADSContextException
Unregister instance key-pair public-key certificate provided in serverProperties.

Parameters:
ctx - the connection to the server.
serverProperties - Properties of the server being unregistered to which the instance key entry belongs.
serverEntryDn - The server's ADS entry DN.
Throws:
ADSContextException - In case some JNDI operation fails.

getOcCryptoInstanceKey

public java.lang.String getOcCryptoInstanceKey()
Returns the crypto instance key objectclass name as defined in ConfigConstants.

Returns:
the crypto instance key objectclass name as defined in ConfigConstants.

getAttrCryptoKeyCompromisedTime

public java.lang.String getAttrCryptoKeyCompromisedTime()
Returns the crypto key compromised time attribute name as defined in ConfigConstants.

Returns:
the crypto key compromised time attribute name as defined in ConfigConstants.