Package net.dona.doip.client
Class ServiceInfo
- java.lang.Object
-
- net.dona.doip.client.ServiceInfo
-
public class ServiceInfo extends java.lang.ObjectA representation of a service identifier together with the DOIPServiceInfo needed for connecting to the DOIP service.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringipAddressThe IP address to connect to.intportThe port to connect to.java.lang.StringprotocolThe protocol; currently assumed to be TCP.java.lang.StringprotocolVersionThe protocol version; currently assume to be DOIPv2.java.security.PublicKeypublicKeyThe public key of the service (serialized in JWK format).java.lang.StringserviceIdThe service identifier.java.lang.StringserviceNameCurrently unused.
-
Constructor Summary
Constructors Constructor Description ServiceInfo()Constructs a ServiceInfo with all fields unpopulated.ServiceInfo(java.lang.String serviceId)Constructs a ServiceInfo with only a service identifier.ServiceInfo(java.lang.String serviceId, java.lang.String ipAddress, int port)Constructs a ServiceInfo with a service identifier, an IP address, and a port.ServiceInfo(java.lang.String serviceId, java.lang.String ipAddress, int port, java.security.PublicKey publicKey)Constructs a ServiceInfo with a service identifier, an IP address, a port, and the expecte public key in the server certificate.
-
-
-
Field Detail
-
serviceId
public java.lang.String serviceId
The service identifier. A ServiceInfo provided to methods ofDoipClientmay have only a serviceId in which case the client will resolve the identifier to find the actual service info.
-
serviceName
public java.lang.String serviceName
Currently unused.
-
ipAddress
public java.lang.String ipAddress
The IP address to connect to.
-
port
public int port
The port to connect to.
-
protocol
public java.lang.String protocol
The protocol; currently assumed to be TCP.
-
protocolVersion
public java.lang.String protocolVersion
The protocol version; currently assume to be DOIPv2.
-
publicKey
public java.security.PublicKey publicKey
The public key of the service (serialized in JWK format).
-
-
Constructor Detail
-
ServiceInfo
public ServiceInfo()
Constructs a ServiceInfo with all fields unpopulated.
-
ServiceInfo
public ServiceInfo(java.lang.String serviceId)
Constructs a ServiceInfo with only a service identifier. If supplied to methods ofDoipClient, the client will resolve the identifier to find the service information.- Parameters:
serviceId- the service identifier
-
ServiceInfo
public ServiceInfo(java.lang.String serviceId, java.lang.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 identifieripAddress- the IP addressport- the port
-
ServiceInfo
public ServiceInfo(java.lang.String serviceId, java.lang.String ipAddress, int port, java.security.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 identifieripAddress- the IP addressport- the portpublicKey- the public key of the server
-
-