Package net.dona.doip.server

# Class DoipServerRequestImpl

java.lang.Object
net.dona.doip.server.DoipServerRequestImpl

All Implemented Interfaces:
  `DoipServerRequest`

public class DoipServerRequestImpl extends Object implements DoipServerRequest
An implementation of `DoipServerRequest` used internally by `DoipServer`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DoipServerRequestImpl(InDoipMessage inDoipMessage, String clientCertId, PublicKey clientCertPublicKey, X509Certificate[] clientCertChain)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `com.google.gson.JsonElement`
  `getAttribute(String key)`
  Returns a single attribute from the attributes given by the initial segment of the DOIP request.
  `String`
  `getAttributeAsString(String key)`
  Returns as a String a single attribute from the attributes given by the initial segment of this DOIP request.
  `com.google.gson.JsonObject`
  `getAttributes()`
  Returns the attributes given by the initial segment of this DOIP request.
  `com.google.gson.JsonElement`
  `getAuthentication()`
  Returns the authentication information given by the initial segment of this DOIP request.
  `String`
  `getClientId()`
  Returns the client ID given by the initial segment of this DOIP request.
  `X509Certificate[]`
  `getConnectionCertificateChain()`
  If the client is using a TLS client-side certificate, this returns the supplied certificate chain.
  `String`
  `getConnectionClientId()`
  If the client is using a TLS client-side certificate, this returns the client id from the certificate.
  `PublicKey`
  `getConnectionPublicKey()`
  If the client is using a TLS client-side certificate, this returns the public key from the certificate.
  `InDoipMessage`
  `getInput()`
  Returns the input of the request.
  `String`
  `getOperationId()`
  Returns the operation ID (the operation to perform) given by the initial segment of this DOIP request.
  `String`
  `getRequestId()`
  `String`
  `getTargetId()`
  Returns the target ID (the object on which to perform the operation) given by the initial segment of this DOIP request.

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

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

- ## Constructor Details

  - ### DoipServerRequestImpl

    public DoipServerRequestImpl(InDoipMessage inDoipMessage, String clientCertId, PublicKey clientCertPublicKey, X509Certificate[] clientCertChain) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### getRequestId

    public String getRequestId()

  - ### getClientId

    public String getClientId()
    Description copied from interface: `DoipServerRequest`
    Returns the client ID given by the initial segment of this DOIP request.
    Specified by:
      `getClientId` in interface `DoipServerRequest`
    Returns:
      the client ID given by the initial segment of this DOIP request

  - ### getTargetId

    public String getTargetId()
    Description copied from interface: `DoipServerRequest`
    Returns the target ID (the object on which to perform the operation) given by the initial segment of this DOIP request.
    Specified by:
      `getTargetId` in interface `DoipServerRequest`
    Returns:
      the target ID given by the initial segment of this DOIP request

  - ### getOperationId

    public String getOperationId()
    Description copied from interface: `DoipServerRequest`
    Returns the operation ID (the operation to perform) given by the initial segment of this DOIP request.
    Specified by:
      `getOperationId` in interface `DoipServerRequest`
    Returns:
      the operation ID given by the initial segment of this DOIP request

  - ### getAttributes

    public com.google.gson.JsonObject getAttributes()
    Description copied from interface: `DoipServerRequest`
    Returns the attributes given by the initial segment of this DOIP request.
    Specified by:
      `getAttributes` in interface `DoipServerRequest`
    Returns:
      the attributes given by the initial segment of this DOIP request

  - ### getAttribute

    public com.google.gson.JsonElement getAttribute(String key)
    Description copied from interface: `DoipServerRequest`
    Returns a single attribute from the attributes given by the initial segment of the DOIP request.
    Specified by:
      `getAttribute` in interface `DoipServerRequest`
    Parameters:
      `key` - the attribute to retrieve
    Returns:
      a single attribute from the attributes given by the initial segment of the DOIP request

  - ### getAttributeAsString

    public String getAttributeAsString(String key)
    Description copied from interface: `DoipServerRequest`
    Returns as a String a single attribute from the attributes given by the initial segment of this DOIP request.
    Specified by:
      `getAttributeAsString` in interface `DoipServerRequest`
    Parameters:
      `key` - the attribute to retrieve
    Returns:
      a single attribute as a string from the attributes given by the initial segment of this DOIP request

  - ### getAuthentication

    public com.google.gson.JsonElement getAuthentication()
    Description copied from interface: `DoipServerRequest`
    Returns the authentication information given by the initial segment of this DOIP request.
    Specified by:
      `getAuthentication` in interface `DoipServerRequest`
    Returns:
      the authentication information given by the initial segment of this DOIP request

  - ### getInput

    public InDoipMessage getInput()
    Description copied from interface: `DoipServerRequest`
    Returns the input of the request. In the case of a "compact" single-segment request, this will be a single JSON segment corresponding to the "input" property of the single-segment request. Otherwise it will be all remaining segments of the request after the initial segment.
    Specified by:
      `getInput` in interface `DoipServerRequest`
    Returns:
      the input of this DOIP request

  - ### getConnectionClientId

    public String getConnectionClientId()
    Description copied from interface: `DoipServerRequest`
    If the client is using a TLS client-side certificate, this returns the client id from the certificate.
    Specified by:
      `getConnectionClientId` in interface `DoipServerRequest`
    Returns:
      the client ID from a TLS client-side certificate

  - ### getConnectionPublicKey

    public PublicKey getConnectionPublicKey()
    Description copied from interface: `DoipServerRequest`
    If the client is using a TLS client-side certificate, this returns the public key from the certificate.
    Specified by:
      `getConnectionPublicKey` in interface `DoipServerRequest`
    Returns:
      the public key from a TLS client-side certificate

  - ### getConnectionCertificateChain

    public X509Certificate[] getConnectionCertificateChain()
    Description copied from interface: `DoipServerRequest`
    If the client is using a TLS client-side certificate, this returns the supplied certificate chain.
    Specified by:
      `getConnectionCertificateChain` in interface `DoipServerRequest`
    Returns:
      the supplied certificate chain from a a TLS client-side certificate