@Component public class ExternalReferenceManagerImpl extends java.lang.Object implements ExternalReferenceManager
Constructor and Description |
---|
ExternalReferenceManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
deactivate(ExternalReference er)
Confirms that the xid and xref values in an XPair belong
to current partner and are of the expected type.
|
ExternalReference |
disable(ExternalReference er)
Disables an external reference
|
ExternalReference |
enable(ExternalReference er) |
ExternalReference |
findByRef(ExternalReferenceType refType,
java.lang.String extRef)
Returns the ExternalReference for a particular entity.
|
ExternalReference |
findByTargetId(ExternalReferenceType refType,
int targetId)
Returns the ExternalReference for a particular database ID.
|
ExternalReference |
findByXid(ExternalReferenceType refType,
int xid)
For internal use only by SDK Manager code.
|
ExternalReference |
findByXinfo(XInfo xinfo)
Returns the ExternalReference for a particular entity
|
java.util.List<ExternalReference> |
findByXrefs(java.util.List<java.lang.String> xRefs,
ExternalReferenceType xRefType) |
ExternalReferenceType |
getRefType(java.lang.String extRef)
Returns an external reference's type
|
int |
getXId(XInfo xinfo) |
boolean |
partnerOwnsXinfo(XInfo xinfo)
Returns whether a partner owns a particular reference
|
ExternalReference |
partnerPersist(int partnerId,
java.lang.String xref) |
ExternalReference |
persist(ExternalReferenceType refType,
java.lang.String xref,
int targetDbid)
Creates an ExternalReference to a particular entity.
|
public ExternalReference persist(ExternalReferenceType refType, java.lang.String xref, int targetDbid) throws NotFoundException, AlreadyExistsException
ExternalReferenceManager
persist
in interface ExternalReferenceManager
refType
- Entity typeNotFoundException
- If partnerRef was not foundAlreadyExistsException
- If an external reference already exists for this entitypublic ExternalReference partnerPersist(int partnerId, java.lang.String xref) throws AlreadyExistsException
partnerPersist
in interface ExternalReferenceManager
AlreadyExistsException
public ExternalReference findByTargetId(ExternalReferenceType refType, int targetId) throws NotFoundException
ExternalReferenceManager
findByTargetId
in interface ExternalReferenceManager
refType
- External reference typetargetId
- Internal database ID of interestNotFoundException
public ExternalReference findByXinfo(XInfo xinfo) throws NotFoundException
ExternalReferenceManager
findByXinfo
in interface ExternalReferenceManager
xinfo
- Contains the external reference info (an xid and xref) to locate
the full referenceNotFoundException
- Ifpublic ExternalReference findByRef(ExternalReferenceType refType, java.lang.String extRef) throws NotFoundException
ExternalReferenceManager
findByRef
in interface ExternalReferenceManager
refType
- External reference typeextRef
- The external reference (a UUID) of interest.NotFoundException
- If a match is not foundpublic ExternalReference findByXid(ExternalReferenceType refType, int xid) throws NotFoundException
ExternalReferenceManager
SDK-based applications that use this method do so at their own peril of sudden and unexpected behavior and errors. :-)
findByXid
in interface ExternalReferenceManager
NotFoundException
public ExternalReferenceType getRefType(java.lang.String extRef) throws NotFoundException
ExternalReferenceManager
getRefType
in interface ExternalReferenceManager
extRef
- The external reference (a UUID) of interest.NotFoundException
public boolean partnerOwnsXinfo(XInfo xinfo)
ExternalReferenceManager
partnerOwnsXinfo
in interface ExternalReferenceManager
xinfo
- The XPair
of interestpublic ExternalReference enable(ExternalReference er) throws NotFoundException
enable
in interface ExternalReferenceManager
NotFoundException
public ExternalReference disable(ExternalReference er) throws NotFoundException
ExternalReferenceManager
disable
in interface ExternalReferenceManager
er
- External reference to disableNotFoundException
- If the specified External Reference does not existpublic void deactivate(ExternalReference er) throws NotFoundException
ExternalReferenceManager
deactivate
in interface ExternalReferenceManager
NotFoundException
- If either the xid or xref are not found, do not belong to the
provided partner reference, or are of the wrong typepublic int getXId(XInfo xinfo)
getXId
in interface ExternalReferenceManager
public java.util.List<ExternalReference> findByXrefs(java.util.List<java.lang.String> xRefs, ExternalReferenceType xRefType) throws NotFoundException
findByXrefs
in interface ExternalReferenceManager
NotFoundException