Class AbstractChannel
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,AttributeRepository,AttributeStore,Channel,ChannelListenerManager,ChannelStreamWriterResolver,ChannelStreamWriterResolverManager,Closeable,PropertyResolver,SessionContextHolder,SessionHolder<Session>,ExecutorServiceCarrier
- Direct Known Subclasses:
AbstractClientChannel,AbstractServerChannel
public abstract class AbstractChannel extends AbstractInnerCloseable implements Channel, ExecutorServiceCarrier
Provides common client/server channel functionality- Author:
- Apache MINA SSHD Project
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractChannel.GracefulChannelCloseableprotected static classAbstractChannel.GracefulState-
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
-
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected ChannelListenerchannelListenerProxyprotected Collection<ChannelListener>channelListenersChannel events listenerprotected AtomicBooleancloseSignaledprotected AtomicBooleaneofReceivedprotected AtomicBooleaneofSentprotected DefaultCloseFuturegracefulFutureprotected AtomicReference<AbstractChannel.GracefulState>gracefulStateprotected AtomicBooleaninitializedstatic IntUnaryOperatorRESPONSE_BUFFER_GROWTH_FACTORDefault growth factor function used to resize response buffersprotected ConnectionServiceserviceprotected AtomicBooleanunregisterSignaled-
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.channel.Channel
CHANNEL_EXEC, CHANNEL_SHELL, CHANNEL_SUBSYSTEM
-
Fields inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolver
NONE
-
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractChannel(boolean client)protectedAbstractChannel(boolean client, Collection<? extends RequestHandler<Channel>> handlers)protectedAbstractChannel(String discriminator, boolean client)protectedAbstractChannel(String discriminator, boolean client, Collection<? extends RequestHandler<Channel>> handlers, CloseableExecutorService executorService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChannelListener(ChannelListener listener)Add a channel listenerprotected DateaddPendingRequest(String request, boolean wantReply)Add a channel request to the tracked pending ones if reply is expectedvoidaddRequestHandler(RequestHandler<Channel> handler)Collection<AttributeRepository.AttributeKey<?>>attributeKeys()voidclearAttributes()Removes all currently stored user-defined attributes<T> TcomputeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)If the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.protected voidconfigureWindow()protected abstract voiddoWriteData(byte[] data, int off, long len)protected abstract voiddoWriteExtendedData(byte[] data, int off, long len)<T> TgetAttribute(AttributeRepository.AttributeKey<T> key)Returns the value of the user-defined attribute.intgetAttributesCount()ChannelListenergetChannelListenerProxy()ChannelStreamWriterResolvergetChannelStreamWriterResolver()CloseableExecutorServicegetExecutorService()intgetId()protected CloseablegetInnerCloseable()WindowgetLocalWindow()PropertyResolvergetParentPropertyResolver()Map<String,Object>getProperties()A map of properties that can be used to configure the SSH server or client.intgetRecipient()WindowgetRemoteWindow()List<RequestHandler<Channel>>getRequestHandlers()SessiongetSession()voidhandleChannelRegistrationResult(ConnectionService service, Session session, int channelId, boolean registered)Invoked after being successfully registered by the connection service - should throw aRuntimeExceptionif not registeredprotected voidhandleChannelRequest(String req, boolean wantReply, Buffer buffer)voidhandleChannelUnregistration(ConnectionService service)Called by the connection service to inform the channel that it has bee unregistered.voidhandleClose()Invoked whenSSH_MSG_CHANNEL_CLOSEreceivedvoidhandleData(Buffer buffer)Invoked whenSSH_MSG_CHANNEL_DATAreceivedvoidhandleEof()Invoked whenSSH_MSG_CHANNEL_EOFreceivedvoidhandleExtendedData(Buffer buffer)Invoked whenSSH_MSG_CHANNEL_EXTENDED_DATAreceivedvoidhandleFailure()Invoked whenSSH_MSG_CHANNEL_FAILUREreceivedprotected RequestHandler.ResulthandleInternalRequest(String req, boolean wantReply, Buffer buffer)Called byhandleUnknownChannelRequest(String, boolean, Buffer)in order to allow channel request handling if none of the registered handlers processed the request - last chance.voidhandleRequest(Buffer buffer)Invoked whenSSH_MSG_CHANNEL_REQUESTreceivedvoidhandleSuccess()Invoked whenSSH_MSG_CHANNEL_SUCCESSreceivedprotected voidhandleUnknownChannelRequest(String req, boolean wantReply, Buffer buffer)Called when none of the register request handlers reported handling the requestvoidhandleWindowAdjust(Buffer buffer)Invoked whenSSH_MSG_CHANNEL_WINDOW_ADJUSTreceivedvoidinit(ConnectionService service, Session session, int id)Invoked when the local channel is initial createdprotected voidinvokeChannelSignaller(Invoker<ChannelListener,Void> invoker)booleanisEofSent()booleanisEofSignalled()booleanisInitialized()protected voidnotifyStateChanged(String hint)protected voidnotifyStateChanged(ChannelListener listener, String hint)protected voidpreClose()preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.<T> TremoveAttribute(AttributeRepository.AttributeKey<T> key)Removes the user-defined attributevoidremoveChannelListener(ChannelListener listener)Remove a channel listenerprotected DateremovePendingRequest(String request)Removes a channel request from the tracked onesvoidremoveRequestHandler(RequestHandler<Channel> handler)ChannelStreamWriterResolverresolveChannelStreamWriterResolver()protected IoWriteFuturesendEof()SendsSSH_MSG_CHANNEL_EOFprovided not already sent and current channel state allows it.protected IoWriteFuturesendResponse(Buffer buffer, String req, RequestHandler.Result result, boolean wantReply)protected voidsendWindowAdjust(long len)<T> TsetAttribute(AttributeRepository.AttributeKey<T> key, T value)Sets a user-defined attribute.voidsetChannelStreamWriterResolver(ChannelStreamWriterResolver resolver)protected voidsetRecipient(int recipient)voidsignalChannelClosed(Throwable reason)protected voidsignalChannelClosed(ChannelListener listener, Throwable reason)protected voidsignalChannelInitialized()protected voidsignalChannelInitialized(ChannelListener listener)protected voidsignalChannelOpenFailure(Throwable reason)protected voidsignalChannelOpenFailure(ChannelListener listener, Throwable reason)protected voidsignalChannelOpenSuccess()protected voidsignalChannelOpenSuccess(ChannelListener listener)StringtoString()protected longvalidateIncomingDataSize(int cmd, long len)IoWriteFuturewritePacket(Buffer buffer)Encode and send the given buffer.-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediately
-
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.channel.Channel
addRequestHandlers, handleOpenFailure, handleOpenSuccess, open, removeRequestHandlers, resolveAttribute
-
Methods inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolverManager
resolveChannelStreamWriter
-
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
-
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getString, getStringProperty, isEmpty
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Field Detail
-
RESPONSE_BUFFER_GROWTH_FACTOR
public static final IntUnaryOperator RESPONSE_BUFFER_GROWTH_FACTOR
Default growth factor function used to resize response buffers
-
service
protected ConnectionService service
-
initialized
protected final AtomicBoolean initialized
-
eofReceived
protected final AtomicBoolean eofReceived
-
eofSent
protected final AtomicBoolean eofSent
-
unregisterSignaled
protected final AtomicBoolean unregisterSignaled
-
closeSignaled
protected final AtomicBoolean closeSignaled
-
gracefulState
protected AtomicReference<AbstractChannel.GracefulState> gracefulState
-
gracefulFuture
protected final DefaultCloseFuture gracefulFuture
-
channelListeners
protected final Collection<ChannelListener> channelListeners
Channel events listener
-
channelListenerProxy
protected final ChannelListener channelListenerProxy
-
-
Constructor Detail
-
AbstractChannel
protected AbstractChannel(boolean client)
-
AbstractChannel
protected AbstractChannel(boolean client, Collection<? extends RequestHandler<Channel>> handlers)
-
AbstractChannel
protected AbstractChannel(String discriminator, boolean client)
-
AbstractChannel
protected AbstractChannel(String discriminator, boolean client, Collection<? extends RequestHandler<Channel>> handlers, CloseableExecutorService executorService)
-
-
Method Detail
-
getRequestHandlers
public List<RequestHandler<Channel>> getRequestHandlers()
- Specified by:
getRequestHandlersin interfaceChannel
-
addRequestHandler
public void addRequestHandler(RequestHandler<Channel> handler)
- Specified by:
addRequestHandlerin interfaceChannel
-
removeRequestHandler
public void removeRequestHandler(RequestHandler<Channel> handler)
- Specified by:
removeRequestHandlerin interfaceChannel
-
getRecipient
public int getRecipient()
- Specified by:
getRecipientin interfaceChannel- Returns:
- Remote channel identifier
-
setRecipient
protected void setRecipient(int recipient)
-
getLocalWindow
public Window getLocalWindow()
- Specified by:
getLocalWindowin interfaceChannel
-
getRemoteWindow
public Window getRemoteWindow()
- Specified by:
getRemoteWindowin interfaceChannel
-
getSession
public Session getSession()
- Specified by:
getSessionin interfaceSessionHolder<Session>
-
getParentPropertyResolver
public PropertyResolver getParentPropertyResolver()
- Specified by:
getParentPropertyResolverin interfacePropertyResolver- Returns:
- The parent resolver that can be used to query for missing properties -
nullif no parent
-
getExecutorService
public CloseableExecutorService getExecutorService()
- Specified by:
getExecutorServicein interfaceExecutorServiceCarrier- Returns:
- The
CloseableExecutorServiceto use
-
getChannelStreamWriterResolver
public ChannelStreamWriterResolver getChannelStreamWriterResolver()
- Specified by:
getChannelStreamWriterResolverin interfaceChannelStreamWriterResolverManager
-
setChannelStreamWriterResolver
public void setChannelStreamWriterResolver(ChannelStreamWriterResolver resolver)
- Specified by:
setChannelStreamWriterResolverin interfaceChannelStreamWriterResolverManager
-
resolveChannelStreamWriterResolver
public ChannelStreamWriterResolver resolveChannelStreamWriterResolver()
- Specified by:
resolveChannelStreamWriterResolverin interfaceChannelStreamWriterResolverManager
-
addPendingRequest
protected Date addPendingRequest(String request, boolean wantReply)
Add a channel request to the tracked pending ones if reply is expected- Parameters:
request- The request typewantReply-trueif reply is expected- Returns:
- The allocated
Datetimestamp -nullif no reply is expected (in which case the request is not tracked) - Throws:
IllegalArgumentException- If the request is already being tracked- See Also:
removePendingRequest(String)
-
removePendingRequest
protected Date removePendingRequest(String request)
Removes a channel request from the tracked ones- Parameters:
request- The request type- Returns:
- The allocated
Datetimestamp -nullif the specified request type is not being tracked or has not been added to the tracked ones to begin with - See Also:
addPendingRequest(String, boolean)
-
handleRequest
public void handleRequest(Buffer buffer) throws IOException
Description copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_REQUESTreceived- Specified by:
handleRequestin interfaceChannel- Parameters:
buffer- The rest of the message dataBufferafter decoding the channel identifiers- Throws:
IOException- If failed to handle the message
-
handleChannelRequest
protected void handleChannelRequest(String req, boolean wantReply, Buffer buffer) throws IOException
- Throws:
IOException
-
handleUnknownChannelRequest
protected void handleUnknownChannelRequest(String req, boolean wantReply, Buffer buffer) throws IOException
Called when none of the register request handlers reported handling the request- Parameters:
req- The request typewantReply- Whether reply is requestedbuffer- TheBuffercontaining extra request-specific data- Throws:
IOException- If failed to send the response (if needed)- See Also:
handleInternalRequest(String, boolean, Buffer)
-
handleInternalRequest
protected RequestHandler.Result handleInternalRequest(String req, boolean wantReply, Buffer buffer) throws IOException
Called byhandleUnknownChannelRequest(String, boolean, Buffer)in order to allow channel request handling if none of the registered handlers processed the request - last chance.- Parameters:
req- The request typewantReply- Whether reply is requestedbuffer- TheBuffercontaining extra request-specific data- Returns:
- The handling result - if
nullorUnsupportedand reply is required then a failure message will be sent - Throws:
IOException- If failed to process the request internally
-
sendResponse
protected IoWriteFuture sendResponse(Buffer buffer, String req, RequestHandler.Result result, boolean wantReply) throws IOException
- Throws:
IOException
-
init
public void init(ConnectionService service, Session session, int id) throws IOException
Description copied from interface:ChannelInvoked when the local channel is initial created- Specified by:
initin interfaceChannel- Parameters:
service- TheConnectionServicethrough which the channel is initializedsession- TheSessionassociated with the channelid- The locally assigned channel identifier- Throws:
IOException- If failed to process the initialization
-
signalChannelInitialized
protected void signalChannelInitialized() throws IOException- Throws:
IOException
-
signalChannelInitialized
protected void signalChannelInitialized(ChannelListener listener)
-
signalChannelOpenSuccess
protected void signalChannelOpenSuccess()
-
signalChannelOpenSuccess
protected void signalChannelOpenSuccess(ChannelListener listener)
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfaceChannel- Returns:
trueif call toChannel.init(ConnectionService, Session, int)was successfully completed
-
handleChannelRegistrationResult
public void handleChannelRegistrationResult(ConnectionService service, Session session, int channelId, boolean registered)
Description copied from interface:ChannelInvoked after being successfully registered by the connection service - should throw aRuntimeExceptionif not registered- Specified by:
handleChannelRegistrationResultin interfaceChannel- Parameters:
service- TheConnectionServicethrough which the channel is registeredsession- TheSessionassociated with the channelchannelId- The locally assigned channel identifierregistered- Whether registration was successful or not
-
signalChannelOpenFailure
protected void signalChannelOpenFailure(Throwable reason)
-
signalChannelOpenFailure
protected void signalChannelOpenFailure(ChannelListener listener, Throwable reason)
-
notifyStateChanged
protected void notifyStateChanged(String hint)
-
notifyStateChanged
protected void notifyStateChanged(ChannelListener listener, String hint)
-
addChannelListener
public void addChannelListener(ChannelListener listener)
Description copied from interface:ChannelListenerManagerAdd a channel listener- Specified by:
addChannelListenerin interfaceChannelListenerManager- Parameters:
listener- TheChannelListenerto add - notnull
-
removeChannelListener
public void removeChannelListener(ChannelListener listener)
Description copied from interface:ChannelListenerManagerRemove a channel listener- Specified by:
removeChannelListenerin interfaceChannelListenerManager- Parameters:
listener- TheChannelListenerto remove
-
getChannelListenerProxy
public ChannelListener getChannelListenerProxy()
- Specified by:
getChannelListenerProxyin interfaceChannelListenerManager- Returns:
- A (never
nullproxyChannelListenerthat represents all the currently registered listeners. Any method invocation on the proxy is replicated to the currently registered listeners
-
handleClose
public void handleClose() throws IOExceptionDescription copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_CLOSEreceived- Specified by:
handleClosein interfaceChannel- Throws:
IOException- If failed to handle the message
-
getInnerCloseable
protected Closeable getInnerCloseable()
- Specified by:
getInnerCloseablein classAbstractInnerCloseable
-
preClose
protected void preClose()
Description copied from class:AbstractCloseablepreClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true- Overrides:
preClosein classAbstractCloseable
-
handleChannelUnregistration
public void handleChannelUnregistration(ConnectionService service)
Description copied from interface:ChannelCalled by the connection service to inform the channel that it has bee unregistered.- Specified by:
handleChannelUnregistrationin interfaceChannel- Parameters:
service- TheConnectionServicethrough which the channel is unregistered
-
signalChannelClosed
public void signalChannelClosed(Throwable reason)
-
signalChannelClosed
protected void signalChannelClosed(ChannelListener listener, Throwable reason)
-
invokeChannelSignaller
protected void invokeChannelSignaller(Invoker<ChannelListener,Void> invoker) throws Throwable
- Throws:
Throwable
-
writePacket
public IoWriteFuture writePacket(Buffer buffer) throws IOException
Description copied from interface:ChannelEncode and send the given buffer. Note: for session packets the buffer has to have 5 bytes free at the beginning to allow the encoding to take place. Also, the write position of the buffer has to be set to the position of the last byte to write.- Specified by:
writePacketin interfaceChannel- Parameters:
buffer- the buffer to encode and send. NOTE: the buffer must not be touched until the returned write future is completed.- Returns:
- An
IoWriteFuturethat can be used to check when the packet has actually been sent - Throws:
IOException- if an error occurred when encoding or sending the packet
-
handleData
public void handleData(Buffer buffer) throws IOException
Description copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_DATAreceived- Specified by:
handleDatain interfaceChannel- Parameters:
buffer- The rest of the message dataBufferafter decoding the channel identifiers- Throws:
IOException- If failed to handle the message
-
handleExtendedData
public void handleExtendedData(Buffer buffer) throws IOException
Description copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_EXTENDED_DATAreceived- Specified by:
handleExtendedDatain interfaceChannel- Parameters:
buffer- The rest of the message dataBufferafter decoding the channel identifiers- Throws:
IOException- If failed to handle the message
-
validateIncomingDataSize
protected long validateIncomingDataSize(int cmd, long len)
-
handleEof
public void handleEof() throws IOExceptionDescription copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_EOFreceived- Specified by:
handleEofin interfaceChannel- Throws:
IOException- If failed to handle the message
-
isEofSignalled
public boolean isEofSignalled()
- Specified by:
isEofSignalledin interfaceChannel- Returns:
trueif the peer signaled that it will not send any more data- See Also:
- RFC 4254 - section 5.3 - SSH_MSG_CHANNEL_EOF
-
handleWindowAdjust
public void handleWindowAdjust(Buffer buffer) throws IOException
Description copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_WINDOW_ADJUSTreceived- Specified by:
handleWindowAdjustin interfaceChannel- Parameters:
buffer- The rest of the message dataBufferafter decoding the channel identifiers- Throws:
IOException- If failed to handle the message
-
handleSuccess
public void handleSuccess() throws IOExceptionDescription copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_SUCCESSreceived- Specified by:
handleSuccessin interfaceChannel- Throws:
IOException- If failed to handle the message
-
handleFailure
public void handleFailure() throws IOExceptionDescription copied from interface:ChannelInvoked whenSSH_MSG_CHANNEL_FAILUREreceived- Specified by:
handleFailurein interfaceChannel- Throws:
IOException- If failed to handle the message
-
doWriteData
protected abstract void doWriteData(byte[] data, int off, long len) throws IOException- Throws:
IOException
-
doWriteExtendedData
protected abstract void doWriteExtendedData(byte[] data, int off, long len) throws IOException- Throws:
IOException
-
sendEof
protected IoWriteFuture sendEof() throws IOException
SendsSSH_MSG_CHANNEL_EOFprovided not already sent and current channel state allows it.- Returns:
- The
IoWriteFutureof the sent packet -nullif message not sent due to channel state (or already sent) - Throws:
IOException- If failed to send the packet
-
isEofSent
public boolean isEofSent()
-
getProperties
public Map<String,Object> getProperties()
Description copied from interface:PropertyResolverA map of properties that can be used to configure the SSH server or client. This map will never be changed by either the server or client and is not supposed to be changed at runtime (changes are not bound to have any effect on a running client or server), though it may affect the creation of sessions later as these values are usually not cached.
Note: the type of the mapped property should match the expected configuration value type -
Long, Integer, Boolean, String, etc.... If it doesn't, thetoString()result of the mapped value is used to convert it to the required type. E.g., if the mapped value is the string "1234" and the expected value is alongthen it will be parsed into one. Also, if the mapped value is anIntegerbut alongis expected, then it will be converted into one.- Specified by:
getPropertiesin interfacePropertyResolver- Returns:
- a valid
Mapcontaining configuration values, nevernull. Note: may be immutable.
-
getAttributesCount
public int getAttributesCount()
- Specified by:
getAttributesCountin interfaceAttributeRepository- Returns:
- Current number of user-defined attributes stored in the repository
-
getAttribute
public <T> T getAttribute(AttributeRepository.AttributeKey<T> key)
Description copied from interface:AttributeRepositoryReturns the value of the user-defined attribute.- Specified by:
getAttributein interfaceAttributeRepository- Type Parameters:
T- The generic attribute type- Parameters:
key- The key of the attribute; must not benull.- Returns:
nullif there is no value associated with the specified key
-
attributeKeys
public Collection<AttributeRepository.AttributeKey<?>> attributeKeys()
- Specified by:
attributeKeysin interfaceAttributeRepository- Returns:
- A
Collectionsnapshot of all the currently registered attributes in the repository
-
computeAttributeIfAbsent
public <T> T computeAttributeIfAbsent(AttributeRepository.AttributeKey<T> key, Function<? super AttributeRepository.AttributeKey<T>,? extends T> resolver)
Description copied from interface:AttributeStoreIf the specified key is not already associated with a value (or is mapped tonull), attempts to compute its value using the given mapping function and enters it into this map unlessnull.- Specified by:
computeAttributeIfAbsentin interfaceAttributeStore- Type Parameters:
T- The generic attribute type- Parameters:
key- The key of the attribute; must not benull.resolver- The (nevernull) mapping function to use if value not already mapped. If returnsnullthen value is not mapped to the provided key.- Returns:
- The resolved value -
nullif value not mapped and resolver did not return a non-nullvalue for it
-
setAttribute
public <T> T setAttribute(AttributeRepository.AttributeKey<T> key, T value)
Description copied from interface:AttributeStoreSets a user-defined attribute.- Specified by:
setAttributein interfaceAttributeStore- Type Parameters:
T- The generic attribute type- Parameters:
key- The key of the attribute; must not benull.value- The value of the attribute; must not benull.- Returns:
- The old value of the attribute;
nullif it is new.
-
removeAttribute
public <T> T removeAttribute(AttributeRepository.AttributeKey<T> key)
Description copied from interface:AttributeStoreRemoves the user-defined attribute- Specified by:
removeAttributein interfaceAttributeStore- Type Parameters:
T- The generic attribute type- Parameters:
key- The key of the attribute; must not benull.- Returns:
- The removed value;
nullif no previous value
-
clearAttributes
public void clearAttributes()
Description copied from interface:AttributeStoreRemoves all currently stored user-defined attributes- Specified by:
clearAttributesin interfaceAttributeStore
-
configureWindow
protected void configureWindow()
-
sendWindowAdjust
protected void sendWindowAdjust(long len) throws IOException- Throws:
IOException
-
-