Class Lookup
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 Akka remoting ports and HTTP ports.
Inherited Members
Namespace: Akka.Discovery
Assembly: Akka.Discovery.dll
Syntax
public class Lookup : INoSerializationVerificationNeeded, IEquatable<Lookup>
Constructors
| Edit this page View SourceLookup(string, string, string)
Create a service Lookup with serviceName, optional portName and optional protocol.
Use WithPortName(string) and WithProtocol(string) to provide optional portName and protocol.
Declaration
public Lookup(string serviceName, string portName = null, string protocol = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serviceName | Must not be 'null' or an empty string |
| string | portName | Optional port name |
| string | protocol | Optional protocol |
Properties
| Edit this page View SourcePortName
Declaration
public string PortName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Protocol
Declaration
public string Protocol { get; }
Property Value
| Type | Description |
|---|---|
| string |
ServiceName
Declaration
public string ServiceName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceCopy(string, string, string)
Declaration
public Lookup Copy(string serviceName = null, string portName = null, string protocol = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | serviceName | |
| string | portName | |
| string | protocol |
Returns
| Type | Description |
|---|---|
| Lookup |
Equals(Lookup)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Lookup other)
Parameters
| Type | Name | Description |
|---|---|---|
| Lookup | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceIsValid(string)
Returns true if passed string conforms with SRV format. Otherwise returns false.
Declaration
public static bool IsValid(string srv)
Parameters
| Type | Name | Description |
|---|---|---|
| string | srv |
Returns
| Type | Description |
|---|---|
| bool |
ParseSrv(string)
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)
Declaration
public static Lookup ParseSrv(string srv)
Parameters
| Type | Name | Description |
|---|---|---|
| string | srv |
Returns
| Type | Description |
|---|---|
| Lookup |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the passed string is null. |
| ArgumentException | If the string does not conform with the SRV format. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
| Edit this page View SourceWithPortName(string)
Which port for a service e.g. Akka remoting or HTTP. Maps to "service" for an SRV records.
Declaration
public Lookup WithPortName(string portName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | portName |
Returns
| Type | Description |
|---|---|
| Lookup |
WithProtocol(string)
Which protocol e.g. TCP or UDP. Maps to "protocol" for SRV records.
Declaration
public Lookup WithProtocol(string protocol)
Parameters
| Type | Name | Description |
|---|---|---|
| string | protocol |
Returns
| Type | Description |
|---|---|
| Lookup |
Edit this page