com.tibco.rta
Interface RtaSession


public interface RtaSession

A user session to communicate with the metric engine. The main class used for saving and retrieving model changes to the engine, querying the metrics as well as for submitting facts to the engine.

RtaSession is thread-safe


Method Summary
 void clearAlerts(java.util.Collection<java.lang.String> alert_ids)
          Clear All alerts specified by ids
 void close()
          Close the session and cleanup any underlying resources.
 Query createQuery()
          Register a transient query on the server.
 void createRule(RuleDef rule)
          Create a new rule with the specified descriptor.
 void deleteRule(java.lang.String name)
          Delete the rule with the given name.
 java.util.List<ActionFunctionDescriptor> getAllActionFunctionDescriptors()
          Get all action function descriptor
 java.util.List<MetricFunctionDescriptor> getAllFunctionDescriptors()
           
 java.util.List<RuleDef> getAllRuleDefs()
          Get all the rule definitions configured on the server.
<S,T> Browser<T>
getChildMetrics(Metric<S> metric, java.util.List<MetricFieldTuple> orderByList)
          Get this metrics child metrics (for drilldown)
 java.lang.String getClientId()
          Return session id.
<S,T> Browser<T>
getConstituentFacts(Metric<S> metric, java.util.List<MetricFieldTuple> orderByList)
          Get this metrics constituent facts (for drilldown and analysis)
 RuleDef getRule(java.lang.String name)
          Get the rule with the specified name.
 java.util.List<java.lang.String> getRules()
          Get all the rules configured on the server.
<T extends RtaSchema>
T
getSchema(java.lang.String name)
          Gets a schema with this name available with the metric engine.
 com.tibco.rta.model.runtime.ServerConfigurationCollection getServerConfiguration()
          Gets the server side runtime configuration.
 void init()
          Synchronous session initialization which attempts to connect to metric server.
 void init(long timeout, java.util.concurrent.TimeUnit units)
          Synchronous session initialization which attempts to connect to metric server.
 java.util.concurrent.Future<java.lang.Object> publishFact(Fact fact)
          Publish a fact to the metric/aggregation engine.
 RtaSchema registerSchema(RtaSchema schema)
          Register schema with this session locally.
 void setCommandListener(RtaCommandListener listener)
          Listener for asynchronous command notifications.
 void setNotificationListener(RtaNotificationListener listener)
          Set a listener interested in server notifications for all possible server notifications
 void setNotificationListener(RtaNotificationListener listener, int interestEvents)
          Set a listener interested in server notifications like transaction success, failure etc.
 void updateRule(RuleDef rule)
          Update an existing rule with the specified descriptor.
 

Method Detail

init

void init()
          throws ConnectionRefusedException,
                 SessionInitFailedException
Synchronous session initialization which attempts to connect to metric server. Blocks forever for init to complete.

If session is already inited, this call does not do anything.

Throws:
ConnectionRefusedException - if connection could not be established.
SessionInitFailedException - Any failure in init phase

init

void init(long timeout,
          java.util.concurrent.TimeUnit units)
          throws ConnectionRefusedException,
                 SessionInitFailedException
Synchronous session initialization which attempts to connect to metric server.

If session is already inited, this call does not do anything.

This call blocks only for specified timeout period. If session init could not complete during this time, SessionInitFailedException is thrown.

Parameters:
timeout - time to wait for init to complete
units - Timeunits.
Throws:
ConnectionRefusedException - if connection could not be established.
SessionInitFailedException - Any failure in init phase.

getClientId

java.lang.String getClientId()
Return session id. This will be unique for every session.


getSchema

@Idempotent
@RetryOnRejection
<T extends RtaSchema> T getSchema(java.lang.String name)
                              throws RtaException
Gets a schema with this name available with the metric engine.

Parameters:
name - the name
Returns:
the schema
Throws:
RtaException - if session was closed or the remote operation failed.

registerSchema

RtaSchema registerSchema(RtaSchema schema)
                         throws RtaException
Register schema with this session locally. If already registered, return the same instance.

This operation is a local operation and does not communicate with the metric engine.

Parameters:
schema - the schema
Returns:
An instance of RtaSchema
Throws:
RtaException

publishFact

@Idempotent
java.util.concurrent.Future<java.lang.Object> publishFact(Fact fact)
                                                          throws RtaException
Publish a fact to the metric/aggregation engine.

Facts will be buffered and asynchronously asserted to the metric engine in a manner driven by a buffer criterion

The Future returned by this API may return a null when its get is called since facts are buffered and another get call on another future may return more than one such ids separated by a ,

Parameters:
fact - The fact instance to be published.
Returns:
a Future task wrapping transaction id upon successful submission of fact.
Throws:
RtaException - if session was closed or the remote operation failed.

close

void close()
           throws RtaException
Close the session and cleanup any underlying resources. Clients should call this API once they are done with using a session.

Throws:
RtaException

createQuery

@Idempotent
@RetryOnRejection
Query createQuery()
                  throws RtaException
Register a transient query on the server.

Throws:
RtaException

getChildMetrics

@Idempotent
@RetryOnRejection
<S,T> Browser<T> getChildMetrics(Metric<S> metric,
                                                             java.util.List<MetricFieldTuple> orderByList)
                           throws RtaException
Get this metrics child metrics (for drilldown)

Parameters:
metric - The metric
orderByList - Optional orderBy
Returns:
A metric browser
Throws:
RtaException

getConstituentFacts

@Idempotent
@RetryOnRejection
<S,T> Browser<T> getConstituentFacts(Metric<S> metric,
                                                                 java.util.List<MetricFieldTuple> orderByList)
                               throws RtaException
Get this metrics constituent facts (for drilldown and analysis)

Parameters:
metric - The metric
orderByList - Optional orderby
Returns:
A fact browser
Throws:
RtaException

setNotificationListener

void setNotificationListener(RtaNotificationListener listener)
Set a listener interested in server notifications for all possible server notifications

Parameters:
listener - the lister to notify.
Please refer
NotificationListenerKey

setNotificationListener

void setNotificationListener(RtaNotificationListener listener,
                             int interestEvents)
Set a listener interested in server notifications like transaction success, failure etc.

Parameters:
listener - the lister to notify.
interestEvents - Set preference for receiving notifications from metric engine
Please refer
NotificationListenerKey

setCommandListener

void setCommandListener(RtaCommandListener listener)
Listener for asynchronous command notifications.

For example if API caller wants to take some action based on rule evaluation like stopping a process on machine, the metric engine will send the command in a manner that can be received by the caller of this API to execute appropriate action.


getRules

@Idempotent
@RetryOnRejection
java.util.List<java.lang.String> getRules()
                                          throws java.lang.Exception
Get all the rules configured on the server.

Returns:
a list of configured rules.
Throws:
java.lang.Exception

getAllRuleDefs

@Idempotent
@RetryOnRejection
java.util.List<RuleDef> getAllRuleDefs()
                                       throws java.lang.Exception
Get all the rule definitions configured on the server.

Returns:
a list of configured rules.
Throws:
java.lang.Exception

getRule

@Idempotent
@RetryOnRejection
RuleDef getRule(java.lang.String name)
                throws RtaException
Get the rule with the specified name. Names are unique across all rules.

Parameters:
name - the rule name
Returns:
the matching rule.
Throws:
RtaException

createRule

@Idempotent
@RetryOnRejection
void createRule(RuleDef rule)
                throws RtaException
Create a new rule with the specified descriptor.

Parameters:
rule - the rule descriptor.
Throws:
RtaException

updateRule

@Idempotent
@RetryOnRejection
void updateRule(RuleDef rule)
                throws RtaException
Update an existing rule with the specified descriptor. Rule with the same name as in the descriptor will be updated.

Parameters:
rule - the rule descriptor to update with.
Throws:
RtaException

deleteRule

@Idempotent
@RetryOnRejection
void deleteRule(java.lang.String name)
                throws RtaException
Delete the rule with the given name.

Throws:
RtaException

getAllFunctionDescriptors

@Idempotent
@RetryOnRejection
java.util.List<MetricFunctionDescriptor> getAllFunctionDescriptors()
                                                                   throws RtaException
Throws:
RtaException

getAllActionFunctionDescriptors

@Idempotent
@RetryOnRejection
java.util.List<ActionFunctionDescriptor> getAllActionFunctionDescriptors()
                                                                         throws RtaException
Get all action function descriptor

Returns:
list of action function descriptors
Throws:
RtaException

getServerConfiguration

com.tibco.rta.model.runtime.ServerConfigurationCollection getServerConfiguration()
                                                                                 throws RtaException
Gets the server side runtime configuration.

Throws:
RtaException

clearAlerts

@Idempotent
@RetryOnRejection
void clearAlerts(java.util.Collection<java.lang.String> alert_ids)
                 throws RtaException
Clear All alerts specified by ids

Parameters:
alert_ids - to clear
Throws:
RtaException


Copyright © 2000-2014 TIBCO Inc. All Rights Reserved.