Package org.yamcs.sle.user
Class AbstractServiceUserHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.yamcs.sle.user.AbstractServiceUserHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
CltuServiceUserHandler,RacfServiceUserHandler
public abstract class AbstractServiceUserHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
Common class for all SLE services
- Author:
- nm
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SleAttributesprotected AuthLevelprotected io.netty.channel.ChannelHandlerContextprotected List<SleMonitor>protected CompletableFuture<Void>protected State -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind()Establish an association with the providerprotected voidchangeState(State newState) voidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidchannelRegistered(io.netty.channel.ChannelHandlerContext ctx) protected voidvoidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) protected abstract Constants.ApplicationIdentifierprotected <T> CompletableFuture<T>protected InvokeIdprotected InvokeIdgetInvokeId(CompletableFuture<?> cf) protected Credentialsabstract CompletableFuture<SleParameter>getParameter(int parameterId) Get the value of an RAF parameter from the providergetState()intbooleanprotected voidprotected voidprotected voidprocessBindInvocation(SleBindInvocation bindInvocation) protected abstract voidprocessData(com.beanit.jasn1.ber.BerTag berTag, InputStream is) protected voidprocessStopReturn(SleAcknowledgement stopReturn) protected voidprocessUnbindInvocation(SleUnbindInvocation unbindInvocation) schedulePeriodicStatusReport(int intervalSec) Send a request to the server to ask for a periodic status report.voidsetAuthLevel(AuthLevel authLevel) voidsetVersionNumber(int versionNumber) voidshutdown()Closes the SLE connection (does not send any unbind or stop first).stop()request that the SLE service provider stop service provision and production.Send a request to stop the periodic status report.unbind(Constants.UnbindReason reason) protected voidverifyBindCredentials(Credentials credentials) protected voidverifyNonBindCredentials(Credentials credentials) Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
startingCf
-
state
-
channelHandlerContext
protected io.netty.channel.ChannelHandlerContext channelHandlerContext -
authLevel
-
attr
-
monitors
-
-
Constructor Details
-
AbstractServiceUserHandler
-
-
Method Details
-
getVersionNumber
public int getVersionNumber() -
setVersionNumber
public void setVersionNumber(int versionNumber) -
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
getAuthLevel
-
setAuthLevel
-
channelRegistered
- Specified by:
channelRegisteredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelRegisteredin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelActive
- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
getParameter
Get the value of an RAF parameter from the provider- Parameters:
parameterId- one of the parameters defined inConstants.ParameterName. Note that not all of them make sense for the RAF, see the table 3-11 in the standard to see which ones make sense.- Returns:
-
isConnected
public boolean isConnected() -
bind
Establish an association with the provider- Returns:
-
stop
request that the SLE service provider stop service provision and production.- Returns:
-
unbind
-
schedulePeriodicStatusReport
Send a request to the server to ask for a periodic status report.- Parameters:
intervalSec- - the cycle on which the periodic report shall be sent- Returns:
-
stopPeriodicStatusReport
Send a request to stop the periodic status report.- Returns:
-
shutdown
public void shutdown()Closes the SLE connection (does not send any unbind or stop first). -
checkUnbound
protected void checkUnbound() -
processBindInvocation
-
processUnbindInvocation
-
processStopReturn
-
peerAbort
protected void peerAbort() -
getNonBindCredentials
-
verifyNonBindCredentials
-
verifyBindCredentials
-
getInvokeId
-
getFuture
-
changeState
-
getInvokeId
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
notifyDisconnected
protected void notifyDisconnected() -
getState
-
getApplicationIdentifier
-
processData
protected abstract void processData(com.beanit.jasn1.ber.BerTag berTag, InputStream is) throws IOException - Throws:
IOException
-