Package akka.discovery
Class Lookup
- java.lang.Object
-
- akka.discovery.Lookup
-
- All Implemented Interfaces:
NoSerializationVerificationNeeded
public final class Lookup extends java.lang.Object implements NoSerializationVerificationNeeded
Which port for a service e.g. Akka remoting or HTTP. Maps to "service" for an SRV records.
-
-
Constructor Summary
Constructors Constructor Description Lookup(java.lang.String serviceName, scala.Option<java.lang.String> portName, scala.Option<java.lang.String> protocol)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Lookup
apply(java.lang.String serviceName)
static Lookup
apply(java.lang.String serviceName, scala.Option<java.lang.String> portName, scala.Option<java.lang.String> protocol)
Create a service Lookup withserviceName
, optionalportName
and optionalprotocol
.static boolean
canEqual(java.lang.Object x$1)
static Lookup
create(java.lang.String serviceName)
Java APIboolean
equals(java.lang.Object obj)
java.util.Optional<java.lang.String>
getPortName()
Java APIjava.util.Optional<java.lang.String>
getProtocol()
Java APIint
hashCode()
static boolean
isValidSrv(java.lang.String srv)
Returns true if passed string conforms with SRV format.static Lookup
parseSrv(java.lang.String str)
Create a service Lookup from a string with format: _portName._protocol.serviceName.scala.Option<java.lang.String>
portName()
static int
productArity()
static java.lang.Object
productElement(int x$1)
static scala.collection.Iterator<java.lang.Object>
productIterator()
static java.lang.String
productPrefix()
scala.Option<java.lang.String>
protocol()
java.lang.String
serviceName()
java.lang.String
toString()
Lookup
withPortName(java.lang.String value)
Which port for a service e.g.Lookup
withProtocol(java.lang.String value)
Which protocol e.g.
-
-
-
Method Detail
-
apply
public static Lookup apply(java.lang.String serviceName)
-
apply
public static Lookup apply(java.lang.String serviceName, scala.Option<java.lang.String> portName, scala.Option<java.lang.String> protocol)
Create a service Lookup withserviceName
, optionalportName
and optionalprotocol
.- Parameters:
serviceName
- (undocumented)portName
- (undocumented)protocol
- (undocumented)- Returns:
- (undocumented)
-
create
public static Lookup create(java.lang.String serviceName)
Java APICreate a service Lookup with only a serviceName. Use withPortName and withProtocol to provide optional portName and protocol
- Parameters:
serviceName
- (undocumented)- Returns:
- (undocumented)
-
parseSrv
public static Lookup parseSrv(java.lang.String str)
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)
- Parameters:
str
- (undocumented)- Returns:
- (undocumented)
- Throws:
java.lang.NullPointerException
- If the passed string is nulljava.lang.IllegalArgumentException
- If the string doesn't not conform with the SRV format
-
isValidSrv
public static boolean isValidSrv(java.lang.String srv)
Returns true if passed string conforms with SRV format. Otherwise returns false.- Parameters:
srv
- (undocumented)- Returns:
- (undocumented)
-
productPrefix
public static java.lang.String productPrefix()
-
productArity
public static int productArity()
-
productElement
public static java.lang.Object productElement(int x$1)
-
productIterator
public static scala.collection.Iterator<java.lang.Object> productIterator()
-
canEqual
public static boolean canEqual(java.lang.Object x$1)
-
serviceName
public java.lang.String serviceName()
-
portName
public scala.Option<java.lang.String> portName()
-
protocol
public scala.Option<java.lang.String> protocol()
-
withPortName
public Lookup withPortName(java.lang.String value)
Which port for a service e.g. Akka remoting or HTTP. Maps to "service" for an SRV records.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
withProtocol
public Lookup withProtocol(java.lang.String value)
Which protocol e.g. TCP or UDP. Maps to "protocol" for SRV records.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
getPortName
public java.util.Optional<java.lang.String> getPortName()
Java API- Returns:
- (undocumented)
-
getProtocol
public java.util.Optional<java.lang.String> getProtocol()
Java API- Returns:
- (undocumented)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-