ibi Patterns .NET API
Loading...
Searching...
No Matches
NetricsServerInterface.NetricsRecOp Class Reference

Objects of this class associate a record operation with a record. More...

Public Types

enum  Op { ADD , UPD , RPL , DEL }
 This defines the known record operations. More...
 

Public Member Functions

NetricsRecOp.Op getOperation ()
 Get the operation code for this Record Operation.
 
NetricsRecord getRecord ()
 Get the record being operated on by this operation.
 
String getKey ()
 Get the record key of the record being operated on.
 
String getParentKey ()
 Get the parent key of the record being operated on.
 
override String ToString ()
 Return a human readable form of this operation.
 

Static Public Member Functions

static NetricsRecOp Add (NetricsRecord rec)
 Create an Add Record Operation.
 
static NetricsRecOp Upd (NetricsRecord rec)
 Create an Update Record Operation.
 
static NetricsRecOp Rpl (NetricsRecord rec)
 Create a Replace Record Operation.
 
static NetricsRecOp Del (NetricsRecord rec)
 Create a Delete Record Operation.
 
static NetricsRecOp Del (String key)
 Create a Delete Record Operation given a record key.
 
static NetricsRecOp Del (String key, String parent_key)
 Create a Delete Record Operation given a record key and parent key.
 

Detailed Description

Objects of this class associate a record operation with a record.

This class is used to associate a record operation (adding, updating, deleting records in an ibi™ Patterns - Search table) with the record to be operated on. It is used to send a stream of mixed record operations to the ibi™ Patterns - Search server.

See also
NetricsRecOpSrc, NetricsArrayRecOpSrc, NetricsServerInterface.doRecOps(String,bool,NetricsRecOpSrc)

Member Enumeration Documentation

◆ Op

This defines the known record operations.

Enumerator
ADD 

Add a record to the table, it is an error if it already exists.o ///.

UPD 

Add a record if it doesn't exist, otherwise replace the record.

RPL 

Replace a record, it is an error if it doesn't exist.

DEL 

Delete a record, it is an error if it doesn't exist.

Member Function Documentation

◆ Add()

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Add ( NetricsRecord  rec)
inlinestatic

Create an Add Record Operation.

A record add operation adds a new record to the ibi™ Patterns - Search table. If a record with the same key already exists the operation fails. If the do max work flag is set these failures are quietly ignored.

Parameters
recthe record to be added.
Returns
a new NetricsRecOp object.

◆ Del() [1/3]

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Del ( NetricsRecord  rec)
inlinestatic

Create a Delete Record Operation.

A record delete operation deletes an existing record in the ibi Patterns table. It is an error if a record with the same key doesn't exist. If the do max work flag is set the error is quietly ignored.

Parameters
recthe record to be deleted.
Returns
a new NetricsRecOp object.

◆ Del() [2/3]

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Del ( String  key)
inlinestatic

Create a Delete Record Operation given a record key.

A record delete operation deletes an existing record in the ibi Patterns table. It is an error if a record with the same key doesn't exist. If the do max work flag is set the error is quietly ignored.

A delete operation only needs a record key value. This method creates a delete operation given only the key, instead of a full record.

Parameters
keyunique key of the record to be deleted.
Returns
a new NetricsRecOp object.

◆ Del() [3/3]

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Del ( String  key,
String  parent_key 
)
inlinestatic

Create a Delete Record Operation given a record key and parent key.

A record delete operation deletes an existing record in the ibi Patterns table. It is an error if a record with the same key doesn't exist. If the do max work flag is set the error is quietly ignored.

A delete operation only needs a record key value. This method creates a delete operation for a child record given the key, and parent key. If parent_key is null or empty this creates a delete on a standard record.

Parameters
keythe key of the child record to be replaced.
parent_keythe parent key of the child record.
Returns
a new NetricsRecOp object.

◆ getKey()

String NetricsServerInterface.NetricsRecOp.getKey ( )
inline

Get the record key of the record being operated on.

Returns
the key value of the record being operated on.

◆ getOperation()

NetricsRecOp.Op NetricsServerInterface.NetricsRecOp.getOperation ( )
inline

Get the operation code for this Record Operation.

Returns
the operation code for this record operation.

◆ getParentKey()

String NetricsServerInterface.NetricsRecOp.getParentKey ( )
inline

Get the parent key of the record being operated on.

Returns
the parent key value of the record, null or empty if this is not a child record.

◆ getRecord()

NetricsRecord NetricsServerInterface.NetricsRecOp.getRecord ( )
inline

Get the record being operated on by this operation.

Returns
the record being operated on by this operation.

◆ Rpl()

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Rpl ( NetricsRecord  rec)
inlinestatic

Create a Replace Record Operation.

A record replace operation replaces an existing record in the ibi Patterns table with a new version. It is an error if a record with the same key doesn't exist. If the do max work flag is set the error is quietly ignored.

Parameters
recthe record to be replaced.
Returns
a new NetricsRecOp object.

◆ ToString()

override String NetricsServerInterface.NetricsRecOp.ToString ( )
inline

Return a human readable form of this operation.

The format is: <op-code>:<record-info> where op-code is the string value of the operation code fot this operation, and record-info is the string form of the record.

Returns
the human readable string form of this record operation.

◆ Upd()

static NetricsRecOp NetricsServerInterface.NetricsRecOp.Upd ( NetricsRecord  rec)
inlinestatic

Create an Update Record Operation.

A record update operation adds a record to the ibi™ Patterns - Search table if no record with the same key exists. If a record with the same key already exists the record is replaced with the given record.

Parameters
recthe record to be updated.
Returns
a new NetricsRecOp object.