Oracle® Data Integrator Java API Reference
11g Release 1 (11.1.1.3.0)

E17060-01

oracle.odi.runtime.agent
Class RuntimeAgent

java.lang.Object
  extended by oracle.odi.runtime.agent.RuntimeAgent

public final class RuntimeAgent
extends java.lang.Object

This class represents the execution engine, or "local agent". It offers all the methods to execute agent operations locally.

  • start a scenario
  • get a session status
  • restart a session
  • stop a session
  • clean the stale sessions
  • test a dataserver
  • It can interact with only one IOdiInstance, the one passed in the constructor.

    The best practice is to have only one RuntimeAgent by OdiInstance.

    Since:
    11.1.1.3.0

    Constructor Summary
    RuntimeAgent(OdiInstance pOdiInstance, java.lang.String pOdiUser, char[] pPassword)
              Constructs a RuntimeAgent object.
     
    Method Summary
     WorkRepositoryInfo cleanStaleSessions()
              Clean the stale sessions present in the work repository.
     java.lang.String getExecutionName()
              Returns the Agent name that will appear in the execution log for a startScenario operation.
     java.util.List<SessionStatusInfo> getSessionStatus(java.util.List<java.lang.Long> pSessionIds)
              Returns the sessions status.
     ExecutionInfo restartSession(long pSessionId, StartupParams pVariables, boolean pSynchronous)
              Restart the given session with various parameters.
     ExecutionInfo restartSession(long pSessionId, StartupParams pVariables, boolean pSynchronous, boolean pKeepSessionParams)
              Restart the given session with various parameters.
     ExecutionInfo startScenario(java.lang.String pScenName, java.lang.String pScenVersion, StartupParams pVariables, java.lang.String pKeywords, java.lang.String pContextCode, java.lang.Integer pLogLevel, java.lang.String pSessionName, boolean pSynchronous)
              Start the scenario with various parameters.
     void stopSession(long pSessionId, StopType pStopType)
              Kill the session described by the parameters.
     void testDataServer(java.lang.Number pDataServerId)
              Tests a data server as defined in the topology.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    RuntimeAgent

    public RuntimeAgent(OdiInstance pOdiInstance,
                        java.lang.String pOdiUser,
                        char[] pPassword)
    Constructs a RuntimeAgent object.

    Parameters:
    pOdiInstance - the odiInstance to which the RuntimeAgent is linked. Cannot be null.
    If the instance is not linked to a work repository, only testDataServer method will work.
    pOdiUser - the name of ODI user you want to use to connect to ODI to execute your operations.
    pPassword - the password NOT encoded
    Method Detail

    cleanStaleSessions

    public WorkRepositoryInfo cleanStaleSessions()
    Clean the stale sessions present in the work repository.

    Returns:
    WorkRepositoryInfo

    getExecutionName

    public java.lang.String getExecutionName()
    Returns the Agent name that will appear in the execution log for a startScenario operation.

    Returns:
    the Agent name that will appear in the execution log for a startScenario operation. Caution: This agent name does not correspond to a logical or physical agent in the topology. This parameter does not enable to run a session on a remote agent. This field is only set through the startScen.sh tool.

    getSessionStatus

    public java.util.List<SessionStatusInfo> getSessionStatus(java.util.List<java.lang.Long> pSessionIds)
                                                       throws InvocationException
    Returns the sessions status.

    Parameters:
    pSessionIds - a list of sessions to check.
    Returns:
    a list of SessionStatusInfo for the session ids passed as parameter
    Throws:
    InvocationException

    restartSession

    public ExecutionInfo restartSession(long pSessionId,
                                        StartupParams pVariables,
                                        boolean pSynchronous)
    Restart the given session with various parameters. The instance you used to instantiate this RuntimeAgent must be connected to a work repository to execute this method.
    Only sessions in status ERROR and WAITING can be restarted.
    If a variable value is not redefined in pVariables, then the last execution value will be used.

    Parameters:
    pSessionId - identifier of the session to restart
    pVariables - start up parameters for this session execution. Redefine the values for the session variables.
    pSynchronous - indicates whether the execution should be synchronous.
    Returns:
    informations on the execution

    restartSession

    public ExecutionInfo restartSession(long pSessionId,
                                        StartupParams pVariables,
                                        boolean pSynchronous,
                                        boolean pKeepSessionParams)
    Restart the given session with various parameters. The instance you used to instantiate this RuntimeAgent must be connected to a work repository to execute this method. Only sessions in status ERROR and WAITING can be restarted.

    Parameters:
    pSessionId - identifier of the session to restart
    pVariables - start up parameters for this session execution. Redefine the values for the session variables.
    pSynchronous - indicates whether the execution should be synchronous.
    pKeepSessionParams - if a session variable value is not redefined in pVariables, then if pKeepSessionParams is true then the value used in the last execution will be re-used.
    if pKeepSessionParams is false, then the default value of the variable will be used for this restart.
    Returns:
    informations on the execution

    startScenario

    public ExecutionInfo startScenario(java.lang.String pScenName,
                                       java.lang.String pScenVersion,
                                       StartupParams pVariables,
                                       java.lang.String pKeywords,
                                       java.lang.String pContextCode,
                                       java.lang.Integer pLogLevel,
                                       java.lang.String pSessionName,
                                       boolean pSynchronous)
    Start the scenario with various parameters. The instance you used to instantiate this RuntimeAgent must be connected to a work repository to execute this method.

    Parameters:
    pScenName - the name of the scenario to run. Must not be null or empty.
    pScenVersion - the version of the scenario to run. Must not be empty. If null or -1, the last version of the scenario will be run.
    pVariables - start up parameters used for the execution of this scenario
    pKeywords - keywords used for the execution of this scenario
    pContextCode - the context in which this scenario will be executed
    pLogLevel - logging level for this scenario execution. If null, default is 5
    pSessionName - the name to give to the sessions that will be created. If null, the scenario name will be used.
    pSynchronous - indicates whether the scenario execution should be synchronous
    Returns:
    information on the execution

    stopSession

    public void stopSession(long pSessionId,
                            StopType pStopType)
    Kill the session described by the parameters. The instance you used to instantiate this RuntimeAgent must be connected to a work repository to execute this method.
    Only the sessions that have been started by this RuntimeAgent instance can be stopped.

    Parameters:
    pSessionId - the id of the session to sop
    pStopType - the type of stop operation to perform

    testDataServer

    public void testDataServer(java.lang.Number pDataServerId)
    Tests a data server as defined in the topology.

    Parameters:
    pDataServerId - the data server identifier. Must not be null.

    Oracle® Data Integrator Java API Reference
    11g Release 1 (11.1.1.3.0)

    E17060-01

    Copyright © 2010, Oracle and/or its affiliates. All rights reserved.