Package org.apache.pekko.discovery
Class Lookup
java.lang.Object
org.apache.pekko.discovery.Lookup
- All Implemented Interfaces:
NoSerializationVerificationNeeded
A service lookup. It is up to each method to decide
what to do with the optional portName and protocol fields.
For example
portName could be used to distinguish between
Apache Pekko remoting ports and HTTP ports.
param: serviceName must not be 'null' or an empty String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LookupCreate a service Lookup with only a serviceName.static LookupCreate a service Lookup withserviceName, optionalportNameand optionalprotocol.static booleanstatic LookupJava APIbooleanJava APIJava APIinthashCode()static booleanisValidSrv(String srv) Returns true if passed string conforms with SRV format.static LookupCreate a service Lookup from a string with format: _portName._protocol.serviceName.scala.Option<String>portName()static intstatic ObjectproductElement(int x$1) static StringproductElementName(int n) static scala.collection.Iterator<String>static scala.collection.Iterator<Object>static Stringscala.Option<String>protocol()toString()withPortName(String value) Which port for a service e.g.withProtocol(String value) Which protocol e.g.
-
Constructor Details
-
Lookup
-
-
Method Details
-
apply
Create a service Lookup with only a serviceName. Use withPortName and withProtocol to provide optional portName and protocol -
apply
public static Lookup apply(String serviceName, scala.Option<String> portName, scala.Option<String> protocol) Create a service Lookup withserviceName, optionalportNameand optionalprotocol. -
create
Java APICreate a service Lookup with only a serviceName. Use withPortName and withProtocol to provide optional portName and protocol
-
parseSrv
Create a service Lookup from a string with format: _portName._protocol.serviceName. (as specified by https://www.ietf.org/rfc/rfc2782.txt)If the passed string conforms with this format, a SRV Lookup is returned. The serviceName part must be a valid domain name. (as defined in https://tools.ietf.org/html/rfc1034)
The string is parsed and dismembered to build a Lookup as following: Lookup(serviceName).withPortName(portName).withProtocol(protocol)
- Throws:
NullPointerException- If the passed string is nullIllegalArgumentException- If the string doesn't not conform with the SRV format
-
isValidSrv
Returns true if passed string conforms with SRV format. Otherwise returns false. -
productPrefix
-
productArity
public static int productArity() -
productElement
-
productIterator
-
canEqual
-
productElementName
-
productElementNames
-
serviceName
-
portName
-
protocol
-
withPortName
Which port for a service e.g. Apache Pekko remoting or HTTP. Maps to "service" for an SRV records. -
withProtocol
Which protocol e.g. TCP or UDP. Maps to "protocol" for SRV records. -
getPortName
Java API -
getProtocol
Java API -
toString
-
equals
-
hashCode
public int hashCode()
-