BaltradDex
BALTRAD Data Exchange System
Loading...
Searching...
No Matches
eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser Class Reference
Inheritance diagram for eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser:
eu.baltrad.dex.net.protocol.ResponseParser

Public Member Functions

 ProtocolVersionResponseParser (HttpResponse httpResponse)
 
int getStatusCode ()
 
String getNodeName ()
 
String getProtocolVersion ()
 
String getConfiguredProtocolVersion ()
 
String getReasonPhrase ()
 
Set< DataSourcegetDataSources ()
 
User getUserAccount ()
 
List< SubscriptiongetSubscriptions ()
 
boolean isRedirected ()
 
String getRedirectURL ()
 

Protected Member Functions

 ProtocolVersionResponseParser ()
 
void init (HttpResponse httpResponse)
 
int parseStatusCode (HttpResponse response)
 
String parseNodeName (HttpResponse response)
 
String parseProtocolVersion (HttpResponse response)
 
String readResponse ()
 

Protected Attributes

HttpResponse httpResponse
 
JsonProtocol jsonProtocol
 

Detailed Description

Supports parsing of responses and is able to manage different versions of the dex protocol

Author
Anders Henja

Constructor & Destructor Documentation

◆ ProtocolVersionResponseParser() [1/2]

eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.ProtocolVersionResponseParser ( HttpResponse httpResponse)
inline

Constructor. Initially parses statusCode, nodeName and protocolVersion since there is no meaning to allow the constructor to be created without this information.

Parameters
httpResponsethe http response to parse
Exceptions
ResponseParserExceptionif above mentioned values not can be extracted

◆ ProtocolVersionResponseParser() [2/2]

eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.ProtocolVersionResponseParser ( )
inlineprotected

Protected default constructor Mostly for test purpose

Member Function Documentation

◆ getConfiguredProtocolVersion()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getConfiguredProtocolVersion ( )
inline

◆ getDataSources()

Set< DataSource > eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getDataSources ( )
inline

◆ getNodeName()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getNodeName ( )
inline

◆ getProtocolVersion()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getProtocolVersion ( )
inline

◆ getReasonPhrase()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getReasonPhrase ( )
inline

◆ getRedirectURL()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getRedirectURL ( )
inline
Returns
the redirect URL is isRedirected returns true

Implements eu.baltrad.dex.net.protocol.ResponseParser.

◆ getStatusCode()

int eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getStatusCode ( )
inline

◆ getSubscriptions()

List< Subscription > eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getSubscriptions ( )
inline

◆ getUserAccount()

User eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.getUserAccount ( )
inline

◆ init()

void eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.init ( HttpResponse httpResponse)
inlineprotected

Initializes the object with the http response

Parameters
httpResponsethe http response

◆ isRedirected()

boolean eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.isRedirected ( )
inline

◆ parseNodeName()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.parseNodeName ( HttpResponse response)
inlineprotected

Extracts the node name from the http response

Parameters
responsethe http response
Returns
the node name

◆ parseProtocolVersion()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.parseProtocolVersion ( HttpResponse response)
inlineprotected

Extracts the protocol version from the http response

Parameters
responsethe http response
Returns
the protocol version. If nothing found, it defaults back to version 2.0

◆ parseStatusCode()

int eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.parseStatusCode ( HttpResponse response)
inlineprotected

Parses the status code from the response

Parameters
responsethe response
Returns
the status code

◆ readResponse()

String eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.readResponse ( )
inlineprotected

Read http response body

Parameters
responseHttp response
Returns
Response body
Exceptions
ResponseParserException

Member Data Documentation

◆ httpResponse

HttpResponse eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.httpResponse
protected

The http response that is parsed

◆ jsonProtocol

JsonProtocol eu.baltrad.dex.net.protocol.impl.ProtocolVersionResponseParser.jsonProtocol
protected

The json protocol to use (if any)


The documentation for this class was generated from the following file: