CommandServiceManager -1.00
Phoenix engine interface
CommandServiceManager Class Reference

#import <CommandServiceManager.h>

Public Member Functions

(long) - execute:
(void) - cancelRequest:
(void) - deleteSession:
(NSArray *) - getAllOrphanedSession
(NSArray *) - getAllPendingSession
(void) - resume:withDelegate:
(void) - testCancelRequest
(Request *) - deQueue

Static Public Member Functions

(CommandServiceManager *) + sharedManager
(CommandServiceManager *) + sharedManagerWithPayloadPath:withDBPath:

Properties

NSURL * structuredURL
NSURL * unstructuredURL
NSString * payloadPath
NSString * databasePath
SessionManagersessionManager
CommandExecutorexecutor
NSMutableArraypriorityQueue

Detailed Description

CommandServiceManager is a singleton using as Phoenix interface


Member Function Documentation

- (void) cancelRequest: (uint32_t)  CSID

Cancel a request by client session id

Parameters:
CSIDthe client session id wanted to cancel
- (void) deleteSession: (uint32_t)  CSID

Delete a session from database by client session id

Parameters:
CSIDthe client session id wanted to delete
- (Request *) deQueue

Pop request from queue

Returns:
the highest priorty request in queue
- (long) execute: (CommandRequest *)  request

Execute a request, will put in to queue and start executor if it's idle

Parameters:
CSIDthe client session id wanted to delete
Returns:
Client session id of the request
- (NSArray *) getAllOrphanedSession

Get all client session ids that payload is not finished yet

Returns:
array of client session id that payload_ready_flag=0
- (NSArray *) getAllPendingSession

Get all client session ids that payload is finished

Returns:
array of client session id that payload_ready_flag=1
- (void) resume: (uint32_t)  CSID
withDelegate: (id<CommandDelegate>)  delegate 

Resume a request that have this client session id and set callback object

Parameters:
CSIDclient session id that wanted to resume
delegatecallback object
+ (CommandServiceManager *) sharedManager

Get singleton CommandServiceManager object

Returns:
shared CommandServiceManager instance
Warning:
don't use this, it does not set db path for session manager. Use sharedManagerWithPayloadPath:withDBPath: instead
+ (CommandServiceManager *) sharedManagerWithPayloadPath: (NSString *)  PLPath
withDBPath: (NSString *)  DBPath 

Get singleton CommandServiceManager object then set payload path and database path at that time

Returns:
shared CommandServiceManager instance that have payload path and database path
Parameters:
PLPathwritable path to save payload file
DBPathwritable path to crate/read/update database file
- (void) testCancelRequest

For test cancel flow it will cancel the first request in the queue


Property Documentation

- (CommandExecutor *) executor [read, write, assign]

Weak link to CommandExecutor shared instance

- (NSMutableArray *) priorityQueue [read, write, retain]

Priority queue NSMutableArray category

- (SessionManager *) sessionManager [read, write, assign]

Weak link to SessionManager shared instance


The documentation for this class was generated from the following files:
 All Data Structures Functions Properties