Package net.dona.doip.client

# Class ServiceInfo

java.lang.Object
net.dona.doip.client.ServiceInfo

public class ServiceInfo extends Object
A representation of a service identifier together with the DOIPServiceInfo needed for connecting to the DOIP service.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `String`
  `ipAddress`
  The IP address to connect to.
  `int`
  `port`
  The port to connect to.
  `String`
  `protocol`
  The protocol; currently assumed to be TCP.
  `String`
  `protocolVersion`
  The protocol version; currently assume to be DOIPv2.
  `PublicKey`
  `publicKey`
  The public key of the service (serialized in JWK format).
  `String`
  `serviceId`
  The service identifier.
  `String`
  `serviceName`
  Currently unused.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServiceInfo()`
  Constructs a ServiceInfo with all fields unpopulated.
  `ServiceInfo(String serviceId)`
  Constructs a ServiceInfo with only a service identifier.
  `ServiceInfo(String serviceId, String ipAddress, int port)`
  Constructs a ServiceInfo with a service identifier, an IP address, and a port.
  `ServiceInfo(String serviceId, String ipAddress, int port, PublicKey publicKey)`
  Constructs a ServiceInfo with a service identifier, an IP address, a port, and the expecte public key in the server certificate.

- ## Method Summary

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### serviceId

    public String serviceId
    The service identifier. A ServiceInfo provided to methods of `DoipClient` may have only a serviceId in which case the client will resolve the identifier to find the actual service info.

  - ### serviceName

    public String serviceName
    Currently unused.

  - ### ipAddress

    public String ipAddress
    The IP address to connect to.

  - ### port

    public int port
    The port to connect to.

  - ### protocol

    public String protocol
    The protocol; currently assumed to be TCP.

  - ### protocolVersion

    public String protocolVersion
    The protocol version; currently assume to be DOIPv2.

  - ### publicKey

    public PublicKey publicKey
    The public key of the service (serialized in JWK format).

- ## Constructor Details

  - ### ServiceInfo

    public ServiceInfo()
    Constructs a ServiceInfo with all fields unpopulated.

  - ### ServiceInfo

    public ServiceInfo(String serviceId)
    Constructs a ServiceInfo with only a service identifier. If supplied to methods of `DoipClient`, the client will resolve the identifier to find the service information.
    Parameters:
      `serviceId` - the service identifier

  - ### ServiceInfo

    public ServiceInfo(String serviceId, String ipAddress, int port)
    Constructs a ServiceInfo with a service identifier, an IP address, and a port. With no public key, the server certificate will not be checked.
    Parameters:
      `serviceId` - the service identifier
      `ipAddress` - the IP address
      `port` - the port

  - ### ServiceInfo

    public ServiceInfo(String serviceId, String ipAddress, int port, PublicKey publicKey)
    Constructs a ServiceInfo with a service identifier, an IP address, a port, and the expecte public key in the server certificate.
    Parameters:
      `serviceId` - the service identifier
      `ipAddress` - the IP address
      `port` - the port
      `publicKey` - the public key of the server