Class ClientActorBehavior<T extends BackendInfo>
java.lang.Object
org.opendaylight.controller.cluster.access.client.AbstractClientActorBehavior<C>
org.opendaylight.controller.cluster.access.client.ClientActorBehavior<T>
- All Implemented Interfaces:
AutoCloseable,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>
public abstract class ClientActorBehavior<T extends BackendInfo>
extends AbstractClientActorBehavior<C>
implements org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>
A behavior, which handles messages sent to a
AbstractClientActor.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceConnection reconnect cohort, driven by this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientActorBehavior(@NonNull ClientActorContext context, @NonNull BackendInfoResolver<T> resolver) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract @NonNull ClientActorBehavior.ConnectionConnectCohortconnectionUp(@NonNull ConnectedClientConnection<T> newConn) Callback invoked when a new connection has been established.final AbstractClientConnection<T>getConnection(Long shard) Get a connection to a shard.final org.opendaylight.controller.cluster.access.concepts.ClientIdentifierprotected abstract voidhaltClient(@NonNull Throwable cause) Halt And Catch Fire.protected abstract @Nullable ClientActorBehavior<T>Override this method to handle any command which is not handled by the base behavior.protected final @NonNull BackendInfoResolver<T>resolver()Override this method to provide a backend resolver instance.Methods inherited from class org.opendaylight.controller.cluster.access.client.AbstractClientActorBehavior
context, persistenceId, self
-
Constructor Details
-
ClientActorBehavior
protected ClientActorBehavior(@NonNull ClientActorContext context, @NonNull BackendInfoResolver<T> resolver)
-
-
Method Details
-
getIdentifier
public final org.opendaylight.controller.cluster.access.concepts.ClientIdentifier getIdentifier()- Specified by:
getIdentifierin interfaceorg.opendaylight.yangtools.concepts.Identifiable<T extends BackendInfo>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractClientActorBehavior<ClientActorContext>
-
getConnection
Get a connection to a shard.- Parameters:
shard- Shard cookie- Returns:
- Connection to a shard
- Throws:
InversibleLockException- if the shard is being reconnected
-
haltClient
Halt And Catch Fire. Halt processing on this client. Implementations need to ensure they initiate state flush procedures. No attempt to use this instance should be made after this method returns. Any such use may result in undefined behavior.- Parameters:
cause- Failure cause
-
onCommand
Override this method to handle any command which is not handled by the base behavior.- Parameters:
command- the command to process- Returns:
- Next behavior to use, null if this actor should shut down.
-
resolver
Override this method to provide a backend resolver instance.- Returns:
- a backend resolver instance
-
connectionUp
@Holding("connectionsLock") protected abstract @NonNull ClientActorBehavior.ConnectionConnectCohort connectionUp(@NonNull ConnectedClientConnection<T> newConn) Callback invoked when a new connection has been established. Implementations are expected perform preparatory tasks before the previous connection is frozen.- Parameters:
newConn- New connection- Returns:
- ConnectionConnectCohort which will be used to complete the process of bringing the connection up.
-