LocalQueueManager Class Reference

#include <LocalQueueManager.hpp>

Inheritance diagram for LocalQueueManager:
[legend]

Public Types

typedef uintptr_t QueueHandle
 

Public Member Functions

 LocalQueueManager ()
 
bool isSessionQueue (const char *name)
 
bool validateQueueName (const char *username)
 
void initializeLocal (LocalAPIManager *a)
 
virtual void terminateProcess ()
 
QueueHandle initializeSessionQueue (SessionID s)
 
QueueHandle createSessionQueue (SessionID session)
 
RexxReturnCode createNamedQueue (const char *name, size_t size, char *createdName, size_t *dup)
 
RexxReturnCode openNamedQueue (const char *name, size_t *dup)
 
RexxReturnCode queryNamedQueue (const char *name)
 
RexxReturnCode deleteSessionQueue ()
 
RexxReturnCode deleteNamedQueue (const char *name)
 
RexxReturnCode clearSessionQueue ()
 
RexxReturnCode clearNamedQueue (const char *name)
 
RexxReturnCode getSessionQueueCount (size_t &)
 
RexxReturnCode getQueueCount (const char *name, size_t &)
 
RexxReturnCode addToNamedQueue (const char *name, CONSTRXSTRING &data, size_t lifoFifo)
 
RexxReturnCode addToSessionQueue (CONSTRXSTRING &data, size_t lifoFifo)
 
RexxReturnCode pullFromQueue (const char *name, RXSTRING &data, size_t waitFlag, RexxQueueTime *timeStamp)
 
QueueHandle nestSessionQueue (SessionID s, QueueHandle q)
 
virtual RexxReturnCode processServiceException (ServiceException *e)
 
RexxReturnCode mapReturnResult (ServiceMessage &m)
 
- Public Member Functions inherited from LocalAPISubsystem
virtual ~LocalAPISubsystem ()
 

Protected Attributes

LocalAPIManagerlocalManager
 
QueueHandle sessionQueue
 
SessionID sessionID
 
- Protected Attributes inherited from LocalAPISubsystem
LocalAPIManagerapiManager
 

Static Protected Attributes

static bool createdSessionQueue = false
 

Detailed Description

Definition at line 52 of file LocalQueueManager.hpp.

Member Typedef Documentation

◆ QueueHandle

Constructor & Destructor Documentation

◆ LocalQueueManager()

LocalQueueManager::LocalQueueManager ( )

Initialize the local queue manager.

Definition at line 55 of file LocalQueueManager.cpp.

References localManager, sessionID, and sessionQueue.

Member Function Documentation

◆ addToNamedQueue()

RexxReturnCode LocalQueueManager::addToNamedQueue ( const char *  name,
CONSTRXSTRING data,
size_t  lifoFifo 
)

Add an item to a named queue.

Parameters
nameThe name of the queue.
dataThe data to add
lifoFifoThe 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.

◆ addToSessionQueue()

RexxReturnCode LocalQueueManager::addToSessionQueue ( CONSTRXSTRING data,
size_t  lifoFifo 
)

◆ clearNamedQueue()

RexxReturnCode LocalQueueManager::clearNamedQueue ( const char *  name)

Remove all items from a named queue.

Parameters
nameThe queue name.

Definition at line 363 of file LocalQueueManager.cpp.

References CLEAR_NAMED_QUEUE, mapReturnResult(), QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().

◆ clearSessionQueue()

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.

◆ createNamedQueue()

RexxReturnCode LocalQueueManager::createNamedQueue ( const char *  name,
size_t  size,
char *  createdName,
size_t *  dup 
)

Create a named queue

Parameters
nameThe requested queue name.
sizeThe size of the buffer for the returned name.
createdNameThe buffer for the returned name.
dupThe duplicate flag.
Returns
true if the requested name already exists and a new name was provided.

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().

◆ createSessionQueue()

QueueHandle LocalQueueManager::createSessionQueue ( SessionID  session)

Create a new session queue

Parameters
sessionThe session identifier
Returns
The handle of the session queue.

Definition at line 178 of file LocalQueueManager.cpp.

References CREATE_SESSION_QUEUE, ServiceMessage::parameter1, QueueManager, and ClientMessage::send().

Referenced by initializeSessionQueue().

◆ deleteNamedQueue()

RexxReturnCode LocalQueueManager::deleteNamedQueue ( const char *  name)

Delete a named queue.

Parameters
nameThe name of the queue.

Definition at line 277 of file LocalQueueManager.cpp.

References DELETE_NAMED_QUEUE, mapReturnResult(), QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().

◆ deleteSessionQueue()

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().

◆ getQueueCount()

RexxReturnCode LocalQueueManager::getQueueCount ( const char *  name,
size_t &  result 
)

Get a queue count from a named queue.

Parameters
nameThe queue name.
Returns
The count of items in the queue.

Definition at line 331 of file LocalQueueManager.cpp.

References GET_NAMED_QUEUE_COUNT, mapReturnResult(), ServiceMessage::parameter1, QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().

◆ getSessionQueueCount()

RexxReturnCode LocalQueueManager::getSessionQueueCount ( size_t &  result)

Get the count of lines in the session queue.

Returns
The queue line count.

Definition at line 313 of file LocalQueueManager.cpp.

References GET_SESSION_QUEUE_COUNT, mapReturnResult(), ServiceMessage::parameter1, QueueManager, ClientMessage::send(), and sessionQueue.

◆ initializeLocal()

void LocalQueueManager::initializeLocal ( LocalAPIManager a)
virtual

Initialize the local (client) queue manager instance.

Parameters
aThe 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().

◆ initializeSessionQueue()

QueueHandle LocalQueueManager::initializeSessionQueue ( SessionID  session)

Create the session queue for this process.

Parameters
session
Returns

Definition at line 147 of file LocalQueueManager.cpp.

References createdSessionQueue, createSessionQueue(), SysLocalAPIManager::getActiveSessionQueue(), nestSessionQueue(), and SysLocalAPIManager::setActiveSessionQueue().

Referenced by initializeLocal().

◆ isSessionQueue()

bool LocalQueueManager::isSessionQueue ( const char *  name)
inline

Definition at line 60 of file LocalQueueManager.hpp.

References Utilities::strCaselessCompare().

◆ mapReturnResult()

RexxReturnCode LocalQueueManager::mapReturnResult ( ServiceMessage m)

◆ nestSessionQueue()

QueueHandle LocalQueueManager::nestSessionQueue ( SessionID  session,
QueueHandle  q 
)

Bump the usage count of a session queue when it is inherited from a parent process.

Parameters
qThe 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().

◆ openNamedQueue()

RexxReturnCode LocalQueueManager::openNamedQueue ( const char *  name,
size_t *  dup 
)

Create a named queue

Parameters
nameThe requested queue name.
dupThe duplicate flag.
Returns
true if the requested name already exists

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().

◆ processServiceException()

RexxReturnCode LocalQueueManager::processServiceException ( ServiceException e)
virtual

Process an exception returned from the server and map it into an API return code.

Parameters
eThe exception from the server.
Returns
The mapped return code.

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().

◆ pullFromQueue()

◆ queryNamedQueue()

RexxReturnCode LocalQueueManager::queryNamedQueue ( const char *  name)

Delete a named queue.

Parameters
nameThe name of the queue.

Definition at line 295 of file LocalQueueManager.cpp.

References mapReturnResult(), QUERY_NAMED_QUEUE, QueueManager, RXQUEUE_BADQNAME, ClientMessage::send(), and validateQueueName().

◆ terminateProcess()

void LocalQueueManager::terminateProcess ( )
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().

◆ validateQueueName()

bool LocalQueueManager::validateQueueName ( const char *  username)

Member Data Documentation

◆ createdSessionQueue

bool LocalQueueManager::createdSessionQueue = false
staticprotected

Definition at line 90 of file LocalQueueManager.hpp.

Referenced by initializeSessionQueue().

◆ localManager

LocalAPIManager* LocalQueueManager::localManager
protected

Definition at line 87 of file LocalQueueManager.hpp.

Referenced by createNamedQueue(), initializeLocal(), and LocalQueueManager().

◆ sessionID

SessionID LocalQueueManager::sessionID
protected

Definition at line 89 of file LocalQueueManager.hpp.

Referenced by LocalQueueManager().

◆ sessionQueue


The documentation for this class was generated from the following files: