#include <LocalQueueManager.hpp>
Public Types | |
typedef uintptr_t | QueueHandle |
Protected Attributes | |
LocalAPIManager * | localManager |
QueueHandle | sessionQueue |
SessionID | sessionID |
Protected Attributes inherited from LocalAPISubsystem | |
LocalAPIManager * | apiManager |
Static Protected Attributes | |
static bool | createdSessionQueue = false |
Definition at line 52 of file LocalQueueManager.hpp.
Definition at line 58 of file LocalQueueManager.hpp.
LocalQueueManager::LocalQueueManager | ( | ) |
Initialize the local queue manager.
Definition at line 55 of file LocalQueueManager.cpp.
References localManager, sessionID, and sessionQueue.
RexxReturnCode LocalQueueManager::addToNamedQueue | ( | const char * | name, |
CONSTRXSTRING & | data, | ||
size_t | lifoFifo | ||
) |
Add an item to a named queue.
name | The name of the queue. |
data | The data to add |
lifoFifo | The lifo/fifo order flag. |
Definition at line 385 of file LocalQueueManager.cpp.
References ADD_TO_NAMED_QUEUE, mapReturnResult(), ServiceMessage::parameter1, ServiceMessage::parameter2, QueueManager, ClientMessage::send(), ServiceMessage::setMessageData(), _CONSTRXSTRING::strlength, and _CONSTRXSTRING::strptr.
RexxReturnCode LocalQueueManager::addToSessionQueue | ( | CONSTRXSTRING & | data, |
size_t | lifoFifo | ||
) |
Add an item to the session queue.
data | The data to add. |
lifoFifo | The lifo/fifo flag. |
Definition at line 406 of file LocalQueueManager.cpp.
References ADD_TO_SESSION_QUEUE, mapReturnResult(), ServiceMessage::parameter1, ServiceMessage::parameter2, ServiceMessage::parameter3, QueueManager, ClientMessage::send(), sessionQueue, ServiceMessage::setMessageData(), _CONSTRXSTRING::strlength, and _CONSTRXSTRING::strptr.
RexxReturnCode LocalQueueManager::clearNamedQueue | ( | const char * | name | ) |
Remove all items from a named queue.
name | The queue name. |
Definition at line 363 of file LocalQueueManager.cpp.
References CLEAR_NAMED_QUEUE, mapReturnResult(), QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().
RexxReturnCode LocalQueueManager::clearSessionQueue | ( | ) |
Remove all items from the session queue.
Definition at line 349 of file LocalQueueManager.cpp.
References CLEAR_SESSION_QUEUE, mapReturnResult(), QueueManager, ClientMessage::send(), and sessionQueue.
RexxReturnCode LocalQueueManager::createNamedQueue | ( | const char * | name, |
size_t | size, | ||
char * | createdName, | ||
size_t * | dup | ||
) |
Create a named queue
name | The requested queue name. |
size | The size of the buffer for the returned name. |
createdName | The buffer for the returned name. |
dup | The duplicate flag. |
Definition at line 199 of file LocalQueueManager.cpp.
References CREATE_NAMED_QUEUE, DUPLICATE_QUEUE_NAME, LocalAPIManager::getSession(), localManager, ServiceMessage::nameArg, ServiceMessage::parameter1, QueueManager, ServiceMessage::result, RXQUEUE_BADQNAME, RXQUEUE_OK, ClientMessage::send(), and validateQueueName().
QueueHandle LocalQueueManager::createSessionQueue | ( | SessionID | session | ) |
Create a new session queue
session | The session identifier |
Definition at line 178 of file LocalQueueManager.cpp.
References CREATE_SESSION_QUEUE, ServiceMessage::parameter1, QueueManager, and ClientMessage::send().
Referenced by initializeSessionQueue().
RexxReturnCode LocalQueueManager::deleteNamedQueue | ( | const char * | name | ) |
Delete a named queue.
name | The name of the queue. |
Definition at line 277 of file LocalQueueManager.cpp.
References DELETE_NAMED_QUEUE, mapReturnResult(), QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().
RexxReturnCode LocalQueueManager::deleteSessionQueue | ( | ) |
Delete the current session queue.
Definition at line 264 of file LocalQueueManager.cpp.
References DELETE_SESSION_QUEUE, mapReturnResult(), QueueManager, ClientMessage::send(), and sessionQueue.
Referenced by terminateProcess().
RexxReturnCode LocalQueueManager::getQueueCount | ( | const char * | name, |
size_t & | result | ||
) |
Get a queue count from a named queue.
name | The queue name. |
Definition at line 331 of file LocalQueueManager.cpp.
References GET_NAMED_QUEUE_COUNT, mapReturnResult(), ServiceMessage::parameter1, QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().
RexxReturnCode LocalQueueManager::getSessionQueueCount | ( | size_t & | result | ) |
Get the count of lines in the session queue.
Definition at line 313 of file LocalQueueManager.cpp.
References GET_SESSION_QUEUE_COUNT, mapReturnResult(), ServiceMessage::parameter1, QueueManager, ClientMessage::send(), and sessionQueue.
|
virtual |
Initialize the local (client) queue manager instance.
a | The local API manager instance. |
Reimplemented from LocalAPISubsystem.
Definition at line 107 of file LocalQueueManager.cpp.
References LocalAPIManager::getSession(), LocalAPISubsystem::initializeLocal(), initializeSessionQueue(), localManager, and sessionQueue.
Referenced by LocalAPIManager::initProcess().
QueueHandle LocalQueueManager::initializeSessionQueue | ( | SessionID | session | ) |
Create the session queue for this process.
session |
Definition at line 147 of file LocalQueueManager.cpp.
References createdSessionQueue, createSessionQueue(), SysLocalAPIManager::getActiveSessionQueue(), nestSessionQueue(), and SysLocalAPIManager::setActiveSessionQueue().
Referenced by initializeLocal().
|
inline |
Definition at line 60 of file LocalQueueManager.hpp.
References Utilities::strCaselessCompare().
RexxReturnCode LocalQueueManager::mapReturnResult | ( | ServiceMessage & | m | ) |
Process an exception returned from the server and map it into an API return code.
e | The exception from the server. |
Definition at line 514 of file LocalQueueManager.cpp.
References BAD_FIFO_LIFO, BAD_WAIT_FLAG, INVALID_QUEUE_NAME, QUEUE_DOES_NOT_EXIST, QUEUE_EMPTY, QUEUE_IN_USE, ServiceMessage::result, RXQUEUE_ACCESS, RXQUEUE_BADQNAME, RXQUEUE_BADWAITFLAG, RXQUEUE_EMPTY, RXQUEUE_NOTREG, RXQUEUE_OK, and RXQUEUE_PRIORITY.
Referenced by addToNamedQueue(), addToSessionQueue(), clearNamedQueue(), clearSessionQueue(), deleteNamedQueue(), deleteSessionQueue(), getQueueCount(), getSessionQueueCount(), pullFromQueue(), and queryNamedQueue().
QueueHandle LocalQueueManager::nestSessionQueue | ( | SessionID | session, |
QueueHandle | q | ||
) |
Bump the usage count of a session queue when it is inherited from a parent process.
q | The handle of the session queue. |
Definition at line 468 of file LocalQueueManager.cpp.
References NEST_SESSION_QUEUE, ServiceMessage::parameter1, ServiceMessage::parameter2, QueueManager, and ClientMessage::send().
Referenced by initializeSessionQueue().
RexxReturnCode LocalQueueManager::openNamedQueue | ( | const char * | name, |
size_t * | dup | ||
) |
Create a named queue
name | The requested queue name. |
dup | The duplicate flag. |
Definition at line 245 of file LocalQueueManager.cpp.
References OPEN_NAMED_QUEUE, QUEUE_EXISTS, QueueManager, ServiceMessage::result, RXQUEUE_BADQNAME, RXQUEUE_OK, ClientMessage::send(), and validateQueueName().
|
virtual |
Process an exception returned from the server and map it into an API return code.
e | The exception from the server. |
Reimplemented from LocalAPISubsystem.
Definition at line 487 of file LocalQueueManager.cpp.
References BAD_FIFO_LIFO, BAD_WAIT_FLAG, ServiceException::getErrorCode(), INVALID_QUEUE_NAME, RXQUEUE_BADQNAME, RXQUEUE_BADWAITFLAG, RXQUEUE_MEMFAIL, and RXQUEUE_PRIORITY.
Referenced by LocalAPIManager::processServiceException().
RexxReturnCode LocalQueueManager::pullFromQueue | ( | const char * | name, |
RXSTRING & | data, | ||
size_t | waitFlag, | ||
RexxQueueTime * | timeStamp | ||
) |
Definition at line 423 of file LocalQueueManager.cpp.
References mapReturnResult(), MEMORY_ERROR, ServiceMessage::nameArg, ServiceMessage::operation, ServiceMessage::parameter1, ServiceMessage::parameter3, PULL_FROM_NAMED_QUEUE, PULL_FROM_SESSION_QUEUE, QUEUE_ITEM_PULLED, QUEUE_NO_WAIT, QUEUE_WAIT_FOR_DATA, QueueManager, ServiceMessage::result, RexxAllocateMemory(), ClientMessage::send(), sessionQueue, _RXSTRING::strptr, and ServiceMessage::transferMessageData().
RexxReturnCode LocalQueueManager::queryNamedQueue | ( | const char * | name | ) |
Delete a named queue.
name | The name of the queue. |
Definition at line 295 of file LocalQueueManager.cpp.
References mapReturnResult(), QUERY_NAMED_QUEUE, QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().
|
virtual |
Handle process termination.
Reimplemented from LocalAPISubsystem.
Definition at line 119 of file LocalQueueManager.cpp.
References deleteSessionQueue(), sessionQueue, and LocalAPISubsystem::terminateProcess().
Referenced by LocalAPIManager::terminateProcess().
bool LocalQueueManager::validateQueueName | ( | const char * | username | ) |
Validate a queue name
username | The name to validate. |
Definition at line 67 of file LocalQueueManager.cpp.
References ch_EXCLAMATION, ch_PERIOD, ch_QUESTION_MARK, ch_UNDERSCORE, MAX_QUEUE_NAME_LENGTH, and Utilities::strCaselessCompare().
Referenced by clearNamedQueue(), createNamedQueue(), deleteNamedQueue(), getQueueCount(), openNamedQueue(), and queryNamedQueue().
|
staticprotected |
Definition at line 90 of file LocalQueueManager.hpp.
Referenced by initializeSessionQueue().
|
protected |
Definition at line 87 of file LocalQueueManager.hpp.
Referenced by createNamedQueue(), initializeLocal(), and LocalQueueManager().
|
protected |
Definition at line 89 of file LocalQueueManager.hpp.
Referenced by LocalQueueManager().
|
protected |
Definition at line 88 of file LocalQueueManager.hpp.
Referenced by addToSessionQueue(), clearSessionQueue(), deleteSessionQueue(), getSessionQueueCount(), initializeLocal(), LocalQueueManager(), pullFromQueue(), and terminateProcess().