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

E17060-01

oracle.odi.runtime.agent.invocation
Class RemoteRuntimeAgentInvoker

java.lang.Object
  extended by oracle.odi.runtime.agent.invocation.RemoteRuntimeAgentInvoker

public class RemoteRuntimeAgentInvoker
extends java.lang.Object

The RemoteRuntimeAgentInvoker is the utility class allowing to invoke operations on a remote ODI agent.
It is instantiated by passing the agent URL and the ODI credentials. The operations offered are: - Ping this agent - Get the agent version - Start a scenario - Get a session's status - Stop a session - Restart a session - Clean the stale sessions - Ask the agent to compute its planning - Get the schedules defined on this agent - Update the schedules - Kill the agent (if the server supports this feature). - Get the JMX information

Since:
11.1.1.3.0

Constructor Summary
RemoteRuntimeAgentInvoker(java.lang.String pAgentUrl, java.lang.String pUser, char[] pPassword)
          Constructs a RemoteRuntimeAgentInvoker object.
 
Method Summary
 java.lang.String getAgentURL()
          Returns the agent URL value.
 char[] getCharArrayPassword()
          Returns the decrypted user password used to connect to the ODI instance.
 java.lang.String getUser()
          Returns the user name value.
 WorkRepositoryInfo invokeCleanStaleSessions(java.lang.String pWorkRepositoryName)
          Cleans the stale sessions in the specified work repository.
 java.util.List<WorkRepositoryInfo> invokeCleanStaleSessionsForAllWorkRepositories()
          Cleans the stale sessions for all work repositories defined in connected master repository.
 void invokeComputePlanning()
          Asks the agent to recompute its schedules for all the work repositories.
The ODI agent will take into account all the new data defined in the ODI work repositories to compute and manage a new list of schedules.
 void invokeComputePlanning(java.lang.String pWorkrep)
          Asks the agent to recompute its schedules for the given work repository.
 java.lang.String invokeGetAgentVersion()
          Returns the version of the agent.
 oracle.odi.runtime.agent.invocation.response.OdiGetJMXServiceInfoAckType invokeGetJMXServiceInfo()
          Returns the JMXServiceInfo details about the current agent.
 SchedulingInfo invokeGetSchedules(long pStart, long pEnd)
          Returns the schedules information for the agent in the interval defined between the two parameters and for all the work repositories linked to the master repository to which the ODI agent is connected.
 SchedulingInfo invokeGetSchedules(java.lang.String pWorkrep, long pStart, long pEnd)
          Returns the schedules information for the agent in the interval defined between the two parameters.
 java.util.List<SessionStatusInfo> invokeGetSessionStatus(java.util.List<java.lang.Long> pSessionIds, java.lang.String pWorkRepositoryName)
          Return the status of given session ids.
 java.lang.String invokeIsAlive()
          Ping the agent.
 void invokeKillAgent(boolean pImmediate, long pMaxWait)
          Kills the agent.
 RemoteObjectResult invokeRemoteObject(java.lang.String pObjectId, java.lang.String pClassName, java.lang.String pMethodName, java.lang.String pParameter)
          Remotely invoke the given method with the given parameter on the remote object instance (class and ID).
 ExecutionInfo invokeRestartSession(long pSessionId, StartupParams pVariables, boolean pSynchronous, java.lang.String pWorkRepName)
          Restarts a session with various parameters.
If a variable value is not redefined in pVariables, then the last execution value will be used.
 ExecutionInfo invokeRestartSession(long pSessionId, StartupParams pVariables, boolean pSynchronous, java.lang.String pWorkRepName, boolean pKeepSessionParams)
          Restarts a session with various parameters.
 ExecutionInfo invokeStartScenario(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, java.lang.String pWorkRepName)
          Starts the given scenario with various parameters.
 void invokeStopSession(long pSessionId, StopType pStopType, java.lang.String pWorkRepoName)
          Stops a session.
 void invokeTestDataServer(java.lang.Number pDataServerId)
          Tests a data server defines in the ODI topology.
 void invokeUpdateSchedules()
          Asks the agent to compute its planning.
 void setPassword(char[] pPassword)
          sets the decrypted user password used to connect to the ODI instance.
 void setUser(java.lang.String pUser)
          sets the ODI user name used to connect to the ODI instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteRuntimeAgentInvoker

public RemoteRuntimeAgentInvoker(java.lang.String pAgentUrl,
                                 java.lang.String pUser,
                                 char[] pPassword)
Constructs a RemoteRuntimeAgentInvoker object.

Parameters:
pAgentUrl - URL of the agent that will be invoked. must not be null or empty. A typical URL is http://managedservername:managedserverport/oraclediagent. It is defined in the ODI topology.
pUser - ODI user name used to connect to the ODI instance. must not be null or empty. The User must be defined in ODI Security.
pPassword - Decrypted user password used to connect to the ODI instance. The password must be defined in ODI Security.
Method Detail

getAgentURL

public java.lang.String getAgentURL()
Returns the agent URL value.

Returns:
the URL of the agent that will be invoked

getCharArrayPassword

public char[] getCharArrayPassword()
Returns the decrypted user password used to connect to the ODI instance.

Returns:
the decrypted user password used to connect to the ODI instance

getUser

public java.lang.String getUser()
Returns the user name value.

Returns:
ODI user name used to connect to the ODI instance
See Also:
setUser(java.lang.String)

invokeCleanStaleSessions

public WorkRepositoryInfo invokeCleanStaleSessions(java.lang.String pWorkRepositoryName)
                                            throws InvocationException
Cleans the stale sessions in the specified work repository.

Parameters:
pWorkRepositoryName - the name of the work repository. This cannot be null
Returns:
a WorkRepositoryInfo
Throws:
InvocationException - if the invocation failed.

invokeCleanStaleSessionsForAllWorkRepositories

public java.util.List<WorkRepositoryInfo> invokeCleanStaleSessionsForAllWorkRepositories()
                                                                                  throws InvocationException
Cleans the stale sessions for all work repositories defined in connected master repository.

Returns:
a list of WorkRepositoryInfo
Throws:
InvocationException - if the invocation failed.

invokeComputePlanning

public void invokeComputePlanning()
                           throws InvocationException
Asks the agent to recompute its schedules for all the work repositories.
The ODI agent will take into account all the new data defined in the ODI work repositories to compute and manage a new list of schedules.

Throws:
InvocationException

invokeComputePlanning

public void invokeComputePlanning(java.lang.String pWorkrep)
                           throws InvocationException
Asks the agent to recompute its schedules for the given work repository. The work repository must be defined in ODI Topology.

Parameters:
pWorkrep - the name of the work repository on which the plannings will computed
Throws:
InvocationException

invokeGetAgentVersion

public java.lang.String invokeGetAgentVersion()
                                       throws InvocationException
Returns the version of the agent.

Returns:
the version of the agent.
Throws:
InvocationException - if the agent was unreachable

invokeGetJMXServiceInfo

public oracle.odi.runtime.agent.invocation.response.OdiGetJMXServiceInfoAckType invokeGetJMXServiceInfo()
                                                                                                 throws InvocationException
Returns the JMXServiceInfo details about the current agent.

Returns:
a OdiGetJMXServiceInfoAckType
Throws:
InvocationException - if the invocation failed

invokeGetSchedules

public SchedulingInfo invokeGetSchedules(long pStart,
                                         long pEnd)
                                  throws InvocationException
Returns the schedules information for the agent in the interval defined between the two parameters and for all the work repositories linked to the master repository to which the ODI agent is connected.

Parameters:
pStart - lower limit of the time interval for schedules searched
pEnd - upper limit of the time interval for schedules searched
Returns:
SchedulingInfo the detail on the schedules defined on this agent for all work repositories.
Throws:
InvocationException - if the schedules retrieval didn't succeed.

invokeGetSchedules

public SchedulingInfo invokeGetSchedules(java.lang.String pWorkrep,
                                         long pStart,
                                         long pEnd)
                                  throws InvocationException
Returns the schedules information for the agent in the interval defined between the two parameters. If workrep is not null then the schedules would be retrieved for the given work repository otherwise schedules would be retrieved from all work repositories.

Parameters:
pWorkrep - the name of the work repository to use
pStart - lower limit of the time interval for schedules searched
pEnd - upper limit of the time interval for schedules searched
Returns:
a SchedulingInfo object holding the schedules information
Throws:
InvocationException - if the schedules retrieval didn't succeed.

invokeGetSessionStatus

public java.util.List<SessionStatusInfo> invokeGetSessionStatus(java.util.List<java.lang.Long> pSessionIds,
                                                                java.lang.String pWorkRepositoryName)
                                                         throws InvocationException
Return the status of given session ids. Use in conjonction with invokeStartScenario(String, String, StartupParams, String, int, boolean, DataSourceDefinition, String, String, String) to follow the execution of a scenario.

Parameters:
pSessionIds - a list of sessions ids. All the session must have been executed on the same work repository.
pWorkRepositoryName - the name on which the session interrogated have been executed. Must not be null or empty. Must be defined in the ODI Topology.
Returns:
the list of session information for the given session ids.
Throws:
InvocationException

invokeIsAlive

public java.lang.String invokeIsAlive()
                               throws InvocationException
Ping the agent.

Returns:
the version of the agent
Throws:
InvocationException - if the agent was unreachable

invokeKillAgent

public void invokeKillAgent(boolean pImmediate,
                            long pMaxWait)
                     throws InvocationException
Kills the agent. Works only if the agent is a standalone ODI agent.

Parameters:
pImmediate - Indicates whether to kill the agent immediately or not.
pMaxWait - the number of milliseconds given to the agent to end its running task before being killed. Used only when pImmediate = false
Throws:
InvocationException - if the invocation failed

invokeRemoteObject

public RemoteObjectResult invokeRemoteObject(java.lang.String pObjectId,
                                             java.lang.String pClassName,
                                             java.lang.String pMethodName,
                                             java.lang.String pParameter)
                                      throws InvocationException
Remotely invoke the given method with the given parameter on the remote object instance (class and ID).

Parameters:
pObjectId - Instance identifier. If null or empty, a new instance of the object will be created.
pClassName - Class of the object to invoke. must not be null or empty
pMethodName - Name of the method to invoke on the object must not be null or empty
pParameter - parameter value for the method invoked.
Returns:
the result of the method invocation
Throws:
InvocationException - if the invocation failed

invokeRestartSession

public ExecutionInfo invokeRestartSession(long pSessionId,
                                          StartupParams pVariables,
                                          boolean pSynchronous,
                                          java.lang.String pWorkRepName)
                                   throws InvocationException
Restarts a session with various parameters.
If a variable value is not redefined in pVariables, then the last execution value will be used.

Parameters:
pSessionId - the identifier of the session to restart. The session is only restartable if its status is ERROR or WAITING.
pVariables - the session variables. Define values for variables used in this session.
pSynchronous - is the session execution synchronous
pWorkRepName - the name of the work repository on which this session has been run. Must not be null or empty. The Work Repository must be defined in the Topology. If the session ID doesn't exist in the work repository, the execution will fail.
Returns:
information on the session execution.
Throws:
InvocationException - if the invocation failed

invokeRestartSession

public ExecutionInfo invokeRestartSession(long pSessionId,
                                          StartupParams pVariables,
                                          boolean pSynchronous,
                                          java.lang.String pWorkRepName,
                                          boolean pKeepSessionParams)
                                   throws InvocationException
Restarts a session with various parameters.

Parameters:
pSessionId - the identifier of the session to restart. The session is only restartable if its status is ERROR or WAITING.
pVariables - the session variables. Define values for variables used in this session.
pSynchronous - is the session execution synchronous
pWorkRepName - the name of the work repository on which this session has been run. Must not be null or empty. The Work Repository must be defined in the Topology. If the session ID doesn't exist in the work repository, the execution will fail.
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:
information on the session execution.
Throws:
InvocationException - if the invocation failed

invokeStartScenario

public ExecutionInfo invokeStartScenario(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,
                                         java.lang.String pWorkRepName)
                                  throws InvocationException
Starts the given scenario with various parameters.

Parameters:
pScenName - name of the scenario to run. Must not be null or empty
pScenVersion - version of the scenario to run. If null or -1, the last version of the scenario will be executed. Must not be empty
pVariables - execution variables to pass to the scenario. If null, the variables used in this scenario will be replaced by values according to their definition in ODI Designer.
pKeywords - keywords for the sessions created
pContextCode - code of the context on which to execute. If null, the default context defined in the ODI Topology will be used.
pLogLevel - the level of logging for this execution. If null, default is 5.
pSessionName - The name of the sessions created. If null or empty, the name of the scenario is used.
pSynchronous - Is this execution synchronous
pWorkRepName - the name of the work repository containing this scenario. Must not be null.
Returns:
information on the scenario execution
Throws:
InvocationException - if the invocation failed

invokeStopSession

public void invokeStopSession(long pSessionId,
                              StopType pStopType,
                              java.lang.String pWorkRepoName)
                       throws InvocationException
Stops a session.

Parameters:
pSessionId - the identifier of the session which needs to be stopped
pStopType - the mechanism to the stop the session
pWorkRepoName - name of the work repository where the session resides. Must not be null or empty. Must be defined in ODI Topology.
Throws:
InvocationException - if the invocation failed

invokeTestDataServer

public void invokeTestDataServer(java.lang.Number pDataServerId)
                          throws InvocationException
Tests a data server defines in the ODI topology. The target data source will be pinged.

Parameters:
pDataServerId - the ID of the data server as defined in the ODI topology. Must not be null.
Throws:
InvocationException - if the invocation failed or if the data server test didn't succeed or if no data server with this identifier exists

invokeUpdateSchedules

public void invokeUpdateSchedules()
                           throws InvocationException
Asks the agent to compute its planning.

Throws:
InvocationException - if the invocation failed.

setPassword

public void setPassword(char[] pPassword)
sets the decrypted user password used to connect to the ODI instance.

Parameters:
pPassword - the decrypted user password used to connect to the ODI instance
See Also:
getPassword()

setUser

public void setUser(java.lang.String pUser)
sets the ODI user name used to connect to the ODI instance.

Parameters:
pUser - the ODI user name used to connect to the ODI instance
See Also:
getUser()

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.