Class MsgOriginator
- java.lang.Object
-
- com.automation_pros.odva.cip.core.MsgOriginator
-
- All Implemented Interfaces:
AppConsumer
,AppLinkBase
,CipMsgProcessor
,LinkProducer
public class MsgOriginator extends java.lang.Object implements CipMsgProcessor, LinkProducer, AppConsumer
-
-
Field Summary
Fields Modifier and Type Field Description protected ConxInstance
conx
protected Deadline
conxdl
protected java.util.Map<java.lang.Short,CipRequest>
pending
protected java.nio.ByteBuffer
resendContent
protected long
resendInterval
protected long
resendTarget
protected java.util.concurrent.atomic.AtomicInteger
seq
static org.slf4j.Logger
sLogger
-
Constructor Summary
Constructors Constructor Description MsgOriginator(FwdOpenRsp reply)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appConsume(long txID, java.nio.ByteBuffer payload)
Application Consumer objects handle data flow from connections to application objects.void
disconnect()
When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up.int
getMaxMsg()
Return this message processor's max allowed message size in bytes.boolean
isDisconnected()
void
linkProduce(long txID, java.nio.ByteBuffer payload)
Link Producer objects handle data flow from generic connections to abstract transport links.protected long
prune(long now)
protected void
resend(long now)
void
send(CipRequest req)
Core method to send or execute a request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.automation_pros.odva.cip.types.CipMsgProcessor
send
-
-
-
-
Field Detail
-
sLogger
public static final org.slf4j.Logger sLogger
-
conx
protected final ConxInstance conx
-
conxdl
protected final Deadline conxdl
-
seq
protected final java.util.concurrent.atomic.AtomicInteger seq
-
pending
protected final java.util.Map<java.lang.Short,CipRequest> pending
-
resendInterval
protected final long resendInterval
-
resendTarget
protected volatile long resendTarget
-
resendContent
protected volatile java.nio.ByteBuffer resendContent
-
-
Constructor Detail
-
MsgOriginator
public MsgOriginator(FwdOpenRsp reply)
-
-
Method Detail
-
prune
protected long prune(long now)
-
send
public void send(CipRequest req)
Description copied from interface:CipMsgProcessor
Core method to send or execute a request.- Specified by:
send
in interfaceCipMsgProcessor
-
resend
protected void resend(long now)
-
getMaxMsg
public int getMaxMsg()
Description copied from interface:CipMsgProcessor
Return this message processor's max allowed message size in bytes. Applies to both request and reply.- Specified by:
getMaxMsg
in interfaceCipMsgProcessor
- Returns:
-
appConsume
public void appConsume(long txID, java.nio.ByteBuffer payload)
Description copied from interface:AppConsumer
Application Consumer objects handle data flow from connections to application objects. Connectable objects will provide instances with the appropriate buffer handling and ownership tracking, including removal/use of CIP short sequence numbers and originator idle/run mode indicators. Bridge connections cross connect their application consumers, passing the complete payload to the peer's appProduce() method.- Specified by:
appConsume
in interfaceAppConsumer
- Parameters:
txID
- Transport layer transaction ID to use with any reply.payload
- Complete CIP data payload, including CIP sequence number, if any.
-
linkProduce
public void linkProduce(long txID, java.nio.ByteBuffer payload)
Description copied from interface:LinkProducer
Link Producer objects handle data flow from generic connections to abstract transport links. When carrying messaging traffic, the txID uniquely identifies the request/reply pair; typically the encapsulation sender context.- Specified by:
linkProduce
in interfaceLinkProducer
- Parameters:
txID
- Transport layer transaction ID uniquely identifying this message or reply, if applicable. Zero for I/O connections.payload
- Complete CIP data payload, including CIP sequence number, if any.
-
disconnect
public void disconnect()
Description copied from interface:AppLinkBase
When a connection is closed or an application forces a disconnect, this shutdown method is called to clean up. It should close the connection when called by the application.- Specified by:
disconnect
in interfaceAppLinkBase
-
isDisconnected
public boolean isDisconnected()
- Specified by:
isDisconnected
in interfaceAppLinkBase
-
-