com.ibm.as400.vaccess

Class KeyedDataQueueDocument

  • java.lang.Object
    • com.ibm.as400.vaccess.KeyedDataQueueDocument
  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.text.Document

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

    public class KeyedDataQueueDocument
    extends java.lang.Object
    implements javax.swing.text.Document, java.io.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:

    • DataQueueEvent
    • DocumentEvent
    • ErrorEvent
    • PropertyChangeEvent
    • UndoableEditEvent
    • WorkingEvent

    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

      Constructors 
      Constructor and Description
      KeyedDataQueueDocument()
      Deprecated. 
      Constructs a KeyedDataQueueDocument object.
      KeyedDataQueueDocument(AS400 system, java.lang.String path)
      Deprecated. 
      Constructs a KeyedDataQueueDocument object.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void addDataQueueListener(DataQueueListener listener)
      Deprecated. 
      Adds a listener to be notified when a data queue event occurs.
      void addDocumentListener(javax.swing.event.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(java.beans.PropertyChangeListener listener)
      Deprecated. 
      Adds a listener to be notified when the value of any bound property changes.
      void addUndoableEditListener(javax.swing.event.UndoableEditListener listener)
      Deprecated. 
      Adds an undoable edit listener to be notified when undoable edits are made to the document.
      void addVetoableChangeListener(java.beans.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.
      javax.swing.text.Position createPosition(int offset)
      Deprecated. 
      Returns a position that will track change as the document is altered.
      javax.swing.text.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.
      javax.swing.text.Position getEndPosition()
      Deprecated. 
      Returns a position that represents the end of the document.
      int getLength()
      Deprecated. 
      Returns the length of the document.
      java.lang.String getPath()
      Deprecated. 
      Returns the fully qualified integrated file system path name of the data queue.
      java.lang.Object getProperty(java.lang.Object key)
      Deprecated. 
      Returns a property value associated with the document.
      javax.swing.text.Element[] getRootElements()
      Deprecated. 
      Returns the root elements.
      javax.swing.text.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.
      java.lang.String getText(int offset, int length)
      Deprecated. 
      Returns the text contained within the specified portion of the document.
      void getText(int offset, int length, javax.swing.text.Segment text)
      Deprecated. 
      Stores the text contained within the specified portion of the document in a segment.
      void insertString(int offset, java.lang.String text, javax.swing.text.AttributeSet attributes)
      Deprecated. 
      Inserts text into the document.
      void peek(java.lang.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(java.lang.String key, int wait, java.lang.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(java.lang.Object key, java.lang.Object value)
      Deprecated. 
      Sets a property value associated with the document.
      void read(java.lang.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(java.lang.String key, int wait, java.lang.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(javax.swing.event.DocumentListener listener)
      Deprecated. 
      Removes a document listener.
      void removeErrorListener(ErrorListener listener)
      Deprecated. 
      Removes an error listener.
      void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
      Deprecated. 
      Removes a property change listener.
      void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
      Deprecated. 
      Removes an undoable edit listener.
      void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Deprecated. 
      Removes a vetoable change listener.
      void removeWorkingListener(WorkingListener listener)
      Deprecated. 
      Removes a working listener.
      void render(java.lang.Runnable runnable)
      Deprecated. 
      Renders the document.
      void setPath(java.lang.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(java.lang.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,
                              java.lang.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(javax.swing.event.DocumentListener listener)
        Deprecated. 
        Adds a listener to be notified when a document event occurs.
        Specified by:
        addDocumentListener in interface javax.swing.text.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(java.beans.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(javax.swing.event.UndoableEditListener listener)
        Deprecated. 
        Adds an undoable edit listener to be notified when undoable edits are made to the document.
        Specified by:
        addUndoableEditListener in interface javax.swing.text.Document
        Parameters:
        listener - The listener.
      • addVetoableChangeListener

        public void addVetoableChangeListener(java.beans.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 javax.swing.text.Position createPosition(int offset)
                                                 throws javax.swing.text.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 javax.swing.text.Document
        Parameters:
        offset - The offset from the start of the document.
        Returns:
        The position.
        Throws:
        javax.swing.text.BadLocationException - If the given offset does not represent a valid location in the document.
      • getDefaultRootElement

        public javax.swing.text.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 javax.swing.text.Document
        Returns:
        The root element.
      • getEndPosition

        public javax.swing.text.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 javax.swing.text.Document
        Returns:
        The end position of the document.
      • getLength

        public int getLength()
        Deprecated. 
        Returns the length of the document.
        Specified by:
        getLength in interface javax.swing.text.Document
        Returns:
        The length of the document in characters.
      • getPath

        public java.lang.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 java.lang.Object getProperty(java.lang.Object key)
        Deprecated. 
        Returns a property value associated with the document.
        Specified by:
        getProperty in interface javax.swing.text.Document
        Parameters:
        key - The property key.
        Returns:
        The property value.
      • getRootElements

        public javax.swing.text.Element[] getRootElements()
        Deprecated. 
        Returns the root elements.
        Specified by:
        getRootElements in interface javax.swing.text.Document
        Returns:
        The root elements.
      • getStartPosition

        public javax.swing.text.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 javax.swing.text.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 java.lang.String getText(int offset,
                               int length)
                                 throws javax.swing.text.BadLocationException
        Deprecated. 
        Returns the text contained within the specified portion of the document.
        Specified by:
        getText in interface javax.swing.text.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:
        javax.swing.text.BadLocationException - If the given offset and length does not represent a valid range in the document.
      • getText

        public void getText(int offset,
                   int length,
                   javax.swing.text.Segment text)
                     throws javax.swing.text.BadLocationException
        Deprecated. 
        Stores the text contained within the specified portion of the document in a segment.
        Specified by:
        getText in interface javax.swing.text.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:
        javax.swing.text.BadLocationException - If the given offset and length does not represent a valid range in the document.
      • insertString

        public void insertString(int offset,
                        java.lang.String text,
                        javax.swing.text.AttributeSet attributes)
                          throws javax.swing.text.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 javax.swing.text.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:
        javax.swing.text.BadLocationException - If the given offset does not represent a valid position in the document.
      • peek

        public void peek(java.lang.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(java.lang.String key,
                int wait,
                java.lang.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(java.lang.Object key,
                       java.lang.Object value)
        Deprecated. 
        Sets a property value associated with the document.
        Specified by:
        putProperty in interface javax.swing.text.Document
        Parameters:
        key - The property key.
        value - The property value.
      • read

        public void read(java.lang.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(java.lang.String key,
                int wait,
                java.lang.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 javax.swing.text.BadLocationException
        Deprecated. 
        Removes text from the document.
        Specified by:
        remove in interface javax.swing.text.Document
        Parameters:
        offset - The offset into the document representing the desired start of the text.
        length - The length of the text.
        Throws:
        javax.swing.text.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(javax.swing.event.DocumentListener listener)
        Deprecated. 
        Removes a document listener.
        Specified by:
        removeDocumentListener in interface javax.swing.text.Document
        Parameters:
        listener - The listener.
      • removeErrorListener

        public void removeErrorListener(ErrorListener listener)
        Deprecated. 
        Removes an error listener.
        Parameters:
        listener - The listener.
      • removePropertyChangeListener

        public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
        Deprecated. 
        Removes a property change listener.
        Parameters:
        listener - The listener.
      • removeUndoableEditListener

        public void removeUndoableEditListener(javax.swing.event.UndoableEditListener listener)
        Deprecated. 
        Removes an undoable edit listener.
        Specified by:
        removeUndoableEditListener in interface javax.swing.text.Document
        Parameters:
        listener - The listener.
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.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(java.lang.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 javax.swing.text.Document
        Parameters:
        runnable - The runnable.
      • setPath

        public void setPath(java.lang.String path)
                     throws java.beans.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:
        java.beans.PropertyVetoException - If the change is vetoed.
      • setSystem

        public void setSystem(AS400 system)
                       throws java.beans.PropertyVetoException
        Deprecated. 
        Sets the system on which the data queue resides.
        Parameters:
        system - The system on which the data queue resides.
        Throws:
        java.beans.PropertyVetoException - If the change is vetoed.
      • write

        public void write(java.lang.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.