org.apache.directory.server.sar
Class DirectoryService

java.lang.Object
  extended byServiceMBeanSupport
      extended byorg.apache.directory.server.sar.DirectoryService
All Implemented Interfaces:
DirectoryServiceMBean

public class DirectoryService
extends ServiceMBeanSupport
implements DirectoryServiceMBean

JBoss 3.x Mbean for embedded and remote directory server support

Version:
$Rev: 434428 $, $Date: 2006-08-24 18:45:34 +0200 (Thu, 24 Aug 2006) $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
static int DEFAULT_LDAP_PORT
          Default LDAP Listen Port
static int DEFAULT_LDAPS_PORT
          Default LDAPS (SSL) Port
 
Constructor Summary
DirectoryService()
           
 
Method Summary
 java.lang.String changedEmbeddedAdminPassword(java.lang.String oldPassword, java.lang.String newPassword)
          Embedded server only - Changes the current password of the uid=admin user
 boolean flushEmbeddedServerData()
          Embedded server only - Flushes out any I/O buffer or write cache
 java.lang.String getContextFactory()
          Gets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY
 java.lang.String getContextProviderURL()
          Gets the name-to-object binding for Context PROVIDER_URL
 java.lang.String getContextSecurityAuthentication()
          Gets the name-to-object binding for Context SECURITY_AUTHENTICATION
 java.lang.String getContextSecurityCredentials()
          Gets the name-to-object binding for Context SECURITY_CREDENTIALS
 java.lang.String getContextSecurityPrincipal()
          Gets the name-to-object binding for Context SECURITY_PRINCIPAL
 org.w3c.dom.Element getEmbeddedAdditionalEnvProperties()
          Gets the root element of the XML properties list of additional environment properties
 org.w3c.dom.Element getEmbeddedCustomBootstrapSchema()
          Gets the root element of the XML properties list of custom bootstrap schema properties
 java.lang.String getEmbeddedCustomRootPartitionName()
          Embedded server only - Gets the name of the root partion which was automatically created on server startup
 int getEmbeddedLDAPPort()
          Embedded server only - gets the LDAP listen port
 int getEmbeddedLDAPSPort()
          Embedded server only - gets the LDAPSSL) listen port (!NOT YET SUPPORTED!)
 java.lang.String getEmbeddedLDIFdir()
          Embedded server only - Gets the name of the LDIF import folder used by the server
 org.w3c.dom.Element getEmbeddedLDIFFilters()
          Gets the root element of the XML properties list of defined LDIF filters
 java.lang.String getEmbeddedWkdir()
          Embedded server only - Gets the name of the workfile folder used by the server
 boolean isEmbeddedAccessControlEnabled()
          Embedded server only - test if access control is enabled
 boolean isEmbeddedAnonymousAccess()
          Embedded server only - tests if anonymous access is permitted
 boolean isEmbeddedEnableChangePassword()
          Embedded server only - test if Change Password wire protocol is enabled
 boolean isEmbeddedEnableKerberos()
          Embedded server only - test if Kerberos wire protocol is enabled
 boolean isEmbeddedEnableNtp()
          Embedded server only - test if NTP wire protocol is enabled
 boolean isEmbeddedLDAPNetworkingSupport()
          Embedded server only - tests if LDAP wire protocol handler is to be started
 boolean isEmbeddedServerEnabled()
          Test to see if the directory service to use is embedded in this VM
 javax.naming.directory.DirContext openDirContext()
          Opens a directory context based on the currently assigned name-to-object bindings
 void setContextFactory(java.lang.String factoryClass)
          Sets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY
 void setContextProviderURL(java.lang.String providerURL)
          Sets the name-to-object binding for Context PROVIDER_URL
 void setContextSecurityAuthentication(java.lang.String securityAuthentication)
          Sets the name-to-object binding for Context SECURITY_AUTHENTICATION
 void setContextSecurityCredentials(java.lang.String securityCredentials)
          Sets the name-to-object binding for Context SECURITY_CREDENTIALS
 void setContextSecurityPrincipal(java.lang.String securityPrincipal)
          Sets the name-to-object binding for Context SECURITY_PRINCIPAL
 void setEmbeddedAccessControlEnabled(boolean enabled)
          Embedded server only - Set if access control is enabled
 void setEmbeddedAdditionalEnvProperties(org.w3c.dom.Element env)
          Sets the root element of the XML properties list of additional environment properties
 void setEmbeddedAnonymousAccess(boolean anonymousAccess)
          Embedded server only - sests if anonymous access is permitted
 void setEmbeddedCustomBootstrapSchema(org.w3c.dom.Element cfg)
          Sets the root element of the XML properties list of custom bootstrap schema properties
 void setEmbeddedCustomRootPartitionName(java.lang.String rootPartitianName)
          Embedded server only - Sets the name of the root partion which is automatically created on server startup
 void setEmbeddedEnableChangePassword(boolean enabled)
          Embedded server only - set if Change Password wire protocol is enabled
 void setEmbeddedEnableKerberos(boolean enabled)
          Embedded server only - set if Kerberos wire protocol is enabled
 void setEmbeddedEnableNtp(boolean enabled)
          Embedded server only - set if NTP wire protocol is enabled
 void setEmbeddedLDAPNetworkingSupport(boolean ldapNetworkingSupport)
          Embedded server only - sests if LDAP wire protocol handler is to be started
 void setEmbeddedLDAPPort(int ldapPort)
          Embedded server only - sets the LDAP listen port
 void setEmbeddedLDAPSPort(int ldapsPort)
          Embedded server only - sets the LDAPS (SSL) listen port (!NOT YET SUPPORTED!)
 void setEmbeddedLDIFdir(java.lang.String LDIFdir)
          Embedded server only - Sets the name of the LDIF import folder used by the server
 void setEmbeddedLDIFFilters(org.w3c.dom.Element fil)
          Sets the root element of the XML properties list of defined LDIF filters
 void setEmbeddedServerEnabled(boolean enabled)
          Set if the directory service to use is embedded in this VM
 void setEmbeddedWkdir(java.lang.String wkdir)
          Embedded server only - Sets the name of the workfile folder used by the server
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LDAP_PORT

public static final int DEFAULT_LDAP_PORT
Default LDAP Listen Port

See Also:
Constant Field Values

DEFAULT_LDAPS_PORT

public static final int DEFAULT_LDAPS_PORT
Default LDAPS (SSL) Port

See Also:
Constant Field Values
Constructor Detail

DirectoryService

public DirectoryService()
Method Detail

startService

protected void startService()
                     throws java.lang.Exception
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Throws:
java.lang.Exception

getContextProviderURL

public java.lang.String getContextProviderURL()
Description copied from interface: DirectoryServiceMBean
Gets the name-to-object binding for Context PROVIDER_URL

Specified by:
getContextProviderURL in interface DirectoryServiceMBean
Returns:
Context.PROVIDER_URL

getContextSecurityAuthentication

public java.lang.String getContextSecurityAuthentication()
Description copied from interface: DirectoryServiceMBean
Gets the name-to-object binding for Context SECURITY_AUTHENTICATION

Specified by:
getContextSecurityAuthentication in interface DirectoryServiceMBean
Returns:
Context.SECURITY_AUTHENTICATION

getContextSecurityCredentials

public java.lang.String getContextSecurityCredentials()
Description copied from interface: DirectoryServiceMBean
Gets the name-to-object binding for Context SECURITY_CREDENTIALS

Specified by:
getContextSecurityCredentials in interface DirectoryServiceMBean
Returns:
Context.SECURITY_CREDENTIALS

getContextSecurityPrincipal

public java.lang.String getContextSecurityPrincipal()
Description copied from interface: DirectoryServiceMBean
Gets the name-to-object binding for Context SECURITY_PRINCIPAL

Specified by:
getContextSecurityPrincipal in interface DirectoryServiceMBean
Returns:
Context.SECURITY_PRINCIPAL

getEmbeddedCustomRootPartitionName

public java.lang.String getEmbeddedCustomRootPartitionName()
Description copied from interface: DirectoryServiceMBean
Embedded server only - Gets the name of the root partion which was automatically created on server startup

Specified by:
getEmbeddedCustomRootPartitionName in interface DirectoryServiceMBean
Returns:
The name of the custom root partition (null for no custom partition)

getEmbeddedLDAPPort

public int getEmbeddedLDAPPort()
Description copied from interface: DirectoryServiceMBean
Embedded server only - gets the LDAP listen port

Specified by:
getEmbeddedLDAPPort in interface DirectoryServiceMBean
Returns:
LDAP listen port

getEmbeddedLDAPSPort

public int getEmbeddedLDAPSPort()
Description copied from interface: DirectoryServiceMBean
Embedded server only - gets the LDAPSSL) listen port (!NOT YET SUPPORTED!)

Specified by:
getEmbeddedLDAPSPort in interface DirectoryServiceMBean
Returns:
LDAPS listen port

getEmbeddedLDIFdir

public java.lang.String getEmbeddedLDIFdir()
Description copied from interface: DirectoryServiceMBean
Embedded server only - Gets the name of the LDIF import folder used by the server

Specified by:
getEmbeddedLDIFdir in interface DirectoryServiceMBean
Returns:
LDIF import folder

getEmbeddedWkdir

public java.lang.String getEmbeddedWkdir()
Description copied from interface: DirectoryServiceMBean
Embedded server only - Gets the name of the workfile folder used by the server

Specified by:
getEmbeddedWkdir in interface DirectoryServiceMBean
Returns:
Folder name

isEmbeddedAnonymousAccess

public boolean isEmbeddedAnonymousAccess()
Description copied from interface: DirectoryServiceMBean
Embedded server only - tests if anonymous access is permitted

Specified by:
isEmbeddedAnonymousAccess in interface DirectoryServiceMBean
Returns:
True if permitted else false

isEmbeddedLDAPNetworkingSupport

public boolean isEmbeddedLDAPNetworkingSupport()
Description copied from interface: DirectoryServiceMBean
Embedded server only - tests if LDAP wire protocol handler is to be started

Specified by:
isEmbeddedLDAPNetworkingSupport in interface DirectoryServiceMBean
Returns:
True if LDAP wire protocol in use else false

isEmbeddedServerEnabled

public boolean isEmbeddedServerEnabled()
Description copied from interface: DirectoryServiceMBean
Test to see if the directory service to use is embedded in this VM

Specified by:
isEmbeddedServerEnabled in interface DirectoryServiceMBean
Returns:
True if embedded else false

openDirContext

public javax.naming.directory.DirContext openDirContext()
                                                 throws javax.naming.NamingException
Description copied from interface: DirectoryServiceMBean
Opens a directory context based on the currently assigned name-to-object bindings

Specified by:
openDirContext in interface DirectoryServiceMBean
Returns:
A valid directory context or null on error
Throws:
javax.naming.NamingException

setContextProviderURL

public void setContextProviderURL(java.lang.String providerURL)
Description copied from interface: DirectoryServiceMBean
Sets the name-to-object binding for Context PROVIDER_URL

Specified by:
setContextProviderURL in interface DirectoryServiceMBean
Parameters:
providerURL - Context.PROVIDER_URL value

setContextSecurityAuthentication

public void setContextSecurityAuthentication(java.lang.String securityAuthentication)
Description copied from interface: DirectoryServiceMBean
Sets the name-to-object binding for Context SECURITY_AUTHENTICATION

Specified by:
setContextSecurityAuthentication in interface DirectoryServiceMBean
Parameters:
securityAuthentication - Context.SECURITY_AUTHENTICATION value

setContextSecurityCredentials

public void setContextSecurityCredentials(java.lang.String securityCredentials)
Description copied from interface: DirectoryServiceMBean
Sets the name-to-object binding for Context SECURITY_CREDENTIALS

Specified by:
setContextSecurityCredentials in interface DirectoryServiceMBean
Parameters:
securityCredentials - Context.SECURITY_CREDENTIALS value

setContextSecurityPrincipal

public void setContextSecurityPrincipal(java.lang.String securityPrincipal)
Description copied from interface: DirectoryServiceMBean
Sets the name-to-object binding for Context SECURITY_PRINCIPAL

Specified by:
setContextSecurityPrincipal in interface DirectoryServiceMBean
Parameters:
securityPrincipal - Context.SECURITY_PRINCIPAL value

setEmbeddedAnonymousAccess

public void setEmbeddedAnonymousAccess(boolean anonymousAccess)
Description copied from interface: DirectoryServiceMBean
Embedded server only - sests if anonymous access is permitted

Specified by:
setEmbeddedAnonymousAccess in interface DirectoryServiceMBean
Parameters:
anonymousAccess - True to allow else false

setEmbeddedCustomRootPartitionName

public void setEmbeddedCustomRootPartitionName(java.lang.String rootPartitianName)
Description copied from interface: DirectoryServiceMBean
Embedded server only - Sets the name of the root partion which is automatically created on server startup

Specified by:
setEmbeddedCustomRootPartitionName in interface DirectoryServiceMBean
Parameters:
rootPartitianName - The name of the custom root partition (null for no partition)

setEmbeddedLDAPNetworkingSupport

public void setEmbeddedLDAPNetworkingSupport(boolean ldapNetworkingSupport)
Description copied from interface: DirectoryServiceMBean
Embedded server only - sests if LDAP wire protocol handler is to be started

Specified by:
setEmbeddedLDAPNetworkingSupport in interface DirectoryServiceMBean
Parameters:
ldapNetworkingSupport - True to install LDAP support else false

setEmbeddedLDAPPort

public void setEmbeddedLDAPPort(int ldapPort)
Description copied from interface: DirectoryServiceMBean
Embedded server only - sets the LDAP listen port

Specified by:
setEmbeddedLDAPPort in interface DirectoryServiceMBean
Parameters:
ldapPort - The LDAP port listened on

setEmbeddedLDAPSPort

public void setEmbeddedLDAPSPort(int ldapsPort)
Description copied from interface: DirectoryServiceMBean
Embedded server only - sets the LDAPS (SSL) listen port (!NOT YET SUPPORTED!)

Specified by:
setEmbeddedLDAPSPort in interface DirectoryServiceMBean
Parameters:
ldapsPort - The LDAPS port listened on

setEmbeddedLDIFdir

public void setEmbeddedLDIFdir(java.lang.String LDIFdir)
Description copied from interface: DirectoryServiceMBean
Embedded server only - Sets the name of the LDIF import folder used by the server

Specified by:
setEmbeddedLDIFdir in interface DirectoryServiceMBean
Parameters:
LDIFdir - LDIF import folder

setEmbeddedServerEnabled

public void setEmbeddedServerEnabled(boolean enabled)
Description copied from interface: DirectoryServiceMBean
Set if the directory service to use is embedded in this VM

Specified by:
setEmbeddedServerEnabled in interface DirectoryServiceMBean
Parameters:
enabled - True if embedded else false

setEmbeddedWkdir

public void setEmbeddedWkdir(java.lang.String wkdir)
Description copied from interface: DirectoryServiceMBean
Embedded server only - Sets the name of the workfile folder used by the server

Specified by:
setEmbeddedWkdir in interface DirectoryServiceMBean
Parameters:
wkdir - Folder name

getContextFactory

public java.lang.String getContextFactory()
Description copied from interface: DirectoryServiceMBean
Gets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY

Specified by:
getContextFactory in interface DirectoryServiceMBean
Returns:
Context.INITIAL_CONTEXT_FACTORY

setContextFactory

public void setContextFactory(java.lang.String factoryClass)
Description copied from interface: DirectoryServiceMBean
Sets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY

Specified by:
setContextFactory in interface DirectoryServiceMBean
Parameters:
factoryClass - Context.INITIAL_CONTEXT_FACTORY value

changedEmbeddedAdminPassword

public java.lang.String changedEmbeddedAdminPassword(java.lang.String oldPassword,
                                                     java.lang.String newPassword)
Description copied from interface: DirectoryServiceMBean
Embedded server only - Changes the current password of the uid=admin user

Specified by:
changedEmbeddedAdminPassword in interface DirectoryServiceMBean
Parameters:
oldPassword - Old password for verification
newPassword - New password to use
Returns:
Confirmation message for UI display

flushEmbeddedServerData

public boolean flushEmbeddedServerData()
Description copied from interface: DirectoryServiceMBean
Embedded server only - Flushes out any I/O buffer or write cache

Specified by:
flushEmbeddedServerData in interface DirectoryServiceMBean
Returns:
True if flush succeeded else false

getEmbeddedAdditionalEnvProperties

public org.w3c.dom.Element getEmbeddedAdditionalEnvProperties()
Description copied from interface: DirectoryServiceMBean
Gets the root element of the XML properties list of additional environment properties

Specified by:
getEmbeddedAdditionalEnvProperties in interface DirectoryServiceMBean
Returns:
The root DOM element

getEmbeddedCustomBootstrapSchema

public org.w3c.dom.Element getEmbeddedCustomBootstrapSchema()
Description copied from interface: DirectoryServiceMBean
Gets the root element of the XML properties list of custom bootstrap schema properties

Specified by:
getEmbeddedCustomBootstrapSchema in interface DirectoryServiceMBean
Returns:
The root DOM element

setEmbeddedAdditionalEnvProperties

public void setEmbeddedAdditionalEnvProperties(org.w3c.dom.Element env)
Description copied from interface: DirectoryServiceMBean
Sets the root element of the XML properties list of additional environment properties

Specified by:
setEmbeddedAdditionalEnvProperties in interface DirectoryServiceMBean
Parameters:
env - The root DOM element

setEmbeddedCustomBootstrapSchema

public void setEmbeddedCustomBootstrapSchema(org.w3c.dom.Element cfg)
Description copied from interface: DirectoryServiceMBean
Sets the root element of the XML properties list of custom bootstrap schema properties

Specified by:
setEmbeddedCustomBootstrapSchema in interface DirectoryServiceMBean
Parameters:
cfg - The root DOM element

isEmbeddedAccessControlEnabled

public boolean isEmbeddedAccessControlEnabled()
Description copied from interface: DirectoryServiceMBean
Embedded server only - test if access control is enabled

Specified by:
isEmbeddedAccessControlEnabled in interface DirectoryServiceMBean
Returns:
True is enabled else false

isEmbeddedEnableChangePassword

public boolean isEmbeddedEnableChangePassword()
Description copied from interface: DirectoryServiceMBean
Embedded server only - test if Change Password wire protocol is enabled

Specified by:
isEmbeddedEnableChangePassword in interface DirectoryServiceMBean
Returns:
True is enabled else false

isEmbeddedEnableKerberos

public boolean isEmbeddedEnableKerberos()
Description copied from interface: DirectoryServiceMBean
Embedded server only - test if Kerberos wire protocol is enabled

Specified by:
isEmbeddedEnableKerberos in interface DirectoryServiceMBean
Returns:
True is enabled else false

isEmbeddedEnableNtp

public boolean isEmbeddedEnableNtp()
Description copied from interface: DirectoryServiceMBean
Embedded server only - test if NTP wire protocol is enabled

Specified by:
isEmbeddedEnableNtp in interface DirectoryServiceMBean
Returns:
True is enabled else false

setEmbeddedAccessControlEnabled

public void setEmbeddedAccessControlEnabled(boolean enabled)
Description copied from interface: DirectoryServiceMBean
Embedded server only - Set if access control is enabled

Specified by:
setEmbeddedAccessControlEnabled in interface DirectoryServiceMBean
Parameters:
enabled - True to enable else false

setEmbeddedEnableChangePassword

public void setEmbeddedEnableChangePassword(boolean enabled)
Description copied from interface: DirectoryServiceMBean
Embedded server only - set if Change Password wire protocol is enabled

Specified by:
setEmbeddedEnableChangePassword in interface DirectoryServiceMBean
Parameters:
enabled - True to enable else false

setEmbeddedEnableKerberos

public void setEmbeddedEnableKerberos(boolean enabled)
Description copied from interface: DirectoryServiceMBean
Embedded server only - set if Kerberos wire protocol is enabled

Specified by:
setEmbeddedEnableKerberos in interface DirectoryServiceMBean
Parameters:
enabled - True to enable else false

setEmbeddedEnableNtp

public void setEmbeddedEnableNtp(boolean enabled)
Description copied from interface: DirectoryServiceMBean
Embedded server only - set if NTP wire protocol is enabled

Specified by:
setEmbeddedEnableNtp in interface DirectoryServiceMBean
Parameters:
enabled - True to enable else false

getEmbeddedLDIFFilters

public org.w3c.dom.Element getEmbeddedLDIFFilters()
Description copied from interface: DirectoryServiceMBean
Gets the root element of the XML properties list of defined LDIF filters

Specified by:
getEmbeddedLDIFFilters in interface DirectoryServiceMBean
Returns:
The root DOM element

setEmbeddedLDIFFilters

public void setEmbeddedLDIFFilters(org.w3c.dom.Element fil)
Description copied from interface: DirectoryServiceMBean
Sets the root element of the XML properties list of defined LDIF filters

Specified by:
setEmbeddedLDIFFilters in interface DirectoryServiceMBean
Parameters:
fil - The root DOM element