jet.server.api.rmi
Interface ReportServerRMIWrapper

All Superinterfaces:
java.rmi.Remote

public interface ReportServerRMIWrapper
extends java.rmi.Remote


Field Summary
static int OOME
           
static java.lang.String RMI_SERVER_WRAPPER
          The remote object name in rmi registry.
static int RUNNING
           
static int UNKNOWN
          Define some constants to denote the status of remote server.
 
Method Summary
 ExportedFileList exportResult(java.lang.String userID, java.lang.String resultFileName, java.util.Properties props)
          Export a report result to RST, HTML, PDF, TEXT, Excel and PS.
 Member[] getAllMembers()
          Returns all members in cluster.
 Member[] getPredefinedServers()
          Get all server list that predefined.
 java.util.Properties getScheduledTask(java.lang.String taskID)
          Get properties of a scheduled task through the task ID.
 java.util.Vector getScheduledTasks()
          Get scheduled tasks.
 int getServerStatus()
          Get the status of remote server.
 boolean isTempResultReady(java.lang.String tempResultName)
          Test if the temporary result is ready.
 void removeLargeReport(java.lang.String tempResultName, boolean isStop)
          Remove the large report record of the temporary result.
 boolean removeScheduledTask(java.lang.String taskID)
          Remove a scheduled task through the task ID.
 java.lang.String runReport(java.lang.String userID, java.lang.String catalog, java.lang.String report, java.util.Properties propParams)
          Run a report immediately.
 java.lang.String runReportWithTimeouts(java.lang.String userID, java.lang.String catalog, java.lang.String report, java.util.Properties propParams, long timeouts)
          Run a report immediately with timeouts.
 void shutdown()
          Shutdown the RptServer.
 java.lang.String submitScheduledTask(java.lang.String userID, java.util.Properties propScheduledTask)
          Submit a scheduled task and return the task ID.
 java.lang.String waitTempResultReady(java.lang.String tempResultName)
          Wait the temporary result to be ready and return the error message.
 

Field Detail

RMI_SERVER_WRAPPER

static final java.lang.String RMI_SERVER_WRAPPER
The remote object name in rmi registry.

See Also:
Constant Field Values

UNKNOWN

static final int UNKNOWN
Define some constants to denote the status of remote server. UNKNOWN will be returned RMI client, if can't get know of server's status because server's error, or network failure. RUNNING denote remote server is normally running. OOME denote OOME occurred on remote server.

See Also:
Constant Field Values

RUNNING

static final int RUNNING
See Also:
Constant Field Values

OOME

static final int OOME
See Also:
Constant Field Values
Method Detail

shutdown

void shutdown()
              throws java.rmi.RemoteException
Shutdown the RptServer.

Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

runReport

java.lang.String runReport(java.lang.String userID,
                           java.lang.String catalog,
                           java.lang.String report,
                           java.util.Properties propParams)
                           throws java.rmi.RemoteException
Run a report immediately. After the running is over, return the temporary result name.

Parameters:
userID - the user ID.
catalog - the catalog path in the report server. For example:/SunVMDemo/SunVMDemo.cat.
report - the report name. For example:invoice.cls.
propParams - the properties that contains APIConst.TAG_WHERE_PORTION, APIConst.TAG_NAMED_WHERE_PORTION, APIConst.TAG_WHERE_CLAUSE, APIConst.TAG_USE_DEF_DB_USER, APIConst.TAG_USE_NEW_DB_PSWD, APIConst.TAG_DB_USER, APIConst.TAG_DB_PSWD, APIConst.TAG_JDBC_URL, APIConst.TAG_JDBC_DRIVER, APIConst.TAG_JDBC_CONNECTION_OBJECT and the parameter values of the report. For each report parameter in the properties, the key is APIConst.TAG_PARAM_PREFIX + PARAMETER_NAME, the value is the value of the parameter.
      Example: Running a report with user's JDBC connection object(APIConst.TAG_JDBC_CONNECTION_OBJECT).
      //creates the java.sql.Connection object.
      java.sql.Connection myCon = java.sql.DriverManager.getConnection(dbUrl);
      
      //set the parameter APIConst.TAG_JDBC_CONNECTION_OBJECT(jrs.jdbc_connection_object) to run a report.
      propParams.put(APIConst.TAG_JDBC_CONNECTION_OBJECT, myCon);
      
      //run the report using this java.sql.Connection object instead of 
      //the default DB settings in the catalog.
      rptServer.runReport(userID, catalog, report, propParams);
      
Returns:
the temporary result name.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

runReportWithTimeouts

java.lang.String runReportWithTimeouts(java.lang.String userID,
                                       java.lang.String catalog,
                                       java.lang.String report,
                                       java.util.Properties propParams,
                                       long timeouts)
                                       throws java.rmi.RemoteException
Run a report immediately with timeouts. When timeouts reached, this method will add the temporary result name into the Large Reports List and return the temporary result name. After calling this method, can use the methods isTempResultReady(...) and waitTempResultReady(...) to check/wait until the temporary result is ready, or use use the methods rptServer.getLargeReportManager().getLargeReportRecord(tempResultName) to check if the temporary result is ready. Can use the method rptServer.getLargeReportManager().getLargeReports(userID) to get the large reports list belong to the userID.

Parameters:
userID - the user ID.
catalog - the catalog path in the report server. For example: /SunVMDemo/SunVMDemo.cat.
report - the report name. For example: invoice.cls.
propParams - the properties that contain APIConst.TAG_WHERE_PORTION, APIConst.TAG_NAMED_WHERE_PORTION, APIConst.TAG_WHERE_CLAUSE, APIConst.TAG_USE_DEF_DB_USER, APIConst.TAG_USE_NEW_DB_PSWD, APIConst.TAG_DB_USER, APIConst.TAG_DB_PSWD, APIConst.TAG_JDBC_URL, APIConst.TAG_JDBC_DRIVER, APIConst.TAG_JDBC_CONNECTION_OBJECT and the parameter values of the report. For each report parameter in the properties, the key is APIConst.TAG_PARAM_PREFIX + PARAMETER_NAME, the value is the value of the paramter.
      Example: Running a report with user's JDBC connection object(APIConst.TAG_JDBC_CONNECTION_OBJECT).
      //creates the java.sql.Connection object.
      java.sql.Connection myCon = java.sql.DriverManager.getConnection(dbUrl);
      
      //set the parameter APIConst.TAG_JDBC_CONNECTION_OBJECT(jrs.jdbc_connection_object) to run a report.
      propParams.put(APIConst.TAG_JDBC_CONNECTION_OBJECT, myCon);
      
      //run the report using this java.sql.Connection object instead of 
      //the default DB settings in the catalog.
      rptServer.runReportWithTimeouts(userID, catalog, report, propParams, jet.server.api.http.HttpUtil.getReportWaitTimeouts());
      
timeouts - the timeouts in millisecond.
Returns:
the temporary result name.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

isTempResultReady

boolean isTempResultReady(java.lang.String tempResultName)
                          throws java.rmi.RemoteException
Test if the temporary result is ready.

Parameters:
tempResultName - the temporary result name.
Returns:
if the temporary result is ready.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

waitTempResultReady

java.lang.String waitTempResultReady(java.lang.String tempResultName)
                                     throws java.rmi.RemoteException
Wait the temporary result to be ready and return the error message.

Parameters:
tempResultName - the temporary result name.
Returns:
the error message. null if no error.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

exportResult

ExportedFileList exportResult(java.lang.String userID,
                              java.lang.String resultFileName,
                              java.util.Properties props)
                              throws java.rmi.RemoteException
Export a report result to RST, HTML, PDF, TEXT, Excel and PS.

Parameters:
userID - the user ID.
resultFileName - the real filename of the result. For example: c:\jrserver\temp\18238181130.temp.
props - the properties APIConst.TAG_RST, APIConst.TAG_PDF, APIConst.TAG_TEXT, APIConst.TAG_EXCEL and APIConst.TAG_PS. Value of these properties is true or false. The properties APIConst.TAG_HTML and APIConst.TAG_RTF. Value of these properties is filename without path(for example: invoice and invoice.rtf). About properties for each result type, please see the document "INSTALL_ROOT/help/server/en/userguide/apdx_sch.htm".
Returns:
the exported file list.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

submitScheduledTask

java.lang.String submitScheduledTask(java.lang.String userID,
                                     java.util.Properties propScheduledTask)
                                     throws java.rmi.RemoteException
Submit a scheduled task and return the task ID.

Parameters:
userID - the user ID.
propScheduledTask - the properties of the scheduled task. Please see the file "INSTALL_ROOT/help/server/en/userguide/apdx_sch.htm" for the instruction of the scheduled task properties.
Returns:
the task ID.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

getScheduledTasks

java.util.Vector getScheduledTasks()
                                   throws java.rmi.RemoteException
Get scheduled tasks.

Returns:
scheduled tasks. The Vector contains Properties objects. Each Properties object includes the properties of a scheduled task.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

getScheduledTask

java.util.Properties getScheduledTask(java.lang.String taskID)
                                      throws java.rmi.RemoteException
Get properties of a scheduled task through the task ID.

Parameters:
taskID - the task ID.
Returns:
the properties of a scheduled task.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

removeScheduledTask

boolean removeScheduledTask(java.lang.String taskID)
                            throws java.rmi.RemoteException
Remove a scheduled task through the task ID.

Parameters:
taskID - the task ID.
Returns:
if the scheduled task is removed.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

removeLargeReport

void removeLargeReport(java.lang.String tempResultName,
                       boolean isStop)
                       throws java.rmi.RemoteException
Remove the large report record of the temporary result.

Parameters:
tempResultName - the temporary result name.
isStop - if stop the running large reports.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

getPredefinedServers

Member[] getPredefinedServers()
                              throws java.rmi.RemoteException
Get all server list that predefined.

Returns:
a member array that represent all servers in predefined server list, or return null only if report server is not an admin server in cluster.
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

getAllMembers

Member[] getAllMembers()
                       throws java.rmi.RemoteException
Returns all members in cluster.

Returns:
all members in cluster, or return null if report server has not cluster feature;
Throws:
java.rmi.RemoteException - if any exception occurs in remote RptServer.

getServerStatus

int getServerStatus()
                    throws java.rmi.RemoteException
Get the status of remote server.

Returns:
the status integer value of remote server.
Throws:
RemoteException, - if any exception occurs when calling to remote RptServer.
java.rmi.RemoteException