Interface ICommunicationEngine

All Known Implementing Classes:
CommunicationEngine

public interface ICommunicationEngine
Communication engine interface that is exposed in the portal context. The interface that implements this interface delegates to the engine of the communication component with the current portal state.
Since:
9.0
Author:
Jon van Leuven
  • Method Details

    • 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.
    • 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.
    • getSoapServiceNames

      String[] getSoapServiceNames()
      This method returns the available service name.
      Returns:
      The names of the 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:
      UnknownRestServiceException - Is thrown when there is no definition for the provided name.
    • getSchemaSetNames

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

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

      ISoapMessageHandler[] getSoapMessageHandlers(String serviceCallName)
      This method returns the soap message handlers for the specified service call.
      Parameters:
      serviceCallName - the service call for which the soap message
      Returns:
      an array of soap message handlers, never null
    • composeRestRequest

      IRestRequestMessage composeRestRequest(String serviceName, String operationName, String mimeType)
      This method composes the rest message using the current portal state.
      Parameters:
      serviceName - The name of the rest service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Returns:
      The composed message, never null.
      Throws:
      UnknownRestServiceException - Is thrown when the given service name does not refer to an existing rest service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      RestMessageComposeException - Is thrown when the message could not be composed.
    • composeRestRequest

      IRestRequestMessage composeRestRequest(String serviceName, String operationName, String mimeType, Map<String,List<String>> headers)
      Parameters:
      serviceName - The name of the rest service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      mimeType - The desired mimetype of the request.
      headers - The headers that will be put on the request
      Returns:
      The composed message, never null.
      Throws:
      UnknownRestServiceException - Is thrown when the given service name does not refer to an existing rest * service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      RestMessageComposeException - Is thrown when the message could not be composed.
    • matchOperation

      IRestOperationDefinition matchOperation(IRestRequestMessage request, String serviceName)
      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.
      Returns:
      The definition of the operation.
      Throws:
      UnmatchableOperationException - When no operation can be matched to the urn/
    • parseRestRequest

      void parseRestRequest(IRestRequestMessage request, String serviceName, String operationName)
      This method parses a rest request message using the current portal state.
      Parameters:
      request - The message to parse, may not be null.
      serviceName - The name of the rest service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Throws:
      UnknownRestServiceException - Is thrown when the given service name does not refer to an existing rest service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      RestMessageParseException - Is thrown when the message could not be parsed.
    • composeRestResponse

      IRestMessage composeRestResponse(String serviceName, String operationName, String mimeType)
      This method composes a rest response message using the current portal state.
      Parameters:
      serviceName - The name of the rest service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Returns:
      The composed response message, never null.
      Throws:
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      RestMessageComposeException - Is thrown when the message could not be composed.
      UnknownRestServiceException - Is thrown when the given service name does not refer to an existing rest service.
    • parseRestResponse

      void parseRestResponse(IRestMessage response, String serviceName, String operationName)
      This method parses a rest response message using the current portal state.
      Parameters:
      response - The response message to parse.
      serviceName - The name of the rest service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Throws:
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      RestMessageParseException - Is thrown when the message could not be parsed.
      UnknownRestServiceException - Is thrown when the given service name does not refer to an existing rest service.
    • composeSoapRequest

      ISoapMessage composeSoapRequest(String serviceName, String operationName)
      This methods composes a soap request message using the current portal state.
      Parameters:
      serviceName - The name of the soap service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Returns:
      The composed soap message, never null.
      Throws:
      UnknownSoapServiceException - Is thrown when the given service name does not refer to an existing soap service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      SoapMessageComposeException - Is thrown when the message could not be composed.
    • composeSoapRequest

      ISoapMessage composeSoapRequest(String serviceName, String operationName, ISoapMessageHandler[] handlers)
      This methods composes a soap request message using the current portal state.
      Parameters:
      serviceName - The name of the soap service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      handlers - an array of handlers for the composed soap request, may not be null
      Returns:
      The composed soap message, never null.
      Throws:
      UnknownSoapServiceException - Is thrown when the given service name does not refer to an existing soap service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      SoapMessageComposeException - Is thrown when the message could not be composed.
    • parseSoapRequest

      void parseSoapRequest(ISoapMessage message, String serviceName, String operationName)
      This method parses a soap request message using the current portal state.
      Parameters:
      message - The source message, may not be null.
      serviceName - The name of the soap service, may not be null or empty.
      operationName - The name of the operation.
      Throws:
      UnknownSoapServiceException - Is thrown when the given service name does not refer to an existing soap service.
      SoapMessageParseException - Is thrown when the message could not be parsed.
    • composeSoapResponse

      ISoapMessage composeSoapResponse(String serviceName, String operationName)
      This method composes a soap response message using the current portal state.
      Parameters:
      serviceName - The name of the soap service, may not be null or empty.
      operationName - The name of the operation, may not be null or empty.
      Returns:
      The composed response message, never null.
      Throws:
      UnknownSoapServiceException - Is thrown when the given service name does not refer to an existing soap service.
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      SoapMessageComposeException - Is thrown when the message could not be composed.
    • parseSoapResponse

      void parseSoapResponse(ISoapMessage message, String serviceName, String operationName)
      This method parses a soap response message using the current portal state.
      Parameters:
      message - The source message, may not be null.
      serviceName - The name of the soap service, may not be null or empty.
      operationName - The name of the operation.
      Throws:
      UnknownOperationException - Is thrown when the given operation name does not refer to an existing operation.
      UnknownSoapServiceException - Is thrown when the given service name does not refer to an existing soap service.
      SoapMessageParseException - Is thrown when the message could not be parsed.
    • validateSoapMessage

      void validateSoapMessage(ISoapServiceConfiguration configuration, ISoapMessageDefinition message, String xml)
      This method may be used to validate a soap message using the current portal state.
      Parameters:
      configuration - The soap message configuration, may not be null.
      message - The soap message definition, may not be null.
      xml - The soap xml to validate, may not be null.
      Throws:
      XmlValidationException - Is thrown when the validation resulted in errors.
      XmlException - Is thrown when the soap message xml could not be parsed.
    • validateRestMessage

      void validateRestMessage(IRestServiceConfiguration configuration, IRestMessageDefinition message, String xml)
      This method may be used to validate a rest message using the current portal state.
      Parameters:
      configuration - The rest message configuration, may not be null.
      message - The rest message definition, may not be null.
      xml - The rest xml to validate, may not be null.
      Throws:
      XmlValidationException - Is thrown when the validation resulted in errors.
      XmlException - Is thrown when the rest message xml could not be parsed.