public class Reference extends Object
Protocol - defines what kind of virtualzied artefact is
referred by this reference as well as what virtualization process was applied
Resource - identifies the main resource used in the
virtualization (egg. a classpath location or repository node reference)ResourceParameters - used in customizing the
virtualization process (egg. a resource pointing to the actual node of a
semi-virtual folder reference)| Constructor and Description |
|---|
Reference(Encoding encoding,
Protocol protocol,
Resource resource) |
Reference(Encoding encoding,
Protocol protocol,
Resource resource,
List<? extends Parameter> parameters)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
encode() |
String |
encode(Encoding anEncoding) |
boolean |
equals(Object obj) |
<R> R |
execute(ProtocolMethod<R> method)
Double-dispatches
ProtocolMethods.Uses Protocol.dispatch(ProtocolMethod, Reference) to trigger
concrete protocol based double dispatch
ProtocolMethod::execute invocation on the given method
object. |
static Reference |
fromNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeRef Reference representation decoder/converter
method.Creates a Reference representation based on the ID of the given
NodeRef.It expects a VIRTUAL_TOKEN prefixed encoded string. |
Encoding |
getEncoding() |
List<Parameter> |
getParameters() |
Protocol |
getProtocol() |
Resource |
getResource() |
int |
hashCode() |
static boolean |
isReference(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Deprecated.
|
Reference |
propagateNodeRefMutations(org.alfresco.service.cmr.repository.NodeRef mutatedNodeRef)
Despite claimed
NodeRef opacity Alfresco sometimes alters
NodeRefs representation to achieve functionality. |
org.alfresco.service.cmr.repository.NodeRef |
toNodeRef() |
org.alfresco.service.cmr.repository.NodeRef |
toNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef) |
org.alfresco.service.cmr.repository.NodeRef |
toNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef,
Encoding encoding) |
String |
toString() |
public Reference(Encoding encoding, Protocol protocol, Resource resource, List<? extends Parameter> parameters)
encoding - the default Encoding of the new resource - to be used
where an encoding is required and none is specifiedprotocol - resource - parameters - resource parameters - a copy of the provided list will be
stored by this referencepublic static final boolean isReference(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeRef.NodeRef when passed to
the fromNodeRef(NodeRef) method.nodeRef - true if the given NodeRef is a valid
Reference representationfalse otherwisepublic static final Reference fromNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeRef Reference representation decoder/converter
method.Reference representation based on the ID of the given
NodeRef.VIRTUAL_TOKEN prefixed encoded string. The encoded
string must start with a valid Encoding token. The Reference
representation structure is (no delimiters between the 3 elements):
VIRTUAL_TOKEN ENCODING_TOKEN referenceString Given that a valid encoding
was detected Encoding.urlNative information is used to obtain a
reference string. The reference string is parsed using the encoding
configured parser.nodeRef - Reference object corresponding to the given
NodeRefpublic String encode() throws ReferenceEncodingException
String representation of this reference using its
default EncodingReferenceEncodingExceptionpublic String encode(Encoding anEncoding) throws ReferenceEncodingException
anEncoding - String representation of this reference using the given
EncodingReferenceEncodingExceptionpublic Protocol getProtocol()
public Resource getResource()
public org.alfresco.service.cmr.repository.NodeRef toNodeRef()
throws ReferenceEncodingException
NodeRef representation of this resource using the
StoreRef.STORE_REF_WORKSPACE_SPACESSTORE and the default
encoding of this resourceReferenceEncodingExceptionpublic org.alfresco.service.cmr.repository.NodeRef toNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef)
throws ReferenceEncodingException
storeRef - NodeRef representation of this resource using the given
StoreRef and the default encoding of this resourceReferenceEncodingExceptionpublic org.alfresco.service.cmr.repository.NodeRef toNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef,
Encoding encoding)
throws ReferenceEncodingException
storeRef - encoding - NodeRef representation of this resource using the given
StoreRef and EncodingReferenceEncodingExceptionpublic <R> R execute(ProtocolMethod<R> method) throws ProtocolMethodException
ProtocolMethods.Protocol.dispatch(ProtocolMethod, Reference) to trigger
concrete protocol based double dispatch
ProtocolMethod::execute invocation on the given method
object.method - ProtocolMethodExceptionpublic Reference propagateNodeRefMutations(org.alfresco.service.cmr.repository.NodeRef mutatedNodeRef)
NodeRef opacity Alfresco sometimes alters
NodeRefs representation to achieve functionality. For example see
VersionUtil.convertNodeRef(NodeRef).NodeRefs have suffered mutations and we try
to detect those mutations and create a correspondent reference.mutatedNodeRef - Reference corresponding to the
given mutated node or this Reference if no mutations
are detectedCopyright © 2005–2018 Alfresco Software. All rights reserved.