All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.DataQueue

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

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


Constructor Index

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

Method Index

 o create(DataQueueAttributes)
Creates a data queue on the AS/400.
 o create(int)
Creates a data queue on the AS/400.
 o create(int, String, boolean, boolean, boolean, String)
Creates a data queue on the AS/400.
 o peek()
Reads an entry from the data queue without removing it from the queue.
 o peek(int)
Reads an entry from the data queue without removing it from the queue.
 o read()
Reads an entry from the data queue and removes it from the queue.
 o read(int)
Reads an entry from the data queue and removes it from the queue.
 o toString()
Returns the String representation of this data queue object.
 o write(byte[])
Writes an entry to the data queue.
 o write(String)
Writes a string entry to the data queue.

Constructors

 o DataQueue
 public DataQueue()
Constructs a DataQueue object. The system and path properties will need to be set before using any method requiring a connection to the AS/400.

 o DataQueue
 public DataQueue(AS400 system,
                  String path)
Constructs a DataQueue 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 AS/400 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 create
 public void create(DataQueueAttributes attributes) throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectAlreadyExistsException, ObjectDoesNotExistException
Creates a data queue on the AS/400. The queue will be created with the attributes provided.

Parameters:
attributes - The attributes of the data queue to be created.
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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
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 maxEntryLength) throws AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectAlreadyExistsException, ObjectDoesNotExistException
Creates a data queue on the AS/400. The queue will be created with the following attributes: authority = *LIBCRTAUT, saveSenderInformation = false, FIFO = true, forceToAuxiliaryStorage = false, description = (50 blanks)

Parameters:
maxEntryLength - The maximum number of bytes per data queue entry. Valid values are 1-64512.
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: IOException
If an error occurs while communicating with the AS/400.
Throws: InterruptedException
If this thread is interrupted.
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 maxEntryLength,
                    String authority,
                    boolean saveSenderInformation,
                    boolean FIFO,
                    boolean forceToAuxiliaryStorage,
                    String description) throws AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectAlreadyExistsException, ObjectDoesNotExistException
Creates a data queue on the AS/400.

Parameters:
maxEntryLength - The maximum number of bytes per data queue entry. Valid values are 1-64512.
authority - The public authority for the data queue. Valid values are *ALL, *CHANGE, *EXCLUDE, *USE, *LIBCRTAUT.
saveSenderInformation - Determines if entry origin information will be saved.
FIFO - true if queue entries are processed in FIFO order, false if queue entries are processed in LIFO order.
forceToAuxiliaryStorage - true if writes are forced to storage before return.
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: IOException
If an error occurs while communicating with the AS/400.
Throws: InterruptedException
If this thread is interrupted.
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 peek
 public DataQueueEntry peek() throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Reads an entry from the data queue without removing it from the queue. This method will not wait for entries if none are on the queue. An exception is thrown when running to a pre-V4R5 server if the maximum length of a message on the queue is greater than 31744 bytes.

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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o peek
 public DataQueueEntry peek(int wait) throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Reads an entry from the data queue without removing it from the queue. An exception is thrown when running to a pre-V4R5 server if the maximum length of a message on the queue is greater than 31744 bytes.

Parameters:
wait - The number of seconds to wait if the queue contains no entries. Negative one (-1) means to wait until an entry is available.
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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o read
 public DataQueueEntry read() throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Reads an entry from the data queue and removes it from the queue. This method will not wait for entries if none are on the queue.

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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o read
 public DataQueueEntry read(int wait) throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Reads an entry from the data queue and removes it from the queue.

Parameters:
wait - The number of seconds to wait if the queue contains no entries. Negative one (-1) means to wait until an entry is available.
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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o toString
 public String toString()
Returns the String representation of this data queue object.

Returns:
The String representation of this data queue object.
Overrides:
toString in class BaseDataQueue
 o write
 public void write(byte data[]) throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Writes an entry to the data queue.

Parameters:
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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
 o write
 public void write(String data) throws AS400SecurityException, ErrorCompletingRequestException, IOException, IllegalObjectTypeException, InterruptedException, ObjectDoesNotExistException
Writes a string entry to the data queue.

Parameters:
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: IOException
If an error occurs while communicating with the AS/400.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
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