Package org.opentcs.access.rmi
Class KernelServicePortalBuilder
java.lang.Object
org.opentcs.access.rmi.KernelServicePortalBuilder
Builds
KernelServicePortal
instances for connections to remote portals.-
Constructor Summary
ConstructorsConstructorDescriptionKernelServicePortalBuilder
(String userName, String password) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns aKernelServicePortal
with the configured parameters.Returns the event filter to be applied for the built portal.Returns the password used for logging in.Returns the socket factory provider used for RMI.Returns the user name used for logging in.setEventFilter
(Predicate<Object> eventFilter) Sets the event filter to be applied for the built portal.setSocketFactoryProvider
(SocketFactoryProvider socketFactoryProvider) Sets the socket factory provider used for RMI.
-
Constructor Details
-
KernelServicePortalBuilder
Creates a new instance.- Parameters:
userName
- The user name to use for logging in.password
- The password to use for logging in.
-
-
Method Details
-
getSocketFactoryProvider
Returns the socket factory provider used for RMI.- Returns:
- The socket factory provider used for RMI.
-
setSocketFactoryProvider
public KernelServicePortalBuilder setSocketFactoryProvider(@Nonnull SocketFactoryProvider socketFactoryProvider) Sets the socket factory provider used for RMI.- Parameters:
socketFactoryProvider
- The socket factory provider.- Returns:
- This instance.
-
getUserName
Returns the user name used for logging in.- Returns:
- The user name used for logging in.
-
getPassword
Returns the password used for logging in.- Returns:
- The password used for logging in.
-
getEventFilter
Returns the event filter to be applied for the built portal.- Returns:
- The event filter to be applied for the built portal.
-
setEventFilter
Sets the event filter to be applied for the built portal.- Parameters:
eventFilter
- The event filter.- Returns:
- This instance.
-
build
Builds and returns aKernelServicePortal
with the configured parameters.- Returns:
- A
KernelServicePortal
instance. - Throws:
ServiceUnavailableException
- If the remote portal is not reachable for some reason.CredentialsException
- If the client login with the remote portal failed, e.g. because of incorrect login data.
-