public class MongoDBReference extends AbstractReference implements Cloneable
Reference
Modifier and Type | Field and Description |
---|---|
protected String |
collection |
protected String |
dataFileName |
protected String |
sourceField |
protected String |
targetField |
fieldName, sourceDirectory, sourceDirectoryName, targetDirectory, targetDirectoryName
Constructor and Description |
---|
MongoDBReference() |
Modifier and Type | Method and Description |
---|---|
void |
addLinks(List<String> sourceIds,
String targetId) |
void |
addLinks(String sourceId,
List<String> targetIds) |
void |
addLinks(String sourceId,
List<String> targetIds,
MongoDBSession session)
Adds the links between the source id and the target ids
|
MongoDBReference |
clone()
Returns a clone, added for hot reload support.
|
protected MongoDBSession |
getMongoDBSession() |
List<String> |
getSourceIdsForTarget(String targetId) |
List<String> |
getTargetIdsForSource(String sourceId) |
List<String> |
getTargetIdsForSource(String sourceId,
MongoDBSession session)
Retrieves all target ids associated to the given source id
|
void |
removeLinksForSource(String sourceId) |
void |
removeLinksForSource(String sourceId,
MongoDBSession session)
Removes all the links for a given source id
|
void |
removeLinksForTarget(String targetId) |
void |
setFieldName(String fieldName) |
void |
setSourceIdsForTarget(String targetId,
List<String> sourceIds) |
void |
setTargetDirectoryName(String targetDirectoryName) |
void |
setTargetIdsForSource(String sourceId,
List<String> targetIds) |
void |
setTargetIdsForSource(String sourceId,
List<String> targetIds,
MongoDBSession session)
Sets all target ids to be associated to the given source id
|
getFieldName, getSourceDirectory, getTargetDirectory, setSourceDirectoryName
protected String collection
protected String sourceField
protected String targetField
protected String dataFileName
public MongoDBReference()
public void setFieldName(String fieldName)
public void setTargetDirectoryName(String targetDirectoryName)
setTargetDirectoryName
in interface Reference
setTargetDirectoryName
in class AbstractReference
public void addLinks(String sourceId, List<String> targetIds) throws DirectoryException
addLinks
in interface Reference
DirectoryException
public void addLinks(String sourceId, List<String> targetIds, MongoDBSession session) throws DirectoryException
sourceId
- the source idtargetIds
- the target idssession
- the mongoDB sessionDirectoryException
public void addLinks(List<String> sourceIds, String targetId) throws DirectoryException
addLinks
in interface Reference
DirectoryException
public void removeLinksForSource(String sourceId) throws DirectoryException
removeLinksForSource
in interface Reference
DirectoryException
public void removeLinksForSource(String sourceId, MongoDBSession session)
sourceId
- the source idsession
- the mongoDB sessionpublic void removeLinksForTarget(String targetId) throws DirectoryException
removeLinksForTarget
in interface Reference
DirectoryException
public List<String> getTargetIdsForSource(String sourceId) throws DirectoryException
getTargetIdsForSource
in interface Reference
DirectoryException
public List<String> getTargetIdsForSource(String sourceId, MongoDBSession session) throws DirectoryException
sourceId
- the source idsession
- the mongoDB sessionDirectoryException
public List<String> getSourceIdsForTarget(String targetId) throws DirectoryException
getSourceIdsForTarget
in interface Reference
DirectoryException
public void setTargetIdsForSource(String sourceId, List<String> targetIds) throws DirectoryException
setTargetIdsForSource
in interface Reference
DirectoryException
public void setTargetIdsForSource(String sourceId, List<String> targetIds, MongoDBSession session) throws DirectoryException
sourceId
- the source idtargetIds
- the target idssession
- the mongoDB sessionDirectoryException
public void setSourceIdsForTarget(String targetId, List<String> sourceIds) throws DirectoryException
setSourceIdsForTarget
in interface Reference
DirectoryException
public MongoDBReference clone()
Reference
clone
in interface Reference
clone
in class AbstractReference
protected MongoDBSession getMongoDBSession() throws DirectoryException
DirectoryException
Copyright © 2017 Nuxeo. All rights reserved.