Class RestParser
- java.lang.Object
-
- com.aquima.interactions.communication.impl.evaluator.parser.RestParser
-
public final class RestParser extends Object
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
Constructors Constructor Description RestParser(IRestServiceDefinition definition, ICommunicationEngineHandler engineHandler, IValueFormatter valueFormatter, IDomainSchemaRegistry schemaRegistry)
Construct a rest parser with a rest service definition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IRestOperationDefinition
matchOperation(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 Detail
-
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 Detail
-
matchOperation
public IRestOperationDefinition matchOperation(IRestRequestMessage request) throws UnmatchableOperationException
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 FieldValidationException, MessageParseException, UnmatchableOperationException, RestMessageParseException, UnknownTypeMappingException, UnknownElementMappingException
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:
FieldValidationException
MessageParseException
UnmatchableOperationException
RestMessageParseException
UnknownTypeMappingException
UnknownElementMappingException
-
parseResponse
public void parseResponse(String operationName, IRestMessage response, InferenceContext profile) throws FieldValidationException, MessageParseException, UnknownOperationException, RestMessageParseException, UnknownTypeMappingException, UnknownElementMappingException
This method may be used to parse a rest response message.- Parameters:
operationName
- The operation name, may not be null or empty.profile
- The destination profile, may not be null.- Throws:
FieldValidationException
MessageParseException
UnknownOperationException
RestMessageParseException
UnknownTypeMappingException
UnknownElementMappingException
-
-