|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ireasoning.protocol.tl1.TL1Line
This class represents each line in payload.
Payload contains one or multiple lines. Each Line (Represented by TL1Line) has the following format: "section [: section]*" (section is represented by TL1Section) In each section: "field [, field]*" (field is represented by TL1Field) In each field "name [ = value]"For instance, for a TL1 response message :
NODE 2000-05-09 17:32:36 M 1 COMPLD "SLOT-3:E1000,EQUIP,,ACT:CARDNAME=E1000" "SLOT-4:OC3,EQUIP,,NA:CARDNAME=OC3-IR:IS" "SLOT-3:E1000,EQUIP,,ACT:CARDNAME=E1000" and "SLOT-4:OC3,EQUIP,,NA:CARDNAME=OC3-IR:IS" are lines in the payload.Usage Example:
... TL1ResponseMsg [] responses = session.send(command); ... TL1ResponseMsg response = response[0]; TL1Line[] lines = response.getPayloadData(); for (int j = 0; j < lines.length ; j++) { TL1Section [] sections = lines[j].getSections(); // System.out.println( "line: " + j); for (int k = 0; k < sections.length ; k++) { // System.out.println( "section: " + k); TL1Field [] fields = sections[k].getFields(); for ( int m = 0; m < fields.length; m++) { TL1Field f = fields[m]; // System.out.println("<" + f.getName() + "> = <" + f.getValue() + ">"); } } }
Constructor Summary | |
TL1Line(String line)
Constructs a new TL1Line with the specified line string |
Method Summary | |
TL1Section |
getSection(int index)
Returns the section at the specified position in this line. |
int |
getSectionCount()
Returns the number of sections contained in this line |
TL1Section[] |
getSections()
Returns the sections contained in this line. |
String |
lookupValue(String key)
Returns the value corresponding to the passed key. |
String |
toString()
Returns the string representation of this class |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TL1Line(String line)
line
- the raw line string. e.g. "SLOT-3:E1000,EQUIP,,ACT:CARDNAME=E1000"Method Detail |
public TL1Section[] getSections()
public TL1Section getSection(int index)
IndexOutOfBoundsException
- if index is out of range (index
< 0 || index >= getSectionCount()).public int getSectionCount()
public String lookupValue(String key)
public String toString()
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |