Class RestParser
java.lang.Object
com.aquima.interactions.communication.impl.evaluator.parser.RestParser
Rest parser to parse a rest message and fill the profile with data.
- Since:
- 9.0
- Author:
- Jon van Leuven, Arjan Pragt, Nicky van Noorloos, Munish Mahabiersing
-
Constructor Summary
ConstructorsConstructorDescriptionRestParser
(IRestServiceDefinition definition, ICommunicationEngineHandler engineHandler, IValueFormatter valueFormatter, IDomainSchemaRegistry schemaRegistry) Construct a rest parser with a rest service definition. -
Method Summary
Modifier and TypeMethodDescriptionmatchOperation
(IRestRequestMessage request) This method matches the urn of a request to an operation of the service.void
parseRequest
(IRestRequestMessage request, InferenceContext profile) This method may be used to parse a rest request message.void
parseResponse
(String operationName, IRestMessage response, InferenceContext profile) This method may be used to parse a rest response message.
-
Constructor Details
-
RestParser
public RestParser(IRestServiceDefinition definition, ICommunicationEngineHandler engineHandler, IValueFormatter valueFormatter, IDomainSchemaRegistry schemaRegistry) Construct a rest parser with a rest service definition.- Parameters:
definition
- The rest service definition.valueFormatter
- The ValueFormatter to format the ISingleValue elements, may not be null
-
-
Method Details
-
matchOperation
This method matches the urn of a request to an operation of the service.- Parameters:
request
- The incoming rest request message.- Returns:
- The definition of the operation.
- Throws:
UnmatchableOperationException
- When no operation can be matched to the urn/
-
parseRequest
public void parseRequest(IRestRequestMessage request, InferenceContext profile) throws MessageParseException This method may be used to parse a rest request message.- Parameters:
request
- The rest request message, may not be null.profile
- The destination profile, may not be null.- Throws:
MessageParseException
- when parsing the request fails.
-
parseResponse
public void parseResponse(String operationName, IRestMessage response, InferenceContext profile) throws MessageParseException This method may be used to parse a rest response message.- Parameters:
operationName
- The operation name, may not be null or empty.response
- the response to parse, may not be null.profile
- The destination profile, may not be null.- Throws:
MessageParseException
- when parsing the response failed.
-