|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.MessageQueue
The MessageQueue class represents an AS/400 message queue. If no message
queue path is set, then the default is CURRENT
,
which represents the current user's message queue,
/QSYS.LIB/QUSRSYS.LIB/userID.MSGQ
.
Some of the selections have associated get and set methods
defined in this class. These are provided for backwards compatibility
with previous versions of the AS/400 Toolbox for Java. The complete
set of selections can be accessed using the
RMessageQueue
class.
QueuedMessage objects have many attributes. Only some of these attribute values are set, depending on how a QueuedMessage object is created. The following is a list of attributes whose values are set on QueuedMessage objects returned in a list of messages:
The following is a list of attributes whose values are set on objects returned by receive():
RMessageQueue
, Serialized FormField Summary | |
static java.lang.String |
ALL
Constant referring to all messages in the message queue. |
static java.lang.String |
ANY
Constant referring to any message in the message queue. |
static java.lang.String |
BYKEY
Constant referring to a message identified by a key. |
static java.lang.String |
COMPLETION
Constant referring to completion messages. |
static java.lang.String |
COPY
Constant referring to the sender's copy of a previously sent inquiry message. |
static java.lang.String |
CURRENT
Constant referring to the current user's message queue. |
static java.lang.String |
DIAGNOSTIC
Constant referring to diagnostic messages. |
static java.lang.String |
FIRST
Constant referring to the first message in the message queue. |
static java.lang.String |
INFORMATIONAL
Constant referring to informational messages. |
static java.lang.String |
INQUIRY
Constant referring to inquiry messages. |
static java.lang.String |
KEEP_UNANSWERED
Constant referring to all messages in the message queue except unanswered inquiry and unanswered senders' copy messages. |
static java.lang.String |
LAST
Constant referring to the last message in the message queue. |
static java.lang.String |
MESSAGES_NEED_REPLY
Constant referring to messages that need a reply. |
static java.lang.String |
MESSAGES_NO_NEED_REPLY
Constant referring to messages that do not need a reply. |
static java.lang.String |
NEW
Constant referring to all new messages in the message queue. |
static byte[] |
NEWEST
Constant referring to the message key for the newest message in the queue. |
static java.lang.String |
NEXT
Constant referring to the next message in the message queue. |
static java.lang.String |
OLD
Constant referring to all old messages in the message queue. |
static byte[] |
OLDEST
Constant referring to the message key for the oldest message in the queue. |
static java.lang.String |
PREVIOUS
Constant referring to the previous message in the message queue. |
static java.lang.String |
REMOVE
Constant indicating that the message should be removed from the message queue. |
static java.lang.String |
REPLY
Constant referring to the reply to an inquiry message. |
static java.lang.String |
SAME
Constant indicating that the message should remain in the message queue without changing its new or old designation. |
static java.lang.String |
SENDERS_COPY_NEED_REPLY
Constant referring to the sender's copies of messages that need replies. |
Constructor Summary | |
MessageQueue()
Constructs a MessageQueue object. |
|
MessageQueue(AS400 system)
Constructs a MessageQueue object. |
|
MessageQueue(AS400 system,
java.lang.String path)
Constructs a MessageQueue object. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener. |
int |
getHelpTextFormatting()
Returns the status of help text formatting. |
int |
getLength()
Returns the number of messages in the message queue. |
boolean |
getListDirection()
Returns the list direction. |
java.util.Enumeration |
getMessages()
Returns the list of messages in the message queue. |
java.lang.String |
getPath()
Returns the fully qualified integrated file system path name of the message queue, or CURRENT to refer to the user's default message queue. |
java.lang.String |
getSelection()
Returns the selection that describes which messages are returned. |
int |
getSeverity()
Returns the severity of the messages which are returned. |
AS400 |
getSystem()
Returns the system. |
QueuedMessage |
receive(byte[] messageKey)
Receives a message from the message queue by key. |
QueuedMessage |
receive(byte[] messageKey,
int waitTime,
java.lang.String messageAction,
java.lang.String messageType)
Receives a message from the message queue. |
void |
remove()
Remove all messages from the message queue. |
void |
remove(byte[] messageKey)
Removes a message from the message queue. |
void |
remove(java.lang.String messageType)
Remove messages from the message queue. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener. |
void |
reply(byte[] messageKey,
java.lang.String replyText)
Replies to and removes a message. |
void |
reply(byte[] messageKey,
java.lang.String replyText,
boolean remove)
Replies to and removes a message if requested. |
void |
sendInformational(java.lang.String messageText)
Sends an informational message to the message queue. |
void |
sendInformational(java.lang.String messageID,
java.lang.String messageFile)
Sends an informational message to the message queue. |
void |
sendInformational(java.lang.String messageID,
java.lang.String messageFile,
byte[] substitutionData)
Sends an informational message to the message queue. |
byte[] |
sendInquiry(java.lang.String messageText,
java.lang.String replyMessageQueue)
Sends an inquiry message to the message queue. |
byte[] |
sendInquiry(java.lang.String messageID,
java.lang.String messageFile,
byte[] substitutionData,
java.lang.String replyMessageQueue)
Sends an inquiry message to the message queue. |
byte[] |
sendInquiry(java.lang.String messageID,
java.lang.String messageFile,
java.lang.String replyMessageQueue)
Sends an inquiry message to the message queue. |
void |
setHelpTextFormatting(int helpTextFormatting)
Sets the help text formatting value. |
void |
setListDirection(boolean listDirection)
Sets the list direction. |
void |
setPath(java.lang.String path)
Sets the fully qualified integrated file system path name of the message queue. |
void |
setSelection(java.lang.String selection)
Sets the selection that describes which messages are returned. |
void |
setSeverity(int severity)
Sets the severity of the messages which are returned. |
void |
setSystem(AS400 system)
Sets the system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ALL
public static final java.lang.String ANY
public static final java.lang.String BYKEY
public static final java.lang.String COMPLETION
public static final java.lang.String COPY
public static final java.lang.String CURRENT
public static final java.lang.String DIAGNOSTIC
public static final java.lang.String FIRST
public static final java.lang.String INFORMATIONAL
public static final java.lang.String INQUIRY
public static final java.lang.String KEEP_UNANSWERED
public static final java.lang.String LAST
public static final java.lang.String MESSAGES_NEED_REPLY
public static final java.lang.String MESSAGES_NO_NEED_REPLY
public static final java.lang.String NEW
public static final byte[] NEWEST
public static final java.lang.String NEXT
public static final java.lang.String OLD
public static final byte[] OLDEST
public static final java.lang.String PREVIOUS
public static final java.lang.String REMOVE
public static final java.lang.String REPLY
public static final java.lang.String SAME
public static final java.lang.String SENDERS_COPY_NEED_REPLY
Constructor Detail |
public MessageQueue()
public MessageQueue(AS400 system)
system
- The system.public MessageQueue(AS400 system, java.lang.String path)
system
- The system.path
- The fully qualified integrated file system path name
of the message queue, or CURRENT to refer to the user's
default message queue.Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public int getLength()
public int getHelpTextFormatting()
MessageFile.NO_FORMATTING
- The help text is returned as a string of characters.
This is the default.
MessageFile.RETURN_FORMATTING_CHARACTERS
- The help text contains AS/400
formatting characters. The formatting characters are:
MessageFile.SUBSTITUTE_FORMATTING_CHARACTERS
- The MessageFile class replaces
AS/400 formatting characters with newline and space characters.
public boolean getListDirection()
public java.util.Enumeration getMessages() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
QueuedMessage
objects.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public java.lang.String getPath()
public java.lang.String getSelection()
RMessageQueue.SELECTION_CRITERIA
public int getSeverity()
RMessageQueue.SEVERITY_CRITERIA
public AS400 getSystem()
public QueuedMessage receive(byte[] messageKey) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageKey
- The message key.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.QueuedMessage.getKey()
public QueuedMessage receive(byte[] messageKey, int waitTime, java.lang.String messageAction, java.lang.String messageType) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageKey
- The message key, or null if no message key is needed.waitTime
- The number of seconds to wait for the message to arrive in the queue
so it can be received. If the message is not received within the
specified wait time, null is returned. Special values are:
messageAction
- The action to take after the message is received. Valid values are:
messageType
- The type of message to return. Valid values are:
AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.QueuedMessage.getKey()
public void remove() throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void remove(byte[] messageKey) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageKey
- The message key.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void remove(java.lang.String messageType) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageType
- The type of message to remove. Valid values are:
AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener.public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- The listener.public void reply(byte[] messageKey, java.lang.String replyText) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageKey
- The message key.replyText
- The reply.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void reply(byte[] messageKey, java.lang.String replyText, boolean remove) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageKey
- The message key.replyText
- The reply.remove
- true to remove the inquiry message and the reply from the
message queue after the reply is sent, false to keep the
inquiry message and the reply after the reply is sent.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void sendInformational(java.lang.String messageID, java.lang.String messageFile) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageID
- The message ID.messageFile
- The integrated file system path name of the message file.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void sendInformational(java.lang.String messageID, java.lang.String messageFile, byte[] substitutionData) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageID
- The message ID.messageFile
- The integrated file system path name of the message file.substitutionData
- The substitution data for the message, or null if none.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void sendInformational(java.lang.String messageText) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageText
- The message text.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public byte[] sendInquiry(java.lang.String messageID, java.lang.String messageFile, java.lang.String replyMessageQueue) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageID
- The message ID.messageFile
- The integrated file system path name of the message file.replyMessageQueue
- The integrated file system path name of the reply message queue.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public byte[] sendInquiry(java.lang.String messageID, java.lang.String messageFile, byte[] substitutionData, java.lang.String replyMessageQueue) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageID
- The message ID.messageFile
- The integrated file system path name of the message file.substitutionData
- The substitution data for the message, or null if none.replyMessageQueue
- The integrated file system path name of the reply message queue.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public byte[] sendInquiry(java.lang.String messageText, java.lang.String replyMessageQueue) throws AS400Exception, AS400SecurityException, java.io.IOException, ObjectDoesNotExistException, ErrorCompletingRequestException, java.lang.InterruptedException
messageText
- The message text.replyMessageQueue
- The integrated file system path name of the reply message queue.AS400Exception
- If the AS/400 system returns an error message.AS400SecurityException
- If a security or authority error occurs.ConnectionDroppedException
- If the connection is dropped unexpectedly.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the AS/400.ObjectDoesNotExistException
- If the AS/400 object does not exist.public void setHelpTextFormatting(int helpTextFormatting)
MessageFile.NO_FORMATTING
- the help text is returned as a string of characters.
This is the default.
MessageFile.RETURN_FORMATTING_CHARACTERS
- the help text contains AS/400
formatting characters. The formatting characters are:
MessageFile.SUBSTITUTE_FORMATTING_CHARACTERS
- the MessageFile class replaces
AS/400 formatting characters with new line and space characters.
value
- The help text formatting value.public void setListDirection(boolean listDirection)
listDirection
- true to list the messages in order from oldest to
newest; false to list the messages in order from newest
to oldest. The default is true.public void setPath(java.lang.String path) throws java.beans.PropertyVetoException
path
- The fully qualified integrated file system path name of the
message queue, or CURRENT to refer to the user's default
message queue.java.beans.PropertyVetoException
- If the change is vetoed.public void setSelection(java.lang.String selection) throws java.beans.PropertyVetoException
selection
- The selection. Valid values are:
java.beans.PropertyVetoException
- If the change is vetoed.RMessageQueue.SELECTION_CRITERIA
public void setSeverity(int severity) throws java.beans.PropertyVetoException
severity
- The severity of the messages to be returned. The
value must be between 0 and 99, inclusive.java.beans.PropertyVetoException
- If the change is vetoed.RMessageQueue.SEVERITY_CRITERIA
public void setSystem(AS400 system) throws java.beans.PropertyVetoException
system
- The system.java.beans.PropertyVetoException
- If the property change is vetoed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |