com.mobileapps.pcre
Class PCREEngine

java.lang.Object
  |
  +--com.mobileapps.pcre.PCREEngine

public class PCREEngine
extends java.lang.Object


Field Summary
static int engineClosed
           
static int engineOpened
           
static int GV_DLL
           
static int GV_ENGINE
           
 
Constructor Summary
PCREEngine(PCREClient client)
          Construct a PCRE Engine object.
PCREEngine(PCREClient client, boolean open)
          Construct a PCRE Engine object and optionally call OpenEngine.
 
Method Summary
 boolean CanClose()
          Query the print engine to see if it is closeable.
 java.lang.Object clone()
          PCREEngine objects are not clonable, this method simply throws an exception.
 void Close()
          Close the print engine.
 PCREAPI getAPI()
          Get the PCREAPI object used by this engine.
 PCREClient getClient()
          Get the client instance for this engine.
 short GetErrorCode()
          Issue a PEGetErrorCode call.
 java.lang.String GetErrorText()
          Issue a PEGetErrorStr call.
 boolean GetHandleString(int textHandle, short textLength, java.lang.StringBuffer string)
          Issue a PEGetHandleString call.
 PCREJobTable getJobTable()
          Get the job-table used by this engine.
 int getStatus()
          Get the current engine status.
 short GetVersion(int versionRequested)
          Get the version of this report engine.
 boolean LogOffServer(java.lang.String dllName, PCRELogOnInfo logOnInfo)
          Log off a database server.
 boolean LogOnServer(java.lang.String dllName, PCRELogOnInfo logOnInfo)
          Log on to a database server.
 boolean Open()
          Open a new print engine.
 PCREJob OpenJob(java.lang.String reportFileName)
          Open a report using this engine
 PCREJob OpenSubreport(PCREJob parentJob, java.lang.String subreportName)
          Open a subreport within a job's current report.
 void PrintReport(java.lang.String reportFile)
          Print a given report
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GV_DLL

public static final int GV_DLL

GV_ENGINE

public static final int GV_ENGINE

engineClosed

public static final int engineClosed

engineOpened

public static final int engineOpened
Constructor Detail

PCREEngine

public PCREEngine(PCREClient client)
           throws PCREClientError,
                  PCREServerError,
                  PCREAPIError
Construct a PCRE Engine object.
Parameters:
client - The PCREClient object that holds the PCRE server connection.
Throws:
PCREClientError - The PCREClient object is not conntected to the PCRE server.
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote OpenEngine call returned a value indicating failure.

PCREEngine

public PCREEngine(PCREClient client,
                  boolean open)
           throws PCREClientError,
                  PCREServerError,
                  PCREAPIError
Construct a PCRE Engine object and optionally call OpenEngine.
Parameters:
client - The PCREClient object that holds the PCRE server connection.
open - If true, call OpenEngine to open the print engine.
Throws:
PCREClientError - The PCREClient object is not connected to the PCRE server.
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote OpenEngine call returned a value indicating failure.
Method Detail

CanClose

public boolean CanClose()
                 throws PCREServerError,
                        PCREAPIError
Query the print engine to see if it is closeable.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

clone

public final java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException
PCREEngine objects are not clonable, this method simply throws an exception.
Throws:
java.lang.CloneNotSupportedException - Indicates that cloning is not supported.

Close

public void Close()
           throws PCREServerError,
                  PCREAPIError
Close the print engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

getAPI

public PCREAPI getAPI()
Get the PCREAPI object used by this engine.
Returns:
An PCREAPI object.

getClient

public PCREClient getClient()
Get the client instance for this engine.
Returns:
The PCREClient for this engine.

GetErrorCode

public short GetErrorCode()
                   throws PCREServerError,
                          PCREAPIError
Issue a PEGetErrorCode call.
Returns:
The error code, or 0 on error
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetErrorCode call returned a value indicating failure.

GetErrorText

public java.lang.String GetErrorText()
                              throws PCREServerError,
                                     PCREAPIError
Issue a PEGetErrorStr call.
Returns:
The error string, or an empty string on error ( not null )
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetErrorText call returned a value indicating failure.

GetHandleString

public boolean GetHandleString(int textHandle,
                               short textLength,
                               java.lang.StringBuffer string)
                        throws PCREServerError,
                               PCREAPIError
Issue a PEGetHandleString call.
Parameters:
textHandle - The handle of the string to retrieve.
textLength - The length of the text.
string - A buffer to store the result into.
Returns:
True on success, False on error.
Throws:
PCREServerError - A fatal error occurred during the remote call.
PCREAPIError - The remote GetHandleString call returned a value indicating failure.

getJobTable

public PCREJobTable getJobTable()
Get the job-table used by this engine.
Returns:
The table holding all currently open PCREAPI objects

getStatus

public int getStatus()
Get the current engine status.
Returns:
The current status code

GetVersion

public short GetVersion(int versionRequested)
                 throws PCREServerError,
                        PCREAPIError
Get the version of this report engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

LogOffServer

public boolean LogOffServer(java.lang.String dllName,
                            PCRELogOnInfo logOnInfo)
                     throws PCREServerError,
                            PCREAPIError
Log off a database server.
Parameters:
dllName - The DLL to use for the data source which you wish to log off.
logOnInfo - The login information to use for logging off the database.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

LogOnServer

public boolean LogOnServer(java.lang.String dllName,
                           PCRELogOnInfo logOnInfo)
                    throws PCREServerError,
                           PCREAPIError
Log on to a database server.
Parameters:
dllName - The DLL to use for the data source which you wish to log on to.
logOnInfo - The login information to use.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

Open

public boolean Open()
             throws PCREServerError,
                    PCREAPIError
Open a new print engine.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

OpenJob

public PCREJob OpenJob(java.lang.String reportFileName)
                throws PCREServerError,
                       PCREAPIError
Open a report using this engine
Parameters:
reportFileName - The path and filename of the report file to open.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

OpenSubreport

public PCREJob OpenSubreport(PCREJob parentJob,
                             java.lang.String subreportName)
                      throws PCREServerError,
                             PCREAPIError
Open a subreport within a job's current report.
Parameters:
parentJob - The job associated with the report containing the subreport.
subreportName - The name of the subreport within parentJob's report.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

PrintReport

public void PrintReport(java.lang.String reportFile)
                 throws PCREServerError,
                        PCREAPIError
Print a given report
Parameters:
reportFile - The path and filename of the report file which is to be printed.
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.