|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jagacy.Session3270
Supports a TN3270 screen-scraping session.
Constructor Summary | |
Session3270(java.lang.String name)
Creates a new session. |
Method Summary | |
void |
abort()
Aborts the session. |
void |
close()
Closes the session. |
Location |
createLocation(int row,
int column)
Creates a Location object. |
int |
getAttributeForPosition(int row,
int column)
Used internally. |
int |
getHeight()
Returns the screen's height. |
Logger |
getLogger()
Returns the logger. |
java.lang.String |
getName()
Returns the session name. |
int |
getPositionField(int position,
int[] offset,
int[] length)
Used internally. |
JagacyProperties |
getProperties()
Returns the Jagacy properties. |
int |
getWidth()
Returns the screen's width. |
boolean |
isInsertOn()
Determines if insert is on or not. |
void |
open()
Opens the session. |
java.lang.String |
read(int length)
Reads a string at the current cursor position. |
java.lang.String |
read(java.lang.String lengthProperty)
Reads a string at the current cursor position. |
long |
readAlarmCount()
Returns the number of times the alarm has sounded. |
int[] |
readCursor()
Deprecated. As of release 1.2, replaced by readCursorLocation() |
Location |
readCursorLocation()
Reads the cursor. |
java.lang.String |
readField(int field,
int offset,
int length)
Reads a string at the given field and offset. |
java.lang.String |
readField(java.lang.String propertyPrefix)
Reads a string at the given field and offset. |
int |
readFieldLength(int field)
Returns the length of a field. |
int |
readFieldLength(java.lang.String fieldProperty)
Returns the length of a field. |
Field[] |
readFields()
Returns an array of all the fields on the screen. |
java.lang.String |
readPosition(int row,
int column,
int length)
Reads a string at the given coordinates. |
java.lang.String |
readPosition(Location location,
int length)
Reads a string at the given location. |
java.lang.String |
readPosition(java.lang.String propertyPrefix)
Reads a string at the given coordinates. |
java.lang.String[] |
readScreen()
Returns the screen. |
boolean |
waitForChange(int timeout)
Waits for the screen to change and the keyboard to unlock. |
boolean |
waitForChange(java.lang.String timeoutProperty)
Waits for the screen to change and the keyboard to unlock. |
boolean |
waitForField(int field,
int offset,
java.lang.String value,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset. |
boolean |
waitForField(java.lang.String propertyPrefix,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset. |
boolean |
waitForField(java.lang.String propertyPrefix,
java.lang.String timeoutProperty)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset. |
boolean |
waitForField(java.lang.String propertyPrefix,
java.lang.String value,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset. |
boolean |
waitForField(java.lang.String propertyPrefix,
java.lang.String value,
java.lang.String timeoutProperty)
Waits (in 100 millisecond intervals) for the value to appear at the given field and offset. |
boolean |
waitForPosition(int row,
int column,
java.lang.String value,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. |
boolean |
waitForPosition(Location location,
java.lang.String value,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given location. |
boolean |
waitForPosition(java.lang.String propertyPrefix,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. |
boolean |
waitForPosition(java.lang.String propertyPrefix,
java.lang.String timeoutProperty)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. |
boolean |
waitForPosition(java.lang.String propertyPrefix,
java.lang.String value,
int timeout)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. |
boolean |
waitForPosition(java.lang.String propertyPrefix,
java.lang.String value,
java.lang.String timeoutProperty)
Waits (in 100 millisecond intervals) for the value to appear at the given coordinates. |
boolean |
waitForUnlock(int timeout)
Waits for the keyboard to unlock. |
boolean |
waitForUnlock(java.lang.String timeoutProperty)
Waits for the keyboard to unlock. |
void |
writeAfterLabel(java.lang.String propertyPrefix)
Writes a string in the next unprotected field after a protected label. |
void |
writeAfterLabel(java.lang.String label,
java.lang.String value)
Writes a string in the next unprotected field after a protected label. |
void |
writeAfterLabelProperty(java.lang.String labelProperty,
java.lang.String value)
Writes a string in the next unprotected field after a protected label. |
void |
writeCursor(int row,
int column)
Writes the cursor at the given coordinates. |
void |
writeCursor(Location location)
Writes the cursor at the given location. |
void |
writeCursor(java.lang.String propertyPrefix)
Writes the cursor at the given coordinates. |
void |
writeField(int field,
int offset,
java.lang.String value)
Writes a string at the given field and offset. |
void |
writeField(java.lang.String propertyPrefix)
Writes a string at the field and offset given by the properties. |
void |
writeField(java.lang.String propertyPrefix,
java.lang.String value)
Writes a string at the field and offset given by the properties. |
void |
writeKey(Key key)
Writes the given key. |
void |
writeKey(java.lang.String keyProperty)
Writes the given key. |
void |
writePosition(int row,
int column,
java.lang.String value)
Writes a string at the given coordinates. |
void |
writePosition(Location location,
java.lang.String value)
Writes a string at the given location. |
void |
writePosition(java.lang.String propertyPrefix)
Writes a string at the coordinates given by the properties. |
void |
writePosition(java.lang.String propertyPrefix,
java.lang.String value)
Writes a string at the coordinates given by the properties. |
void |
writeProperty(java.lang.String valueProperty)
Writes the contents of valueProperty at the current cursor position. |
void |
writeString(java.lang.String value)
Writes a string at the current cursor position. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Session3270(java.lang.String name) throws JagacyException
name
- The session name (also the name of the .properties file).
JagacyException
- If an error occurs.Method Detail |
public void open() throws JagacyException
JagacyException
- If an error occurs.public java.lang.String getName()
public JagacyProperties getProperties()
public Logger getLogger()
public boolean isInsertOn()
public Location createLocation(int row, int column) throws JagacyException
row
- Row of location.column
- Column of location.
JagacyException
- If an error occurs.public void writeString(java.lang.String value) throws JagacyException
value
- String to write.
JagacyException
- If an error occurs.public void writeProperty(java.lang.String valueProperty) throws JagacyException
valueProperty
- Property to lookup.
JagacyException
- If an error occurs.public void writePosition(int row, int column, java.lang.String value) throws JagacyException
row
- Row (indexed from 0).column
- Column (indexed from 0).value
- Value to write.
JagacyException
- If an error occurs.public void writePosition(Location location, java.lang.String value) throws JagacyException
location
- Location.value
- Value to write.
JagacyException
- If an error occurs.public void writePosition(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public void writePosition(java.lang.String propertyPrefix, java.lang.String value) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
propertyPrefix
- Prefix used to lookup properties.value
- String to write.
JagacyException
- If an error occurs.public void writeField(int field, int offset, java.lang.String value) throws JagacyException
field
- Field (indexed from 1).offset
- Offset in the field (indexed from 1).value
- String to write.
JagacyException
- If an error occurs.public void writeField(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public void writeField(java.lang.String propertyPrefix, java.lang.String value) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
propertyPrefix
- Prefix used to lookup properties.value
- String to write.
JagacyException
- If an error occurs.public void writeAfterLabel(java.lang.String label, java.lang.String value) throws JagacyException
label
- Label to find.value
- String to write after label.
JagacyException
- If an error occurs.public void writeAfterLabel(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.label
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public void writeAfterLabelProperty(java.lang.String labelProperty, java.lang.String value) throws JagacyException
labelProperty
- Property to lookup.value
- String to write after label.
JagacyException
- If an error occurs.public java.lang.String[] readScreen() throws JagacyException
JagacyException
- If an error occurs.public java.lang.String read(int length) throws JagacyException
length
- Length of string to read.
JagacyException
- If an error occurs.public java.lang.String read(java.lang.String lengthProperty) throws JagacyException
lengthProperty
- Property to lookup.
JagacyException
- If an error occurs.public java.lang.String readPosition(int row, int column, int length) throws JagacyException
row
- Row (indexed from 0).column
- Column (indexed from 0).length
- Length of string to read.
JagacyException
- If an error occurs.public java.lang.String readPosition(Location location, int length) throws JagacyException
location
- Location of string to read.length
- Length of string to read.
JagacyException
- If an error occurs.public java.lang.String readPosition(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.length
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public Field[] readFields() throws JagacyException
JagacyException
- If an error occurs.Field
public java.lang.String readField(int field, int offset, int length) throws JagacyException
field
- Field (indexed from 1).offset
- Offset (indexed from 1).length
- Length of string to read.
JagacyException
- If an error occurs.public java.lang.String readField(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
<propertyPrefix>.length
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public int readFieldLength(int field) throws JagacyException
field
- Field (indexed from 1).
JagacyException
- If an error occurs.public int readFieldLength(java.lang.String fieldProperty) throws JagacyException
fieldProperty
- Property to lookup.
JagacyException
- If an error occurs.public void writeKey(Key key) throws JagacyException
key
- Key to write.
JagacyException
- If an error occurs.public void writeKey(java.lang.String keyProperty) throws JagacyException
keyProperty
- Property to lookup.
JagacyException
- If an error occurs.public boolean waitForChange(int timeout) throws JagacyException
timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForChange(java.lang.String timeoutProperty) throws JagacyException
timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public boolean waitForUnlock(int timeout) throws JagacyException
timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForUnlock(java.lang.String timeoutProperty) throws JagacyException
timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public long readAlarmCount() throws JagacyException
JagacyException
- If an error occurs.public boolean waitForPosition(int row, int column, java.lang.String value, int timeout) throws JagacyException
row
- Row (indexed from 0).column
- Column (indexed from 0).value
- Value to appear.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForPosition(Location location, java.lang.String value, int timeout) throws JagacyException
location
- The location of the value.value
- Value to appear.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForPosition(java.lang.String propertyPrefix, java.lang.String timeoutProperty) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public boolean waitForPosition(java.lang.String propertyPrefix, int timeout) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForPosition(java.lang.String propertyPrefix, java.lang.String value, java.lang.String timeoutProperty) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
propertyPrefix
- Prefix used to lookup properties.value
- Value to appear.timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public boolean waitForPosition(java.lang.String propertyPrefix, java.lang.String value, int timeout) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
propertyPrefix
- Prefix used to lookup properties.value
- Value to appear.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForField(int field, int offset, java.lang.String value, int timeout) throws JagacyException
field
- Field (indexed from 1).offset
- Offset (indexed from 1).value
- Value to appear.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForField(java.lang.String propertyPrefix, java.lang.String timeoutProperty) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public boolean waitForField(java.lang.String propertyPrefix, int timeout) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
<propertyPrefix>.value
propertyPrefix
- Prefix used to lookup properties.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public boolean waitForField(java.lang.String propertyPrefix, java.lang.String value, java.lang.String timeoutProperty) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
propertyPrefix
- Prefix used to lookup properties.value
- Value to appear.timeoutProperty
- Property to lookup (if property ends with
'.seconds', value will be converted to milliseconds).
JagacyException
- If an error occurs.public boolean waitForField(java.lang.String propertyPrefix, java.lang.String value, int timeout) throws JagacyException
<propertyPrefix>.field
<propertyPrefix>.offset
propertyPrefix
- Prefix used to lookup properties.value
- Value to appear.timeout
- Amount of time to wait (in milliseconds).
JagacyException
- If an error occurs.public int getWidth()
public int getHeight()
public int[] readCursor() throws JagacyException
readCursorLocation()
JagacyException
- If an error occurs.public Location readCursorLocation() throws JagacyException
JagacyException
- If an error occurs.public void writeCursor(int row, int column) throws JagacyException
row
- Row (indexed from 0).column
- Column (indexed from 0).
JagacyException
- If an error occurs.public void writeCursor(Location location) throws JagacyException
location
- The location at which to write the cursor.
JagacyException
- If an error occurs.public void writeCursor(java.lang.String propertyPrefix) throws JagacyException
<propertyPrefix>.row
<propertyPrefix>.column
propertyPrefix
- Prefix used to lookup properties.
JagacyException
- If an error occurs.public int getAttributeForPosition(int row, int column) throws JagacyException
row
- Row (indexed from 0).column
- Column (indexed from 0).
JagacyException
- If an error occurs.Field.getAttribute()
public int getPositionField(int position, int[] offset, int[] length) throws JagacyException
position
- Position to find.offset
- Offset within field.length
- Length of field.
JagacyException
- If an error occurs.public void close() throws JagacyException
JagacyException
- If an error occurs.public void abort()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |