Class BlockingClientTCPTransport
- java.lang.Object
-
- org.epics.pvaccess.impl.remote.codec.AbstractCodec
-
- org.epics.pvaccess.impl.remote.codec.impl.BlockingAbstractCodec
-
- org.epics.pvaccess.impl.remote.codec.impl.BlockingSocketAbstractCodec
-
- org.epics.pvaccess.impl.remote.tcp.BlockingTCPTransport
-
- org.epics.pvaccess.client.impl.remote.tcp.BlockingClientTCPTransport
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
,WritableByteChannel
,Lockable
,Transport
,TransportSendControl
,TransportSender
,SecurityPlugin.SecurityPluginControl
,org.epics.pvdata.misc.Timer.TimerCallback
,org.epics.pvdata.pv.DeserializableControl
,org.epics.pvdata.pv.SerializableControl
public class BlockingClientTCPTransport extends BlockingTCPTransport implements Transport, org.epics.pvdata.misc.Timer.TimerCallback, TransportSender, SecurityPlugin.SecurityPluginControl
Client TCP transport implementation.- Version:
- $Id$
- Author:
- Matej Sekoranja
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.epics.pvaccess.impl.remote.codec.AbstractCodec
AbstractCodec.ReadMode, AbstractCodec.WriteMode
-
-
Field Summary
-
Fields inherited from class org.epics.pvaccess.impl.remote.tcp.BlockingTCPTransport
context, incomingIR, outgoingIR, priority, remoteTransportRevision, responseHandler, verified, verifiedCalled
-
Fields inherited from class org.epics.pvaccess.impl.remote.codec.impl.BlockingSocketAbstractCodec
channel, socketAddress
-
Fields inherited from class org.epics.pvaccess.impl.remote.codec.AbstractCodec
blockingProcessQueue, command, flags, logger, MAX_ENSURE_BUFFER_SIZE, MAX_ENSURE_DATA_SIZE, MAX_ENSURE_SIZE, MAX_MESSAGE_PROCESS, MAX_MESSAGE_SEND, payloadSize, readMode, remoteTransportSocketReceiveBufferSize, sendBuffer, sendQueue, sendTo, socketBuffer, totalBytesSent, version, writeMode, writeOpReady
-
-
Constructor Summary
Constructors Constructor Description BlockingClientTCPTransport(Context context, SocketChannel channel, ResponseHandler responseHandler, int receiveBufferSize, TransportClient client, short remoteTransportRevision, float heartbeatInterval, short priority)
Client TCP transport constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acquire(TransportClient client)
Acquires transport.void
aliveNotification()
Alive notification.void
authenticationCompleted(org.epics.pvdata.pv.Status status)
void
authNZInitialize(Object data)
Used to initialize authNZ (select security plug-in).void
authNZMessage(org.epics.pvdata.pv.PVField data)
Pass data to the active security plug-in session.void
callback()
Live-check timer.void
changedTransport()
Changed transport (server restared) notify.void
close()
SecurityPlugin.SecuritySession
getSecuritySession()
protected void
internalClose()
Called to any resources just before closing transportvoid
lock()
void
release(TransportClient client)
Releases transport.void
send(ByteBuffer buffer, TransportSendControl control)
PVA connection validation responsevoid
sendSecurityPluginMessage(org.epics.pvdata.pv.PVField data)
void
timerStopped()
void
unlock()
-
Methods inherited from class org.epics.pvaccess.impl.remote.tcp.BlockingTCPTransport
cachedDeserialize, cachedSerialize, getContext, getPriority, getReceiveBufferSize, getRemoteAddress, getRevision, getSocketReceiveBufferSize, getType, internalDestroy, processApplicationMessage, processControlMessage, setRemoteRevision, setRemoteTransportReceiveBufferSize, setRemoteTransportSocketReceiveBufferSize, verified, verify
-
Methods inherited from class org.epics.pvaccess.impl.remote.codec.impl.BlockingSocketAbstractCodec
getLastReadBufferSocketAddress, invalidDataStreamHandler, read, write
-
Methods inherited from class org.epics.pvaccess.impl.remote.codec.impl.BlockingAbstractCodec
isOpen, readPollOne, receiveThread, scheduleSend, sendBufferFull, sendCompleted, sendThread, start, terminated, writePollOne
-
Methods inherited from class org.epics.pvaccess.impl.remote.codec.AbstractCodec
alignBuffer, alignData, alignedValue, clearSendQueue, endMessage, enqueueSendRequest, enqueueSendRequest, ensureBuffer, ensureData, flush, flushSerializeBuffer, processRead, processSendQueue, processWrite, putControlMessage, send, setByteOrder, setRecipient, setSenderThread, startMessage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.epics.pvdata.pv.DeserializableControl
alignData, cachedDeserialize, ensureData
-
Methods inherited from interface org.epics.pvaccess.impl.remote.Transport
enqueueSendRequest, getContext, getPriority, getReceiveBufferSize, getRemoteAddress, getRevision, getSocketReceiveBufferSize, getType, setByteOrder, setRemoteRevision, setRemoteTransportReceiveBufferSize, setRemoteTransportSocketReceiveBufferSize, verified, verify
-
-
-
-
Constructor Detail
-
BlockingClientTCPTransport
public BlockingClientTCPTransport(Context context, SocketChannel channel, ResponseHandler responseHandler, int receiveBufferSize, TransportClient client, short remoteTransportRevision, float heartbeatInterval, short priority) throws SocketException
Client TCP transport constructor.- Parameters:
context
- context where transport lives in.channel
- used socker channel.responseHandler
- response handler used to process PVA headers.receiveBufferSize
- receive buffer size.client
- transport client (owner, requestor).remoteTransportRevision
- remote transport revision.heartbeatInterval
- heartbeat interval in seconds.priority
- transport priority.- Throws:
SocketException
- thrown on any socket exception.
-
-
Method Detail
-
internalClose
protected void internalClose()
Description copied from class:BlockingTCPTransport
Called to any resources just before closing transport- Overrides:
internalClose
in classBlockingTCPTransport
- See Also:
BlockingTCPTransport.internalClose()
-
acquire
public boolean acquire(TransportClient client)
Acquires transport.
-
release
public void release(TransportClient client)
Releases transport.
-
aliveNotification
public final void aliveNotification()
Alive notification. This method needs to be called (by newly received data or beacon) at least once in this period, if not echo will be issued and if there is not reponse to it, transport will be considered as unresponsive.- Specified by:
aliveNotification
in interfaceTransport
-
timerStopped
public void timerStopped()
- Specified by:
timerStopped
in interfaceorg.epics.pvdata.misc.Timer.TimerCallback
-
callback
public void callback()
Live-check timer.- Specified by:
callback
in interfaceorg.epics.pvdata.misc.Timer.TimerCallback
- See Also:
Timer.TimerCallback.callback()
-
changedTransport
public void changedTransport()
Changed transport (server restared) notify.- Specified by:
changedTransport
in interfaceTransport
- Overrides:
changedTransport
in classBlockingTCPTransport
-
send
public void send(ByteBuffer buffer, TransportSendControl control)
PVA connection validation response- Specified by:
send
in interfaceTransportSender
- Parameters:
buffer
- buffer to send.control
- transport send control instance.
-
authNZInitialize
public void authNZInitialize(Object data)
Description copied from interface:Transport
Used to initialize authNZ (select security plug-in).- Specified by:
authNZInitialize
in interfaceTransport
- Parameters:
data
- any data.
-
authNZMessage
public void authNZMessage(org.epics.pvdata.pv.PVField data)
Description copied from interface:Transport
Pass data to the active security plug-in session.- Specified by:
authNZMessage
in interfaceTransport
- Parameters:
data
- the data (any data), can benull
.
-
sendSecurityPluginMessage
public void sendSecurityPluginMessage(org.epics.pvdata.pv.PVField data)
- Specified by:
sendSecurityPluginMessage
in interfaceSecurityPlugin.SecurityPluginControl
-
authenticationCompleted
public void authenticationCompleted(org.epics.pvdata.pv.Status status)
- Specified by:
authenticationCompleted
in interfaceSecurityPlugin.SecurityPluginControl
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classBlockingAbstractCodec
- Throws:
IOException
-
getSecuritySession
public SecurityPlugin.SecuritySession getSecuritySession()
- Specified by:
getSecuritySession
in interfaceTransport
-
-