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_LISTprotected intscopeprotected LDAPDirectoryDescriptortargetDirectoryDescriptor-
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 voidaddLinks(String sourceId, List<String> targetIds)NOT IMPLEMENTED: Store new linksvoidaddLinks(String sourceId, List<String> targetIds, Session session)NOT IMPLEMENTED: Store new linksvoidaddLinks(List<String> sourceIds, String targetId)NOT IMPLEMENTED: Store new links.voidaddLinks(List<String> sourceIds, String targetId, Session session)Adds the links between the source ids and the target idLDAPTreeReferenceclone()protected LDAPFilterMatchergetFilterMatcher()protected StringgetParentDn(String dn)intgetScope()DirectorygetSourceDirectory()List<String>getSourceIdsForTarget(String targetId)Fetches single parent, cutting the dn and trying to get the given entry.protected LDAPDirectorygetSourceLDAPDirectory()DirectorygetTargetDirectory()protected LDAPDirectoryDescriptorgetTargetDirectoryDescriptor()List<String>getTargetIdsForSource(String sourceId)Fetches children, onelevel or subtree given the reference configuration.protected LDAPDirectorygetTargetLDAPDirectory()protected static StringpseudoNormalizeDn(String dn)Simple helper that replaces ", " by "," in the provided dn and returns the lower case version of the result for comparison purpose.voidremoveLinksForSource(String sourceId)NOT IMPLEMENTED: Remove existing statically defined links for the given source idvoidremoveLinksForSource(String sourceId, Session session)Removes all the links for a given source idvoidremoveLinksForTarget(String targetId)NOT IMPLEMENTED: Remove existing statically defined links for the given target idvoidremoveLinksForTarget(String targetId, Session session)Removes all the links for a given target idvoidsetFieldName(String fieldName)voidsetScope(String scope)voidsetSourceIdsForTarget(String targetId, List<String> sourceIds)NOT IMPLEMENTED: Edit the list of statically defined references for a given targetvoidsetSourceIdsForTarget(String targetId, List<String> sourceIds, Session session)Sets all source ids to be associated to the given target idvoidsetTargetDirectoryName(String targetDirectoryName)voidsetTargetIdsForSource(String sourceId, List<String> targetIds)NOT IMPLEMENTED: Set the list of statically defined references for a given sourcevoidsetTargetIdsForSource(String sourceId, List<String> targetIds, Session session)Sets all target ids to be associated to the given source idStringtoString()-
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:
setTargetDirectoryNamein interfaceReference- Overrides:
setTargetDirectoryNamein classAbstractReference
-
getScope
public int getScope()
-
setScope
public void setScope(String scope)
-
getSourceDirectory
public Directory getSourceDirectory()
- Specified by:
getSourceDirectoryin interfaceReference- Overrides:
getSourceDirectoryin classAbstractReference
-
getTargetDirectory
public Directory getTargetDirectory()
- Specified by:
getTargetDirectoryin interfaceReference- Overrides:
getTargetDirectoryin 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:
addLinksin 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:
addLinksin 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:ReferenceAdds 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:
addLinksin 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:
getSourceIdsForTargetin 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:
getTargetIdsForSourcein 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:
removeLinksForSourcein 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:
removeLinksForTargetin 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:
setSourceIdsForTargetin interfaceReference- See Also:
Reference.setSourceIdsForTarget(String, List)
-
setSourceIdsForTarget
public void setSourceIdsForTarget(String targetId, List<String> sourceIds, Session session)
Description copied from interface:ReferenceSets all source ids to be associated to the given target id- Specified by:
setSourceIdsForTargetin 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:
setTargetIdsForSourcein interfaceReference- See Also:
Reference.setTargetIdsForSource(String, List)
-
setTargetIdsForSource
public void setTargetIdsForSource(String sourceId, List<String> targetIds, Session session)
Description copied from interface:ReferenceSets all target ids to be associated to the given source id- Specified by:
setTargetIdsForSourcein interfaceReference- Parameters:
sourceId- the source idtargetIds- the target idssession- the session
-
removeLinksForTarget
public void removeLinksForTarget(String targetId, Session session)
Description copied from interface:ReferenceRemoves all the links for a given target id- Specified by:
removeLinksForTargetin interfaceReference- Parameters:
targetId- the target idsession- the session
-
removeLinksForSource
public void removeLinksForSource(String sourceId, Session session)
Description copied from interface:ReferenceRemoves all the links for a given source id- Specified by:
removeLinksForSourcein interfaceReference- Parameters:
sourceId- the source idsession- the session
-
clone
public LDAPTreeReference clone()
-
-