oracle.odi.sdk.invocation
Class OdiInvocation

java.lang.Object
  extended by oracle.odi.sdk.invocation.OdiInvocation

public class OdiInvocation
extends java.lang.Object

Class used for requesting an execution on a remote agent

To request an execution:

1. first create the command using the OdiCommandScenario object:

                OdiCommandScenario scenCmd=new OdiCommandScenario();
                scenCmd.setScenName("TEST"); 
                scenCmd.setScenVersion("001"); 
                scenCmd.setSyncMode(OdiCommand.SYNC_MODE_SYNCHRONE);
                scenCmd.setLogLevel(5);
                scenCmd.setContext("GLOBAL"); 
     ...
 


2. create the repository connection using OdiRepositoryConnection object:
                OdiRepositoryConnection conn=new OdiRepositoryConnection();
                conn.setOdiUser("SUPERVISOR"); 
                conn.setOdiPassword("SUNOPSIS"); 
 

If the agent is not connected to a repository (not an agent scheduler) then JDBC parameters must be set:
                conn.setJdbcDriver("oracle.jdbc.driver.OracleDriver"); 
                conn.setJdbcUrl("jdbc:oracle:thin:@ours:1521:ORA9"); 
                conn.setJdbcUser("sa"); 
                conn.setJdbcUrl(""); 
    conn.setWorkRepositoryCode("WORKREP"); 


3. Finally, the command can be launched on an agent using this object:
     OdiInvocation invocation = new OdiInvocation(agentHost,agentPort);
     
     OdiInvocationResult result=invocation.invokeCommand(command,conn);
     
     if (!result.isOk())
     {
        //process wrong invocation
        ....
     }
     
     invocation.close();
 

See Also:
OdiRepositoryConnection, OdiCommand

Field Summary
static java.lang.String DEFAULT_AGENT_HOSTNAME
          Default agent host : localhost
static int DEFAULT_AGENT_PORT
          Default agent port : 20910
 
Constructor Summary
OdiInvocation()
          Creates an invocation object to request execution on the default agent.
OdiInvocation(java.lang.String pHostName, int pHostPort)
          Creates an invocation object to request execution on a remote agent.
 
Method Summary
 void close()
          Close the connection to the agent.
 OdiInvocationResult invokeCommand(OdiCommand pCommand, OdiRepositoryConnection pConnection)
          Launch a command on an agent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_AGENT_PORT

public static final int DEFAULT_AGENT_PORT
Default agent port : 20910

See Also:
Constant Field Values

DEFAULT_AGENT_HOSTNAME

public static final java.lang.String DEFAULT_AGENT_HOSTNAME
Default agent host : localhost

See Also:
Constant Field Values
Constructor Detail

OdiInvocation

public OdiInvocation(java.lang.String pHostName,
                     int pHostPort)
              throws java.io.IOException
Creates an invocation object to request execution on a remote agent. The agent host and listening port must be specified.

Parameters:
pHostName - Agent host name.
pHostPort - Agent listening port.
Throws:
java.io.IOException

OdiInvocation

public OdiInvocation()
              throws java.io.IOException
Creates an invocation object to request execution on the default agent. The default agent should be on the same machine, and listening on port 20910.

Throws:
java.io.IOException
Method Detail

invokeCommand

public OdiInvocationResult invokeCommand(OdiCommand pCommand,
                                         OdiRepositoryConnection pConnection)
Launch a command on an agent.

Parameters:
pCommand - OdiCommand to run.
pConnection - Repository connection.
Returns:
Result of the execution

close

public void close()
Close the connection to the agent.