Package org.opentcs.access.rmi.services

# Class RemoteKernelServicePortalProxy

java.lang.Object
org.opentcs.access.rmi.services.RemoteKernelServicePortalProxy

All Implemented Interfaces:
  `KernelServicePortal`, `ServiceListener`

    public class RemoteKernelServicePortalProxy
    extends java.lang.Object
    implements KernelServicePortal, ServiceListener

The default implementation for the `KernelServicePortal`.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `RemoteKernelServicePortalProxy​(java.lang.String userName, java.lang.String password, SocketFactoryProvider socketFactoryProvider, java.util.function.Predicate<java.lang.Object> eventFilter)` | Creates a new instance.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.util.List<java.lang.Object>` | `fetchEvents​(long timeout)` | Fetches events buffered for the client.
  `DispatcherService` | `getDispatcherService()` | Returns the service a client can use to access methods regarding the dispatcher.
  `NotificationService` | `getNotificationService()` | Returns the service a client can use to access methods regarding user notifications.
  `PeripheralDispatcherService` | `getPeripheralDispatcherService()` | Returns the service a client can use to access methods regarding the peripheral dispatcher.
  `PeripheralJobService` | `getPeripheralJobService()` | Returns the service a client can use to access methods regarding peripheral jobs.
  `PeripheralService` | `getPeripheralService()` | Returns the service a client can use to access methods regarding peripherals.
  `PlantModelService` | `getPlantModelService()` | Returns the service a client can use to access methods regarding the plant model.
  `QueryService` | `getQueryService()` | Returns the service a client can use to access methods for generic queries.
  `RouterService` | `getRouterService()` | Returns the service a client can use to access methods regarding the router.
  `SchedulerService` | `getSchedulerService()` | Returns the service a client can use to access methods regarding the scheduler.
  `ServiceListener` | `getServiceListener()` |
  `Kernel.State` | `getState()` | Returns the current state of the kernel.
  `TransportOrderService` | `getTransportOrderService()` | Returns the service a client can use to access methods regarding transport orders and order sequences.
  `VehicleService` | `getVehicleService()` | Returns the service a client can use to access methods regarding vehicles.
  `void` | `login​(java.lang.String hostName, int port)` | Logs in with/establishes a connection to the remote kernel service portal.
  `void` | `logout()` | Logs out from/clears the connection to the remote kernel service portal.
  `void` | `onServiceUnavailable()` | Notifies a listener that the service is unavailable, i.e.
  `void` | `publishEvent​(java.lang.Object event)` | Publishes an event.
  `org.opentcs.access.rmi.services.AbstractRemoteServiceProxy<R>` | `setServiceListener​(ServiceListener serviceListener)` | Sets the listener that is interested in updates of this service.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RemoteKernelServicePortalProxy

    public RemoteKernelServicePortalProxy​(@Nonnull java.lang.String userName, @Nonnull java.lang.String password, @Nonnull SocketFactoryProvider socketFactoryProvider, @Nonnull java.util.function.Predicate<java.lang.Object> eventFilter)
    Creates a new instance.
    Parameters:
      `userName` - The user name used with the remote portal.
      `password` - The password used with the remote portal.
      `socketFactoryProvider` - Provides socket factories used for RMI.
      `eventFilter` - The event filter to be applied to events on the server side.

- ## Method Details

  - ### getServiceListener

    public ServiceListener getServiceListener()

  - ### onServiceUnavailable

    public void onServiceUnavailable()
    Description copied from interface: `ServiceListener`
    Notifies a listener that the service is unavailable, i.e. is not in a usable state.
    Specified by:
      `onServiceUnavailable` in interface `ServiceListener`

  - ### login

    public void login​(@Nonnull java.lang.String hostName, int port) throws CredentialsException, ServiceUnavailableException
    Description copied from interface: `KernelServicePortal`
    Logs in with/establishes a connection to the remote kernel service portal.
    Specified by:
      `login` in interface `KernelServicePortal`
    Parameters:
      `hostName` - The host on which the remote portal is running.
      `port` - The port at which we can reach the remote RMI registry.
    Throws:
      `CredentialsException`
      `ServiceUnavailableException`

  - ### logout

    public void logout()
    Description copied from interface: `KernelServicePortal`
    Logs out from/clears the connection to the remote kernel service portal.
    Specified by:
      `logout` in interface `KernelServicePortal`

  - ### getState

    public Kernel.State getState() throws KernelRuntimeException
    Description copied from interface: `KernelServicePortal`
    Returns the current state of the kernel.
    Specified by:
      `getState` in interface `KernelServicePortal`
    Returns:
      The current state of the kernel.
    Throws:
      `KernelRuntimeException` - In case there is an exception executing this method.

  - ### fetchEvents

    public java.util.List<java.lang.Object> fetchEvents​(long timeout) throws KernelRuntimeException
    Description copied from interface: `KernelServicePortal`
    Fetches events buffered for the client.
    Specified by:
      `fetchEvents` in interface `KernelServicePortal`
    Parameters:
      `timeout` - A timeout (in ms) for which to wait for events to arrive.
    Returns:
      A list of events (in the order they arrived).
    Throws:
      `KernelRuntimeException` - In case there is an exception executing this method.

  - ### publishEvent

    public void publishEvent​(java.lang.Object event) throws KernelRuntimeException
    Description copied from interface: `KernelServicePortal`
    Publishes an event.
    Specified by:
      `publishEvent` in interface `KernelServicePortal`
    Parameters:
      `event` - The event to be published.
    Throws:
      `KernelRuntimeException` - In case there is an exception executing this method.

  - ### getPlantModelService

    @Nonnull public PlantModelService getPlantModelService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding the plant model.
    Specified by:
      `getPlantModelService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding the plant model.

  - ### getTransportOrderService

    @Nonnull public TransportOrderService getTransportOrderService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding transport orders and order sequences.
    Specified by:
      `getTransportOrderService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding transport orders and order sequences.

  - ### getVehicleService

    @Nonnull public VehicleService getVehicleService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding vehicles.
    Specified by:
      `getVehicleService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding vehicles.

  - ### getNotificationService

    @Nonnull public NotificationService getNotificationService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding user notifications.
    Specified by:
      `getNotificationService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding user notifications.

  - ### getDispatcherService

    @Nonnull public DispatcherService getDispatcherService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding the dispatcher.
    Specified by:
      `getDispatcherService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding the dispatcher.

  - ### getRouterService

    @Nonnull public RouterService getRouterService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding the router.
    Specified by:
      `getRouterService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding the router.

  - ### getQueryService

    @Nonnull public QueryService getQueryService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods for generic queries.
    Specified by:
      `getQueryService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods for generic queries.

  - ### getSchedulerService

    @Nonnull public SchedulerService getSchedulerService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding the scheduler.
    Specified by:
      `getSchedulerService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding the scheduler.

  - ### getPeripheralService

    @Nonnull public PeripheralService getPeripheralService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding peripherals.
    Specified by:
      `getPeripheralService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding peripherals.

  - ### getPeripheralJobService

    @Nonnull public PeripheralJobService getPeripheralJobService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding peripheral jobs.
    Specified by:
      `getPeripheralJobService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding peripheral jobs.

  - ### getPeripheralDispatcherService

    @Nonnull public PeripheralDispatcherService getPeripheralDispatcherService()
    Description copied from interface: `KernelServicePortal`
    Returns the service a client can use to access methods regarding the peripheral dispatcher.
    Specified by:
      `getPeripheralDispatcherService` in interface `KernelServicePortal`
    Returns:
      The service a client can use to access methods regarding the peripheral dispatcher.

  - ### setServiceListener

    public org.opentcs.access.rmi.services.AbstractRemoteServiceProxy<R> setServiceListener​(ServiceListener serviceListener)
    Sets the listener that is interested in updates of this service.
    Parameters:
      `serviceListener` - The service listener.
    Returns:
      This remote service proxy.