Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A subscription allows a Console application to monitor specific management data for changes in its state. A Console creates a subscription with an Agent based on a Query. The Query specifies the set of management data that is to be monitored. When the Agent detects changes to the data within the selected set, a notification is sent to the The Agent will periodically publish updates to the subscribing Console(s).  The notification update contains a snapshot of the of the changed monitored data. 

A subscription remains in effect for a predetermined amount of time, as configured on the Agent.  Once the subscription expires, no further notifications are generated should the data changeupdates are published.  A console may elect to refresh a subscription prior to its expiration.   Alternatively, a Console may explicitly cancel the subscription when the data no longer needs to be monitored.

...

  • AGENT_ADDED
  • AGENT_DELETED
  • NEW_PACKAGE
  • NEW_CLASS
  • OBJECT_UPDATE
  • EVENT_RECEIVED
  • AGENT_HEARTBEAT
  • SUBSCRIBE_RESPONSE
  • RESUBSCRIBESUBSCRIPTION_RESPONSE
  • SUBSCRIPTION_INDICATION

...

OBJECT_UPDATE

TBD.

EVENT_RECEIVED

TBD

...

SUBSCRIBE_RESPONSE

The SUBSCRIPTIONSUBSCRIBE_RESPONSE WorkItem returns the result of a subscription request made by this Console.  This WorkItem is generated when the Console's create_subscription() is called in an asychronous manner, rather than pending for the result.  This WorkItem is also used to return the status of an asychronous call to the Console's refresh_subscription() method.

The get_params() method of a SUBSCRIPTIONSUBSCRIBE_RESPONSE  WorkItem will return an instance of the following object:

No Format
class SubscriptionParamsSubscribeParams:
      .get_subscription_id(): If the subscription is successful, this method returns a SubscriptionId object.
          Should the subscription fail, this method returns None, and get_error() can be used to obtain an
          application-specific QmfData error object.
      .get_expirationpublish_dateinterval(): returns athe datetimetime objectinterval containingin theseconds timestampon (utc)which when the subscription
Agent will publish updates
       will automatically expire iffor not renewed by the consolethis subscription.
      .get_errorlifetime(): (optional) returns anthe application-specifictime QmfDatainterval objectin indicatingseconds whyfor the subscription. The subscription will automatically
          expire after this interval if not renewed by the console.
      .get_error(): (optional) returns an application-specific QmfData object indicating why the subscription
          request failed.  Returns None if not supported.
      .get_console_handle(): returns the console handle as passed to the create_subscription() call.

The SubscriptionId object must be used when the subscription is refreshed or cancelled .  The SubscriptionId - it must be passed to the Console's refresh_subscription() and cancel_subscription() methods.  The value of the SubscriptionId does not change over the lifetime of the subscription.

The console handle will be provided by the Agent on each data indication event that corresponds to this subscription.  It should not change for the lifetime of the subscription.

The get_handle() method returns the reply handle provided to the create_subscription() method call.  This handle is merely the handle used for the asynchronous response, it is not associated with the subscription in any other way get_handle() method returns the application handle provided to the create_subscription() method call.

Once a subscription is created, the Agent that maintains the subscription will periodically issue an initial update updates for the subscribed data.  This update will contain the current values of the subscribed data, and will appear as the first SUBSCRIPTION_INDICATION WorkItem for this subscription.

...

The SUBSCRIPTION_INDICATION WorkItem signals the arrival of an update to subscribed data from the ConsoleAgent. 

The get_params() method of a SUBSCRIPTION_INDICATION  WorkItem will return a list of updated data objects.The getan instance of the following object:

No Format

class SubscribeIndication:
      .get_console_handle()

...

: returns the console handle as passed to the create_subscription()

...

 call

...

.
      .get_data(): returns a list containing all updated data objects associated with the subscripion.

The get_handle() method returns None.

RESUBSCRIBE_RESPONSE

The RESUBSCRIBE_RESPONSE WorkItem is generated in response to a subscription refresh request made by this Console.  This WorkItem is generated when the Console's refresh_subscription() is called in an asychronous manner, rather than pending for the result. 

The get_params() method of a RESUBSCRIBE_RESPONSE  WorkItem will return an instance of the following object:

No Format

class SubscribeParams:
      .get_subscription_id(): If the re-subscription is successful, this method returns an instance of
          the original SubscriptionId object.  Should the subscription fail, this method returns None,
          and get_error() can be used to obtain an application-specific QmfData error object.
      .get_publish_interval(): returns the time interval in seconds on which the Agent will publish updates
          for this subscription.
      .get_lifetime(): returns the time interval in seconds for the subscription. The subscription will automatically
          expire after this interval if not renewed by the console.
      .get_error(): (optional) returns an application-specific QmfData object indicating why the re-subscription
          request failed.  Returns None on successful resubscribe.
      .get_console_handle(): returns the console handle as passed to the create_subscription() call, if available.
          Note: if the Agent failed the resubscribe request due to an unrecognized subscription, this call may
          return None.

The get_handle() method returns the reply handle provided to the refresh_subscription() method call.  This handle is merely the handle used for the asynchronous response, it is not associated with the subscription in any other way.

Local Local representation of a remote Agent.

...

No Format
class Console:
      <constructor>(name=<name-str>,
                    domain=(optional) domain string for console's AMQP address,
                    notifier=<class Notifier>,
                    reply_timeout=<default for all blocking calls>,
                    agent_timeout=<default timeout for agent heartbeat>,
                    subscription_duration=<default lifetime of a subscription>)

      .destroy(timeout=None): Must be called to release Console's resources.

      .add_connection(QPID Connection): Connect the console to the AMQP cloud.

      .remove_connection(conn): Remove the AMQP connection from the console.  Un-does the add_connection() operation, and
          releases any agents associated with the connection.  All blocking methods are unblocked and given a failure status.
          All outstanding asynchronous operations are cancelled without producing WorkItems.

      .get_address():
          Get the AMQP address this Console is listening to (type str).

      .find_agent( name string, [timeout] ): Query for the presence of a specific agent in the QMF domain. Returns a
          class Agent if the agent is present.  If the agent is not already known to the console, this call will send
          a query for the agent and block (with default timeout override) waiting for a response timeout override) waiting for a response.

      .enable_agent_discovery( [Query] ): Called to enable the asynchronous Agent Discovery process. Once enabled, AGENT_ADDED
          and AGENT_DELETED work items can arrive on the WorkQueue.  If a query is supplied, it will be used to filter agent
          notifications.

      .enabledisable_agent_discovery( [Query] ): Called to enabledisable the asynchronousasync Agent Discovery process. enabled Onceby enabled, AGENT_ADDEDcalling enable_agent_discovery().

      .get_workitem_count(): Returns the count andof AGENT_DELETEDpending workWorkItems itemsthat can arrive on the WorkQueue.  If a query is supplied, it will be used to filter agent
          notifications.

      .disable_agent_discovery(): Called to disable the async Agent Discovery process enabled by calling enable_agent_discovery() be retrieved.

      .get_next_workitem([timeout=0]): Obtains the next pending work item, or None if none available.

      .release_workitem(wi): Releases a WorkItem instance obtained by getNextWorkItem(). Called when the application has finished
          processing the WorkItem.

      .get_workitem_countagents(): Returns thea countlist of pendingavailable WorkItemsagents that can be retrieved.(class Agent)

      .get_next_workitem([timeout=0]agent( name string ): ObtainsReturn the nextclass pendingAgent workfor item,the ornamed Noneagent, if none availableknown.

      .releaseget_workitem(wipackages( [class Agent] ): ReleasesReturns a WorkItem instance obtained by getNextWorkItem(). Called when the application has finished
 list of the names of all known packages.  If an optional Agent is provided, then
          only those packages available processing the WorkItemfrom that Agent are returned.

      .get_agents(classes( [class Agent] ):  Returns a list of SchemaClassIds for all available agents (class Agent)

Schema.  If an optional Agent is provided,
      .get_agent( name string ): Returnthen the classreturned AgentSchemaClassIds forare thelimited namedto agent,those ifSchema known to the given Agent.

      .get_packagesschema( class SchemaClassId [, class Agent] ): ReturnsReturn a list of the names ofall available class SchemaClass across all known packagesagents.
          If an optional Agent is provided, then
       restrict the returned schema to those supported by that Agent.

    only those packages available from that Agent are returned.

.get_objects( _SchemaClassId= | _package=, _class= |
      .get_classes( [class Agent] ):  Returns a list of SchemaClassIds for all available Schema.  If an optional Agent is provided,
 _object_identifier=,
                then the returned SchemaClassIds are limited to those Schema known to the given Agent.

 [timeout=],
                .get_schema( class SchemaClassId [, class list-of-class-Agent] ): Returnperform a listblocking ofquery all available class SchemaClass across all known agents.
          If an optional Agent is provided, restrict the returned schema to those supported by that Agent.

      .get_objects( _SchemaClassId= | _package=, _class= |
for QmfConsoleObjects.  Returns a list (possibly empty) of matching
           objects. The selector for the query may be either:
           * class SchemaClassId - all objects whose schema match the schema identified by _object_identifier=,SchemaClassId parameter.
           * package/class name - all objects whose  [timeout=],
       schema are contained by the named package and class.
            [list-of-class-Agent] ): perform a blocking query for QmfConsoleObjects.  Returns a list (possibly empty) of matching
           objects. The selector for the query may be either:
* the object identified by _object_identifier
           This method will block until all known agents reply, or the timeout expires. Once the timeout expires, all
           data retrieved to date is *returned. classIf SchemaClassIda -list allof objectsagents whoseis schemasupplied, matchthen the query is schemasent identifiedto byonly _SchemaClassIdthose parameteragents.

      .create_subscription( agent, class Query, console_handle  * package/class name - all objects whose schema are contained by the named package and class.
[, reply_handle] [, timeout],
                        * the object identified by[, _object_identifier
           This method will block until all known agents reply, or the timeout expires. Once the timeout expires, all
  publish_interval] [, lifetime] ):  creates a subscription to the agent
          using the given Query.  The console_handle is an application-provided handle that will accompany each subscription update
         data retrievedsend tofrom datethe isAgent. returned. IfSubscription aupdates listwill ofappear agentsas is supplied, thenSUBSCRIPTION_INDICATION WorkItems on the query is sent to only those agents.

Console's work queue.
          The .create_subscription( agent, class Query, app_context [, reply_handle] [, timeout] ): creates a subscription to the agent
publish_interval is the requested time interval in seconds on which the Agent should publish updates.  The lifetime
          parameter usingis the given Query.  The app_context is an application-provided handle that will accompany each subscription updaterequested time interval in seconds for which this subscription should remain in effect.  Both the
          sendrequested lifetime fromand the agent.  Subscription updates will appear as SUBSCRIPTION_INDICATION WorkItems on the Console's work queuepublish_interval may be overridden by the Agent, as indicated in the subscription response.
          This method may be called asynchronously by providing a reply_handle argument.  When called asynchronously, the result
          of this method call is returned in a SUBSCRIPTIONSUBSCRIBE_RESPONSE WorkItem with a handle matching the value of reply_handle.
          Timeout can be used to override the console's
          default reply timeout.  When called synchronously, this method returns a class
 SubscriptionParams object containing
       SubscribeParams object containing the result of the subscription request.

      .refresh_subscription( SubscriptionId [, lifetime] [,reply_handle] [, timeout] ): renews a subscription identified by
          SubscriptionId.  The Console may request a new subscription duration by providing a requested lifetime. This
          method may be called asynchronously by providing a reply_handle argument. When called asynchronously, the result
          of this method call is returned in a SUBSCRIPTIONSUBSCRIBE_RESPONSE WorkItem.  Timeout can be used to override the console's
          default reply timeout.  When called synchronously, this method returns a class SubscriptionParamsSubscribeParams object containing
          the result of the subscription request.

      .cancel_subscription( SubscriptionId ): terminates the given subscription.

...