Package org.alfresco.repo.virtual.ref
Class Protocol
- java.lang.Object
-
- org.alfresco.repo.virtual.ref.Protocol
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
NodeProtocol,VirtualProtocol
public class Protocol extends java.lang.Object implements java.io.SerializableAReferencemodel element that defines the type of the referred artefact and the virtualization process that was applied when creating a reference.
Protocols define the semantics of all elements of a reference. Protocol implementations add syntactic processing methods.
The high level semantic functionality of a protocol is implemented withProtocolMethods.- Author:
- Bogdan Horje
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static EncodingDEFAULT_ENCODINGjava.lang.Stringname
-
Constructor Summary
Constructors Constructor Description Protocol(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReferenceaddParameter(Reference reference, Parameter parameter)ReferenceaddParameter(Reference reference, Resource resource)<R> Rdispatch(ProtocolMethod<R> method, Reference reference)ProtocolMethoddouble-dispatch/visitor protocol type selector.ParametergetParameter(Reference reference, int index)ReferencepropagateNodeRefMutations(org.alfresco.service.cmr.repository.NodeRef mutatedNodeRef, Reference reference)Protocoldelegate ofReference.propagateNodeRefMutations(NodeRef)ReferencereplaceParameter(Reference reference, int index, java.lang.String stringParameter)ReferencereplaceParameter(Reference reference, int index, Parameter parameter)java.lang.StringtoString()
-
-
-
Field Detail
-
name
public final java.lang.String name
-
DEFAULT_ENCODING
protected static final Encoding DEFAULT_ENCODING
-
-
Method Detail
-
replaceParameter
public Reference replaceParameter(Reference reference, int index, java.lang.String stringParameter)
-
replaceParameter
public Reference replaceParameter(Reference reference, int index, Parameter parameter)
-
dispatch
public <R> R dispatch(ProtocolMethod<R> method, Reference reference) throws ProtocolMethodException
ProtocolMethoddouble-dispatch/visitor protocol type selector. Subclasses should override this method to select the appropriate type bound method.
This particular implementation calls the defaultProtocolMethod.execute(Protocol, Reference)default method implementation.- Parameters:
method-reference-- Returns:
- the value returned by the type bond method
- Throws:
ProtocolMethodException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
propagateNodeRefMutations
public Reference propagateNodeRefMutations(org.alfresco.service.cmr.repository.NodeRef mutatedNodeRef, Reference reference)
Protocoldelegate ofReference.propagateNodeRefMutations(NodeRef)
-
-