Interface ADEPT2ServiceExport


public interface ADEPT2ServiceExport
This submodule of the CommunicationService is responsible for publishing services, i. e. to enable them to be called remotely.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    exportService(URI serviceURI, Class<? extends ADEPT2Service> serviceInterface, ADEPT2Service service)
    Enables the designated service identified by the designated URI to be called remotely through the designated service interface.
    Gets the remote interface and the service associated with the designated remote object identifier.
    Gets the URI with which the designated service has been exported with this service export or null in case this service export has not exported the designated service.
    boolean
    isExportPrepared(URI remoteObjectIdentifier)
    Returns whether the specified service identifier has been prepared by this service export but has not been exported yet.
    boolean
    isRegisteredService(URI remoteObjectIdentifier)
    Returns if the specified service identifier is known to this service export, that is whether this URI has been exported.
    prepareServiceExport(String serviceType, String simpleServiceName, Class<? extends ADEPT2Service> serviceInterface)
    Prepares the specified service for being exported and creates a remote object identifier of type URI valid for the communication protocol this communication factory supports.
    void
    Unregisters the designated service to release resources.
  • Method Details

    • prepareServiceExport

      URI prepareServiceExport(String serviceType, String simpleServiceName, Class<? extends ADEPT2Service> serviceInterface) throws AbortServiceException
      Prepares the specified service for being exported and creates a remote object identifier of type URI valid for the communication protocol this communication factory supports.
      Parameters:
      serviceType - The identifier of the ADEPT2 service type the specified service is an instance of.
      simpleServiceName - The name assigned to the service to export by the registry.
      serviceInterface - The remote interface used to access the exported service remotely.
      Returns:
      The remote object identifier identifying the service instance and the communication protocol to use for remote access.
      Throws:
      AbortServiceException - If the preparation of the service export fails, an AbortServiceException will be thrown.
    • exportService

      boolean exportService(URI serviceURI, Class<? extends ADEPT2Service> serviceInterface, ADEPT2Service service) throws AbortServiceException
      Enables the designated service identified by the designated URI to be called remotely through the designated service interface.

      Before the service could be exported, it must be prepared for export by calling prepareExport. The returned URI must match the URI returned by the prepareExport call.

      Parameters:
      serviceURI - The URI under which the service should be exported.
      serviceInterface - The remote interface used to access the exported service remotely.
      service - The service to export.
      Returns:
      Whether the user should be informed of the URI of the (locally) exported service. Usually only the globally exported URIs should be disclosed but specific communication service may want that, too, for instance the web service export.
      Throws:
      AbortServiceException - If the exporting the service fails, an AbortServiceException will be thrown.
    • unregisterService

      void unregisterService(String serviceName)
      Unregisters the designated service to release resources. In case the designated service is not registered, this is a no-op.
      Parameters:
      serviceName - The hierarchical name of the exported service.
    • getService

      Pair<Class<?>,ADEPT2Service> getService(URI roi)
      Gets the remote interface and the service associated with the designated remote object identifier.
      Parameters:
      roi - The remote object identifier of the requested remote service.
      Returns:
      The remote interface and the remote service identified by the designated remote object identifier.
    • isExportPrepared

      boolean isExportPrepared(URI remoteObjectIdentifier)
      Returns whether the specified service identifier has been prepared by this service export but has not been exported yet.
      Parameters:
      remoteObjectIdentifier - The identifier to check.
      Returns:
      Whether the designated identifier has been prepared for service export but not exported yet.
    • isRegisteredService

      boolean isRegisteredService(URI remoteObjectIdentifier)
      Returns if the specified service identifier is known to this service export, that is whether this URI has been exported.
      Parameters:
      remoteObjectIdentifier - The identifier to check.
      Returns:
      if the passed service identifier is exported by this service export TRUE is returned else FALSE is returned.
    • getServiceUri

      URI getServiceUri(ADEPT2Service service)
      Gets the URI with which the designated service has been exported with this service export or null in case this service export has not exported the designated service.
      Parameters:
      service - The service of which to get the URI it has been exported with by this service export.
      Returns:
      The URI with which the designated service has been exported with this service export or null.