|
jPOS 1.6.1 API Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
org.jpos.iso.BaseChannel
public abstract class BaseChannel
ISOChannel is an abstract class that provides functionality that allows the transmision and reception of ISO 8583 Messages over a TCP/IP session.
It is not thread-safe, ISOMUX takes care of the synchronization details
ISOChannel is Observable in order to suport GUI components
such as ISOChannelPanel.
It now support the new Logger architecture so we will
probably setup ISOChannelPanel to be a LogListener insteado
of being an Observer in future releases.
ISOMsg,
ISOMUX,
ISOException,
CSChannel,
Logger| Field Summary |
|---|
| Fields inherited from interface org.jpos.iso.ISOChannel |
|---|
CONNECT, RX, SIZEOF_CNT, TX |
| Constructor Summary | |
|---|---|
BaseChannel()
constructor shared by server and client ISOChannels (which have different signatures) |
|
BaseChannel(ISOPackager p)
constructs a server ISOChannel |
|
BaseChannel(ISOPackager p,
java.net.ServerSocket serverSocket)
constructs a server ISOChannel associated with a Server Socket |
|
BaseChannel(java.lang.String host,
int port,
ISOPackager p)
constructs a client ISOChannel |
|
| Method Summary | |
|---|---|
void |
accept(java.net.ServerSocket s)
Accepts connection |
void |
addFilter(ISOFilter filter)
|
void |
addFilter(ISOFilter filter,
int direction)
|
void |
addIncomingFilter(ISOFilter filter)
|
void |
addOutgoingFilter(ISOFilter filter)
|
java.lang.Object |
clone()
Expose channel clonning interface |
void |
connect()
Connects client ISOChannel to server |
void |
disconnect()
disconnects the TCP/IP session. |
int |
getBytes(byte[] b)
Low level receive |
static ISOChannel |
getChannel(java.lang.String name)
|
Configuration |
getConfiguration()
|
int[] |
getCounters()
|
byte[] |
getHeader()
|
java.lang.String |
getHost()
|
java.util.Collection |
getIncomingFilters()
|
Logger |
getLogger()
|
int |
getMaxPacketLength()
|
java.lang.String |
getName()
|
java.lang.String |
getOriginalRealm()
|
java.util.Collection |
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 |
getTimeout()
|
boolean |
isConnected()
|
boolean |
isOverrideHeader()
|
ISOMsg |
receive()
Waits and receive an ISOMsg over the TCP/IP session |
void |
reconnect()
Issues a disconnect followed by a connect |
void |
removeFilter(ISOFilter filter)
|
void |
removeFilter(ISOFilter filter,
int direction)
|
void |
removeIncomingFilter(ISOFilter filter)
|
void |
removeOutgoingFilter(ISOFilter filter)
|
void |
resetCounters()
reset stat info |
void |
send(ISOMsg m)
sends an ISOMsg over the TCP/IP session |
void |
sendKeepAlive()
Sends a high-level keep-alive message (zero length) |
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 ISOChannel |
void |
setIncomingFilters(java.util.Collection filters)
|
void |
setLocalAddress(java.lang.String iface,
int port)
initialize an ISOChannel |
void |
setLogger(Logger logger,
java.lang.String realm)
|
void |
setMaxPacketLength(int maxPacketLength)
|
void |
setName(java.lang.String name)
associates this ISOChannel with a name using NameRegistrar |
void |
setOutgoingFilters(java.util.Collection filters)
|
void |
setOverrideHeader(boolean overrideHeader)
|
void |
setPackager(ISOPackager p)
set Packager for channel |
void |
setPort(int port)
|
void |
setServerSocket(java.net.ServerSocket sock)
Associates this ISOChannel with a server socket |
void |
setSocketFactory(ISOClientSocketFactory socketFactory)
Sets the specified Socket Factory to create sockets |
void |
setTimeout(int timeout)
sets socket timeout (as suggested by Leonard Thomas |
void |
setUsable(boolean b)
|
| Methods inherited from class java.util.Observable |
|---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseChannel()
public BaseChannel(java.lang.String host,
int port,
ISOPackager p)
host - server TCP Addressport - server port numberp - an ISOPackagerISOPackager
public BaseChannel(ISOPackager p)
throws java.io.IOException
p - an ISOPackager
java.io.IOExceptionISOPackager
public BaseChannel(ISOPackager p,
java.net.ServerSocket serverSocket)
throws java.io.IOException
p - an ISOPackagerserverSocket - where to accept a connection
java.io.IOExceptionISOPackager| Method Detail |
|---|
public void setHost(java.lang.String host,
int port)
setHost in interface ClientChannelhost - server TCP Addressport - server port number
public void setLocalAddress(java.lang.String iface,
int port)
host - server TCP Addressport - server port numberpublic void setHost(java.lang.String host)
setHost in interface BaseChannelMBeanhost - to connect (client ISOChannel)public void setPort(int port)
setPort in interface BaseChannelMBeanport - to connect (client ISOChannel)public java.lang.String getHost()
getHost in interface BaseChannelMBeangetHost in interface ClientChannelpublic int getPort()
getPort in interface BaseChannelMBeangetPort in interface ClientChannelpublic void setPackager(ISOPackager p)
setPackager in interface ISOChannelp - an ISOPackagerISOPackagerpublic ISOPackager getPackager()
getPackager in interface ISOChannelpublic void setServerSocket(java.net.ServerSocket sock)
sock - where to accept a connectionpublic void resetCounters()
public int[] getCounters()
public boolean isConnected()
isConnected in interface BaseChannelMBeanisConnected in interface ISOChannelisConnected in interface ISOSourcepublic java.net.Socket getSocket()
public java.net.ServerSocket getServerSocket()
public void setTimeout(int timeout)
throws java.net.SocketException
timeout - in milliseconds
java.net.SocketExceptionpublic int getTimeout()
public void connect()
throws java.io.IOException
connect in interface BaseChannelMBeanconnect in interface ISOChanneljava.io.IOException
public void accept(java.net.ServerSocket s)
throws java.io.IOException
accept in interface ServerChanneljava.io.IOExceptionpublic void setUsable(boolean b)
setUsable in interface ISOChannelb - - new Usable state (used by ISOMUX internals to
flag as unusable in order to force a reconnection)
public void send(ISOMsg m)
throws java.io.IOException,
ISOException,
ISOFilter.VetoException
send in interface ISOChannelsend in interface ISOSourcem - the Message to be sent
java.io.IOException
ISOException
ISOFilter.VetoException;
ISOFilter.VetoException
public void sendKeepAlive()
throws java.io.IOException
java.io.IOException
public ISOMsg receive()
throws java.io.IOException,
ISOException
receive in interface ISOChanneljava.io.IOException
ISOException
public int getBytes(byte[] b)
throws java.io.IOException
b - byte array
java.io.IOException
public void disconnect()
throws java.io.IOException
disconnect in interface BaseChannelMBeandisconnect in interface ISOChanneljava.io.IOException
public void reconnect()
throws java.io.IOException
reconnect in interface BaseChannelMBeanreconnect in interface ISOChanneljava.io.IOException
public void setLogger(Logger logger,
java.lang.String realm)
setLogger in interface LogSourcepublic java.lang.String getRealm()
getRealm in interface LogSourcepublic Logger getLogger()
getLogger in interface LogSourcepublic java.lang.String getOriginalRealm()
public void setName(java.lang.String name)
setName in interface ISOChannelname - name to registerNameRegistrarpublic java.lang.String getName()
getName in interface ISOChannel
public void addFilter(ISOFilter filter,
int direction)
filter - filter to adddirection - ISOMsg.INCOMING, ISOMsg.OUTGOING, 0 for bothpublic void addIncomingFilter(ISOFilter filter)
addIncomingFilter in interface FilteredChannelfilter - incoming filter to addpublic void addOutgoingFilter(ISOFilter filter)
addOutgoingFilter in interface FilteredChannelfilter - outgoing filter to addpublic void addFilter(ISOFilter filter)
addFilter in interface FilteredChannelfilter - filter to add (both directions, incoming/outgoing)
public void removeFilter(ISOFilter filter,
int direction)
filter - filter to removedirection - ISOMsg.INCOMING, ISOMsg.OUTGOING, 0 for bothpublic void removeFilter(ISOFilter filter)
removeFilter in interface FilteredChannelfilter - filter to remove (both directions)public void removeIncomingFilter(ISOFilter filter)
removeIncomingFilter in interface FilteredChannelfilter - incoming filter to removepublic void removeOutgoingFilter(ISOFilter filter)
removeOutgoingFilter in interface FilteredChannelfilter - outgoing filter to remove
public void setConfiguration(Configuration cfg)
throws ConfigurationException
setConfiguration in interface Configurablecfg - Configuration
ConfigurationExceptionpublic Configuration getConfiguration()
public java.util.Collection getIncomingFilters()
getIncomingFilters in interface FilteredChannelpublic java.util.Collection getOutgoingFilters()
getOutgoingFilters in interface FilteredChannelpublic void setIncomingFilters(java.util.Collection filters)
setIncomingFilters in interface FilteredChannelfilters - incoming filter setpublic void setOutgoingFilters(java.util.Collection filters)
setOutgoingFilters in interface FilteredChannelfilters - outgoing filter setpublic void setHeader(byte[] header)
public void setHeader(java.lang.String header)
public byte[] getHeader()
public void setOverrideHeader(boolean overrideHeader)
public boolean isOverrideHeader()
public static ISOChannel getChannel(java.lang.String name)
throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException;
NameRegistrar.NotFoundExceptionNameRegistrarpublic ISOClientSocketFactory getSocketFactory()
ISOClientSocketFactorypublic void setSocketFactory(ISOClientSocketFactory socketFactory)
setSocketFactory in interface FactoryChannelsocketFactory - the ISOClientSocketFactoryISOClientSocketFactorypublic int getMaxPacketLength()
public void setMaxPacketLength(int maxPacketLength)
public java.lang.Object clone()
ISOChannel
clone in interface ISOChannelclone in class java.lang.Object
|
jPOS.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||