Interface ICommunicationEngine

All Superinterfaces:
IDomainSchemaRegistry
All Known Implementing Classes:
CommunicationEngine

public interface ICommunicationEngine extends IDomainSchemaRegistry
This class exposes all the communication functionality.
Since:
9.0
Author:
Jon van Leuven, Arjan Pragt
  • Method Details

    • getRestService

      IRestServiceDefinition getRestService(String serviceName)
      This method returns the rest service.
      Parameters:
      serviceName - The name of the service, may not be null.
      Returns:
      The definition of the service.
      Throws:
      UnknownRestServiceException - Is thrown when there is no definition for the provided name.
    • getRestServiceNames

      String[] getRestServiceNames()
      This method returns the available rest service name.
      Returns:
      The names of the rest services that are available, never null, but may be an empty array.
    • getSoapServiceNames

      String[] getSoapServiceNames()
      This method returns the available soap service name.
      Returns:
      The names of the soap services that are available, never null, but may be an empty array.
    • getSoapService

      ISoapServiceDefinition getSoapService(String serviceName)
      This method return the definition of a service for the specified name.
      Parameters:
      serviceName - The name of the service that is requested (case insensitive)
      Returns:
      The service definition, never null
      Throws:
      UnknownSoapServiceException - Is thrown when there is no definition for the provided name.
    • getSchemaSetNames

      String[] getSchemaSetNames()
      This method returns the available schema set names.
      Returns:
      The names of the schema sets that are available, never null, but may be an empty array.
    • getSchemaSet

      ISchemaSetDefinition getSchemaSet(String name)
      This method return the definition of a schema set for the specified name.
      Parameters:
      name - The name of the schema set that is requested (case insensitive)
      Returns:
      The schema set definition, never null
      Throws:
      UnknownSchemaSetException - Is thrown when there is no definition for the provided name.
    • composeRestRequest

      IRestRequestMessage composeRestRequest(IProfile profile, String serviceName, String operationName, String mimeType, ICommunicationEngineHandler handler, Map<String,List<String>> headers)
      This method composes the rest message.
      Parameters:
      profile - The used profile during the compose.
      serviceName - The name of the rest service.
      operationName - The name of the operation.
      mimeType - the mime type of the request
      handler - The handler for custom element composing.
      headers - the http headers that will be put on the http request
      Returns:
      The composed message.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • composeRestRequest

      IRestRequestMessage composeRestRequest(IProfile profile, String serviceName, String operationName, String mimeType, ICommunicationEngineHandler handler)
      This method composes the rest message.
      Parameters:
      profile - The used profile during the compose.
      serviceName - The name of the rest service.
      operationName - The name of the operation.
      mimeType - the mime type of the request
      handler - The handler for custom element composing.
      Returns:
      The composed message.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • matchOperation

      IRestOperationDefinition matchOperation(IRestRequestMessage request, String serviceName, ICommunicationEngineHandler handler)
      This method matches the urn of a request to an operation of the service.
      Parameters:
      request - The incoming rest request message.
      serviceName - The name of the rest service, may not be null or empty.
      handler - The handler for custom element composing.
      Returns:
      The definition of the operation.
      Throws:
      UnmatchableOperationException - When no operation can be matched to the urn
    • parseRestRequest

      void parseRestRequest(IRestRequestMessage request, InferenceContext target, String serviceName, String operationName, ICommunicationEngineHandler handler, IDebugger debugger)
      This method parses a rest request message.
      Parameters:
      request - The message to parse.
      target - The target profile.
      serviceName - The name of the rest service.
      operationName - The name of the operation.
      handler - The handler for custom element composing.
      debugger - A debugger instance that is attached, may be null.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • composeRestResponse

      IRestMessage composeRestResponse(IProfile profile, String serviceName, String operationName, String mimeType, ICommunicationEngineHandler handler)
      This method composes a rest response message.
      Parameters:
      profile - The profile used to compose values.
      serviceName - The name of the rest service.
      operationName - The name of the operation.
      mimeType - the mime type of the request.
      handler - The handler for custom element composing.
      Returns:
      The composed response message.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • parseRestResponse

      void parseRestResponse(IRestMessage response, InferenceContext target, String serviceName, String operationName, ICommunicationEngineHandler handler, IDebugger debugger)
      This method parses a rest response message.
      Parameters:
      response - The response message to parse.
      target - The target profile.
      serviceName - The name of the rest service.
      operationName - The name of the operation.
      handler - The handler for custom element composing.
      debugger - A debugger instance that is attached, may be null.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • composeSoapRequest

      ISoapMessage composeSoapRequest(IInternalPortalContext context, String serviceName, String operationName, ICommunicationEngineHandler handler)
      This methods composes a soap request message.
      Parameters:
      context - The context used to compose values.
      serviceName - The name of the soap service.
      operationName - The name of the operation.
      handler - The handler used for custom element composing.
      Returns:
      The composed soap message.
      Throws:
      UnknownRestServiceException - when the rest service does not exist
      UnknownOperationException - when the operation does not exist for the rest service
      RestMessageComposeException - when an error occurs when the rest message is composed
    • composeSoapRequest

      ISoapMessage composeSoapRequest(IInternalPortalContext context, String serviceName, String operationName, ISoapMessageHandler[] soapHandlers, ICommunicationEngineHandler handler)
      This methods composes a soap request message.
      Parameters:
      context - The context used to compose values.
      serviceName - The name of the soap service.
      operationName - The name of the operation.
      soapHandlers - an array of soap message handlers, must not be null.
      handler - The handler used for custom element composing.
      Returns:
      The composed soap message.
      Throws:
      UnknownSoapServiceException - when the soap service does not exist
      UnknownOperationException - when the operation does not exist for the soap service
      SoapMessageComposeException - when an error occurs when the soap message is composed
    • parseSoapRequest

      void parseSoapRequest(ISoapMessage message, InferenceContext target, String serviceName, String operationName, IDebugger debugger)
      This method parses a soap request message.
      Parameters:
      message - The source message.
      target - The target profile.
      serviceName - The name of the soap service.
      operationName - the name of the operation being called.
      debugger - A debugger instance that is attached, may be null.
      Throws:
      UnknownSoapServiceException - when the soap service does not exist
      SoapMessageParseException - when an error occurs on parsing the request message
    • composeSoapResponse

      ISoapMessage composeSoapResponse(IInternalPortalContext context, String serviceName, String operationName, ICommunicationEngineHandler handler)
      This method composes a soap response message.
      Parameters:
      context - The context used to compose values.
      serviceName - The name of the soap service.
      operationName - The name of the operation.
      handler - The handler used for custom element composing.
      Returns:
      The composed response message.
      Throws:
      UnknownSoapServiceException - when the soap service does not exist
      UnknownOperationException - when the oeration does not exist for the soap service
      SoapMessageComposeException - when an error occurs when the soap message is composed
    • parseSoapResponse

      void parseSoapResponse(ISoapMessage message, InferenceContext target, String serviceName, String operationName, IDebugger debugger)
      This method parses a soap response message.
      Parameters:
      message - The source message.
      target - The target profile.
      serviceName - The name of the soap service.
      operationName - The name of the operation.
      debugger - A debugger instance that is attached, may be null.
      Throws:
      UnknownOperationException - when the operation does not exist for the soap service
      UnknownWebServiceException - when the webservice does not exist
      SoapMessageParseException - when an error occurs on parsing the request message
    • getSchemaContractNames

      String[] getSchemaContractNames()
      Returns the names of the contracts.
      Returns:
      The contract names, not null.
    • getSchemaContract

      ISchemaContract getSchemaContract(String contractName)
      Returns the schema contract of a specified name.
      Parameters:
      contractName - The name of the contract, not null.
      Returns:
      The schema contract.
      Throws:
      UnknownXmlContractException - If the contact is unknown.
    • getSoapContractNames

      String[] getSoapContractNames()
      Returns the names of the contracts.
      Returns:
      The contract names, not null.
    • getSoapContract

      ISoapContract getSoapContract(String contractName)
      Returns the soap contract of a specified name.
      Parameters:
      contractName - The name of the contract, not null.
      Returns:
      The soap contract.
      Throws:
      UnknownSoapServiceContractException - If the contract is unknown.