public class VAPChannel extends BaseChannel
ISOMsg
,
ISOException
,
ISOChannel
cnt, header, incomingFilters, logger, originalRealm, outgoingFilters, overrideHeader, packager, realm, serverIn, serverInLock, serverOut, serverOutLock, serverSocket, socketFactory, usable
CONNECT, RX, SIZEOF_CNT, TX
Constructor and Description |
---|
VAPChannel()
Public constructor (used by Class.forName("...").newInstance())
|
VAPChannel(ISOPackager p)
Construct server ISOChannel
|
VAPChannel(ISOPackager p,
java.net.ServerSocket serverSocket)
constructs a server ISOChannel associated with a Server Socket
|
VAPChannel(java.lang.String host,
int port,
ISOPackager p)
Construct client ISOChannel
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDstId() |
protected ISOHeader |
getDynamicHeader(byte[] image)
The default header for VAPChannel is BASE1Header
|
protected int |
getHeaderLength() |
protected int |
getMessageLength() |
java.lang.String |
getSrcId() |
protected boolean |
isRejected(byte[] b) |
protected byte[] |
readHeader(int hLen)
This method reads in a Base 1 Header.
|
void |
send(ISOMsg m)
sends an ISOMsg over the TCP/IP session.
|
protected void |
sendMessageHeader(ISOMsg m,
int len) |
protected void |
sendMessageLength(int len) |
void |
setConfiguration(Configuration cfg)
Implements Configurable
Properties: host - destination host (if ClientChannel) port - port number (if ClientChannel) local-iface - local interfase to use (if ClientChannel) local-port - local port to bind (if ClientChannel) (host not present indicates a ServerChannel) |
void |
setDstId(java.lang.String dstid) |
void |
setSrcId(java.lang.String srcid) |
protected boolean |
shouldIgnore(byte[] b) |
accept, addFilter, addFilter, addIncomingFilter, addOutgoingFilter, applyIncomingFilters, applyIncomingFilters, applyOutgoingFilters, applyTimeout, clone, closeSocket, connect, connect, createISOMsg, createMsg, disconnect, getBytes, getChannel, getConfiguration, getCounters, getDynamicPackager, getDynamicPackager, getDynamicPackager, getExceptionHandlers, getHeader, getHeaderLength, getHeaderLength, getHost, getIncomingFilters, getLogger, getMaxPacketLength, getMessage, getMessageTrailer, getMessageTrailler, getName, getOriginalRealm, getOutgoingFilters, getPackager, getPort, getRealm, getServerSocket, getSocket, getSocketFactory, getSoLingerSeconds, getTimeout, isConnected, isExpectKeepAlive, isOverrideHeader, isSoLingerOn, newSocket, newSocket, pack, postConnectHook, receive, reconnect, removeFilter, removeFilter, removeIncomingFilter, removeOutgoingFilter, resetCounters, send, sendKeepAlive, sendMessage, sendMessageTrailer, sendMessageTrailler, sendMessageTrailler, setHeader, setHeader, setHost, setHost, setIncomingFilters, setLocalAddress, setLogger, setMaxPacketLength, setName, setOutgoingFilters, setOverrideHeader, setPackager, setPort, setServerSocket, setSocketFactory, setSoLinger, setTimeout, setUsable, streamReceive, unpack
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addHandler, addHandler, handle, removeHandler, removeHandler, removeHandlers
public VAPChannel()
public VAPChannel(java.lang.String host, int port, ISOPackager p)
host
- server TCP Addressport
- server port numberp
- an ISOPackager (should be ISO87BPackager)ISO87BPackager
public VAPChannel(ISOPackager p) throws java.io.IOException
p
- an ISOPackager (should be ISO87BPackager)java.io.IOException
ISO87BPackager
public VAPChannel(ISOPackager p, java.net.ServerSocket serverSocket) throws java.io.IOException
p
- an ISOPackagerserverSocket
- where to accept a connectionjava.io.IOException
ISOPackager
public void setSrcId(java.lang.String srcid)
public java.lang.String getSrcId()
public void setDstId(java.lang.String dstid)
public java.lang.String getDstId()
protected ISOHeader getDynamicHeader(byte[] image)
getDynamicHeader
in class BaseChannel
image
- message imageprotected byte[] readHeader(int hLen) throws java.io.IOException
readHeader
in class BaseChannel
hLen
- java.io.IOException
protected void sendMessageLength(int len) throws java.io.IOException
sendMessageLength
in class BaseChannel
java.io.IOException
protected void sendMessageHeader(ISOMsg m, int len) throws java.io.IOException
sendMessageHeader
in class BaseChannel
m
- the messagelen
- already packed message len (to avoid re-pack)java.io.IOException
protected int getMessageLength() throws java.io.IOException, ISOException
getMessageLength
in class BaseChannel
java.io.IOException
ISOException
protected int getHeaderLength()
getHeaderLength
in class BaseChannel
protected boolean isRejected(byte[] b)
isRejected
in class BaseChannel
protected boolean shouldIgnore(byte[] b)
shouldIgnore
in class BaseChannel
public void send(ISOMsg m) throws java.io.IOException, ISOException
send
in interface ISOChannel
send
in interface ISOSource
send
in class BaseChannel
m
- the Message to be sentjava.io.IOException
ISOException
ISOChannel.send(org.jpos.iso.ISOMsg)
public void setConfiguration(Configuration cfg) throws ConfigurationException
BaseChannel
setConfiguration
in interface Configurable
setConfiguration
in class BaseChannel
cfg
- ConfigurationConfigurationException