Package org.opentcs.access.rmi
Class KernelServicePortalBuilder
java.lang.Object
org.opentcs.access.rmi.KernelServicePortalBuilder
public class KernelServicePortalBuilder
extends java.lang.Object
Builds
KernelServicePortal
instances for connections to remote portals.-
Constructor Summary
Constructors Constructor Description KernelServicePortalBuilder(java.lang.String userName, java.lang.String password)
Creates a new instance. -
Method Summary
Modifier and Type Method Description KernelServicePortal
build()
Builds and returns aKernelServicePortal
with the configured parameters.java.util.function.Predicate<java.lang.Object>
getEventFilter()
Returns the event filter to be applied for the built portal.java.lang.String
getPassword()
Returns the password used for logging in.SocketFactoryProvider
getSocketFactoryProvider()
Returns the socket factory provider used for RMI.java.lang.String
getUserName()
Returns the user name used for logging in.KernelServicePortalBuilder
setEventFilter(java.util.function.Predicate<java.lang.Object> eventFilter)
Sets the event filter to be applied for the built portal.KernelServicePortalBuilder
setSocketFactoryProvider(SocketFactoryProvider socketFactoryProvider)
Sets the socket factory provider used for RMI.
-
Constructor Details
-
KernelServicePortalBuilder
public KernelServicePortalBuilder(java.lang.String userName, java.lang.String password)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
public java.lang.String getUserName()Returns the user name used for logging in.- Returns:
- The user name used for logging in.
-
getPassword
public java.lang.String getPassword()Returns the password used for logging in.- Returns:
- The password used for logging in.
-
getEventFilter
public java.util.function.Predicate<java.lang.Object> getEventFilter()Returns the event filter to be applied for the built portal.- Returns:
- The event filter to be applied for the built portal.
-
setEventFilter
public KernelServicePortalBuilder setEventFilter(@Nonnull java.util.function.Predicate<java.lang.Object> eventFilter)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.
-