Interface EPContextPartitionService


public interface EPContextPartitionService
Service interface for administration of contexts and context partitions.
  • Method Details

    • getContextStatementNames

      String[] getContextStatementNames(String deploymentId, String contextName)
      Returns the statement names associated to the context of the given name.

      Returns null if a context declaration for the name does not exist.

      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name to return statements for
      Returns:
      statement names, or null if the context does not exist, or empty list if no statements are associated to the context (counting started and stopped statements, not destroyed ones).
    • getContextNestingLevel

      int getContextNestingLevel(String deploymentId, String contextName)
      Returns the nesting level for the context declaration, i.e. 1 for unnested and >1 for nested contexts.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      Returns:
      nesting level
      Throws:
      IllegalArgumentException - if a context by that name was not declared
    • getContextPartitions

      ContextPartitionCollection getContextPartitions(String deploymentId, String contextName, ContextPartitionSelector selector)
      Returns information about selected context partitions including state.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      selector - a selector that identifies the context partitions
      Returns:
      collection of the context partition ids and descriptors
      Throws:
      IllegalArgumentException - if a context by that name was not declared
      InvalidContextPartitionSelector - if the selector type and context declaration mismatch
    • getContextPartitionIds

      Set<Integer> getContextPartitionIds(String deploymentId, String contextName, ContextPartitionSelector selector)
      Returns the context partition ids.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      selector - a selector that identifies the context partitions
      Returns:
      set of the context partition ids
      Throws:
      IllegalArgumentException - if a context by that name was not declared
      InvalidContextPartitionSelector - if the selector type and context declaration mismatch
    • getContextPartitionCount

      long getContextPartitionCount(String deploymentId, String contextName)
      Returns the current count of context partition.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      Returns:
      context partition count
      Throws:
      IllegalArgumentException - if a context by that name was not declared
    • getIdentifier

      ContextPartitionIdentifier getIdentifier(String deploymentId, String contextName, int agentInstanceId)
      Returning the descriptor of a given context partition.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      agentInstanceId - the context partition id number
      Returns:
      identifier or null if the context partition is not found
      Throws:
      IllegalArgumentException - if a context by that name was not declared
    • addContextStateListener

      void addContextStateListener(ContextStateListener listener)
      Add a context state listener
      Parameters:
      listener - to add
    • removeContextStateListener

      void removeContextStateListener(ContextStateListener listener)
      Remove a context state listener
      Parameters:
      listener - to remove
    • getContextStateListeners

      Iterator<ContextStateListener> getContextStateListeners()
      Returns an iterator of context state listeners (read-only)
      Returns:
      listeners
    • removeContextStateListeners

      void removeContextStateListeners()
      Removes all context state listener
    • addContextPartitionStateListener

      void addContextPartitionStateListener(String deploymentId, String contextName, ContextPartitionStateListener listener)
      Add context partition state listener for the given context
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      listener - to add
    • removeContextPartitionStateListener

      void removeContextPartitionStateListener(String deploymentId, String contextName, ContextPartitionStateListener listener)
      Remove a context partition state listener for the given context
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      listener - to remove
    • getContextPartitionStateListeners

      Iterator<ContextPartitionStateListener> getContextPartitionStateListeners(String deploymentId, String contextName)
      Returns an iterator of context partition state listeners (read-only) for the given context
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      Returns:
      listeners
    • removeContextPartitionStateListeners

      void removeContextPartitionStateListeners(String deploymentId, String contextName)
      Removes all context partition state listener for the given context
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
    • getContextProperties

      Map<String,Object> getContextProperties(String deploymentId, String contextName, int contextPartitionId)
      Returns the context properties for a given deployment id, context name and context partition id.
      Parameters:
      deploymentId - deployment id of context (deployment id of create-context statement)
      contextName - context name
      contextPartitionId - context partition id
      Returns:
      map of built-in properties wherein values representing event are EventBean instances