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.
-
DataQueue()
- Constructs a DataQueue object.
-
DataQueue(AS400, String)
- Constructs a DataQueue object.
-
create(DataQueueAttributes)
- Creates a data queue on the AS/400.
-
create(int)
- Creates a data queue on the AS/400.
-
create(int, String, boolean, boolean, boolean, String)
- Creates a data queue on the AS/400.
-
peek()
- Reads an entry from the data queue without removing it from the queue.
-
peek(int)
- Reads an entry from the data queue without removing it from the queue.
-
read()
- Reads an entry from the data queue and removes it from the queue.
-
read(int)
- Reads an entry from the data queue and removes it from the queue.
-
write(byte[])
- Writes an entry to the data queue.
-
write(String)
- Writes a string entry to the data queue.
DataQueue
public DataQueue()
- Constructs a DataQueue object. The system and name properties will need to be set before using any method requiring a connection to the AS/400.
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.
create
public void create(DataQueueAttributes attributes) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, 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: 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: 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.
create
public void create(int entryLength) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException
- Creates a data queue on the AS/400. The queue will be created with the following attributes: authority = *LIBCRTAUT, saveSenderInfo = false, FIFO = true, forceToAuxiliaryStorage = false, description = (50 blanks)
- Parameters:
- 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.
create
public void create(int entryLength,
String authority,
boolean saveSenderInfo,
boolean FIFO,
boolean forceToAuxiliaryStorage,
String description) throws AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException
- Creates a data queue on the AS/400.
- Parameters:
- 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.
- 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: 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.
peek
public DataQueueEntry peek() 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 none are on the queue.
An exception is thrown 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: 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.
peek
public DataQueueEntry peek(int wait) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
- Reads an entry from the data queue without removing it from the queue.
An exception is thrown 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. -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: 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.
read
public DataQueueEntry read() 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 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: 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.
read
public DataQueueEntry read(int wait) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException
- Reads an entry from the data queue and removes it from 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: 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.
write
public void write(byte data[]) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, 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: 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.
write
public void write(String data) throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
- 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: 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