Interface Admin

All Known Implementing Classes:
HAAdmin

interface Admin
Interface describes the admin commands that pass from the client to the stream base server.

Currently, the lowest implementation layer uses XMLRPC for the protocol.

  • Method Details

    • addContainer

      String[] addContainer(long timeoutMS, String containerName, byte[] application, List<String> containerStreamMappings) throws StreamBaseException
      Add the given application to the given container in the StreamBaseServer
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - the containerName
      application - contents of an application. Text sbapp, ssql or binary contents of a jar file
      containerStreamMappings - stream mappings between containers. Each member of the list should contain a mapping. For example: newContainer.newStream=oldContainer.oldStream
      Returns:
      results if any
      Throws:
      StreamBaseException - thrown on typecheck and other errors
    • addDeploy

      String[] addDeploy(long timeoutMS, byte[] deploy, List<String> args) throws StreamBaseException
      Add the given deploy file to the server. This will add all containers and all container connections defined in the deploy file. At that point, they are treated as any other container or container connection, and may be manipulated by modifyContainer and removeContainer. The given bytes may either be UTF-8 XML that conforms to the deploy file xsd, or a StreamBase Archive that was produced by running the sbargen command on an XML deploy file.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      deploy - contents of deploy file. XML text or binary contents of an sbar file made from a deploy file.
      args - command arguments
      Returns:
      results if any
      Throws:
      StreamBaseException - thrown on typecheck and other errors
      StreamBaseException - thrown on typecheck and other errors
      Since:
      7.0
    • removeContainer

      String[] removeContainer(long timeoutMS, String containerName, List<String> args) throws StreamBaseException
      Remove the given container in the StreamBaseServer
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - the containerName
      args - command arguments
      Returns:
      results if any
      Throws:
      StreamBaseException - thrown on typecheck and other errors
    • modifyContainer

      String[] modifyContainer(long timeoutMS, String containerName, List<String> args) throws StreamBaseException
      Modify the given container
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName -
      args - list of arguments
      Returns:
      results if any
      Throws:
      StreamBaseException
    • restartContainer

      String[] restartContainer(long timeoutMS, String containerName) throws StreamBaseException
      Restart the given container
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - the name of the container to restart
      Returns:
      results if any
      Throws:
      StreamBaseException
    • typecheck

      StreamProperties[] typecheck(long timeoutMS, String application, boolean full) throws StreamBaseException
      Typecheck (validate) the given StreamBase Application. Return a list of StreamProperties for that Application
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      application - contents of an application. Text sbapp or ssql.
      full - do a full typecheck
      Returns:
      array of StreamProperties for the StreamBase application
      Throws:
      StreamBaseException - on network or typecheck error
    • shutdown

      String shutdown(long timeoutMS, String containerName) throws StreamBaseException
      Shutdown a StreamBase container or if empty the whole server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - optional containerName
      Returns:
      message describing the shutdown outcome
      Throws:
      StreamBaseException - thrown on network or other errors
    • getDynamicVariables

      Tuple getDynamicVariables(long timeoutMS, com.streambase.sb.util.Path modulePath) throws StreamBaseException
      Return the current value of the dynamic variables in the given module, as a Tuple of field name to Java value.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      modulePath - the path to the module
      Returns:
      a Tuple of all the module's dynamic variables. The field names are the names of the dynamic variables, and the values are their current values.
      Throws:
      StreamBaseException - on nonexistence of the path, network, if the module contains no dynamic variables, or other errors.
    • setDynamicVariable

      void setDynamicVariable(long timeoutMS, com.streambase.sb.util.Path dynamicVariablePath, Object value) throws StreamBaseException
      Set the value of the given dynamic variable to the given value.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      dynamicVariablePath - the path to the dynamic variable
      value - the value to set the variable to
      Throws:
      StreamBaseException
    • fastForwardTime

      void fastForwardTime(long timeoutMS, Object msecs) throws StreamBaseException
      Number of milliseconds to jump forward in time. Note that if you specify a negative number for msecs, the behavior could vary depending on the TimeService implementation. (no guaranteed what could happen!)
      Parameters:
      timeoutMS - Timeout in milliseconds to wait for completion
      msecs - number of milliseconds to jump forward in time
      Throws:
      StreamBaseException - Error forwarding time
    • getTargetTime

      String getTargetTime(long timeoutMS) throws StreamBaseException
      Get target time
      Parameters:
      timeoutMS - Timeout in milliseconds to wait for completion
      Returns:
      Target time
      Throws:
      StreamBaseException - Error getting time
    • getEvalCacheContent

      String getEvalCacheContent(long timeoutMS, String containerName) throws StreamBaseException
      Get evaluation cache content
      Parameters:
      timeoutMS - Timeout in milliseconds to wait for completion
      containerName - Container name
      Returns:
      Cache contents
      Throws:
      StreamBaseException - Error reading cache
    • clearEvalCache

      String clearEvalCache(long timeoutMS, String containerName) throws StreamBaseException
      Clear evaluation cache
      Parameters:
      timeoutMS - Timeout in milliseconds to wait for completion
      containerName - Container name
      Returns:
      Cache contents
      Throws:
      StreamBaseException - Error clearing cache
    • getMapperCacheContent

      String getMapperCacheContent(long timeoutMS, String containerName) throws StreamBaseException
      Get mapper cache content
      Parameters:
      timeoutMS - Timeout in milliseconds to wait for completion
      containerName - Container name
      Returns:
      Cache contents
      Throws:
      StreamBaseException - Error reading cache
    • getOperatorProperties

      String[] getOperatorProperties(long timeoutMS, String operatorName) throws StreamBaseException
      For the given Operator, return its set of properties and their values.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operatorName - The operator whose properties are retrieved.
      Returns:
      set of operator properties and values
      Throws:
      StreamBaseException
    • getOperatorProperty

      String getOperatorProperty(long timeoutMS, String operatorName, String propertyName) throws StreamBaseException
      Return the value of the given property on the given Operator.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operatorName - The operator whose property value is retrieved.
      propertyName - The property whose value is retrieved.
      Returns:
      set of operator properties and values
      Throws:
      StreamBaseException
    • setOperatorProperty

      void setOperatorProperty(long timeoutMS, String operatorName, String propertyName, String value) throws StreamBaseException
      On the given Operator, set the given property to the given value.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operatorName - The operator whose property value is set.
      propertyName - The property whose value is set.
      value - The value set.
      Throws:
      StreamBaseException
    • shutdownOperators

      void shutdownOperators(long timeoutMS, List<String> operators) throws StreamBaseException
      Shut down the given Operators on the StreamBase server.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operators - The Operators to shut down
      Throws:
      StreamBaseException - throws on network or other errors
    • restartOperators

      void restartOperators(long timeoutMS, List<String> operators) throws StreamBaseException
      Restart the given Operators on the StreamBase server. The Operators must currently be shut down.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operators - The Operators to shut down
      Throws:
      StreamBaseException - throws on network or other errors
    • suspendOperators

      void suspendOperators(long timeoutMS, List<String> operators) throws StreamBaseException
      Suspend the given Operators on the StreamBase Server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operators - the operators to suspend
      Throws:
      StreamBaseException - thrown on network or other errors
    • suspend

      void suspend(long timeoutMS, String name) throws StreamBaseException
      Suspend (pause) a StreamBase container or operator
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      name - container or operator name
      Throws:
      StreamBaseException - thrown on network or other errors
    • resumeOperators

      void resumeOperators(long timeoutMS, List<String> operators) throws StreamBaseException
      Resume the given Operators on the StreamBase server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      operators - the operators to suspend
      Throws:
      StreamBaseException
    • resume

      void resume(long timeoutMS, String containerName) throws StreamBaseException
      Resume a paused StreamBase container of if empty the whole Server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - optional containerName
      Throws:
      StreamBaseException
    • describe

      String describe(long timeoutMS, String entityName) throws StreamBaseException
      Return an XML description of a StreamBase entity
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      entityName - the name of the entity to describe
      Returns:
      an XML description of a StreamBase entity
      Throws:
      StreamBaseException - thrown on network or other errors
    • checkLicense

      boolean checkLicense(long timeoutMS, String featureName) throws StreamBaseException
      Return true if a license for the specified feature is available and false otherwise.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      featureName - the name of the licensed feature
      Returns:
      true if a license for the specified feature is available and false otherwise
      Throws:
      StreamBaseException - thrown on network or other errors
    • getStreamProperties

      StreamProperties getStreamProperties(long timeoutMS, String streamName) throws StreamBaseException
      Return the StreamProperties for the given name. Uses CaptureTransformStrategy.FLATTEN
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      streamName - the stream name to lookup
      Returns:
      The StreamProperties object for the given name
      Throws:
      StreamBaseException - thrown on network or other errors
    • getStreamProperties

      StreamProperties getStreamProperties(long timeoutMS, String streamName, CaptureTransformStrategy strategy) throws StreamBaseException
      Return the StreamProperties for the given name.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      streamName - the stream name to lookup
      strategy - the CaptureTransformStrategy to use if the target stream has capture fields.
      Returns:
      The StreamProperties object for the given name
      Throws:
      StreamBaseException - thrown on network or other errors
      Since:
      7.2.6
    • getStreamPropertiesByHash

      StreamProperties getStreamPropertiesByHash(long timeoutMS, byte[] hash) throws StreamBaseException
      Return the StreamProperties for the given hash
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      hash - The Hash to lookup
      Returns:
      The StreamProperties object for the given name
      Throws:
      StreamBaseException - thrown on network or other errors
    • listEntities

      String[] listEntities(long timeoutMS, String entityType, int flags, CaptureTransformStrategy strategy) throws StreamBaseException
      Return an array of entity names for the given entity type
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      entityType - the entity type to do the lookup
      flags - FULLY_QUALIFIED_NAMES and INCLUDE_MODULES flags
      strategy - the capture transform strategy
      Returns:
      an array of entity names for the given entity type
      Throws:
      StreamBaseException - thrown on network or other errors
    • getSchemaByHash

      Schema getSchemaByHash(long timeoutMS, byte[] hash) throws StreamBaseException
      Return the Schema object for the given hash value
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      hash - a byte array that contains a hash value
      Returns:
      The Schema object associated with the given hash value
      Throws:
      StreamBaseException - thrown on network or other errors
    • getSchemaByName

      Schema getSchemaByName(long timeoutMS, String schemaName) throws StreamBaseException
      Return the Schema object for the given name
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      schemaName - the name of the Schema to lookup
      Returns:
      the Schema for the given name
      Throws:
      StreamBaseException - thrown on network or other errors
    • drain

      void drain(long timeoutMS, String containerName) throws StreamBaseException
      Drain a StreamBase container or if empty the entire Server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - optional containerName
      Throws:
      StreamBaseException - thrown on network or other errors
    • operatorStatus

      String[] operatorStatus(long timeoutMS, String containerName) throws StreamBaseException
      Return the status of each Operator present in the StreamBase server.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      containerName - name of the container
      Returns:
      An array of Strings, each String hold the status of an Operator present in the server.
      Throws:
      StreamBaseException
    • status

      String[] status(long timeoutMS, boolean verbose) throws StreamBaseException
      Return the status of the StreamBase Server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      verbose - return a verbose status
      Returns:
      the status
      Throws:
      StreamBaseException - thrown on network and other errors
    • subscribe

      SubscriptionEntry subscribe(long timeoutMS, SubscriptionEntry subscription, List<TupleConnections.StreamTupleConnection> connections) throws StreamBaseException
      Subscribe to an output stream.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      subscription - a SubscriptionEntry describing the desired subscription. Contains the StreamProperties of the desired stream, an optional predicate, and an optional logical stream to associate with the predicate.
      connections - the list of tupleconnections on which to subscribe to
      Returns:
      a subscription entry
      Throws:
      StreamBaseException - server errors, or network errors.
    • unsubscribe

      void unsubscribe(long timeoutMS, StreamProperties props, String logicalstream, List<TupleConnections.StreamTupleConnection> connections) throws StreamBaseException
      UnSubscribe to an output stream.
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      props - the stream
      logicalstream - name of the logical stream
      connections - the list of tupleconnections on which to subscribe to
      Throws:
      StreamBaseException - server errors, or network errors.
    • internalCommand

      String[] internalCommand(long timeoutMS, String... args) throws StreamBaseException
      run an internal command
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      args - the arguments for the command
      Returns:
      the results of the command
      Throws:
      StreamBaseException - thrown on network or other errors
    • listConnections

      String[] listConnections(long timeoutMS, StreamBaseAdminClient.ListConnectionArgument... arg) throws StreamBaseException
      Return an array of client connections
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      arg - arguments for the command
      Returns:
      an array of client connections
      Throws:
      StreamBaseException - thrown on network or other errors
    • killConnection

      String[] killConnection(long timeoutMS, byte[] connectionId) throws StreamBaseException
      Kill the connection with the given connectionId
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      connectionId -
      Returns:
      status of kill command
      Throws:
      StreamBaseException
    • killAllConnections

      String[] killAllConnections(long timeoutMS) throws StreamBaseException
      Kill all of the connections on the server
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      Returns:
      status of kill command
      Throws:
      StreamBaseException
    • manageJdbcConnections

      String[] manageJdbcConnections(long timeoutMS, List<String> args) throws StreamBaseException
      Manage jdbc connections:
      count [name]
      Count the open JDBC connections to the named data source (or all data sources if ommitted)
      close [name]
      Close any open JDBC connections to the named data source (or all data sources if ommitted)
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      args - a list that must contain at least one command string (close or count), and may contain an optional second argument string (the name of a data source). When no argument string is given, the command will apply to all data sources.
      Returns:
      for close, one string containing the number of connections closed for count, one string containing the number of open connections
      Throws:
      StreamBaseException - throw on network or other errors
      Since:
      7.2
    • enqueue

      void enqueue(long timeoutMS, StreamProperties props, Collection<String> tuples) throws StreamBaseException
      Enqueue a list of CSV encoded tuples using connectionless XMLRPC
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      props - StreamProperties for stream
      tuples - list of tuples
      Throws:
      StreamBaseException
    • setRuntimeParam

      void setRuntimeParam(long timeoutMS, String paramName, String paramValue, String operator) throws StreamBaseException
      set the given runtime param
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      paramName - the name of the param
      paramValue - the value of the command
      operator - the operator for the param
      Throws:
      StreamBaseException
    • isHA

      boolean isHA()
      Are we in HA mode
      Returns:
      return if in HA mode
    • getByteOrder

      ByteOrder getByteOrder(long timeoutMS) throws StreamBaseException
      What is the byte order of the server?
      Parameters:
      timeoutMS - the timeout in milliseconds to wait for the command to complete
      Returns:
      byte order of the server
      Throws:
      StreamBaseException
    • setConnectionID

      void setConnectionID(com.streambase.sb.util.ByteString connectionid)
      Set the Connection ID
      Parameters:
      connectionid -
    • getConnectionID

      com.streambase.sb.util.ByteString getConnectionID()
      Return the connection id (which may be null)
      Returns:
      connection id (which may be null)
    • readTable

      List<Tuple> readTable(long timeoutMS, String tablePath, int rowLimit, String predicate) throws StreamBaseException
      Return rows from the table.
      Parameters:
      timeoutMS - timeout in milliseconds
      tablePath - Path to the table.
      rowLimit - Limit on number of rows to return, or -1 for all rows.
      predicate -
      Returns:
      A list of rows from the table.
      Throws:
      StreamBaseException - If the connection is not valid or the server cannot be contacted.
      Since:
      10.2 Executes a cluster wide-query on partitioned transasctional memory tables
    • getNamesForContainer

      Map<Integer,String> getNamesForContainer(long timeoutMS, int id) throws StreamBaseException
      Return a map of id and names for the given container id.
      Parameters:
      timeoutMS -
      id -
      Returns:
      a map of id and names for the given container id
      Throws:
      StreamBaseException