|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IJavaProgram
This object provides functionality which allows you to use a Java program within the BusinessObjects Enterprise framework. This program can be used for any number of different tasks, such as deleting all instances owned by a particular user.
Java programs can be published to BusinessObjects Enterprise and scheduled to run at specific intervals. Once a Java program has been published and scheduled to BusinessObjects Enterprise, at the scheduled interval, the Program Job Server logs into the CMS using a logon token, and retrieves and InfoStore and EnterpriseSession instance. The Java program then implements the Java SDK IProgramBase interface, and the Program Job Server executes its run() method. This process ensures that a Java program can conveniently execute against a BusinessObjects Enterprise system. Any output from the Java program is sent to stdout or stderr, and is captured as an instance and stored in a text file.
Note: The run method takes three parameters: an InfoStore object, an EnterpriseSession object, and an array containing program arguments.
The following example implements the IProgramBase interface and retrieves the CMS name, and the arguments that were set for a Java program:
import com.crystaldecisions.sdk.plugin.desktop.program.IProgramBase;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
import com.crystaldecisions.sdk.SDKException;
public class MyProgram implements IProgramBase
{
public void run(IEnterpriseSessiion Session, IInfoStore InfoStore, String[] args) throws SDKException
{
System.out.println("Arguments are: ");
for (int i=0; i<args.length; i++)
{
System.out.println("args[" + i + "]=" + args[i]);
}
System.out.println("CMS is " + Session.getCMSname());
}
}
Note: The use of a java policy file is required for running a java program. For more information see the IProgramGlobal interface.
Note:A Java program must implement the IProgramBase interface in order to execute.
| Method Summary | |
|---|---|
java.lang.String |
getArgs()
Returns the program arguments for this java program object. |
java.lang.String |
getClasspath()
Returns the class path for the java program object. |
java.lang.String |
getFileName()
Returns the name of file to be processed. |
java.lang.String |
getJVMArgs()
Returns the Java Virtual Machine (JVM) arguments. |
java.lang.String |
getMainClass()
Returns the main class. |
java.lang.String |
getUserName()
Returns the user name for the system that this object will run on. |
java.lang.String |
getWorkingDir()
Returns the working directory of this java program object. |
boolean |
isPasswordNotEmpty()
Returns a boolean that indicates whether the password is set and not empty. |
boolean |
isPasswordSet()
Returns a boolean that indicates whether the password is set. |
void |
setArgs(java.lang.String newVal)
Sets the program arguments for this java program object. |
void |
setClasspath(java.lang.String path)
Sets the class path for the java program object. |
void |
setFile(java.lang.String filePath)
Sets the file to be processed. |
void |
setJVMArgs(java.lang.String jvmArgs)
Sets additional arguments for the Java Virtual Machine (JVM). |
void |
setMainClass(java.lang.String mainClass)
Sets the main class. |
void |
setPassword(java.lang.String password)
Sets the users's password for the system that this object will run on. |
void |
setUserName(java.lang.String userName)
Sets the user name for the system that this object will run on. |
void |
setWorkingDir(java.lang.String workingDir)
Sets the working directory of this java program object. |
| Method Detail |
|---|
void setFile(java.lang.String filePath)
throws SDKException
Sets the file to be processed.
filePath - A String specifying the location of the file to be processed.
SDKException
java.lang.String getFileName()
throws SDKException
Returns the name of file to be processed.
String containing the name of the file to be processed.
SDKException - This is thrown if the process is unsuccessful.void setArgs(java.lang.String newVal)
Sets the program arguments for this java program object.
newVal - A String specifying the program arguments.java.lang.String getArgs()
Returns the program arguments for this java program object.
String containing the program arguments.void setClasspath(java.lang.String path)
Sets the class path for the java program object.
path - A String specifying the class path.java.lang.String getClasspath()
Returns the class path for the java program object.
String containing the class path.void setJVMArgs(java.lang.String jvmArgs)
Sets additional arguments for the Java Virtual Machine (JVM).
jvmArgs - A String specifying the JVM arguments.java.lang.String getJVMArgs()
Returns the Java Virtual Machine (JVM) arguments.
String containing the JVM arguments.void setMainClass(java.lang.String mainClass)
Sets the main class. This is the complete name of the class implementing the IProgramBase interface.
mainClass - A String specifying which class is designated as the main class.java.lang.String getMainClass()
Returns the main class. This is the complete name of the class implementing the IProgramBase interface.
String containing the designated main class.java.lang.String getWorkingDir()
Returns the working directory of this java program object.
String containing the working directory.void setWorkingDir(java.lang.String workingDir)
Sets the working directory of this java program object.
workingDir - A String specifying the working directory.java.lang.String getUserName()
Returns the user name for the system that this object will run on.
String containing the username.void setUserName(java.lang.String userName)
Sets the user name for the system that this object will run on.
userName - A String specifying the user name.void setPassword(java.lang.String password)
Sets the users's password for the system that this object will run on.
password - A String specifying the user's password.
boolean isPasswordSet()
throws SDKException
Returns a boolean that indicates whether the password is set.
Note: the password can be set and contain an empty field.
true if the password is set, and false otherwise.
SDKException - This is thrown if the process is unsuccessful.
boolean isPasswordNotEmpty()
throws SDKException
Returns a boolean that indicates whether the password is set and not empty.
true if the password is set and not empty, and false otherwise.
SDKException - This is thrown if the process is unsuccessful.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||