Status APIs

Many of the Sybase CEP SDKs, including C/C++, Java 1.5, and .NET3, enable you to get status information by calling particular functions/methods.

To get information about a particular object (for example, a container or a query), you must provide two pieces of information:

To specify the ID of the object, use the objectID. The objectID was described briefly above; below outlines how to compose the object ID for each type of object:

Object Type

ObjectID

Manager

Manager URI.

Container

Container URI.

Workspace

Workspace name.

Project

The ObjectID is the full path to the given project in the form: <WorkspaceName>/<ProjectName>. ProjectName is the project's load name, or the name that is displayed in Sybase CEP Studio's Explorer View. This is usually, but not always, the same as the name of the project file without the ".ccp" extension.

Query

The ObjectID is the full path to the given Query in the form: <WorkspaceName>/<FullCclPath>/<StatementNumber> Where <FullCclPath> is the "path" of the loaded module as you see it in Studio's Explorer View (for example, Project1/SubModule1/SubModule2) and <StatementNumber> is the sequential number of the CCL statement in the module.

To specify what information you want, specify both the Message Group and the Message Name. A complete list of Message Groups and Message Names is available in Status Information.

In general, the Message Name indicates the specific information that you want. For example, the percentage of CPU time utilized by an object (such as a container). Because some types of objects have similar information (for example, both modules and individual queries have status information about the number of "InputMessages"), you must specify a MessageGroup which combines with the Message Name to indicate what information you want. To get a specific value (for example, the number of input messages received by a particular query), you must specify all three of the objectID, MessageGroup, and MessageName.

You will first receive a status object that contains information about a Manager, a Workspace, or a Project (a "top module"). Once you have that object, you can call a function that queries that object for more specific information, such as the number of rows received by a particular query within the project. Note that a single status object may contain many status messages. For example, if a status object for a top query module ("project") has ten different message types (MessageNames), then when you retrieve a status object for a particular query you will be able to extract ten different messages from it. In pseudo-code, this would look similar to the following:

char messageGroup[] = "CclQueryInfo";
char messageName[] = "InputMessages"; 
// objectID = workspace name + full CCL Path + query number.
char objectID[] = "AccountingWorkspace/fullCCLPath/2"; 
C8Message *statusMsg; 
char *bufferPtr = NULL; 
// Get the status object for a project ("top module"). 
statusObject = C8StatusObjectForTopModule(managerUri, 
            workspaceName, moduleName); 
numMsgs = C8StatusObjectGetMessagesNumber(statusObject); 
for (i = 0; i < numMsgs; i++) { 
 statusMsg = GetStatusObjectMessageAtPos(i, messageGroup, 
             objectID, messageName); 
 C8MessageColumnGetAsStringByName(statusMsg, "Value", 
             &bufferPtr); 
 msgsRcvd = stringToInteger(&bufferPtr);
 }

More specific information about the function/method calls is provided in the chapter for each SDK that supports status information.