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 Object
implements KernelServicePortal, ServiceListener
The default implementation for the
KernelServicePortal.-
Constructor Summary
ConstructorsConstructorDescriptionRemoteKernelServicePortalProxy(String userName, String password, SocketFactoryProvider socketFactoryProvider, Predicate<Object> eventFilter) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfetchEvents(long timeout) Fetches events buffered for the client.Returns the service a client can use to access methods regarding the dispatcher.Returns the service a client can use to access methods regarding user notifications.Returns the service a client can use to access methods regarding the peripheral dispatcher.Returns the service a client can use to access methods regarding peripheral jobs.Returns the service a client can use to access methods regarding peripherals.Returns the service a client can use to access methods regarding the plant model.Returns the service a client can use to access methods for generic queries.Returns the service a client can use to access methods regarding the router.getState()Returns the current state of the kernel.Returns the service a client can use to access methods regarding transport orders and order sequences.Returns the service a client can use to access methods regarding vehicles.voidLogs in with/establishes a connection to the remote kernel service portal.voidlogout()Logs out from/clears the connection to the remote kernel service portal.voidNotifies a listener that the service is unavailable, i.e.voidpublishEvent(Object event) Publishes an event.org.opentcs.access.rmi.services.AbstractRemoteServiceProxy<RemoteKernelServicePortal> setServiceListener(ServiceListener serviceListener) Sets the listener that is interested in updates of this service.
-
Constructor Details
-
RemoteKernelServicePortalProxy
public RemoteKernelServicePortalProxy(@Nonnull String userName, @Nonnull String password, @Nonnull SocketFactoryProvider socketFactoryProvider, @Nonnull Predicate<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
-
login
public void login(@Nonnull String hostName, int port) throws CredentialsException, ServiceUnavailableException Description copied from interface:KernelServicePortalLogs in with/establishes a connection to the remote kernel service portal.- Specified by:
loginin interfaceKernelServicePortal- Parameters:
hostName- The host on which the remote portal is running.port- The port at which we can reach the remote RMI registry.- Throws:
CredentialsExceptionServiceUnavailableException
-
logout
public void logout()Description copied from interface:KernelServicePortalLogs out from/clears the connection to the remote kernel service portal.- Specified by:
logoutin interfaceKernelServicePortal
-
getState
Description copied from interface:KernelServicePortalReturns the current state of the kernel.- Specified by:
getStatein interfaceKernelServicePortal- Returns:
- The current state of the kernel.
- Throws:
KernelRuntimeException- In case there is an exception executing this method.
-
fetchEvents
Description copied from interface:KernelServicePortalFetches events buffered for the client.- Specified by:
fetchEventsin interfaceKernelServicePortal- 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
Description copied from interface:KernelServicePortalPublishes an event.- Specified by:
publishEventin interfaceKernelServicePortal- Parameters:
event- The event to be published.- Throws:
KernelRuntimeException- In case there is an exception executing this method.
-
getPlantModelService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding the plant model.- Specified by:
getPlantModelServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding the plant model.
-
getTransportOrderService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding transport orders and order sequences.- Specified by:
getTransportOrderServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding transport orders and order sequences.
-
getVehicleService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding vehicles.- Specified by:
getVehicleServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding vehicles.
-
getNotificationService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding user notifications.- Specified by:
getNotificationServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding user notifications.
-
getDispatcherService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding the dispatcher.- Specified by:
getDispatcherServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding the dispatcher.
-
getRouterService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding the router.- Specified by:
getRouterServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding the router.
-
getQueryService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods for generic queries.- Specified by:
getQueryServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods for generic queries.
-
getPeripheralService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding peripherals.- Specified by:
getPeripheralServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding peripherals.
-
getPeripheralJobService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding peripheral jobs.- Specified by:
getPeripheralJobServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding peripheral jobs.
-
getPeripheralDispatcherService
Description copied from interface:KernelServicePortalReturns the service a client can use to access methods regarding the peripheral dispatcher.- Specified by:
getPeripheralDispatcherServicein interfaceKernelServicePortal- Returns:
- The service a client can use to access methods regarding the peripheral dispatcher.
-
setServiceListener
public org.opentcs.access.rmi.services.AbstractRemoteServiceProxy<RemoteKernelServicePortal> setServiceListener(ServiceListener serviceListener) Sets the listener that is interested in updates of this service.- Parameters:
serviceListener- The service listener.- Returns:
- This remote service proxy.
-