Class ResolveResult
java.lang.Object
org.apache.vinci.transport.FrameComponent
org.apache.vinci.transport.Frame
org.apache.vinci.transport.vns.client.ResolveResult
- All Implemented Interfaces:
Transportable
Specialized document (Frame) for representing the result of resolving a service name to host/port
through VNS. Also provides utility methods for manipulating qualified/unqualified service names.
This class is used by VinciClient to locate the physical location of the requested service from
its logical service name.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String key, FrameComponent val) Implement the frame add() callback.static Frame
composeQuery
(String service_name) Create a document representing the VNS resolve query for the specified service.static Frame
composeQuery
(String service_name, int mypriority) Create a document representing the VNS resolve query for the highest priority service(s) whose priority is strictly below the specified priority.createSubFrame
(String key, int capacity) Override the Frame createSubFrame method to create a ServiceLocator.getNext()
Fetch the next service listing.boolean
hasMore()
Determine if there are more service listing to be fetched.void
Initialize the service listing iterator.static boolean
isQualified
(String service_name) Check whether a service_name has qualifications (that is, any or all of level, host, instance are explicitly specified.)static String
unqualifiedName
(String service_name) Strip the qualifications from this qualified service name.Methods inherited from class org.apache.vinci.transport.Frame
createFrameLeaf, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, fadd, faddTrueBinary, fromStream, getFrameTransporter, getKeyValuePair, getKeyValuePairCount, setFrameTransporter, toRawXML, toRawXML, toRawXMLWork, toStream, toString, toXML, toXML, toXML
Methods inherited from class org.apache.vinci.transport.FrameComponent
getAttributes, setAttributes
-
Field Details
-
priority
public int priority -
factory
-
-
Constructor Details
-
ResolveResult
public ResolveResult()
-
-
Method Details
-
unqualifiedName
Strip the qualifications from this qualified service name.- Parameters:
service_name
- -- Returns:
- -
-
isQualified
Check whether a service_name has qualifications (that is, any or all of level, host, instance are explicitly specified.)- Parameters:
service_name
- -- Returns:
- -
-
composeQuery
Create a document representing the VNS resolve query for the specified service. This method accepts either qualified or unqualified service names.- Parameters:
service_name
- -- Returns:
- -
-
composeQuery
Create a document representing the VNS resolve query for the highest priority service(s) whose priority is strictly below the specified priority. This method accepts either qualified or unqualified service names.- Parameters:
service_name
- -mypriority
- -- Returns:
- -
-
initializeIterator
public void initializeIterator()Initialize the service listing iterator. This initializes to a random spot to implement simple load balancing across multiple equivalent service instances. -
hasMore
public boolean hasMore()Determine if there are more service listing to be fetched.- Returns:
- -
-
getNext
Fetch the next service listing.- Returns:
- -
-
add
Implement the frame add() callback. -
createSubFrame
Override the Frame createSubFrame method to create a ServiceLocator.- Overrides:
createSubFrame
in classFrame
- Parameters:
key
- -capacity
- -- Returns:
- the created sub-frame.
-