Package org.jpos.iso
Class BaseChannel
- java.lang.Object
-
- java.util.Observable
-
- org.jpos.iso.BaseChannel
-
- All Implemented Interfaces:
java.lang.Cloneable
,Configurable
,ExceptionHandlerAware
,BaseChannelMBean
,ClientChannel
,FactoryChannel
,FilteredChannel
,ISOChannel
,ISOSource
,ServerChannel
,LogSource
- Direct Known Subclasses:
AmexChannel
,ASCIIChannel
,BASE24Channel
,BASE24TCPChannel
,BCDChannel
,CSChannel
,GICCChannel
,GZIPChannel
,HEXChannel
,LogChannel
,NACChannel
,NCCChannel
,PADChannel
,PostChannel
,RawChannel
,RBPChannel
,TelnetXMLChannel
,VAPChannel
,X25Channel
,XMLChannel
public abstract class BaseChannel extends java.util.Observable implements FilteredChannel, ClientChannel, ServerChannel, FactoryChannel, LogSource, Configurable, BaseChannelMBean, java.lang.Cloneable, ExceptionHandlerAware
ISOChannel is an abstract class that provides functionality that allows the transmission and reception of ISO 8583 Messages over a TCP/IP session.This class is not thread-safe.
ISOChannel is Observable in order to support GUI components such as ISOChannelPanel.
It now support the new Logger architecture so we will probably setup ISOChannelPanel to be a LogListener instead of being an Observer in future releases.- See Also:
ISOMsg
,MUX
,ISOException
,CSChannel
,Logger
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
cnt
protected byte[]
header
protected java.util.List<ISOFilter>
incomingFilters
protected Logger
logger
protected java.lang.String
originalRealm
protected java.util.List<ISOFilter>
outgoingFilters
protected boolean
overrideHeader
protected ISOPackager
packager
protected java.lang.String
realm
protected java.io.DataInputStream
serverIn
protected java.lang.Object
serverInLock
protected java.io.DataOutputStream
serverOut
protected java.lang.Object
serverOutLock
protected java.net.ServerSocket
serverSocket
protected ISOClientSocketFactory
socketFactory
protected boolean
usable
-
Fields inherited from interface org.jpos.iso.ISOChannel
CONNECT, RX, SIZEOF_CNT, TX
-
-
Constructor Summary
Constructors Constructor Description BaseChannel()
constructor shared by server and client ISOChannels (which have different signatures)BaseChannel(java.lang.String host, int port, ISOPackager p)
constructs a client ISOChannelBaseChannel(ISOPackager p)
constructs a server ISOChannelBaseChannel(ISOPackager p, java.net.ServerSocket serverSocket)
constructs a server ISOChannel associated with a Server Socket
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(java.net.ServerSocket s)
Accepts connectionvoid
addFilter(ISOFilter filter)
void
addFilter(ISOFilter filter, int direction)
void
addIncomingFilter(ISOFilter filter)
void
addOutgoingFilter(ISOFilter filter)
protected ISOMsg
applyIncomingFilters(ISOMsg m, byte[] header, byte[] image, LogEvent evt)
protected ISOMsg
applyIncomingFilters(ISOMsg m, LogEvent evt)
protected ISOMsg
applyOutgoingFilters(ISOMsg m, LogEvent evt)
protected void
applyTimeout()
sets timeout, and also keep alivejava.lang.Object
clone()
Expose channel clonning interfaceprotected void
closeSocket()
void
connect()
Connects client ISOChannel to serverprotected void
connect(java.net.Socket socket)
setup I/O Streams from socketprotected ISOMsg
createISOMsg()
protected ISOMsg
createMsg()
support old factory method name for backward compatibilityvoid
disconnect()
disconnects the TCP/IP session.int
getBytes(byte[] b)
Low level receivestatic ISOChannel
getChannel(java.lang.String name)
Configuration
getConfiguration()
int[]
getCounters()
protected ISOHeader
getDynamicHeader(byte[] image)
Allow subclasses to override the Default header on incoming messages.protected ISOPackager
getDynamicPackager(byte[] image)
allow subclasses to override default packager on incoming messagesprotected ISOPackager
getDynamicPackager(byte[] header, byte[] image)
allow subclasses to override default packager on incoming messagesprotected ISOPackager
getDynamicPackager(ISOMsg m)
allow subclasses to override default packager on outgoing messagesjava.util.Map<java.lang.Class<? extends java.lang.Exception>,java.util.List<ExceptionHandler>>
getExceptionHandlers()
byte[]
getHeader()
protected int
getHeaderLength()
protected int
getHeaderLength(byte[] b)
protected int
getHeaderLength(ISOMsg m)
java.lang.String
getHost()
java.util.Collection<ISOFilter>
getIncomingFilters()
Logger
getLogger()
int
getMaxPacketLength()
protected void
getMessage(byte[] b, int offset, int len)
protected int
getMessageLength()
protected void
getMessageTrailer(ISOMsg m)
Read some trailer data from this channel and optionally store it in the incoming ISOMsg.protected void
getMessageTrailler()
Deprecated.use getMessageTrailer(ISOMsg m) instead.java.lang.String
getName()
java.lang.String
getOriginalRealm()
java.util.Collection<ISOFilter>
getOutgoingFilters()
ISOPackager
getPackager()
int
getPort()
java.lang.String
getRealm()
java.net.ServerSocket
getServerSocket()
java.net.Socket
getSocket()
ISOClientSocketFactory
getSocketFactory()
Gets the ISOClientSocketFactory (may be null)int
getSoLingerSeconds()
int
getTimeout()
boolean
isConnected()
boolean
isExpectKeepAlive()
boolean
isOverrideHeader()
protected boolean
isRejected(byte[] b)
boolean
isSoLingerOn()
protected java.net.Socket
newSocket(java.lang.String[] hosts, int[] ports, LogEvent evt)
protected java.net.Socket
newSocket(java.lang.String host, int port)
factory method pattern (as suggested by [email protected])protected byte[]
pack(ISOMsg m)
protected void
postConnectHook()
protected byte[]
readHeader(int hLen)
Reads in a message header.ISOMsg
receive()
Waits and receive an ISOMsg over the TCP/IP sessionvoid
reconnect()
Issues a disconnect followed by a connectvoid
removeFilter(ISOFilter filter)
void
removeFilter(ISOFilter filter, int direction)
void
removeIncomingFilter(ISOFilter filter)
void
removeOutgoingFilter(ISOFilter filter)
void
resetCounters()
reset stat infovoid
send(byte[] b)
sends a byte[] over the TCP/IP sessionvoid
send(ISOMsg m)
sends an ISOMsg over the TCP/IP sessionvoid
sendKeepAlive()
Sends a high-level keep-alive message (zero length)protected void
sendMessage(byte[] b, int offset, int len)
protected void
sendMessageHeader(ISOMsg m, int len)
protected void
sendMessageLength(int len)
protected void
sendMessageTrailer(ISOMsg m, byte[] b)
Send a Message trailer.protected void
sendMessageTrailler(ISOMsg m, byte[] b)
Deprecated.use sendMessageTrailer(ISOMsg m, byte[] b instead.protected void
sendMessageTrailler(ISOMsg m, int len)
Deprecated.use sendMessageTrailer(ISOMsg m, byte[] b) instead.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
setHeader(byte[] header)
void
setHeader(java.lang.String header)
void
setHost(java.lang.String host)
void
setHost(java.lang.String host, int port)
initialize an ISOChannelvoid
setIncomingFilters(java.util.Collection filters)
void
setLocalAddress(java.lang.String iface, int port)
initialize an ISOChannelvoid
setLogger(Logger logger, java.lang.String realm)
void
setMaxPacketLength(int maxPacketLength)
void
setName(java.lang.String name)
associates this ISOChannel with a name using NameRegistrarvoid
setOutgoingFilters(java.util.Collection filters)
void
setOverrideHeader(boolean overrideHeader)
void
setPackager(ISOPackager p)
set Packager for channelvoid
setPort(int port)
void
setServerSocket(java.net.ServerSocket sock)
Associates this ISOChannel with a server socketvoid
setSocketFactory(ISOClientSocketFactory socketFactory)
Sets the specified Socket Factory to create socketsvoid
setSoLinger(boolean on, int linger)
Socket SO_LINGER option to use when closing the socket.void
setTimeout(int timeout)
sets socket timeout (as suggested by Leonard Thomas) void
setUsable(boolean b)
protected boolean
shouldIgnore(byte[] b)
protected byte[]
streamReceive()
protected void
unpack(ISOMsg m, byte[] b)
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jpos.core.handlers.exception.ExceptionHandlerAware
addHandler, addHandler, handle, removeHandler, removeHandler, removeHandlers
-
-
-
-
Field Detail
-
usable
protected boolean usable
-
overrideHeader
protected boolean overrideHeader
-
serverIn
protected java.io.DataInputStream serverIn
-
serverOut
protected java.io.DataOutputStream serverOut
-
serverInLock
protected java.lang.Object serverInLock
-
serverOutLock
protected java.lang.Object serverOutLock
-
packager
protected ISOPackager packager
-
serverSocket
protected java.net.ServerSocket serverSocket
-
incomingFilters
protected java.util.List<ISOFilter> incomingFilters
-
outgoingFilters
protected java.util.List<ISOFilter> outgoingFilters
-
socketFactory
protected ISOClientSocketFactory socketFactory
-
cnt
protected int[] cnt
-
realm
protected java.lang.String realm
-
originalRealm
protected java.lang.String originalRealm
-
header
protected byte[] header
-
-
Constructor Detail
-
BaseChannel
public BaseChannel()
constructor shared by server and client ISOChannels (which have different signatures)
-
BaseChannel
public BaseChannel(java.lang.String host, int port, ISOPackager p)
constructs a client ISOChannel- Parameters:
host
- server TCP Addressport
- server port numberp
- an ISOPackager- See Also:
ISOPackager
-
BaseChannel
public BaseChannel(ISOPackager p) throws java.io.IOException
constructs a server ISOChannel- Parameters:
p
- an ISOPackager- Throws:
java.io.IOException
- on error- See Also:
ISOPackager
-
BaseChannel
public BaseChannel(ISOPackager p, java.net.ServerSocket serverSocket) throws java.io.IOException
constructs a server ISOChannel associated with a Server Socket- Parameters:
p
- an ISOPackagerserverSocket
- where to accept a connection- Throws:
java.io.IOException
- on error- See Also:
ISOPackager
-
-
Method Detail
-
setHost
public void setHost(java.lang.String host, int port)
initialize an ISOChannel- Specified by:
setHost
in interfaceClientChannel
- Parameters:
host
- server TCP Addressport
- server port number
-
setLocalAddress
public void setLocalAddress(java.lang.String iface, int port)
initialize an ISOChannel- Parameters:
iface
- server TCP Addressport
- server port number
-
setHost
public void setHost(java.lang.String host)
- Specified by:
setHost
in interfaceBaseChannelMBean
- Parameters:
host
- to connect (client ISOChannel)
-
setPort
public void setPort(int port)
- Specified by:
setPort
in interfaceBaseChannelMBean
- Parameters:
port
- to connect (client ISOChannel)
-
getHost
public java.lang.String getHost()
- Specified by:
getHost
in interfaceBaseChannelMBean
- Specified by:
getHost
in interfaceClientChannel
- Returns:
- hostname (may be null)
-
getPort
public int getPort()
- Specified by:
getPort
in interfaceBaseChannelMBean
- Specified by:
getPort
in interfaceClientChannel
- Returns:
- port number
-
setPackager
public void setPackager(ISOPackager p)
set Packager for channel- Specified by:
setPackager
in interfaceISOChannel
- Parameters:
p
- an ISOPackager- See Also:
ISOPackager
-
getPackager
public ISOPackager getPackager()
- Specified by:
getPackager
in interfaceISOChannel
- Returns:
- current packager
-
setServerSocket
public void setServerSocket(java.net.ServerSocket sock)
Associates this ISOChannel with a server socket- Parameters:
sock
- where to accept a connection
-
getExceptionHandlers
public java.util.Map<java.lang.Class<? extends java.lang.Exception>,java.util.List<ExceptionHandler>> getExceptionHandlers()
- Specified by:
getExceptionHandlers
in interfaceExceptionHandlerAware
- Returns:
- A map of exception classes to exception handlers. These handlers only execute if the exception matches.
-
resetCounters
public void resetCounters()
reset stat info
-
getCounters
public int[] getCounters()
- Returns:
- counters
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceBaseChannelMBean
- Specified by:
isConnected
in interfaceISOChannel
- Specified by:
isConnected
in interfaceISOSource
- Returns:
- the connection state
-
connect
protected void connect(java.net.Socket socket) throws java.io.IOException
setup I/O Streams from socket- Parameters:
socket
- a Socket (client or server)- Throws:
java.io.IOException
- on error
-
postConnectHook
protected void postConnectHook() throws java.io.IOException
- Throws:
java.io.IOException
-
newSocket
protected java.net.Socket newSocket(java.lang.String host, int port) throws java.io.IOException
factory method pattern (as suggested by [email protected])- Parameters:
host
- remote hostport
- remote port- Returns:
- newly created socket
- Throws:
java.io.IOException
- on error Use Socket factory if exists. If it is missing create a normal socket- See Also:
ISOClientSocketFactory
-
newSocket
protected java.net.Socket newSocket(java.lang.String[] hosts, int[] ports, LogEvent evt) throws java.io.IOException
- Throws:
java.io.IOException
-
getSocket
public java.net.Socket getSocket()
- Returns:
- current socket
-
getServerSocket
public java.net.ServerSocket getServerSocket()
- Returns:
- current serverSocket
-
setTimeout
public void setTimeout(int timeout) throws java.net.SocketException
sets socket timeout (as suggested by Leonard Thomas) - Parameters:
timeout
- in milliseconds- Throws:
java.net.SocketException
- on error
-
getTimeout
public int getTimeout()
-
applyTimeout
protected void applyTimeout() throws java.net.SocketException
sets timeout, and also keep alive- Throws:
java.net.SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger)
Socket SO_LINGER option to use when closing the socket.- See Also:
Socket.setSoLinger(boolean, int)
-
isSoLingerOn
public boolean isSoLingerOn()
-
getSoLingerSeconds
public int getSoLingerSeconds()
-
connect
public void connect() throws java.io.IOException
Connects client ISOChannel to server- Specified by:
connect
in interfaceBaseChannelMBean
- Specified by:
connect
in interfaceISOChannel
- Throws:
java.io.IOException
-
accept
public void accept(java.net.ServerSocket s) throws java.io.IOException
Accepts connection- Specified by:
accept
in interfaceServerChannel
- Throws:
java.io.IOException
-
setUsable
public void setUsable(boolean b)
- Specified by:
setUsable
in interfaceISOChannel
- Parameters:
b
- - new Usable state (used by ISOMUX internals to flag as unusable in order to force a reconnection)
-
getDynamicPackager
protected ISOPackager getDynamicPackager(ISOMsg m)
allow subclasses to override default packager on outgoing messages- Parameters:
m
- outgoing ISOMsg- Returns:
- ISOPackager
-
getDynamicPackager
protected ISOPackager getDynamicPackager(byte[] image)
allow subclasses to override default packager on incoming messages- Parameters:
image
- incoming message image- Returns:
- ISOPackager
-
getDynamicPackager
protected ISOPackager getDynamicPackager(byte[] header, byte[] image)
allow subclasses to override default packager on incoming messages- Parameters:
header
- message headerimage
- incoming message image- Returns:
- ISOPackager
-
getDynamicHeader
protected ISOHeader getDynamicHeader(byte[] image)
Allow subclasses to override the Default header on incoming messages.- Parameters:
image
- message image- Returns:
- ISOHeader instance
-
sendMessageLength
protected void sendMessageLength(int len) throws java.io.IOException
- Throws:
java.io.IOException
-
sendMessageHeader
protected void sendMessageHeader(ISOMsg m, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
sendMessageTrailler
protected void sendMessageTrailler(ISOMsg m, int len) throws java.io.IOException
Deprecated.use sendMessageTrailer(ISOMsg m, byte[] b) instead.- Parameters:
m
- a reference to the ISOMsglen
- the packed image length- Throws:
java.io.IOException
- on error
-
sendMessageTrailler
protected void sendMessageTrailler(ISOMsg m, byte[] b) throws java.io.IOException
Deprecated.use sendMessageTrailer(ISOMsg m, byte[] b instead.- Throws:
java.io.IOException
-
sendMessageTrailer
protected void sendMessageTrailer(ISOMsg m, byte[] b) throws java.io.IOException
Send a Message trailer.- Parameters:
m
- The unpacked ISOMsg.b
- The packed ISOMsg image.- Throws:
java.io.IOException
-
getMessageTrailler
protected void getMessageTrailler() throws java.io.IOException
Deprecated.use getMessageTrailer(ISOMsg m) instead.- Throws:
java.io.IOException
-
getMessageTrailer
protected void getMessageTrailer(ISOMsg m) throws java.io.IOException
Read some trailer data from this channel and optionally store it in the incoming ISOMsg.- Parameters:
m
- The ISOMessage to store the trailer data.- Throws:
java.io.IOException
-
getMessage
protected void getMessage(byte[] b, int offset, int len) throws java.io.IOException, ISOException
- Throws:
java.io.IOException
ISOException
-
getMessageLength
protected int getMessageLength() throws java.io.IOException, ISOException
- Throws:
java.io.IOException
ISOException
-
getHeaderLength
protected int getHeaderLength()
-
getHeaderLength
protected int getHeaderLength(byte[] b)
-
getHeaderLength
protected int getHeaderLength(ISOMsg m)
-
streamReceive
protected byte[] streamReceive() throws java.io.IOException
- Throws:
java.io.IOException
-
sendMessage
protected void sendMessage(byte[] b, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
send
public void send(ISOMsg m) throws java.io.IOException, ISOException
sends an ISOMsg over the TCP/IP session- Specified by:
send
in interfaceISOChannel
- Specified by:
send
in interfaceISOSource
- Parameters:
m
- the Message to be sent- Throws:
java.io.IOException
ISOException
-
send
public void send(byte[] b) throws java.io.IOException, ISOException
sends a byte[] over the TCP/IP session- Specified by:
send
in interfaceISOChannel
- Parameters:
b
- the byte array to be sent- Throws:
java.io.IOException
ISOException
-
sendKeepAlive
public void sendKeepAlive() throws java.io.IOException
Sends a high-level keep-alive message (zero length)- Throws:
java.io.IOException
- on exception
-
isExpectKeepAlive
public boolean isExpectKeepAlive()
-
isRejected
protected boolean isRejected(byte[] b)
-
shouldIgnore
protected boolean shouldIgnore(byte[] b)
-
createMsg
protected ISOMsg createMsg()
support old factory method name for backward compatibility- Returns:
- newly created ISOMsg
-
createISOMsg
protected ISOMsg createISOMsg()
-
readHeader
protected byte[] readHeader(int hLen) throws java.io.IOException
Reads in a message header.- Parameters:
hLen
- The Length og the reader to read- Returns:
- The header bytes that were read in
- Throws:
java.io.IOException
- on error
-
receive
public ISOMsg receive() throws java.io.IOException, ISOException
Waits and receive an ISOMsg over the TCP/IP session- Specified by:
receive
in interfaceISOChannel
- Returns:
- the Message received
- Throws:
java.io.IOException
ISOException
-
getBytes
public int getBytes(byte[] b) throws java.io.IOException
Low level receive- Parameters:
b
- byte array- Returns:
- the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
- Throws:
java.io.IOException
- on error
-
disconnect
public void disconnect() throws java.io.IOException
disconnects the TCP/IP session. The instance is ready for a reconnection. There is no need to create a new ISOChannel- Specified by:
disconnect
in interfaceBaseChannelMBean
- Specified by:
disconnect
in interfaceISOChannel
- Throws:
java.io.IOException
-
reconnect
public void reconnect() throws java.io.IOException
Issues a disconnect followed by a connect- Specified by:
reconnect
in interfaceBaseChannelMBean
- Specified by:
reconnect
in interfaceISOChannel
- Throws:
java.io.IOException
-
getOriginalRealm
public java.lang.String getOriginalRealm()
-
setName
public void setName(java.lang.String name)
associates this ISOChannel with a name using NameRegistrar- Specified by:
setName
in interfaceISOChannel
- Parameters:
name
- name to register- See Also:
NameRegistrar
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceISOChannel
- Returns:
- this ISOChannel's name ("" if no name was set)
-
addFilter
public void addFilter(ISOFilter filter, int direction)
- Parameters:
filter
- filter to adddirection
- ISOMsg.INCOMING, ISOMsg.OUTGOING, 0 for both
-
addIncomingFilter
public void addIncomingFilter(ISOFilter filter)
- Specified by:
addIncomingFilter
in interfaceFilteredChannel
- Parameters:
filter
- incoming filter to add
-
addOutgoingFilter
public void addOutgoingFilter(ISOFilter filter)
- Specified by:
addOutgoingFilter
in interfaceFilteredChannel
- Parameters:
filter
- outgoing filter to add
-
addFilter
public void addFilter(ISOFilter filter)
- Specified by:
addFilter
in interfaceFilteredChannel
- Parameters:
filter
- filter to add (both directions, incoming/outgoing)
-
removeFilter
public void removeFilter(ISOFilter filter, int direction)
- Parameters:
filter
- filter to removedirection
- ISOMsg.INCOMING, ISOMsg.OUTGOING, 0 for both
-
removeFilter
public void removeFilter(ISOFilter filter)
- Specified by:
removeFilter
in interfaceFilteredChannel
- Parameters:
filter
- filter to remove (both directions)
-
removeIncomingFilter
public void removeIncomingFilter(ISOFilter filter)
- Specified by:
removeIncomingFilter
in interfaceFilteredChannel
- Parameters:
filter
- incoming filter to remove
-
removeOutgoingFilter
public void removeOutgoingFilter(ISOFilter filter)
- Specified by:
removeOutgoingFilter
in interfaceFilteredChannel
- Parameters:
filter
- outgoing filter to remove
-
applyOutgoingFilters
protected ISOMsg applyOutgoingFilters(ISOMsg m, LogEvent evt) throws ISOFilter.VetoException
- Throws:
ISOFilter.VetoException
-
applyIncomingFilters
protected ISOMsg applyIncomingFilters(ISOMsg m, LogEvent evt) throws ISOFilter.VetoException
- Throws:
ISOFilter.VetoException
-
applyIncomingFilters
protected ISOMsg applyIncomingFilters(ISOMsg m, byte[] header, byte[] image, LogEvent evt) throws ISOFilter.VetoException
- Throws:
ISOFilter.VetoException
-
unpack
protected void unpack(ISOMsg m, byte[] b) throws ISOException
- Throws:
ISOException
-
pack
protected byte[] pack(ISOMsg m) throws ISOException
- Throws:
ISOException
-
setConfiguration
public void setConfiguration(Configuration cfg) throws ConfigurationException
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)
- Specified by:
setConfiguration
in interfaceConfigurable
- Parameters:
cfg
- Configuration- Throws:
ConfigurationException
-
getConfiguration
public Configuration getConfiguration()
-
getIncomingFilters
public java.util.Collection<ISOFilter> getIncomingFilters()
- Specified by:
getIncomingFilters
in interfaceFilteredChannel
- Returns:
- Collection containing all incoming filters
-
getOutgoingFilters
public java.util.Collection<ISOFilter> getOutgoingFilters()
- Specified by:
getOutgoingFilters
in interfaceFilteredChannel
- Returns:
- Collection containing all outgoing filters
-
setIncomingFilters
public void setIncomingFilters(java.util.Collection filters)
- Specified by:
setIncomingFilters
in interfaceFilteredChannel
- Parameters:
filters
- incoming filter set
-
setOutgoingFilters
public void setOutgoingFilters(java.util.Collection filters)
- Specified by:
setOutgoingFilters
in interfaceFilteredChannel
- Parameters:
filters
- outgoing filter set
-
setHeader
public void setHeader(byte[] header)
-
setHeader
public void setHeader(java.lang.String header)
-
getHeader
public byte[] getHeader()
-
setOverrideHeader
public void setOverrideHeader(boolean overrideHeader)
-
isOverrideHeader
public boolean isOverrideHeader()
-
getChannel
public static ISOChannel getChannel(java.lang.String name) throws NameRegistrar.NotFoundException
- Parameters:
name
- the Channel's name (without the "channel." prefix)- Returns:
- ISOChannel instance with given name.
- Throws:
NameRegistrar.NotFoundException
- See Also:
NameRegistrar
-
getSocketFactory
public ISOClientSocketFactory getSocketFactory()
Gets the ISOClientSocketFactory (may be null)- Returns:
- ISOClientSocketFactory
- Since:
- 1.3.3 \
- See Also:
ISOClientSocketFactory
-
setSocketFactory
public void setSocketFactory(ISOClientSocketFactory socketFactory)
Sets the specified Socket Factory to create sockets- Specified by:
setSocketFactory
in interfaceFactoryChannel
- Parameters:
socketFactory
- the ISOClientSocketFactory- Since:
- 1.3.3
- See Also:
ISOClientSocketFactory
-
getMaxPacketLength
public int getMaxPacketLength()
-
setMaxPacketLength
public void setMaxPacketLength(int maxPacketLength)
-
closeSocket
protected void closeSocket() throws java.io.IOException
- Throws:
java.io.IOException
-
clone
public java.lang.Object clone()
Description copied from interface:ISOChannel
Expose channel clonning interface- Specified by:
clone
in interfaceISOChannel
- Overrides:
clone
in classjava.lang.Object
-
-