Interface EPStatement

All Superinterfaces:
EPIterable, EPListenable
All Known Subinterfaces:
EPStatementSPI
All Known Implementing Classes:
EPStatementImpl

public interface EPStatement extends EPListenable, EPIterable
The statement is the means to attach callbacks to receive statement results (push, observer) and to object current results using pull.
  • Method Details

    • getEventType

      com.espertech.esper.common.client.EventType getEventType()
      Returns the type of events the statement pushes to listeners or returns for iterator.

      For create-schema returns the created event type.

      Returns:
      event type of events the iterator returns and that listeners receive
    • getAnnotations

      Annotation[] getAnnotations()
      Returns statement annotations.

      See the annotation com.espertech.esper.common.client.annotation package for available annotations. Application can define their own annotations.

      Returns:
      annotations or a zero-length array if no annotaions have been specified.
    • getName

      String getName()
      Returns the statement name.
      Returns:
      statement name
    • getDeploymentId

      String getDeploymentId()
      Returns the deployment id.
      Returns:
      deployment id
    • getProperty

      Object getProperty(com.espertech.esper.common.client.util.StatementProperty field)
      Returns a statement property value.
      Parameters:
      field - statement property value
      Returns:
      property or null if not set
    • isDestroyed

      boolean isDestroyed()
      Returns true if the statement has been undeployed.
      Returns:
      true for undeployed statements, false for deployed statements.
    • setSubscriber

      void setSubscriber(Object subscriber) throws EPSubscriberException
      Attaches a subscriber to receive statement results, or removes a previously set subscriber (by providing a null value).

      Note: Requires the allow-subscriber compiler options.

      Only a single subscriber may be set for a statement. If this method is invoked twice any previously-set subscriber is no longer used.
      Parameters:
      subscriber - to attach, or null to remove the previously set subscriber
      Throws:
      EPSubscriberException - if the subscriber does not provide the methods needed to receive statement results
    • setSubscriber

      void setSubscriber(Object subscriber, String methodName) throws EPSubscriberException
      Attaches a subscriber to receive statement results by calling the method with the provided method name, or removes a previously set subscriber (by providing a null value).

      Note: Requires the allow-subscriber compiler options.

      Only a single subscriber may be set for a statement. If this method is invoked twice any previously-set subscriber is no longer used.
      Parameters:
      subscriber - to attach, or null to remove the previously set subscriber
      methodName - the name of the method to invoke, or null for the "update" method
      Throws:
      EPSubscriberException - if the subscriber does not provide the methods needed to receive statement results
    • getSubscriber

      Object getSubscriber()
      Returns the current subscriber instance that receives statement results.
      Returns:
      subscriber object, or null to indicate that no subscriber is attached
    • getUserObjectCompileTime

      Object getUserObjectCompileTime()
      Returns the application defined user data object associated with the statement at compile time, or null if none was supplied at time of statement compilation.

      The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

      User objects are passed at time of statement compilation via options.

      Returns:
      user object or null if none defined
    • getUserObjectRuntime

      Object getUserObjectRuntime()
      Returns the application defined user data object associated with the statement at deployment time, or null if none was supplied at time of deployment.

      The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

      User objects are passed at time of deployment via options.

      Returns:
      user object or null if none defined