Package net.dona.doip.server
Class DoipServerRequestImpl
- java.lang.Object
-
- net.dona.doip.server.DoipServerRequestImpl
-
- All Implemented Interfaces:
DoipServerRequest
public class DoipServerRequestImpl extends java.lang.Object implements DoipServerRequest
An implementation ofDoipServerRequest
used internally byDoipServer
.
-
-
Constructor Summary
Constructors Constructor Description DoipServerRequestImpl(InDoipMessage inDoipMessage, java.lang.String clientCertId, java.security.PublicKey clientCertPublicKey, java.security.cert.X509Certificate[] clientCertChain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonElement
getAttribute(java.lang.String key)
Returns a single attribute from the attributes given by the initial segment of the request.java.lang.String
getAttributeAsString(java.lang.String key)
Returns as a String a single attribute from the attributes given by the initial segment of the request.com.google.gson.JsonObject
getAttributes()
Returns the attributes given by the initial segment of the request.com.google.gson.JsonElement
getAuthentication()
Returns the authentication information given by the initial segment of the request.java.lang.String
getClientId()
Returns the client id given by the initial segment of the request.java.security.cert.X509Certificate[]
getConnectionCertificateChain()
If the client is using a TLS client-side certificate, this returns the supplied certificate chain.java.lang.String
getConnectionClientId()
If the client is using a TLS client-side certificate, this returns the client id from the certificate.java.security.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.java.lang.String
getOperationId()
Returns the operation id (the operation to perform) given by the initial segment of the request.java.lang.String
getRequestId()
java.lang.String
getTargetId()
Returns the target id (the object on which to perform the operation) given by the initial segment of the request.
-
-
-
Constructor Detail
-
DoipServerRequestImpl
public DoipServerRequestImpl(InDoipMessage inDoipMessage, java.lang.String clientCertId, java.security.PublicKey clientCertPublicKey, java.security.cert.X509Certificate[] clientCertChain) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getRequestId
public java.lang.String getRequestId()
-
getClientId
public java.lang.String getClientId()
Description copied from interface:DoipServerRequest
Returns the client id given by the initial segment of the request.- Specified by:
getClientId
in interfaceDoipServerRequest
-
getTargetId
public java.lang.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 the request.- Specified by:
getTargetId
in interfaceDoipServerRequest
-
getOperationId
public java.lang.String getOperationId()
Description copied from interface:DoipServerRequest
Returns the operation id (the operation to perform) given by the initial segment of the request.- Specified by:
getOperationId
in interfaceDoipServerRequest
-
getAttributes
public com.google.gson.JsonObject getAttributes()
Description copied from interface:DoipServerRequest
Returns the attributes given by the initial segment of the request.- Specified by:
getAttributes
in interfaceDoipServerRequest
-
getAttribute
public com.google.gson.JsonElement getAttribute(java.lang.String key)
Description copied from interface:DoipServerRequest
Returns a single attribute from the attributes given by the initial segment of the request.- Specified by:
getAttribute
in interfaceDoipServerRequest
- Parameters:
key
- the attribute to retrieve
-
getAttributeAsString
public java.lang.String getAttributeAsString(java.lang.String key)
Description copied from interface:DoipServerRequest
Returns as a String a single attribute from the attributes given by the initial segment of the request.- Specified by:
getAttributeAsString
in interfaceDoipServerRequest
- Parameters:
key
- the attribute to retrieve
-
getAuthentication
public com.google.gson.JsonElement getAuthentication()
Description copied from interface:DoipServerRequest
Returns the authentication information given by the initial segment of the request.- Specified by:
getAuthentication
in interfaceDoipServerRequest
-
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 interfaceDoipServerRequest
-
getConnectionClientId
public java.lang.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 interfaceDoipServerRequest
-
getConnectionPublicKey
public java.security.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 interfaceDoipServerRequest
-
getConnectionCertificateChain
public java.security.cert.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 interfaceDoipServerRequest
-
-