Package org.nuxeo.ecm.directory.ldap
Class LDAPTreeReference
- java.lang.Object
-
- org.nuxeo.ecm.directory.AbstractReference
-
- org.nuxeo.ecm.directory.ldap.LDAPTreeReference
-
public class LDAPTreeReference extends AbstractReference implements Cloneable
Implementation of the directory Reference interface that makes it possible to retrieve children of a node in the LDAP tree structure.- Author:
- Anahide Tchertchian
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
EMPTY_STRING_LIST
protected int
scope
protected LDAPDirectoryDescriptor
targetDirectoryDescriptor
-
Fields inherited from class org.nuxeo.ecm.directory.AbstractReference
fieldName, sourceDirectory, sourceDirectoryName, targetDirectory, targetDirectoryName
-
-
Constructor Summary
Constructors Constructor Description LDAPTreeReference()
LDAPTreeReference(ReferenceDescriptor referenceDescriptor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLinks(String sourceId, List<String> targetIds)
NOT IMPLEMENTED: Store new linksvoid
addLinks(String sourceId, List<String> targetIds, Session session)
NOT IMPLEMENTED: Store new linksvoid
addLinks(List<String> sourceIds, String targetId)
NOT IMPLEMENTED: Store new links.void
addLinks(List<String> sourceIds, String targetId, Session session)
Adds the links between the source ids and the target idLDAPTreeReference
clone()
protected LDAPFilterMatcher
getFilterMatcher()
protected String
getParentDn(String dn)
int
getScope()
Directory
getSourceDirectory()
List<String>
getSourceIdsForTarget(String targetId)
Fetches single parent, cutting the dn and trying to get the given entry.protected LDAPDirectory
getSourceLDAPDirectory()
Directory
getTargetDirectory()
protected LDAPDirectoryDescriptor
getTargetDirectoryDescriptor()
List<String>
getTargetIdsForSource(String sourceId)
Fetches children, onelevel or subtree given the reference configuration.protected LDAPDirectory
getTargetLDAPDirectory()
protected static String
pseudoNormalizeDn(String dn)
Simple helper that replaces ", " by "," in the provided dn and returns the lower case version of the result for comparison purpose.void
removeLinksForSource(String sourceId)
NOT IMPLEMENTED: Remove existing statically defined links for the given source idvoid
removeLinksForSource(String sourceId, Session session)
Removes all the links for a given source idvoid
removeLinksForTarget(String targetId)
NOT IMPLEMENTED: Remove existing statically defined links for the given target idvoid
removeLinksForTarget(String targetId, Session session)
Removes all the links for a given target idvoid
setFieldName(String fieldName)
void
setScope(String scope)
void
setSourceIdsForTarget(String targetId, List<String> sourceIds)
NOT IMPLEMENTED: Edit the list of statically defined references for a given targetvoid
setSourceIdsForTarget(String targetId, List<String> sourceIds, Session session)
Sets all source ids to be associated to the given target idvoid
setTargetDirectoryName(String targetDirectoryName)
void
setTargetIdsForSource(String sourceId, List<String> targetIds)
NOT IMPLEMENTED: Set the list of statically defined references for a given sourcevoid
setTargetIdsForSource(String sourceId, List<String> targetIds, Session session)
Sets all target ids to be associated to the given source idString
toString()
-
Methods inherited from class org.nuxeo.ecm.directory.AbstractReference
getFieldName, setSourceDirectoryName
-
-
-
-
Field Detail
-
targetDirectoryDescriptor
protected LDAPDirectoryDescriptor targetDirectoryDescriptor
-
scope
protected int scope
-
-
Constructor Detail
-
LDAPTreeReference
public LDAPTreeReference()
-
LDAPTreeReference
public LDAPTreeReference(ReferenceDescriptor referenceDescriptor)
-
-
Method Detail
-
setFieldName
public void setFieldName(String fieldName)
-
getFilterMatcher
protected LDAPFilterMatcher getFilterMatcher()
-
setTargetDirectoryName
public void setTargetDirectoryName(String targetDirectoryName)
- Specified by:
setTargetDirectoryName
in interfaceReference
- Overrides:
setTargetDirectoryName
in classAbstractReference
-
getScope
public int getScope()
-
setScope
public void setScope(String scope)
-
getSourceDirectory
public Directory getSourceDirectory()
- Specified by:
getSourceDirectory
in interfaceReference
- Overrides:
getSourceDirectory
in classAbstractReference
-
getTargetDirectory
public Directory getTargetDirectory()
- Specified by:
getTargetDirectory
in interfaceReference
- Overrides:
getTargetDirectory
in classAbstractReference
-
getTargetLDAPDirectory
protected LDAPDirectory getTargetLDAPDirectory()
-
getSourceLDAPDirectory
protected LDAPDirectory getSourceLDAPDirectory()
-
getTargetDirectoryDescriptor
protected LDAPDirectoryDescriptor getTargetDirectoryDescriptor()
-
addLinks
public void addLinks(String sourceId, List<String> targetIds)
NOT IMPLEMENTED: Store new links- Specified by:
addLinks
in interfaceReference
- See Also:
Reference.addLinks(String, List)
-
addLinks
public void addLinks(String sourceId, List<String> targetIds, Session session)
NOT IMPLEMENTED: Store new links- Specified by:
addLinks
in interfaceReference
- Parameters:
sourceId
- the source idtargetIds
- the target idssession
- the session- See Also:
Reference.addLinks(String, List, Session)
-
addLinks
public void addLinks(List<String> sourceIds, String targetId, Session session)
Description copied from interface:Reference
Adds the links between the source ids and the target id
-
addLinks
public void addLinks(List<String> sourceIds, String targetId)
NOT IMPLEMENTED: Store new links.- Specified by:
addLinks
in interfaceReference
- See Also:
Reference.addLinks(List, String)
-
getSourceIdsForTarget
public List<String> getSourceIdsForTarget(String targetId)
Fetches single parent, cutting the dn and trying to get the given entry.- Specified by:
getSourceIdsForTarget
in interfaceReference
- See Also:
Reference.getSourceIdsForTarget(String)
-
getTargetIdsForSource
public List<String> getTargetIdsForSource(String sourceId)
Fetches children, onelevel or subtree given the reference configuration.Removes entries with same id than parent to only get real children.
- Specified by:
getTargetIdsForSource
in interfaceReference
- See Also:
Reference.getTargetIdsForSource(String)
-
pseudoNormalizeDn
protected static String pseudoNormalizeDn(String dn) throws InvalidNameException
Simple helper that replaces ", " by "," in the provided dn and returns the lower case version of the result for comparison purpose.- Parameters:
dn
- the raw unnormalized dn- Returns:
- lowercase version without whitespace after commas
- Throws:
InvalidNameException
-
removeLinksForSource
public void removeLinksForSource(String sourceId)
NOT IMPLEMENTED: Remove existing statically defined links for the given source id- Specified by:
removeLinksForSource
in interfaceReference
- See Also:
Reference.removeLinksForSource(String)
-
removeLinksForTarget
public void removeLinksForTarget(String targetId)
NOT IMPLEMENTED: Remove existing statically defined links for the given target id- Specified by:
removeLinksForTarget
in interfaceReference
- See Also:
Reference.removeLinksForTarget(String)
-
setSourceIdsForTarget
public void setSourceIdsForTarget(String targetId, List<String> sourceIds)
NOT IMPLEMENTED: Edit the list of statically defined references for a given target- Specified by:
setSourceIdsForTarget
in interfaceReference
- See Also:
Reference.setSourceIdsForTarget(String, List)
-
setSourceIdsForTarget
public void setSourceIdsForTarget(String targetId, List<String> sourceIds, Session session)
Description copied from interface:Reference
Sets all source ids to be associated to the given target id- Specified by:
setSourceIdsForTarget
in interfaceReference
- Parameters:
targetId
- the target idsourceIds
- the source idssession
- the session
-
setTargetIdsForSource
public void setTargetIdsForSource(String sourceId, List<String> targetIds)
NOT IMPLEMENTED: Set the list of statically defined references for a given source- Specified by:
setTargetIdsForSource
in interfaceReference
- See Also:
Reference.setTargetIdsForSource(String, List)
-
setTargetIdsForSource
public void setTargetIdsForSource(String sourceId, List<String> targetIds, Session session)
Description copied from interface:Reference
Sets all target ids to be associated to the given source id- Specified by:
setTargetIdsForSource
in interfaceReference
- Parameters:
sourceId
- the source idtargetIds
- the target idssession
- the session
-
removeLinksForTarget
public void removeLinksForTarget(String targetId, Session session)
Description copied from interface:Reference
Removes all the links for a given target id- Specified by:
removeLinksForTarget
in interfaceReference
- Parameters:
targetId
- the target idsession
- the session
-
removeLinksForSource
public void removeLinksForSource(String sourceId, Session session)
Description copied from interface:Reference
Removes all the links for a given source id- Specified by:
removeLinksForSource
in interfaceReference
- Parameters:
sourceId
- the source idsession
- the session
-
clone
public LDAPTreeReference clone()
-
-