|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.safmq.MQConnection
public class MQConnection
This class provides an interface to communicate with a SAFMQ message queue
server. Typically instances of this class are constructed by the
MQBuilder
class, however constructing the class directly
is also allowed.
Once constructed, this class may be used to construct
instances of the class MessageQueue
to abstract the connection
interface to the message queue level.
Note: This class is not thread safe, and applications should take precautions to not initiate communications with a message queue via more than one (1) thread simultaneously.
MQBuilder.buildConnection(URI,String,String)
,
MessageQueue
Nested Class Summary | |
---|---|
class |
MQConnection.QueueData
Result data from a call to MQConnection.EnumerateQueues(Vector) . |
class |
MQConnection.QueuePermissions
Contains an entity's permission when accessing a queue. |
class |
MQConnection.UserDescription
Result data from a call to MQConnection.EnumerateUsers(Vector) . |
Constructor Summary | |
---|---|
MQConnection(java.net.Socket s,
java.lang.String user,
java.lang.String password)
Constructs the object from the name of the server, the tcp/ip port to be used the user's name and password. |
Method Summary | |
---|---|
int |
AddUserIdentity(java.lang.String subjectDN,
java.lang.String issuerDN,
java.lang.String username)
Adds an X509 digitital certificate identity mapping. |
int |
AdvanceCursor(QueueHandle qhandle,
CursorHandle cursorID)
Advances the cursor to the next message in the queue. |
int |
BeginTransaction()
Begins a transaction which causes all Retrieve & Enqueue operations to be committed atomically. |
void |
Close()
Closes the connection to the server. |
int |
CloseCursor(QueueHandle qhandle,
CursorHandle cursorID)
Closes a cursor when it is no longer needed to access the queue. |
int |
CloseQueue(QueueHandle handle)
Closes a queue which was previously opened. |
int |
CommitTransaction()
Commits a group of Retrieve & Enqueue operations atomically. |
int |
CreateGroup(java.lang.String groupname)
Creates a new security group on the SAFMQ server. |
int |
CreateQueue(java.lang.String queuename)
Creates a new queue on the SAFMQ server. |
int |
CreateTempQueue(java.lang.String[] tmpQueueName,
QueueHandle tmpQueue)
Creates a new temporary message queue. |
int |
CreateUser(java.lang.String username,
java.lang.String password,
java.lang.String description)
Create a new user by providing a user name, password and description. |
int |
DeleteGroup(java.lang.String groupname)
Removes the security group from the SAFMQ server. |
int |
DeleteQueue(java.lang.String queuename)
Attempts to remove a queue fromt he SAFMQ server. |
int |
DeleteUser(java.lang.String username)
Delete a user from the SAFMQ server. |
int |
EndTransaction()
Commits and closes a group of Retrieve & Enqueue operations. |
int |
Enqueue(QueueHandle handle,
QueueMessage msg)
Places a message on the queue. |
int |
EnqueueWithRelay(java.net.URI uri,
QueueMessage msg)
Enqueues a message for message relay forwarding to another queue/queue server. |
int |
EnumerateGroups(java.util.Vector groups)
Retrieves a list of all groups available on the SAFMQ server. |
int |
EnumerateQueues(java.util.Vector qnames)
Retrieves a list of all queues served by the connection and the queue's owner. |
int |
EnumerateUserIdentities(java.lang.String username,
java.util.Vector ids)
Lists a set of X509 subject name and issuer names associated with the passed SAFMQ user login id. |
int |
EnumerateUsers(java.util.Vector users)
Retrieves a list of users which may access the SAFMQ server. |
MQConnection.UserDescription |
genDesc(java.lang.String name,
java.lang.String desc)
For external use of UserDescriptions. |
int |
GetQueueStatistics(QueueHandle qhandle,
boolean includeStorageBytes,
boolean includeMessageBytes,
QueueStatistics stats)
Gets statistics about an open queue. |
int |
GetServerMajorProtocolVersion()
|
int |
GetServerMinorProtocolVersion()
|
int |
GetServerStatistics(QueueStatistics stats)
Gets statistics for an entire server. |
int |
GroupAddUser(java.lang.String groupname,
java.lang.String username)
Adds a user to a group. |
int |
GroupDeleteUser(java.lang.String groupname,
java.lang.String username)
Deletes a user from a group. |
int |
GroupGetPermissions(java.lang.String groupname,
ActorPermissions actorPerms)
Retrieves the permissions of a specific group. |
int |
GroupGetUsers(java.lang.String groupname,
java.util.Vector users)
Retrieves a the list of users in a group. |
int |
GroupSetPermissions(java.lang.String groupname,
boolean modifyqueues,
boolean modifyusers,
boolean modifygroups)
Changes the permissions for the specified group. |
int |
OpenCursor(QueueHandle qhandle,
CursorHandle cursorID)
Opens a cursor for sequential reading of the queue. |
int |
OpenQueue(java.lang.String queuename,
QueueHandle handle)
Opens a queue for reading and writing. |
int |
PeekCursor(QueueHandle qhandle,
boolean retrievebody,
CursorHandle cursorID,
QueueMessage msg)
Retrieves the message pointed to by cursorID . |
int |
PeekFront(QueueHandle qhandle,
boolean retrievebody,
int timeoutseconds,
QueueMessage msg)
Gathers the highest priority FIFO message present on the queue. |
int |
PeekID(QueueHandle qhandle,
boolean retrievebody,
UUID id,
int timeoutseconds,
QueueMessage msg)
Gathers the message identified by id in the message's
receipt id, set prior to the message having been enqueued (See:
Enqueue(QueueMessage) . |
int |
QueueDeleteGroupPermission(java.lang.String queuename,
java.lang.String groupname)
Removes permissions for a specified group. |
int |
QueueDeleteUserPermission(java.lang.String queuename,
java.lang.String username)
Removes permissions for a specified user. |
int |
QueueEnumeratePermissions(java.lang.String queuename,
java.util.Vector perms)
Retrieves the permission profile for the specified queue. |
int |
QueueSetGroupPermission(java.lang.String queuename,
java.lang.String groupname,
boolean rd,
boolean wr,
boolean destroy,
boolean changesecurity)
Attempts to set the security profile for a specified group. |
int |
QueueSetUserPermission(java.lang.String queuename,
java.lang.String username,
boolean rd,
boolean wr,
boolean destroy,
boolean changesecurity)
Attempts to set the security profile for a specified user. |
int |
RemoveUerIdentity(java.lang.String subjectDN,
java.lang.String issuerDN)
Removes an X509 digitital certificate identity mapping. |
int |
Retrieve(QueueHandle qhandle,
boolean retrievebody,
int timeoutseconds,
QueueMessage msg)
Retrieves the highest priority FIFO message present on the queue. |
int |
RetrieveCursor(QueueHandle qhandle,
boolean retrievebody,
CursorHandle cursorID,
QueueMessage msg)
Retrieves the message pointed to by cursorID . |
int |
RetrieveID(QueueHandle qhandle,
boolean retrievebody,
UUID id,
int timeoutseconds,
QueueMessage msg)
Retrieves the message identified by id in the message's
receipt id, set prior to the message having been enqueued (See:
Enqueue(QueueMessage) . |
int |
RollbackTransaction()
Rolls back or "undoes" a group of Retrieve & Enqueue operations atomically. |
int |
SeekID(QueueHandle qhandle,
UUID id,
int timeoutseconds,
CursorHandle cursorID)
Attempts to locate the messaged indicated by id . |
int |
SetPassword(java.lang.String username,
java.lang.String password)
Changes the password for the specified user. |
int |
TestCursor(QueueHandle qhandle,
CursorHandle cursorID)
Determines whether the cursor indicated by cursorID is still
a valid cursor, and has not been invalidated by other queue readers. |
int |
UserGetGroups(java.lang.String username,
java.util.Vector groups)
Retrieves a the list of groups the in which the user resides. |
int |
UserGetPermissions(java.lang.String username,
ActorPermissions actorPerms)
Retrieve the permissions for a specific user. |
int |
UserSetPermissions(java.lang.String username,
boolean modifyqueues,
boolean modifyusers,
boolean modifygroups)
Change the user's permissions to those specified. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MQConnection(java.net.Socket s, java.lang.String user, java.lang.String password) throws MQException, java.io.IOException
s
- A socket connected to the server.user
- The name of the user wishing to connect to the serverpassword
- The password of the user wishing to connect to the server
MQException
- In the case that the supplied credentials are not accepted by
the SAFMQ server. The value of MQException.getErrorCode()
could be but is not limited to:
Safmq.EC_LOGIN |
The login credentials supplied were not accepted. |
java.io.IOException
- In the case the SAFMQ server was not able to be contacted
via TCP/IP.Method Detail |
---|
public MQConnection.UserDescription genDesc(java.lang.String name, java.lang.String desc)
name
- Name of the accountdesc
- Description of the account
UserDescription
object.public void Close()
public int GetServerMajorProtocolVersion()
public int GetServerMinorProtocolVersion()
public int OpenQueue(java.lang.String queuename, QueueHandle handle)
handle
for calls such as
Enqueue(QueueHandle,QueueMessage)
and
Retrieve(QueueHandle,boolean,int,QueueMessage)
.
Note: Queues which have been opened by a call to OpenQueue()
must be closed by a call to CloseQueue(QueueHandle)
if the queue
is not closed, resources allocated by a call to OpenQueue()
will not be released.
queuename
- The name of the queuehandle
- Receives a reference to the queue
Safmq.EC_NOERROR
on success otherwise errors such as these, but
not limited to could be produced:
Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_DOESNOTEXIST |
The queue does not exist on the server specified. |
CloseQueue(QueueHandle handle)
public int CloseQueue(QueueHandle handle)
handle
- Reference to the previously opened queue
Safmq.EC_NOERROR
on success otherwise errors such as these, but
not limited to could be produced:
Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTOPEN |
The queue was not currently in an open status in the context of this connection. |
public int GetQueueStatistics(QueueHandle qhandle, boolean includeStorageBytes, boolean includeMessageBytes, QueueStatistics stats)
stats
.
qhandle
- Handle to an open queueincludeStorageBytes
- Causes server to calculate the number of bytes on diskincludeMessageBytes
- Causes the server to calculate the number of bytes in queue, may be less than bytes on diskstats
- Receives the statistics information.
public int GetServerStatistics(QueueStatistics stats)
stats
- Receives the statistics information.
public int EnqueueWithRelay(java.net.URI uri, QueueMessage msg)
msg
's
time stamp and message will have been set. It is important to note if the response
queue name is not set, any errors from the final destination queue/queue server will
be lost. It is suggested to use round tripping unless error determination is not
required, otherwise errors generated by the final destination server such as:EC_DOESNOTEXIST |
EC_NOTAUTHORIZED |
EC_WRONGMESSAGETYPE |
EC_NOTOPEN |
EC_FORWARDNOTALLOWED |
EC_DUPLICATEMSGID |
uri
- A safmq URI in the format safmq://user:password@server:port/queuename -or- for ssl safmqs://user:password@server:port/queuename.msg
- The message to be sent.
public int Enqueue(QueueHandle handle, QueueMessage msg)
msg
must have
been previously prepared before calling this method. Upon successful sending
of the message, the message id and message time stamp will be set by the server
and may be retrieved by a call to QueueMessage.getMessageID()
and QueueMessage.getTimeStamp()
respectively.
Note: Message responders will typically place the message id of the original message in the receipt id of the message being returned. This round-trip message identification is provided by SAFMQ as a method for coordinated two-way communications.
handle
- A reference to a queue opened by a call to OpenQueue()
msg
- The message to be placed on the queue
Safmq.EC_NOERROR
on success, Otherwise results may be such listed
below but are not limited to:
Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to write messages to this queue. |
OpenQueue(String, QueueHandle)
public int Retrieve(QueueHandle qhandle, boolean retrievebody, int timeoutseconds, QueueMessage msg)
msg
.
Note: Retrieved messages are removed from the queue
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedtimeoutseconds
- The number of seconds to wait before returning, a value of zero (0) will
cause the method to return immediately if no messages are present on the queue,
a value of (-1) will cause the method to wait until a message is placed on the queue.msg
- Receives the contents of the message.
Safmq.EC_NOERROR
is returned and
the resulting message is placed in msg
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_TIMEDOUT |
The operation timed out before a message became available. |
OpenQueue(String, QueueHandle)
public int RetrieveID(QueueHandle qhandle, boolean retrievebody, UUID id, int timeoutseconds, QueueMessage msg)
id
in the message's
receipt id, set prior to the message having been enqueued (See:
Enqueue(QueueMessage)
. The results are placed in the object
msg
.
Note: Message responders will typically place the message id of the original message in the receipt id of the message being returned. This round-trip message identification is provided by SAFMQ as a method for coordinated two-way communications.
Note: Retrieved messages are removed from the queue.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedid
- The UUID of the message to be retrieved.timeoutseconds
- The number of seconds to wait before returning, a value of zero (0) will
cause the method to return immediately if no messages are present on the queue,
a value of (-1) will cause the method to wait until a message is placed on the queue.msg
- Receives the contents of the message.
Safmq.EC_NOERROR
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_TIMEDOUT |
The operation timed out before a message became available. |
Enqueue(QueueMessage)
,
OpenQueue(String, QueueHandle)
public int RetrieveCursor(QueueHandle qhandle, boolean retrievebody, CursorHandle cursorID, QueueMessage msg)
cursorID
. The results
are placed in the object msg
.
Note: Retrieved messages are removed from the queue.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedcursorID
- The cursor indicating the current position in the queue to be read frommsg
- Receives the contents of the message.
Safmq.EC_NOERROR
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_CURSORINVALIDATED |
The cursor no longer points to a valid location in the queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
OpenQueue(String, QueueHandle)
public int PeekFront(QueueHandle qhandle, boolean retrievebody, int timeoutseconds, QueueMessage msg)
msg
. Any errors from the operation are
returned on the stack. The message retrieved is not removed from the
queue and is available for reading by other queue readers.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedtimeoutseconds
- The number of seconds to wait before returning, a value of zero (0) will
cause the method to return immediately if no messages are present on the queue,
a value of (-1) will cause the method to wait until a message is placed on the queue.msg
- Receives the contents of the message.
Safmq.EC_NOERROR
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_TIMEDOUT |
The operation timed out before a message became available. |
OpenQueue(String, QueueHandle)
public int PeekID(QueueHandle qhandle, boolean retrievebody, UUID id, int timeoutseconds, QueueMessage msg)
id
in the message's
receipt id, set prior to the message having been enqueued (See:
Enqueue(QueueMessage)
. The results are placed in the object
msg
. The message retrieved is not removed from the
queue and is available for reading by other queue readers.
Note: Message responders will typically place the message id of the original message in the receipt id of the message being returned. This round-trip message identification is provided by SAFMQ as a method for coordinated two-way communications.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedid
- The UUID of the message to be retrieved.timeoutseconds
- The number of seconds to wait before returning, a value of zero (0) will
cause the method to return immediately if no messages are present on the queue,
a value of (-1) will cause the method to wait until a message is placed on the queue.msg
- Receives the contents of the message.
Safmq.EC_NOERROR
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_TIMEDOUT |
The operation timed out before a message became available. |
Enqueue(QueueMessage)
,
OpenQueue(String, QueueHandle)
public int PeekCursor(QueueHandle qhandle, boolean retrievebody, CursorHandle cursorID, QueueMessage msg)
cursorID
. The results
are placed in the object msg
. The message retrieved is
not removed from the queue and is available for reading by other
queue readers.
Note: Retrieved messages are removed from the queue.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)retrievebody
- A flag indicating whether the body of the message should be retrievedcursorID
- The cursor indicating the current position in the queue to be read frommsg
- Receives the contents of the message.
Safmq.EC_NOERROR
, otherwise
errors such as but not limited to could occur: Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOMOREMESSAGES |
The queue is empty and no more messages are available. |
Safmq.EC_ALREADYCLOSED |
The queue reference is not valid as it has been closed. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_CURSORINVALIDATED |
The cursor no longer points to a valid location in the queue. |
OpenQueue(String, QueueHandle)
public int OpenCursor(QueueHandle qhandle, CursorHandle cursorID)
Cursors may be used to violate the priority FIFO nature of the queue
by scanning the queue and only retreiving messages which meet the
criteria of the reader. Cursor access is sequential when used in conjunction
with AdvanceCursor(CursorHandle)
, however specific messages may
be sought out by a call to SeekID(UUID,int,CursorHandle)
.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)cursorID
- A previously allocated reference to a CursorHandle
which will receive the reference to the cursor.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
OpenQueue(String, QueueHandle)
public int CloseCursor(QueueHandle qhandle, CursorHandle cursorID)
CloseCursor()
and
should not be used again.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)cursorID
- The cursor to be closed.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
OpenQueue(String, QueueHandle)
public int AdvanceCursor(QueueHandle qhandle, CursorHandle cursorID)
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)cursorID
- The cursor to be advanced.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_CURSORINVALIDATED |
The cursor is no longer valid. |
OpenQueue(String, QueueHandle)
public int SeekID(QueueHandle qhandle, UUID id, int timeoutseconds, CursorHandle cursorID)
id
. If the message
is succesfully located, the cursor will point to the message idenfified
and the message may be retrieved there after.
qhandle
- A handle to a queue previously opened by a call to OpenQueue(String)id
- The receipt UUID of the message to be locatedtimeoutseconds
- The maximum number of seconds the call should be allowed
before resulting in a "timeout".cursorID
- The cursor which should be be assigned the position
of the message indicated by id
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The user is not authorized to read messages from this queue. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_CURSORINVALIDATED |
The cursor is no longer valid. |
OpenQueue(String, QueueHandle)
public int TestCursor(QueueHandle qhandle, CursorHandle cursorID)
cursorID
is still
a valid cursor, and has not been invalidated by other queue readers.
cursorID
- The cursor which should be be evaluated
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTOPEN |
The queue specified has not been opened by this connection. |
Safmq.EC_CURSORINVALIDATED |
The cursor is no longer valid. |
OpenQueue(String, QueueHandle)
public int BeginTransaction()
Safmq.EC_NOERROR
, Safmq.EC_NETWORKERROR
,
Safmq.EC_ALREADYOPEN
if a transaction is already openpublic int CommitTransaction()
Safmq.EC_NOERROR
, Safmq.EC_NETWORKERROR
public int RollbackTransaction()
Safmq.EC_NOERROR
, Safmq.EC_NETWORKERROR
public int EndTransaction()
Safmq.EC_NOERROR
, Safmq.EC_NETWORKERROR
,
Safmq.EC_NOTOPEN
in the case that a transaction was not open.public int EnumerateQueues(java.util.Vector qnames)
Vector qnames
receives MQConnection.QueueData
objects to enumerate the queue.
qnames
- The vector which will be emptied then populated with MQconnection.QueueData
objects.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
MQConnection.QueueData
public int EnumerateUsers(java.util.Vector users)
MQConnection.UserDescription
objects placed in the passed Vector, users
.
users
- The vector which will be emptied then populated with MQConnection.UserDescription
objects
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
MQConnection.UserDescription
public int EnumerateGroups(java.util.Vector groups)
String
objects representing
the name of the group.
groups
- The vector which will be emptied then populated with
String
objects containing the names of the
groups.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
public int CreateUser(java.lang.String username, java.lang.String password, java.lang.String description)
username
- The name of the new userpassword
- The password for the new user, cannot be nulldescription
- The description for the new user.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_ALREADYDEFINED |
A user with this name already exists |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create users. |
public int DeleteUser(java.lang.String username)
username
- The name of the suer to delete.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create users. |
Safmq.EC_DOESNOTEXIST |
The user specified does not exist. |
public int UserSetPermissions(java.lang.String username, boolean modifyqueues, boolean modifyusers, boolean modifygroups)
username
- Name of the user to changemodifyqueues
- Allow the user to create queuesmodifyusers
- Allow the user to create and delete users and set permmsionsmodifygroups
- Allow the user to create, delete, and change group membership and permissions
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to modify user permissions. |
Safmq.EC_DOESNOTEXIST |
The specified user does not exist on the SAFMQ server. |
public int UserGetPermissions(java.lang.String username, ActorPermissions actorPerms)
username
- The name of the useractorPerms
- Receives the permissions for the user, must not be null.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_DOESNOTEXIST |
The specified user does not exist on the SAFMQ server, or the user has no permissions set. |
public int SetPassword(java.lang.String username, java.lang.String password)
username
- Name of the userpassword
- New password for the user.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create users. |
Safmq.EC_DOESNOTEXIST |
The specified user does not exist on the SAFMQ server. |
public int AddUserIdentity(java.lang.String subjectDN, java.lang.String issuerDN, java.lang.String username)
Example: (the sample X509 certificate shipped with SAFMQ source)
Subject: C=US, ST=Nebraska, L=Omaha, O=SAFMQ, CN=Matthew Battey/emailAddress=mattbattey@users.sourceforge.net Issuer: C=US, ST=Nebraska, L=Omaha, O=SAFMQ, CN=Matthew Battey/emailAddress=mattbattey@users.sourceforge.netThawte's Issuer DN:
Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=Certification Services Division, CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
In this case the issuer and subject are the same value, because the certificate shipped with SAFMQ is a "self-signed" certificate. Typically the Subject DN will be set by you and the Issuer DN will be determined by the organization certifying the authenticity of the certificate's origin.
Note: The Java implentation produces distinguished name strings in reverse order in comparison to the default output from tools like OpenSSL. SAFMQ uses OpenSSL so these must be in the order that OpenSSL would report the value pair order.
subjectDN
- [in] the Subject Distinguished Name of the certificateissuerDN
- [in] the Issuer Distinguished Name of the certificateusername
- [in] the target SAFMQ login id (username)
public int RemoveUerIdentity(java.lang.String subjectDN, java.lang.String issuerDN)
subjectDN
- [in] the Subject Distinguished Name of the certificateissuerDN
- [in] the Issuer Distinguished Name of the certificate
public int EnumerateUserIdentities(java.lang.String username, java.util.Vector ids)
username
- [in] The user name used to search for X509 identities.ids
- [out] This vector of safmq::X509Identity objects is populated upon successful return
public int CreateGroup(java.lang.String groupname)
groupname
- Name of the group to create.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_ALREADYDEFINED |
A group with this name already exists |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create groups. |
public int DeleteGroup(java.lang.String groupname)
groupname
- The name of the group
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create groups. |
Safmq.EC_DOESNOTEXIST |
The group specified does not exist. |
public int GroupSetPermissions(java.lang.String groupname, boolean modifyqueues, boolean modifyusers, boolean modifygroups)
groupname
- The name of the groupmodifyqueues
- Whether the group may create queuesmodifyusers
- Whether the group may create and delete users and set permissionsmodifygroups
- Whether the gorup may create, delete and change group membership and permissions
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to modify group permissions. |
Safmq.EC_DOESNOTEXIST |
The specified group does not exist on the SAFMQ server. |
public int GroupGetPermissions(java.lang.String groupname, ActorPermissions actorPerms)
groupname
- The name of the groupactorPerms
- Receives the permissions, must not be null
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_DOESNOTEXIST |
The specified group does not exist on the SAFMQ server, or no permissions have been set for that group. |
public int GroupAddUser(java.lang.String groupname, java.lang.String username)
groupname
- The name of the groupusername
- The name of the user
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to modify group permissions. |
Safmq.EC_DOESNOTEXIST |
The specified group does not exist on the SAFMQ server. |
public int GroupDeleteUser(java.lang.String groupname, java.lang.String username)
groupname
- The name of the groupusername
- The name of the user
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to modify group permissions. |
Safmq.EC_DOESNOTEXIST |
The specified group does not exist on the SAFMQ server. |
public int GroupGetUsers(java.lang.String groupname, java.util.Vector users)
Vector users
in the form of String
objects.
groupname
- The name of the users.users
- A vector receiving String
objects containing
the user's name.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_DOESNOTEXIST |
The specified group does not exist on the SAFMQ server. |
public int UserGetGroups(java.lang.String username, java.util.Vector groups)
Vector users
in the form of String
objects.
username
- The name of the users.groups
- A vector receiving String
objects containing
the group's name.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_DOESNOTEXIST |
The specified user does not exist on the SAFMQ server. |
public int CreateQueue(java.lang.String queuename)
queuename
- The name of the new queue to be created.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_ALREADYDEFINED |
A queue with this name already exists |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to create queues. |
public int CreateTempQueue(java.lang.String[] tmpQueueName, QueueHandle tmpQueue)
CreateTempQueue
the SAFMQ server has created a queue,
flagged as temporary, returns the server generated name of the queue, and a handle
to that queue. Closing the queue removes it from the system, there is no need to
explicitly delete it. Using the Closing technique, it is possible that the queue
may remain open, because other clients have access to the queue.
tmpQueueName
- [out] Receives the name of the temporary queue, relative to the server,
when supplying this queue name to other clients, the server URL
must be prepended to the name. i.e. If the url
safmq://localhost was used to open the connection use
"safmq://localhost/" + tmpQueue
when supplying
the queue name to other clients. Must be an array of atleast
one element, first element will receive the name.tmpQueue
- [out] Receives a handle to the open queue
public int DeleteQueue(java.lang.String queuename)
queuename
- The name of the queue to be removed.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_QUEUEOPEN |
The queue is currently in use by some connection. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to delete this queue. |
public int QueueSetUserPermission(java.lang.String queuename, java.lang.String username, boolean rd, boolean wr, boolean destroy, boolean changesecurity)
queuename
- Name of the queueusername
- Name of the userrd
- User may read from the queuewr
- User may write to the queuedestroy
- User may delete the queuechangesecurity
- User may alter security of the queue
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to change the permissions of the user. |
public int QueueDeleteUserPermission(java.lang.String queuename, java.lang.String username)
queuename
- The name of the queueeusername
- The name of the user
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to change the permissions of the user. |
Safmq.EC_DOESNOTEXIST |
The security record for that user does not exist. |
public int QueueSetGroupPermission(java.lang.String queuename, java.lang.String groupname, boolean rd, boolean wr, boolean destroy, boolean changesecurity)
queuename
- Name of the queuegroupname
- Name of the grouprd
- Group may read from the queuewr
- Group may write to the queuedestroy
- Group may delete the queuechangesecurity
- Group may alter security of the queue
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to change the permissions of the user. |
public int QueueDeleteGroupPermission(java.lang.String queuename, java.lang.String groupname)
queuename
- The name of the queuegroupname
- The name of the group
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
Safmq.EC_NOTAUTHORIZED |
The current logged in user is not authorized to change the permissions of the group. |
Safmq.EC_DOESNOTEXIST |
The security record for that group does not exist. |
public int QueueEnumeratePermissions(java.lang.String queuename, java.util.Vector perms)
Vector perms
as QueuePermissions
objects.
queuename
- The name of the queue.perms
- The vector which will be emptied and populated with MQConnection.QueuePermissions
objects.
Safmq.EC_NOERROR
upon success, otherwise errors returned
could be but are not limited to:Safmq.EC_NETWORKERROR |
A networking error has occurred and the connection is no longer valid. |
MQConnection.QueuePermissions
|
Copyright Matthew J. Battey, 2004-2010; Powered By: |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |