All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.KeyedDataQueue

java.lang.Object
   |
   +----com.ibm.as400.access.BaseDataQueue
           |
           +----com.ibm.as400.access.KeyedDataQueue

public class KeyedDataQueue
extends BaseDataQueue
The KeyedDataQueue class represents an AS/400 keyed data queue object.


Constructor Index

 o KeyedDataQueue()
Constructs a KeyedDataQueue object.
 o KeyedDataQueue(AS400, String)
Constructs a KeyedDataQueue object.

Method Index

 o clear(byte[])
Removes all entries that match the key from the data queue.
 o clear(String)
Removes all entries that match the key from the data queue.
 o create(int, int)
Creates a keyed data queue on the AS/400.
 o create(int, int, String, boolean, boolean, String)
Creates a keyed data queue on the AS/400.
 o getKeyLength()
Returns the length of the keys (in bytes) on this queue.
 o peek(byte[])
Reads an entry from the data queue without removing it from the queue.
 o peek(byte[], int, String)
Reads an entry from the data queue without removing it from the queue.
 o peek(String)
Reads an entry from the data queue without removing it from the queue.
 o peek(String, int, String)
Reads an entry from the data queue without removing it from the queue.
 o read(byte[])
Reads an entry from the data queue and removes it from the queue.
 o read(byte[], int, String)
Reads an entry from the data queue and removes it from the queue.
 o read(String)
Reads an entry from the data queue and removes it from the queue.
 o read(String, int, String)
Reads an entry from the data queue and removes it from the queue.
 o write(byte[], byte[])
Writes an entry to the data queue.
 o write(String, String)
Writes a string entry to the data queue.

Constructors

 o KeyedDataQueue
 public KeyedDataQueue()
Constructs a KeyedDataQueue object. The system and name properties will need to be set before using any method requiring a connection to the AS400.

 o KeyedDataQueue
 public KeyedDataQueue(AS400 system,
                       String path)
Constructs a KeyedDataQueue object. Depending on how the AS400 object was constructed, the user may need to be prompted for the system name, user ID, or password when any method requiring a connection to the AS400 is done.

Parameters:
system - The AS/400 system on which the data queue exists.
path - The fully qualified integrated file system path name of the data queue. The library and queue name must each be 10 characters or less.

Methods

 o clear
 public void clear(byte key[]) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Removes all entries that match the key from the data queue.

Parameters:
key - The key with which data queue entries will be compared. All entries whose key is equal to this parameter will be removed from the queue.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o clear
 public void clear(String key) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Removes all entries that match the key from the data queue.

Parameters:
key - The key with which data queue entries will be compared. All entries whose key is equal to this parameter will be removed from the queue.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o create
 public void create(int keyLength,
                    int entryLength) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException
Creates a keyed data queue on the AS/400. The queue will be created with the following attributes: authority = *LIBCRTAUT, saveSenderInfo = false, forceToAuxiliaryStorage = false, description = (50 blanks).

Parameters:
keyLength - The number of bytes per data queue key. Valid values are 1-256.
entryLength - The maximum number of bytes per data queue entry. Valid values are 1-31744.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectAlreadyExistsException
If the AS/400 object already exists.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o create
 public void create(int keyLength,
                    int entryLength,
                    String authority,
                    boolean saveSenderInfo,
                    boolean forceToAuxiliaryStorage,
                    String description) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException
Creates a keyed data queue on the AS/400.

Parameters:
keyLength - The number of bytes per data queue key. Valid values are 1-256.
entryLength - The maximum number of bytes per data queue entry. Valid values are 1-31744.
authority - The public authority for the data queue. Valid values are *ALL, *CHANGE, *EXCLUDE, *USE, *LIBCRTAUT.
saveSenderInfo - Determines if entry origin information will be saved.
forceToAuxiliaryStorage - true if writes are forced to storage before return; false otherwise.
description - The text description. This string must be 50 characters or less.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectAlreadyExistsException
If the AS/400 object already exists.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o getKeyLength
 public int getKeyLength() throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Returns the length of the keys (in bytes) on this queue.

Returns:
The length of the keys.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o peek
 public KeyedDataQueueEntry peek(byte key[]) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Reads an entry from the data queue without removing it from the queue. This method will not wait for entries if there are none on the queue.

Parameters:
key - The array that contains the key used to search for an entry. An entry must have a key equal to this value to be read.
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o peek
 public KeyedDataQueueEntry peek(byte key[],
                                 int wait,
                                 String searchType) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Reads an entry from the data queue without removing it from the queue.

Parameters:
key - The array that contains the key used to search for an entry.
wait - The number of seconds to wait if the queue contains no entries. Negative one (-1) indicates 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).
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o peek
 public KeyedDataQueueEntry peek(String key) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Reads an entry from the data queue without removing it from the queue. This method will not wait for entries if there are none on the queue.

Parameters:
key - The string that contains the key used to search for an entry. An entry must have a key equal to this value to be read.
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o peek
 public KeyedDataQueueEntry peek(String key,
                                 int wait,
                                 String searchType) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Reads an entry from the data queue without removing it from the queue.

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).
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o read
 public KeyedDataQueueEntry read(byte key[]) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Reads an entry from the data queue and removes it from the queue. This method will not wait for entries if there are none on the queue.

Parameters:
key - The array that contains the key used to search for an entry. An entry must have a key equal to this value to be read.
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o read
 public KeyedDataQueueEntry read(byte key[],
                                 int wait,
                                 String searchType) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Reads an entry from the data queue and removes it from the queue.

Parameters:
key - The array that contains the key used to search for an entry.
wait - The number of seconds to wait if the queue contains no entries. Negative one (-1) indicates 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).
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o read
 public KeyedDataQueueEntry read(String key) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Reads an entry from the data queue and removes it from the queue. This method will not wait for entries if there are none on the queue.

Parameters:
key - The string that contains the key used to search for an entry. An entry must have a key equal to this value to be read.
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o read
 public KeyedDataQueueEntry read(String key,
                                 int wait,
                                 String searchType) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Reads an entry from the data queue and removes it from the queue.

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. Negative one (-1) indicates 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).
Returns:
The entry read from the queue. If no entries were available, null is returned.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.
 o write
 public void write(byte key[],
                   byte data[]) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
Writes an entry to the data queue.

Parameters:
key - The array that contains the key for this entry.
data - The array of bytes to write to the queue.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o write
 public void write(String key,
                   String data) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
Writes a string entry to the data queue.

Parameters:
key - The string that contains the key for this entry.
data - The string to write to the queue.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: UnsupportedEncodingException
If the ccsid is not supported.

All Packages  Class Hierarchy  This Package  Previous  Next  Index