com.ibm.as400.vaccess
Class KeyedDataQueueDocument

java.lang.Object
  extended by com.ibm.as400.vaccess.KeyedDataQueueDocument
All Implemented Interfaces:
Serializable, Document

Deprecated. Use Java Swing instead, along with the classes in package com.ibm.as400.access

public class KeyedDataQueueDocument
extends Object
implements Document, Serializable

The KeyedDataQueueDocument class represents an underlying model for text components, where the text is entries from a keyed data queue on a system.

Use this class in conjuction with any JTextComponent or any other component that works with the Document interface.

Most errors are reported as ErrorEvents rather than throwing exceptions. Users should listen for ErrorEvents in order to diagnose and recover from error conditions.

KeyedDataQueueDocument objects generate the following events:

The following example creates a document which contains the next entry in a data queue on a system. It then presents the document in a JTextField object.

// Set up the document and the JTextField.
AS400 system = new AS400 ("MySystem", "Userid", "Password");
KeyedDataQueueDocument document = new KeyedDataQueueDocument (system, "/QSYS.LIB/MYLIB.LIB/MYDATAQ.DTAQ");
JTextField textField = new JTextField (document, "", 50);

// Add the JTextField to a frame. JFrame frame = new JFrame ("My Window"); frame.getContentPane().add(new JScrollPane(textField));
// Read the next entry from the data queue. document.read (aKey);

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
KeyedDataQueueDocument()
          Deprecated. Constructs a KeyedDataQueueDocument object.
KeyedDataQueueDocument(AS400 system, String path)
          Deprecated. Constructs a KeyedDataQueueDocument object.
 
Method Summary
 void addDataQueueListener(DataQueueListener listener)
          Deprecated. Adds a listener to be notified when a data queue event occurs.
 void addDocumentListener(DocumentListener listener)
          Deprecated. Adds a listener to be notified when a document event occurs.
 void addErrorListener(ErrorListener listener)
          Deprecated. Adds a listener to be notified when an error occurs.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Deprecated. Adds a listener to be notified when the value of any bound property changes.
 void addUndoableEditListener(UndoableEditListener listener)
          Deprecated. Adds an undoable edit listener to be notified when undoable edits are made to the document.
 void addVetoableChangeListener(VetoableChangeListener listener)
          Deprecated. Adds a listener to be notified when the value of any constrained property changes.
 void addWorkingListener(WorkingListener listener)
          Deprecated. Adds a listener to be notified when work starts and stops on potentially long-running operations.
 Position createPosition(int offset)
          Deprecated. Returns a position that will track change as the document is altered.
 Element getDefaultRootElement()
          Deprecated. Returns the root element that views should be based upon unless some other mechanism for assigning views to element structures is provided.
 Position getEndPosition()
          Deprecated. Returns a position that represents the end of the document.
 int getLength()
          Deprecated. Returns the length of the document.
 String getPath()
          Deprecated. Returns the fully qualified integrated file system path name of the data queue.
 Object getProperty(Object key)
          Deprecated. Returns a property value associated with the document.
 Element[] getRootElements()
          Deprecated. Returns the root elements.
 Position getStartPosition()
          Deprecated. Returns a position that represents the start of the document.
 AS400 getSystem()
          Deprecated. Returns the system on which the data queue resides.
 String getText(int offset, int length)
          Deprecated. Returns the text contained within the specified portion of the document.
 void getText(int offset, int length, Segment text)
          Deprecated. Stores the text contained within the specified portion of the document in a segment.
 void insertString(int offset, String text, AttributeSet attributes)
          Deprecated. Inserts text into the document.
 void peek(String key)
          Deprecated. Reads an entry from the data queue without removing it from the queue, and stores the text of the entry in the document.
 void peek(String key, int wait, String searchType)
          Deprecated. Reads an entry from the data queue without removing it from the queue, and stores the text of the entry in the document.
 void putProperty(Object key, Object value)
          Deprecated. Sets a property value associated with the document.
 void read(String key)
          Deprecated. Reads an entry from the data queue and removes it from the queue, and stores the text of the entry in the document.
 void read(String key, int wait, String searchType)
          Deprecated. Reads an entry from the data queue and removes it from the queue, and stores the text of the entry in the document.
 void remove(int offset, int length)
          Deprecated. Removes text from the document.
 void removeDataQueueListener(DataQueueListener listener)
          Deprecated. Removes a data queue listener.
 void removeDocumentListener(DocumentListener listener)
          Deprecated. Removes a document listener.
 void removeErrorListener(ErrorListener listener)
          Deprecated. Removes an error listener.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Deprecated. Removes a property change listener.
 void removeUndoableEditListener(UndoableEditListener listener)
          Deprecated. Removes an undoable edit listener.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Deprecated. Removes a vetoable change listener.
 void removeWorkingListener(WorkingListener listener)
          Deprecated. Removes a working listener.
 void render(Runnable runnable)
          Deprecated. Renders the document.
 void setPath(String path)
          Deprecated. Sets the fully qualified integrated file system path name of the data queue.
 void setSystem(AS400 system)
          Deprecated. Sets the system on which the data queue resides.
 void write(String key)
          Deprecated. Writes the contents of the document to the data queue.The entry replaces the current content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyedDataQueueDocument

public KeyedDataQueueDocument()
Deprecated. 
Constructs a KeyedDataQueueDocument object.


KeyedDataQueueDocument

public KeyedDataQueueDocument(AS400 system,
                              String path)
Deprecated. 
Constructs a KeyedDataQueueDocument object.

Parameters:
system - The system on which the data queue resides.
path - The fully qualified integrated file system path name of the data queue. The path must be in the format of /QSYS.LIB/libname.LIB/dataQueue.DTAQ. The library and queue name must each be 10 characters or less.
Method Detail

addDataQueueListener

public void addDataQueueListener(DataQueueListener listener)
Deprecated. 
Adds a listener to be notified when a data queue event occurs.

Parameters:
listener - The listener.

addDocumentListener

public void addDocumentListener(DocumentListener listener)
Deprecated. 
Adds a listener to be notified when a document event occurs.

Specified by:
addDocumentListener in interface Document
Parameters:
listener - The listener.

addErrorListener

public void addErrorListener(ErrorListener listener)
Deprecated. 
Adds a listener to be notified when an error occurs.

Parameters:
listener - The listener.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Deprecated. 
Adds a listener to be notified when the value of any bound property changes.

Parameters:
listener - The listener.

addUndoableEditListener

public void addUndoableEditListener(UndoableEditListener listener)
Deprecated. 
Adds an undoable edit listener to be notified when undoable edits are made to the document.

Specified by:
addUndoableEditListener in interface Document
Parameters:
listener - The listener.

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener listener)
Deprecated. 
Adds a listener to be notified when the value of any constrained property changes.

Parameters:
listener - The listener.

addWorkingListener

public void addWorkingListener(WorkingListener listener)
Deprecated. 
Adds a listener to be notified when work starts and stops on potentially long-running operations.

Parameters:
listener - The listener.

createPosition

public Position createPosition(int offset)
                        throws BadLocationException
Deprecated. 
Returns a position that will track change as the document is altered. If the relative position is null, then the start of the document will be used.

Specified by:
createPosition in interface Document
Parameters:
offset - The offset from the start of the document.
Returns:
The position.
Throws:
BadLocationException - If the given offset does not represent a valid location in the document.

getDefaultRootElement

public Element getDefaultRootElement()
Deprecated. 
Returns the root element that views should be based upon unless some other mechanism for assigning views to element structures is provided.

Specified by:
getDefaultRootElement in interface Document
Returns:
The root element.

getEndPosition

public Position getEndPosition()
Deprecated. 
Returns a position that represents the end of the document. The position returned can be counted on to track change and stay located at the end of the document.

Specified by:
getEndPosition in interface Document
Returns:
The end position of the document.

getLength

public int getLength()
Deprecated. 
Returns the length of the document.

Specified by:
getLength in interface Document
Returns:
The length of the document in characters.

getPath

public String getPath()
Deprecated. 
Returns the fully qualified integrated file system path name of the data queue.

Returns:
The fully qualified integrated file system path name of the data queue.

getProperty

public Object getProperty(Object key)
Deprecated. 
Returns a property value associated with the document.

Specified by:
getProperty in interface Document
Parameters:
key - The property key.
Returns:
The property value.

getRootElements

public Element[] getRootElements()
Deprecated. 
Returns the root elements.

Specified by:
getRootElements in interface Document
Returns:
The root elements.

getStartPosition

public Position getStartPosition()
Deprecated. 
Returns a position that represents the start of the document. The position returned can be counted on to track change and stay located at the beginning of the document.

Specified by:
getStartPosition in interface Document
Returns:
The start position of the document.

getSystem

public AS400 getSystem()
Deprecated. 
Returns the system on which the data queue resides.

Returns:
The system on which the data queue resides.

getText

public String getText(int offset,
                      int length)
               throws BadLocationException
Deprecated. 
Returns the text contained within the specified portion of the document.

Specified by:
getText in interface Document
Parameters:
offset - The offset into the document representing the desired start of the text.
length - The length of the text.
Returns:
The text.
Throws:
BadLocationException - If the given offset and length does not represent a valid range in the document.

getText

public void getText(int offset,
                    int length,
                    Segment text)
             throws BadLocationException
Deprecated. 
Stores the text contained within the specified portion of the document in a segment.

Specified by:
getText in interface Document
Parameters:
offset - The offset into the document representing the desired start of the text.
length - The length of the text.
text - The segment in which to store the text.
Throws:
BadLocationException - If the given offset and length does not represent a valid range in the document.

insertString

public void insertString(int offset,
                         String text,
                         AttributeSet attributes)
                  throws BadLocationException
Deprecated. 
Inserts text into the document. A position marks a location in the document between items. If the attributes that have been defined exactly match the current attributes defined at the position, the element representing the content at that position will simply be expanded. If the attributes defined are different, a new content element will be created that matches the attributes.

Specified by:
insertString in interface Document
Parameters:
offset - The offset into the document representing the insertion position.
text - The text.
attributes - The attributes to associate with the inserted content, or null if there are no attributes.
Throws:
BadLocationException - If the given offset does not represent a valid position in the document.

peek

public void peek(String key)
Deprecated. 
Reads an entry from the data queue without removing it from the queue, and stores the text of the entry in the document. The entry replaces the current content. This method will not wait for entries if none are on the queue. System and path must be set prior to calling this method.

Parameters:
key - The string that contains the key used to search for an entry.

peek

public void peek(String key,
                 int wait,
                 String searchType)
Deprecated. 
Reads an entry from the data queue without removing it from the queue, and stores the text of the entry in the document. The entry replaces the current content. System and path must be set prior to calling this method.

Parameters:
key - The string that contains the key used to search for an entry.
wait - The number of seconds to wait if the queue contains no entries. -1 means to wait until an entry is available.
searchType - The type of comparison to use to determine if a key is a match. Valid values are EQ (equal), NE (not equal), LT (less than), LE (less than or equal), GT (greater than), and GE (greater than or equal).

putProperty

public void putProperty(Object key,
                        Object value)
Deprecated. 
Sets a property value associated with the document.

Specified by:
putProperty in interface Document
Parameters:
key - The property key.
value - The property value.

read

public void read(String key)
Deprecated. 
Reads an entry from the data queue and removes it from the queue, and stores the text of the entry in the document. The entry replaces the current content. This method will not wait for entries if none are on the queue. System and path must be set prior to calling this method.

Parameters:
key - The string that contains the key used to search for an entry.

read

public void read(String key,
                 int wait,
                 String searchType)
Deprecated. 
Reads an entry from the data queue and removes it from the queue, and stores the text of the entry in the document. The entry replaces the current content. System and path must be set prior to calling this method.

Parameters:
key - The string that contains the key used to search for an entry.
wait - The number of seconds to wait if the queue contains no entries. -1 means to wait until an entry is available.
searchType - The type of comparison to use to determine if a key is a match. Valid values are EQ (equal), NE (not equal), LT (less than), LE (less than or equal), GT (greater than), and GE (greater than or equal).

remove

public void remove(int offset,
                   int length)
            throws BadLocationException
Deprecated. 
Removes text from the document.

Specified by:
remove in interface Document
Parameters:
offset - The offset into the document representing the desired start of the text.
length - The length of the text.
Throws:
BadLocationException - If the given offset and length does not represent a valid range in the document.

removeDataQueueListener

public void removeDataQueueListener(DataQueueListener listener)
Deprecated. 
Removes a data queue listener.

Parameters:
listener - The listener.

removeDocumentListener

public void removeDocumentListener(DocumentListener listener)
Deprecated. 
Removes a document listener.

Specified by:
removeDocumentListener in interface Document
Parameters:
listener - The listener.

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Deprecated. 
Removes an error listener.

Parameters:
listener - The listener.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Deprecated. 
Removes a property change listener.

Parameters:
listener - The listener.

removeUndoableEditListener

public void removeUndoableEditListener(UndoableEditListener listener)
Deprecated. 
Removes an undoable edit listener.

Specified by:
removeUndoableEditListener in interface Document
Parameters:
listener - The listener.

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener listener)
Deprecated. 
Removes a vetoable change listener.

Parameters:
listener - The listener.

removeWorkingListener

public void removeWorkingListener(WorkingListener listener)
Deprecated. 
Removes a working listener.

Parameters:
listener - The listener.

render

public void render(Runnable runnable)
Deprecated. 
Renders the document. This allows the model to be safely rendered in the presence of currency, if the model supports being updated asynchronously. The given runnable will be executed in a way that allows it to safely read the model with no changes while the runnable is being executed. The runnable itself may not make any mutations.

Specified by:
render in interface Document
Parameters:
runnable - The runnable.

setPath

public void setPath(String path)
             throws PropertyVetoException
Deprecated. 
Sets the fully qualified integrated file system path name of the data queue.

Parameters:
path - The fully qualified integrated file system path name of the data queue. The path must be in the format of /QSYS.LIB/libname.LIB/dataQueue.DTAQ. The library and queue name must each be 10 characters or less.
Throws:
PropertyVetoException - If the change is vetoed.

setSystem

public void setSystem(AS400 system)
               throws PropertyVetoException
Deprecated. 
Sets the system on which the data queue resides.

Parameters:
system - The system on which the data queue resides.
Throws:
PropertyVetoException - If the change is vetoed.

write

public void write(String key)
Deprecated. 
Writes the contents of the document to the data queue.The entry replaces the current content. System and path must be set prior to calling this method.

Parameters:
key - The string that contains the key for this entry.