org.apache.directory.server.core
Class MockCoreSession

java.lang.Object
  extended by org.apache.directory.server.core.MockCoreSession
All Implemented Interfaces:
CoreSession

public class MockCoreSession
extends java.lang.Object
implements CoreSession

The default CoreSession implementation. TODO - has not been completed yet TODO - need to supply controls and other parameters to setup opContexts

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
MockCoreSession(LdapPrincipal principal, DirectoryService directoryService)
           
 
Method Summary
 void add(org.apache.directory.shared.ldap.message.internal.InternalAddRequest addRequest)
          Adds an entry into the DirectoryService associated with this CoreSession.
 void add(org.apache.directory.shared.ldap.message.internal.InternalAddRequest addRequest, LogChange log)
          Adds an entry into the DirectoryService associated with this CoreSession.
 void add(org.apache.directory.shared.ldap.entry.ServerEntry entry)
          Adds an entry into the DirectoryService associated with this CoreSession.
 void add(org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean ignoreReferral)
          Adds an entry into the DirectoryService associated with this CoreSession.
 void add(org.apache.directory.shared.ldap.entry.ServerEntry entry, boolean ignoreReferral, LogChange log)
          Adds an entry into the DirectoryService associated with this CoreSession.
 void add(org.apache.directory.shared.ldap.entry.ServerEntry entry, LogChange log)
          Adds an entry into the DirectoryService associated with this CoreSession.
 boolean compare(org.apache.directory.shared.ldap.name.DN dn, java.lang.String oid, java.lang.Object value)
          Checks to see if an attribute in an entry contains a value.
 boolean compare(org.apache.directory.shared.ldap.name.DN dn, java.lang.String oid, java.lang.Object value, boolean ignoreReferral)
          Checks to see if an attribute in an entry contains a value.
 boolean compare(org.apache.directory.shared.ldap.message.internal.InternalCompareRequest compareRequest)
          Checks to see if an attribute in an entry contains a value.
 void delete(org.apache.directory.shared.ldap.name.DN dn)
          Deletes an entry in the server.
 void delete(org.apache.directory.shared.ldap.name.DN dn, boolean ignoreReferral)
          Deletes an entry in the server.
 void delete(org.apache.directory.shared.ldap.name.DN dn, boolean ignoreReferral, LogChange log)
          Deletes an entry in the server.
 void delete(org.apache.directory.shared.ldap.name.DN dn, LogChange log)
          Deletes an entry in the server.
 void delete(org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest deleteRequest)
          
 void delete(org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest deleteRequest, LogChange log)
          
 boolean exists(org.apache.directory.shared.ldap.name.DN dn)
          Checks to see if an entry exists.
 LdapPrincipal getAuthenticatedPrincipal()
          Gets the LDAP principal used to authenticate.
 org.apache.directory.shared.ldap.constants.AuthenticationLevel getAuthenticationLevel()
          Gets the authentication level associated with this session.
 java.net.SocketAddress getClientAddress()
          Gets the socket address of the LDAP client or null if there is no LDAP client associated with the session.
 java.util.Set<org.apache.directory.shared.ldap.message.control.Control> getControls()
          Gets the controls enabled for this session.
 DirectoryService getDirectoryService()
          Gets the DirectoryService this session is bound to.
 LdapPrincipal getEffectivePrincipal()
          Gets the LDAP principal used for the effective identity associated with this session which may not be the same as the authenticated principal.
 java.util.Set<OperationContext> getOutstandingOperations()
          Gets all outstanding operations currently being performed that have yet to be completed.
 java.net.SocketAddress getServiceAddress()
          Gets the socket address of the LDAP server or null if there is no LDAP service associated with the session.
 boolean isAdministrator()
          TODO - perhaps we should just use a flag that is calculated on creation of this session
 boolean isAnAdministrator()
          TODO - this method impl does not check to see if the principal is in the administrators group - it only returns true of the principal is the actual admin user.
 boolean isAnonymous()
          Gets whether or not this user is anonymous.
 boolean isConfidential()
          Gets whether or not confidentiality is enabled for this session.
 boolean isVirtual()
          Gets whether or not this session is virtual.
 EntryFilteringCursor list(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode, java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes)
          An optimized search operation using one level search scope which returns all the children of an entry specified by distinguished name.
 EntryFilteringCursor list(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode, java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes, long sizeLimit, int timeLimit)
          An optimized search operation using one level search scope which applies size and time limit constraints and returns all the children of an entry specified by distinguished name if thes limits are not violated.
 ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn)
          Looks up an entry in the server returning all attributes: both user and operational attributes.
 ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn, java.lang.String[] attrId)
          Looks up an entry in the server returning all attributes: both user and operational attributes.
 void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
          Modifies an entry within the server by applying a list of modifications to the entry.
 void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods, boolean ignoreReferral)
          Modifies an entry within the server by applying a list of modifications to the entry.
 void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods, boolean ignoreReferral, LogChange log)
          Modifies an entry within the server by applying a list of modifications to the entry.
 void modify(org.apache.directory.shared.ldap.name.DN dn, java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods, LogChange log)
          Modifies an entry within the server by applying a list of modifications to the entry.
 void modify(org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest)
          
 void modify(org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest, LogChange log)
          
 void move(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent)
          Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.
 void move(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, boolean ignoreReferral)
          Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.
 void move(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, boolean ignoreReferral, LogChange log)
          Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.
 void move(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, LogChange log)
          Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.
 void move(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
          Move an entry by changing its superior.
 void move(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest, LogChange log)
          Move an entry by changing its superior.
 void moveAndRename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn)
          Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.
 void moveAndRename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, boolean ignoreReferral)
          Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.
 void moveAndRename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, boolean ignoreReferral, LogChange log)
          Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.
 void moveAndRename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.DN newParent, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, LogChange log)
          Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.
 void moveAndRename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
          Move and rename an entry.
 void moveAndRename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest, LogChange log)
          Move and rename an entry.
 void rename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn)
          Renames an entry by changing it's relative distinguished name.
 void rename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, boolean ignoreReferral)
          Renames an entry by changing it's relative distinguished name.
 void rename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, boolean ignoreReferral, LogChange log)
          Renames an entry by changing it's relative distinguished name.
 void rename(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.name.RDN newRdn, boolean deleteOldRdn, LogChange log)
          Renames an entry by changing it's relative distinguished name.
 void rename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
          Rename an entry applying the ModifyDN request
 void rename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest, LogChange log)
          Rename an entry applying the ModifyDN request
 EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.filter.SearchScope scope, org.apache.directory.shared.ldap.filter.ExprNode filter, org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode, java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes)
          Searches the directory using a specified search scope and filter.
 EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn, org.apache.directory.shared.ldap.filter.SearchScope scope, org.apache.directory.shared.ldap.filter.ExprNode filter, org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode, java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes, long sizeLimit, int timeLimit)
          Searches the directory using a specified search scope and filter.
 EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn, java.lang.String filter)
          Searches the directory using a specified filter.
 EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn, java.lang.String filter, boolean ignoreReferrals)
          Searches the directory using a specified filter.
 EntryFilteringCursor search(org.apache.directory.shared.ldap.message.internal.InternalSearchRequest searchRequest)
           
 void setDirectoryService(DirectoryService directoryService)
           
 void unbind()
           
 void unbind(org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest unbindRequest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockCoreSession

public MockCoreSession(LdapPrincipal principal,
                       DirectoryService directoryService)
Method Detail

add

public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession.

Specified by:
add in interface CoreSession
Parameters:
entry - the entry to add
Throws:
java.lang.Exception - on failures to add the entry

add

public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
                boolean ignoreReferral)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
add in interface CoreSession
Parameters:
entry - the entry to add
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - on failures to add the entry

add

public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
                LogChange log)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession.

Specified by:
add in interface CoreSession
Parameters:
entry - the entry to add
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - on failures to add the entry

add

public void add(org.apache.directory.shared.ldap.entry.ServerEntry entry,
                boolean ignoreReferral,
                LogChange log)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
add in interface CoreSession
Parameters:
entry - the entry to add
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - on failures to add the entry

add

public void add(org.apache.directory.shared.ldap.message.internal.InternalAddRequest addRequest)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession. The entry is built using the received AddRequest.

Specified by:
add in interface CoreSession
Throws:
java.lang.Exception - on failures to add the entry

add

public void add(org.apache.directory.shared.ldap.message.internal.InternalAddRequest addRequest,
                LogChange log)
         throws java.lang.Exception
Adds an entry into the DirectoryService associated with this CoreSession. The entry is built using the received AddRequest.

Specified by:
add in interface CoreSession
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - on failures to add the entry

compare

public boolean compare(org.apache.directory.shared.ldap.name.DN dn,
                       java.lang.String oid,
                       java.lang.Object value)
                throws java.lang.Exception
Checks to see if an attribute in an entry contains a value.

Specified by:
compare in interface CoreSession
Parameters:
dn - the distinguished name of the entry to check
oid - the OID of the attribute to check for the value
value - the value to check for
Throws:
java.lang.Exception - if there are failures while comparing

compare

public boolean compare(org.apache.directory.shared.ldap.name.DN dn,
                       java.lang.String oid,
                       java.lang.Object value,
                       boolean ignoreReferral)
                throws java.lang.Exception
Checks to see if an attribute in an entry contains a value. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
compare in interface CoreSession
Parameters:
dn - the distinguished name of the entry to check
oid - the OID of the attribute to check for the value
value - the value to check for
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - if there are failures while comparing

delete

public void delete(org.apache.directory.shared.ldap.name.DN dn)
            throws java.lang.Exception
Deletes an entry in the server.

Specified by:
delete in interface CoreSession
Parameters:
dn - the distinguished name of the entry to delete
Throws:
java.lang.Exception - if there are failures while deleting the entry

delete

public void delete(org.apache.directory.shared.ldap.name.DN dn,
                   LogChange log)
            throws java.lang.Exception
Deletes an entry in the server.

Specified by:
delete in interface CoreSession
Parameters:
dn - the distinguished name of the entry to delete
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while deleting the entry

delete

public void delete(org.apache.directory.shared.ldap.name.DN dn,
                   boolean ignoreReferral)
            throws java.lang.Exception
Deletes an entry in the server. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
delete in interface CoreSession
Parameters:
dn - the distinguished name of the entry to delete
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - if there are failures while deleting the entry

delete

public void delete(org.apache.directory.shared.ldap.name.DN dn,
                   boolean ignoreReferral,
                   LogChange log)
            throws java.lang.Exception
Deletes an entry in the server. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
delete in interface CoreSession
Parameters:
dn - the distinguished name of the entry to delete
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while deleting the entry

getAuthenticatedPrincipal

public LdapPrincipal getAuthenticatedPrincipal()
Description copied from interface: CoreSession
Gets the LDAP principal used to authenticate. This is the identity used to establish this session on authentication.

Specified by:
getAuthenticatedPrincipal in interface CoreSession
Returns:
the LdapPrincipal used to authenticate.

getAuthenticationLevel

public org.apache.directory.shared.ldap.constants.AuthenticationLevel getAuthenticationLevel()
Description copied from interface: CoreSession
Gets the authentication level associated with this session.

Specified by:
getAuthenticationLevel in interface CoreSession
Returns:
the authentication level associated with the session

getClientAddress

public java.net.SocketAddress getClientAddress()
Description copied from interface: CoreSession
Gets the socket address of the LDAP client or null if there is no LDAP client associated with the session. Some calls to the core can be made by embedding applications or by non-LDAP services using a programmatic (virtual) session. In these cases no client address is available.

Specified by:
getClientAddress in interface CoreSession
Returns:
null if the session is virtual, non-null when the session is associated with a real LDAP client

getControls

public java.util.Set<org.apache.directory.shared.ldap.message.control.Control> getControls()
Description copied from interface: CoreSession
Gets the controls enabled for this session.

Specified by:
getControls in interface CoreSession
Returns:
the session controls as a Set

getDirectoryService

public DirectoryService getDirectoryService()
Description copied from interface: CoreSession
Gets the DirectoryService this session is bound to.

Specified by:
getDirectoryService in interface CoreSession
Returns:
the DirectoryService associated with this session

getEffectivePrincipal

public LdapPrincipal getEffectivePrincipal()
Description copied from interface: CoreSession
Gets the LDAP principal used for the effective identity associated with this session which may not be the same as the authenticated principal. This principal is often the same as the authenticated principal. Sometimes however, a user authenticating as one principal, may request to have all operations performed in the session as if they were another principal. The SASL mechanism allows setting an authorized principal which is in effect for the duration of the session. In this case all operations are performed as if they are being performed by this principal. This method will then return the authorized principal which will be different from the authenticated principal. Implementations of this interface may have a means to set the authorized principal which may or may not be the same as the authenticated principal. Implementations should default to return the authenticated principal when an authorized principal is not provided.

Specified by:
getEffectivePrincipal in interface CoreSession
Returns:
the LdapPrincipal to use as the effective principal

getOutstandingOperations

public java.util.Set<OperationContext> getOutstandingOperations()
Description copied from interface: CoreSession
Gets all outstanding operations currently being performed that have yet to be completed.

Specified by:
getOutstandingOperations in interface CoreSession
Returns:
the set of outstanding operations

getServiceAddress

public java.net.SocketAddress getServiceAddress()
Description copied from interface: CoreSession
Gets the socket address of the LDAP server or null if there is no LDAP service associated with the session. Some calls to the core can be made by embedding applications or by non-LDAP services using a programmatic (virtual) session. In these cases no service address is available.

Specified by:
getServiceAddress in interface CoreSession
Returns:
null if the session is virtual, non-null when the session is associated with a real LDAP service

isConfidential

public boolean isConfidential()
Description copied from interface: CoreSession
Gets whether or not confidentiality is enabled for this session.

Specified by:
isConfidential in interface CoreSession
Returns:
true if confidentiality is enabled, false otherwise

isVirtual

public boolean isVirtual()
Description copied from interface: CoreSession
Gets whether or not this session is virtual. Virtual sessions verses real sessions represent logical sessions established by non-LDAP services or embedding applications which do not expose the LDAP access.

Specified by:
isVirtual in interface CoreSession
Returns:
true if the session is virtual, false otherwise

isAdministrator

public boolean isAdministrator()
TODO - perhaps we should just use a flag that is calculated on creation of this session

Specified by:
isAdministrator in interface CoreSession
Returns:
true if authorized as the administrator, false otherwise
See Also:
CoreSession.isAdministrator()

isAnAdministrator

public boolean isAnAdministrator()
TODO - this method impl does not check to see if the principal is in the administrators group - it only returns true of the principal is the actual admin user. need to make it check groups. TODO - perhaps we should just use a flag that is calculated on creation of this session

Specified by:
isAnAdministrator in interface CoreSession
Returns:
true if authorized as an administrator, false otherwise
See Also:
CoreSession.isAnAdministrator()

list

public EntryFilteringCursor list(org.apache.directory.shared.ldap.name.DN dn,
                                 org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode,
                                 java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes)
                          throws java.lang.Exception
Description copied from interface: CoreSession
An optimized search operation using one level search scope which returns all the children of an entry specified by distinguished name. This is equivalent to a search operation with one level scope using the (objectClass=*) filter.

Specified by:
list in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
aliasDerefMode - the alias dereferencing mode used
returningAttributes - the attributes to return
Throws:
java.lang.Exception - if there are failures while listing children

list

public EntryFilteringCursor list(org.apache.directory.shared.ldap.name.DN dn,
                                 org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode,
                                 java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes,
                                 long sizeLimit,
                                 int timeLimit)
                          throws java.lang.Exception
Description copied from interface: CoreSession
An optimized search operation using one level search scope which applies size and time limit constraints and returns all the children of an entry specified by distinguished name if thes limits are not violated. This is equivalent to a search operation with one level scope using the (objectClass=*) filter.

Specified by:
list in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
aliasDerefMode - the alias dereferencing mode used
returningAttributes - the attributes to return
sizeLimit - the upper bound to the number of entries to return
timeLimit - the upper bound to the amount of time before terminating the search
Throws:
java.lang.Exception - if there are failures while listing children

lookup

public ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn)
                         throws java.lang.Exception
Looks up an entry in the server returning all attributes: both user and operational attributes.

Specified by:
lookup in interface CoreSession
Parameters:
dn - the name of the entry to lookup
Throws:
java.lang.Exception - if there are failures while looking up the entry

lookup

public ClonedServerEntry lookup(org.apache.directory.shared.ldap.name.DN dn,
                                java.lang.String[] attrId)
                         throws java.lang.Exception
Looks up an entry in the server returning all attributes: both user and operational attributes.

Specified by:
lookup in interface CoreSession
Parameters:
dn - the name of the entry to lookup
attrId - The list of attributes to return
Throws:
java.lang.Exception - if there are failures while looking up the entry

modify

public void modify(org.apache.directory.shared.ldap.name.DN dn,
                   java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods)
            throws java.lang.Exception
Modifies an entry within the server by applying a list of modifications to the entry.

Specified by:
modify in interface CoreSession
Parameters:
dn - the distinguished name of the entry to modify
mods - the list of modifications to apply
Throws:
java.lang.Exception - if there are failures while modifying the entry

modify

public void modify(org.apache.directory.shared.ldap.name.DN dn,
                   java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods,
                   LogChange log)
            throws java.lang.Exception
Modifies an entry within the server by applying a list of modifications to the entry.

Specified by:
modify in interface CoreSession
Parameters:
dn - the distinguished name of the entry to modify
mods - the list of modifications to apply
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while modifying the entry

modify

public void modify(org.apache.directory.shared.ldap.name.DN dn,
                   java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods,
                   boolean ignoreReferral)
            throws java.lang.Exception
Modifies an entry within the server by applying a list of modifications to the entry. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
modify in interface CoreSession
Parameters:
dn - the distinguished name of the entry to modify
mods - the list of modifications to apply
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - if there are failures while modifying the entry

modify

public void modify(org.apache.directory.shared.ldap.name.DN dn,
                   java.util.List<org.apache.directory.shared.ldap.entry.Modification> mods,
                   boolean ignoreReferral,
                   LogChange log)
            throws java.lang.Exception
Modifies an entry within the server by applying a list of modifications to the entry. The flag is used to tell the server to ignore the referrals and manipulate them as if they were normal entries.

Specified by:
modify in interface CoreSession
Parameters:
dn - the distinguished name of the entry to modify
mods - the list of modifications to apply
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while modifying the entry

move

public void move(org.apache.directory.shared.ldap.name.DN dn,
                 org.apache.directory.shared.ldap.name.DN newParent)
          throws java.lang.Exception
Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.

Specified by:
move in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
Throws:
java.lang.Exception

move

public void move(org.apache.directory.shared.ldap.name.DN dn,
                 org.apache.directory.shared.ldap.name.DN newParent,
                 LogChange log)
          throws java.lang.Exception
Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.

Specified by:
move in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception

move

public void move(org.apache.directory.shared.ldap.name.DN dn,
                 org.apache.directory.shared.ldap.name.DN newParent,
                 boolean ignoreReferral)
          throws java.lang.Exception
Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.

Specified by:
move in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception

move

public void move(org.apache.directory.shared.ldap.name.DN dn,
                 org.apache.directory.shared.ldap.name.DN newParent,
                 boolean ignoreReferral,
                 LogChange log)
          throws java.lang.Exception
Moves an entry or a branch of entries at a specified distinguished name to a position under a new parent.

Specified by:
move in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN dn,
                          org.apache.directory.shared.ldap.name.DN newParent,
                          org.apache.directory.shared.ldap.name.RDN newRdn,
                          boolean deleteOldRdn)
                   throws java.lang.Exception
Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.

Specified by:
moveAndRename in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
newRdn - the new relative distinguished name of the entry at the root of the branch
Throws:
java.lang.Exception

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN dn,
                          org.apache.directory.shared.ldap.name.DN newParent,
                          org.apache.directory.shared.ldap.name.RDN newRdn,
                          boolean deleteOldRdn,
                          LogChange log)
                   throws java.lang.Exception
Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.

Specified by:
moveAndRename in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
newRdn - the new relative distinguished name of the entry at the root of the branch
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN dn,
                          org.apache.directory.shared.ldap.name.DN newParent,
                          org.apache.directory.shared.ldap.name.RDN newRdn,
                          boolean deleteOldRdn,
                          boolean ignoreReferral)
                   throws java.lang.Exception
Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.

Specified by:
moveAndRename in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
newRdn - the new relative distinguished name of the entry at the root of the branch
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.name.DN dn,
                          org.apache.directory.shared.ldap.name.DN newParent,
                          org.apache.directory.shared.ldap.name.RDN newRdn,
                          boolean deleteOldRdn,
                          boolean ignoreReferral,
                          LogChange log)
                   throws java.lang.Exception
Moves and renames (the relative distinguished name of) an entry (or a branch if the entry has children) at a specified distinguished name to a position under a new parent.

Specified by:
moveAndRename in interface CoreSession
Parameters:
dn - the distinguished name of the entry/branch to move
newParent - the new parent under which the entry/branch is moved
newRdn - the new relative distinguished name of the entry at the root of the branch
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception

rename

public void rename(org.apache.directory.shared.ldap.name.DN dn,
                   org.apache.directory.shared.ldap.name.RDN newRdn,
                   boolean deleteOldRdn)
            throws java.lang.Exception
Renames an entry by changing it's relative distinguished name. This has the side effect of changing the distinguished name of all entries directly or indirectly subordinate to the named entry if it has descendants.

Specified by:
rename in interface CoreSession
Parameters:
dn - the distinguished name of the entry to rename
newRdn - the new relative distinguished name for the entry
deleteOldRdn - whether or not the old value for the relative distinguished name is to be deleted from the entry
Throws:
java.lang.Exception - if there are failures while renaming the entry

rename

public void rename(org.apache.directory.shared.ldap.name.DN dn,
                   org.apache.directory.shared.ldap.name.RDN newRdn,
                   boolean deleteOldRdn,
                   LogChange log)
            throws java.lang.Exception
Renames an entry by changing it's relative distinguished name. This has the side effect of changing the distinguished name of all entries directly or indirectly subordinate to the named entry if it has descendants.

Specified by:
rename in interface CoreSession
Parameters:
dn - the distinguished name of the entry to rename
newRdn - the new relative distinguished name for the entry
deleteOldRdn - whether or not the old value for the relative distinguished name is to be deleted from the entry
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while renaming the entry

rename

public void rename(org.apache.directory.shared.ldap.name.DN dn,
                   org.apache.directory.shared.ldap.name.RDN newRdn,
                   boolean deleteOldRdn,
                   boolean ignoreReferral)
            throws java.lang.Exception
Renames an entry by changing it's relative distinguished name. This has the side effect of changing the distinguished name of all entries directly or indirectly subordinate to the named entry if it has descendants.

Specified by:
rename in interface CoreSession
Parameters:
dn - the distinguished name of the entry to rename
newRdn - the new relative distinguished name for the entry
deleteOldRdn - whether or not the old value for the relative distinguished name is to be deleted from the entry
ignoreReferral - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - if there are failures while renaming the entry

rename

public void rename(org.apache.directory.shared.ldap.name.DN dn,
                   org.apache.directory.shared.ldap.name.RDN newRdn,
                   boolean deleteOldRdn,
                   boolean ignoreReferral,
                   LogChange log)
            throws java.lang.Exception
Renames an entry by changing it's relative distinguished name. This has the side effect of changing the distinguished name of all entries directly or indirectly subordinate to the named entry if it has descendants.

Specified by:
rename in interface CoreSession
Parameters:
dn - the distinguished name of the entry to rename
newRdn - the new relative distinguished name for the entry
deleteOldRdn - whether or not the old value for the relative distinguished name is to be deleted from the entry
ignoreReferral - a flag to tell the server to ignore referrals
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while renaming the entry

search

public EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn,
                                   java.lang.String filter)
                            throws java.lang.Exception
Searches the directory using a specified filter. The scope is defaulting to 'base'. The alias dereferencing default to 'always'. the returned attributes defaults to 'all the user attributes)

Specified by:
search in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
filter - the search filter
Throws:
java.lang.Exception - if there are failures while listing children

search

public EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn,
                                   java.lang.String filter,
                                   boolean ignoreReferrals)
                            throws java.lang.Exception
Searches the directory using a specified filter. The scope is defaulting to 'base'. The alias dereferencing default to 'always'. the returned attributes defaults to 'all the user attributes)

Specified by:
search in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
filter - the search filter
ignoreReferrals - a flag to tell the server to ignore referrals
Throws:
java.lang.Exception - if there are failures while listing children

search

public EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn,
                                   org.apache.directory.shared.ldap.filter.SearchScope scope,
                                   org.apache.directory.shared.ldap.filter.ExprNode filter,
                                   org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode,
                                   java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes)
                            throws java.lang.Exception
Description copied from interface: CoreSession
Searches the directory using a specified search scope and filter.

Specified by:
search in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
scope - the search scope to apply
filter - the search filter
aliasDerefMode - the alias dereferencing mode used
returningAttributes - the attributes to return
Throws:
java.lang.Exception - if there are failures while listing children

search

public EntryFilteringCursor search(org.apache.directory.shared.ldap.name.DN dn,
                                   org.apache.directory.shared.ldap.filter.SearchScope scope,
                                   org.apache.directory.shared.ldap.filter.ExprNode filter,
                                   org.apache.directory.shared.ldap.message.AliasDerefMode aliasDerefMode,
                                   java.util.Set<org.apache.directory.shared.ldap.schema.AttributeTypeOptions> returningAttributes,
                                   long sizeLimit,
                                   int timeLimit)
                            throws java.lang.Exception
Description copied from interface: CoreSession
Searches the directory using a specified search scope and filter.

Specified by:
search in interface CoreSession
Parameters:
dn - the distinguished name of the entry to list the children of
aliasDerefMode - the alias dereferencing mode used
returningAttributes - the attributes to return
sizeLimit - the upper bound to the number of entries to return
timeLimit - the upper bound to the amount of time before terminating the search
Throws:
java.lang.Exception - if there are failures while listing children

isAnonymous

public boolean isAnonymous()
Description copied from interface: CoreSession
Gets whether or not this user is anonymous.

Specified by:
isAnonymous in interface CoreSession
Returns:
true if the identity is anonymous false otherwise

compare

public boolean compare(org.apache.directory.shared.ldap.message.internal.InternalCompareRequest compareRequest)
                throws java.lang.Exception
Checks to see if an attribute in an entry contains a value.

Specified by:
compare in interface CoreSession
Parameters:
compareRequest - the received request
Throws:
java.lang.Exception - if there are failures while comparing

delete

public void delete(org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest deleteRequest)
            throws java.lang.Exception

Specified by:
delete in interface CoreSession
Throws:
java.lang.Exception

delete

public void delete(org.apache.directory.shared.ldap.message.internal.InternalDeleteRequest deleteRequest,
                   LogChange log)
            throws java.lang.Exception

Specified by:
delete in interface CoreSession
Throws:
java.lang.Exception

exists

public boolean exists(org.apache.directory.shared.ldap.name.DN dn)
               throws java.lang.Exception
Description copied from interface: CoreSession
Checks to see if an entry exists.

Specified by:
exists in interface CoreSession
Throws:
java.lang.Exception

modify

public void modify(org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest)
            throws java.lang.Exception

Specified by:
modify in interface CoreSession
Throws:
java.lang.Exception

modify

public void modify(org.apache.directory.shared.ldap.message.internal.InternalModifyRequest modifyRequest,
                   LogChange log)
            throws java.lang.Exception

Specified by:
modify in interface CoreSession
Throws:
java.lang.Exception

move

public void move(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
          throws java.lang.Exception
Move an entry by changing its superior.

Specified by:
move in interface CoreSession
Parameters:
modifyDnRequest - The ModifyDN request
Throws:
java.lang.Exception - if there are failures while moving the entry/branch

move

public void move(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest,
                 LogChange log)
          throws java.lang.Exception
Move an entry by changing its superior.

Specified by:
move in interface CoreSession
Parameters:
modifyDnRequest - The ModifyDN request
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while moving the entry/branch

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
                   throws java.lang.Exception
Move and rename an entry. We change the RDN and the superior.

Specified by:
moveAndRename in interface CoreSession
Parameters:
modifyDnRequest - The move and rename request
Throws:
java.lang.Exception - if there are failures while moving and renaming the entry or branch

moveAndRename

public void moveAndRename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest,
                          LogChange log)
                   throws java.lang.Exception
Move and rename an entry. We change the RDN and the superior.

Specified by:
moveAndRename in interface CoreSession
Parameters:
modifyDnRequest - The move and rename request
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while moving and renaming the entry or branch

rename

public void rename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest)
            throws java.lang.Exception
Rename an entry applying the ModifyDN request

Specified by:
rename in interface CoreSession
Parameters:
modifyDnRequest - The requested modification
Throws:
java.lang.Exception - if there are failures while renaming the entry

rename

public void rename(org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest modifyDnRequest,
                   LogChange log)
            throws java.lang.Exception
Rename an entry applying the ModifyDN request

Specified by:
rename in interface CoreSession
Parameters:
modifyDnRequest - The requested modification
log - a flag set if the added entry should be stored in the changeLog
Throws:
java.lang.Exception - if there are failures while renaming the entry

search

public EntryFilteringCursor search(org.apache.directory.shared.ldap.message.internal.InternalSearchRequest searchRequest)
                            throws java.lang.Exception
Specified by:
search in interface CoreSession
Throws:
java.lang.Exception

unbind

public void unbind()
            throws java.lang.Exception
Specified by:
unbind in interface CoreSession
Throws:
java.lang.Exception

unbind

public void unbind(org.apache.directory.shared.ldap.message.internal.InternalUnbindRequest unbindRequest)
Specified by:
unbind in interface CoreSession

setDirectoryService

public void setDirectoryService(DirectoryService directoryService)
Parameters:
directoryService - the directoryService to set


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.