|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpos.iso.ISOComponent
org.jpos.iso.ISOMsg
public class ISOMsg
implements Composite whithin a Composite pattern
ISOComponent,
ISOField,
Serialized Form| Field Summary | |
|---|---|
protected int |
direction
|
protected boolean |
dirty
|
protected int |
fieldNumber
|
protected Map<Integer,Object> |
fields
|
protected ISOHeader |
header
|
static int |
INCOMING
|
protected int |
maxField
|
protected boolean |
maxFieldDirty
|
static int |
OUTGOING
|
protected ISOPackager |
packager
|
| Constructor Summary | |
|---|---|
ISOMsg()
Creates an ISOMsg |
|
ISOMsg(int fieldNumber)
Creates a nested ISOMsg |
|
ISOMsg(String mti)
Creates an ISOMsg with given mti |
|
| Method Summary | |
|---|---|
Object |
clone()
|
Object |
clone(int[] fields)
Partially clone an ISOMsg |
void |
dump(PrintStream p,
String indent)
dump the message to a PrintStream. |
byte[] |
getBytes(int fldno)
Return the byte[] value associated with the given ISOField number |
byte[] |
getBytes(String fpath)
Return the String value associated with the given field path |
Map |
getChildren()
clone fields |
ISOComponent |
getComponent(int fldno)
get the component associated with the given field number |
ISOComponent |
getComponent(String fpath)
get the component associated with the given field number |
ISOComponent |
getComposite()
In order to interchange Composites and Leafs we use getComposite(). |
int |
getDirection()
|
byte[] |
getHeader()
get optional message header image |
ISOHeader |
getISOHeader()
Return this messages ISOHeader |
Object |
getKey()
valid on Leafs only. |
int |
getMaxField()
a Composite must override this function |
String |
getMTI()
|
ISOPackager |
getPackager()
|
ISOSource |
getSource()
|
String |
getString(int fldno)
Return the String value associated with the given ISOField number |
String |
getString(String fpath)
Return the String value associated with the given field path |
Object |
getValue()
valid on Leafs only. |
Object |
getValue(int fldno)
Return the object value associated with the given field number |
Object |
getValue(String fpath)
Return the object value associated with the given field path |
boolean |
hasField(int fldno)
Check if a given field is present |
boolean |
hasField(String fpath)
Check if a field indicated by a fpath is present |
boolean |
hasFields()
|
boolean |
hasFields(int[] fields)
Check if all fields are present |
boolean |
isIncoming()
|
boolean |
isInner()
|
boolean |
isOutgoing()
|
boolean |
isRequest()
|
boolean |
isResponse()
|
boolean |
isRetransmission()
|
void |
merge(ISOMsg m)
add all fields present on received parameter to this ISOMsg please note that received fields take precedence over existing ones (simplifying card agent message creation and template handling) |
void |
move(int oldFieldNumber,
int newFieldNumber)
moves a field (renumber) |
byte[] |
pack()
pack the message with the current packager |
protected void |
readDirection(ObjectInput in)
|
void |
readExternal(ObjectInput in)
|
protected void |
readHeader(ObjectInput in)
|
protected void |
readPackager(ObjectInput in)
|
void |
recalcBitMap()
setup BitMap |
void |
set(int fldno,
byte[] value)
Creates an ISOBinaryField associated with fldno within this ISOMsg |
void |
set(int fldno,
String value)
Creates an ISOField associated with fldno within this ISOMsg |
void |
set(ISOComponent c)
Set a field within this message |
void |
set(String fpath,
byte[] value)
Creates an ISOField associated with fldno within this ISOMsg |
void |
set(String fpath,
ISOComponent c)
Creates an ISOField associated with fldno within this ISOMsg |
void |
set(String fpath,
String value)
Creates an ISOField associated with fldno within this ISOMsg |
void |
setDirection(int direction)
Sets the direction information related to this message |
void |
setFieldNumber(int fieldNumber)
changes this Component field number Use with care, this method does not change any reference held by a Composite. |
void |
setHeader(byte[] b)
Sets an optional message header image |
void |
setHeader(ISOHeader header)
|
void |
setMTI(String mti)
|
void |
setPackager(ISOPackager p)
|
void |
setResponseMTI()
sets an appropiate response MTI. |
void |
setRetransmissionMTI()
sets an appropiate retransmission MTI |
void |
setSource(ISOSource source)
Let this ISOMsg object hold a weak reference to an ISOSource (usually used to carry a reference to the incoming ISOChannel) |
void |
setValue(Object obj)
Don't call setValue on an ISOMsg. |
String |
toString()
|
int |
unpack(byte[] b)
unpack a message |
void |
unpack(InputStream in)
|
void |
unset(int fldno)
Unset a field if it exists, otherwise ignore. |
void |
unset(int[] flds)
Unsets several fields at once |
void |
unset(String fpath)
Unset a field referenced by a fpath if it exists, otherwise ignore. |
protected void |
writeDirection(ObjectOutput out)
|
void |
writeExternal(ObjectOutput out)
|
protected void |
writeHeader(ObjectOutput out)
|
protected void |
writePackager(ObjectOutput out)
|
| Methods inherited from class org.jpos.iso.ISOComponent |
|---|
getBytes, pack |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Map<Integer,Object> fields
protected int maxField
protected ISOPackager packager
protected boolean dirty
protected boolean maxFieldDirty
protected int direction
protected ISOHeader header
protected int fieldNumber
public static final int INCOMING
public static final int OUTGOING
| Constructor Detail |
|---|
public ISOMsg()
public ISOMsg(int fieldNumber)
fieldNumber - (in the outter ISOMsg) of this nested messagepublic ISOMsg(String mti)
mti - Msg's MTI| Method Detail |
|---|
public void setFieldNumber(int fieldNumber)
setFieldNumber in class ISOComponentfieldNumber - new field numberpublic void setDirection(int direction)
direction - can be either ISOMsg.INCOMING or ISOMsg.OUTGOINGpublic void setHeader(byte[] b)
b - header imagepublic void setHeader(ISOHeader header)
public byte[] getHeader()
public ISOHeader getISOHeader()
public int getDirection()
ISOChannelpublic boolean isIncoming()
ISOChannelpublic boolean isOutgoing()
ISOChannelpublic int getMaxField()
ISOComponent
getMaxField in class ISOComponentpublic void setPackager(ISOPackager p)
p - - a peer packagerpublic ISOPackager getPackager()
public void set(ISOComponent c)
throws ISOException
set in class ISOComponentc - - a component
ISOException
public void set(int fldno,
String value)
throws ISOException
fldno - field numbervalue - field value
ISOException - on error
public void set(String fpath,
String value)
throws ISOException
fpath - dot-separated field path (i.e. 63.2)value - field value
ISOException - on error
public void set(String fpath,
ISOComponent c)
throws ISOException
fpath - dot-separated field path (i.e. 63.2)c - component
ISOException - on error
public void set(String fpath,
byte[] value)
throws ISOException
fpath - dot-separated field path (i.e. 63.2)value - binary field value
ISOException - on error
public void set(int fldno,
byte[] value)
throws ISOException
fldno - field numbervalue - field value
ISOException - on errorpublic void unset(int fldno)
unset in class ISOComponentfldno - - the field numberpublic void unset(int[] flds)
flds - - array of fields to be unset from this ISOMsg
public void unset(String fpath)
throws ISOException
fpath - dot-separated field path (i.e. 63.2)
ISOException - on errorpublic ISOComponent getComposite()
getComposite in class ISOComponent
public void recalcBitMap()
throws ISOException
ISOException - on errorpublic Map getChildren()
getChildren in class ISOComponent
public byte[] pack()
throws ISOException
pack in class ISOComponentISOException
public int unpack(byte[] b)
throws ISOException
unpack in class ISOComponentb - - raw message
ISOException
public void unpack(InputStream in)
throws IOException,
ISOException
unpack in class ISOComponentIOException
ISOException
public void dump(PrintStream p,
String indent)
dump in interface Loggeabledump in class ISOComponentp - - print streamindent - - optional indent stringpublic ISOComponent getComponent(int fldno)
fldno - the Field Number
public Object getValue(int fldno)
throws ISOException
fldno - the Field Number
ISOException - on error
public Object getValue(String fpath)
throws ISOException
fpath - field path
ISOException - on error
public ISOComponent getComponent(String fpath)
throws ISOException
fpath - field path
ISOException - on errorpublic String getString(int fldno)
fldno - the Field Number
public String getString(String fpath)
fpath - field path
public byte[] getBytes(int fldno)
fldno - the Field Number
public byte[] getBytes(String fpath)
fpath - field path
public boolean hasField(int fldno)
fldno - the Field Number
public boolean hasFields(int[] fields)
fields - an array of fields to check for presence
public boolean hasField(String fpath)
throws ISOException
fpath - dot-separated field path (i.e. 63.2)
ISOException - on errorpublic boolean hasFields()
public void setValue(Object obj)
throws ISOException
setValue in class ISOComponentISOExceptionISOField,
ISOExceptionpublic Object clone()
clone in class Objectpublic Object clone(int[] fields)
fields - int array of fields to go
public void merge(ISOMsg m)
m - ISOMsg to mergepublic String toString()
toString in class Object
public Object getKey()
throws ISOException
ISOComponent
getKey in class ISOComponentISOExceptionpublic Object getValue()
ISOComponent
getValue in class ISOComponentpublic boolean isInner()
public void setMTI(String mti)
throws ISOException
mti - new MTI
ISOException - if message is inner message
public void move(int oldFieldNumber,
int newFieldNumber)
throws ISOException
oldFieldNumber - old field numbernewFieldNumber - new field number
ISOException - on error
public String getMTI()
throws ISOException
ISOException - on inner message or MTI not set
public boolean isRequest()
throws ISOException
ISOException - on MTI not set
public boolean isResponse()
throws ISOException
ISOException - on MTI not set
public boolean isRetransmission()
throws ISOException
ISOException - on MTI not set
public void setResponseMTI()
throws ISOException
ISOException - on MTI not set or it is not a request
public void setRetransmissionMTI()
throws ISOException
ISOException - on MTI not set or it is not a request
protected void writeHeader(ObjectOutput out)
throws IOException
IOException
protected void readHeader(ObjectInput in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
protected void writePackager(ObjectOutput out)
throws IOException
IOException
protected void readPackager(ObjectInput in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
protected void writeDirection(ObjectOutput out)
throws IOException
IOException
protected void readDirection(ObjectInput in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundExceptionpublic void setSource(ISOSource source)
source - an ISOSourcepublic ISOSource getSource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||