Package org.alfresco.repo.virtual.ref
Class Reference
java.lang.Object
org.alfresco.repo.virtual.ref.Reference
A generic, immutable virtualized artefact reference.
Refers virtualized artefacts through :
Refers virtualized artefacts through :
- a
Protocol- defines what kind of virtualzied artefact is referred by this reference as well as what virtualization process was applied - a
Resource- identifies the main resource used in the virtualization (egg. a classpath location or repository node reference) - a list of
ResourceParameters - used in customizing the virtualization process (egg. a resource pointing to the actual node of a semi-virtual folder reference)
- Author:
- Bogdan Horje
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencode()boolean<R> Rexecute(ProtocolMethod<R> method) Double-dispatchesProtocolMethods.
UsesProtocol.dispatch(ProtocolMethod, Reference)to trigger concrete protocol based double dispatchProtocolMethod::executeinvocation on the given method object.static final ReferencefromNodeRef(NodeRef nodeRef) inthashCode()static final booleanisReference(NodeRef nodeRef) Deprecated.propagateNodeRefMutations(NodeRef mutatedNodeRef) Despite claimedNodeRefopacity Alfresco sometimes alters NodeRefs representation to achieve functionality.toString()
-
Constructor Details
-
Reference
public Reference(Encoding encoding, Protocol protocol, Resource resource, List<? extends Parameter> parameters) Constructor- Parameters:
encoding- the defaultEncodingof 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 reference
-
Reference
-
-
Method Details
-
isReference
Deprecated.Quick Reference compliance check of aNodeRef.
NodeRef Reference representations validated by this method should produce valid Reference objects based on the givenNodeRefwhen passed to thefromNodeRef(NodeRef)method.- Parameters:
nodeRef-- Returns:
trueif the givenNodeRefis a valid Reference representation
falseotherwise
-
fromNodeRef
NodeRefReferencerepresentation decoder/converter method.
Creates aReferencerepresentation based on the ID of the givenNodeRef.
It expects aVIRTUAL_TOKENprefixed encoded string. The encoded string must start with a validEncodingtoken. The Reference representation structure is (no delimiters between the 3 elements): VIRTUAL_TOKEN ENCODING_TOKEN referenceString Given that a valid encoding was detectedEncoding.urlNativeinformation is used to obtain a reference string. The reference string is parsed using the encoding configured parser. -
encode
- Returns:
- a
Stringrepresentation of this reference using its defaultEncoding - Throws:
ReferenceEncodingException
-
encode
- Parameters:
anEncoding-- Returns:
- a
Stringrepresentation of this reference using the givenEncoding - Throws:
ReferenceEncodingException
-
getEncoding
- Returns:
- the default
Encodingof this reference
-
getProtocol
-
getResource
-
getParameters
-
toNodeRef
- Returns:
- a
NodeRefrepresentation of this resource using theStoreRef.STORE_REF_WORKSPACE_SPACESSTOREand the default encoding of this resource - Throws:
ReferenceEncodingException
-
toNodeRef
- Parameters:
storeRef-- Returns:
- a
NodeRefrepresentation of this resource using the givenStoreRefand the default encoding of this resource - Throws:
ReferenceEncodingException
-
toNodeRef
- Parameters:
storeRef-encoding-- Returns:
- a
NodeRefrepresentation of this resource using the givenStoreRefandEncoding - Throws:
ReferenceEncodingException
-
execute
Double-dispatchesProtocolMethods.
UsesProtocol.dispatch(ProtocolMethod, Reference)to trigger concrete protocol based double dispatchProtocolMethod::executeinvocation on the given method object.- Parameters:
method-- Returns:
- the dispatched method execution result
- Throws:
ProtocolMethodException
-
propagateNodeRefMutations
Despite claimedNodeRefopacity Alfresco sometimes alters NodeRefs representation to achieve functionality. For example seeVersionUtil.convertNodeRef(NodeRef).
We say that alteredNodeRefs have suffered mutations and we try to detect those mutations and create a correspondent reference.- Parameters:
mutatedNodeRef-- Returns:
- a mutated version of this
Referencecorresponding to the given mutated node orthisReference if no mutations are detected
-
toString
-
hashCode
public int hashCode() -
equals
-