com.dynalivery.pcre
Class PCREClient

java.lang.Object
  |
  +--com.dynalivery.pcre.PCREClient
Direct Known Subclasses:
PCREAppletClient, PCREApplicationClient

public class PCREClient
extends java.lang.Object


Field Summary
static int PCRE_FAIL
          Failure return code.
static java.lang.String PCRE_NAME
          The default PCRE name
static int PCRE_OK
          Successful return code.
 int priority
          priority variable
static int PRIORITY_HIGH
          HIGH PRIORITY variable
static int PRIORITY_LOW
          LOW PRIORITY variable
static int PRIORITY_MEDIUM
          MEDIUM PRIORITY variable
 
Constructor Summary
PCREClient(PCREConsole console, java.lang.String host, int port, java.applet.Applet applet, java.util.Properties props, org.omg.CORBA.ORB cltOrb)
          Construct a PCRE client context for Java applets with the given applet, console and property array.
PCREClient(PCREConsole console, java.lang.String host, int port, java.lang.String[] args, java.util.Properties props, org.omg.CORBA.ORB cltOrb)
          Construct a PCRE client context for Java applications with given console, command-line arguments and property-array.
 
Method Summary
 void Connect()
          Connect client to selected PCRE services.
 void Connect(boolean useLoadBalancer)
          Connect client to selected PCRE services.
 boolean Connected(java.lang.String name)
          Is the Client is connected to named service.
 void DisableScripting()
          Disable event-driven scripting for this client.
 void Disconnect()
          Disconnect client from all PCRE services.
 void EnableScripting()
          Enable event-driven scripting for this client.
 java.lang.Object GetAPI(java.lang.String name)
          Get an API object from the registry.
 java.applet.Applet getApplet()
          Return the applet hosting the client.
 java.lang.String getAppletHost()
          If the client is running as an applet, return the host-name of the applet's code-base.
 boolean getArchiveFileReturnOption()
          Getter method for zipFlag member.
 PCREConfigServer getConfigServer()
          Returns the config server object associated with this client.
static PCREConsole getConsole()
          Return the client's console.
 PCRECustomServer getCustomServer()
          Returns the custom server object associated with this client.
static PCREConsole getDefaultConsole()
          Return the default console for the client.
 boolean getDisableServerTimeout()
          Getter method for disableServerTimeout flag.
 PCREGateway getGateway()
          Returns the gateway server object associated with this client.
static java.lang.String getHost()
          Return the PCRE client's host IP-address.
 java.lang.String getName()
          Return the client's name.
 org.omg.CORBA.ORB getORB()
          Return the client orb.
 java.lang.String[] GetPrinterInfo(java.lang.String printerName, java.lang.StringBuffer driverName, PCREDEVMODE devMode)
          This method returns the printer Info given the Printer Name
 java.lang.String[] GetPrinterNames()
          This method returns the names of the printers attached to the report server
 int getPriority()
          Getter method for priority member.
 PCREServer getServer()
          Returns the pcreserver object associated with this client.
 PCREService GetService(java.lang.String name)
          Get a service from the client's registry.
static org.omg.CORBA.ORB getSharedORB()
          Get the shared ORB instance.
static PCREConsole getThreadConsole()
          Return the console for the current thread.
 void InvokeScript(PCREScripting script, java.awt.Event evt, java.lang.Object arg)
          Schedule a script triggered by the AWT event.
 boolean isAppletClient()
          Is the client is invoked in an applet?
 PCREEngine OpenEngine()
          Acquire a print-engine for this client.
 PCREEngine OpenEngine(boolean open)
          Acquire and optionally open a print-engine for this client.
 void PutAPI(java.lang.String name, java.lang.Object api)
          Put an API object into the registry.
 void PutService(PCREService service)
          Enter a PCRE service in the client's registry.
 void Quit()
          Short-hand for Quit(PCREClient.PCRE_OK).
 void Quit(int code)
          Disconnect client from all PCRE services.
 void RemoveAPI(java.lang.String name)
          Remove an API object from the registry.
 void RemoveService(java.lang.String name)
          Remove a service from the client's registry.
 void ResetReportServer(PCREReportServerInfo rsinfo)
           
 void SelectReportServer(java.lang.String method)
          Use the Load balancer to select a Gateway by the given method.
 void setArchiveFileReturnOption(boolean zipOption)
          Setter method for zipFlag member.
 void setConfigServer(PCREConfigServer newConfigServer)
          Sets the config server object associated with this client.
 void setCustomServer(PCRECustomServer newCustomServer)
          Sets the custom server object associated with this client.
static void setDefaultConsole(PCREConsole console)
          Set the default console for the client.
 void setDisableServerTimeout(boolean timeoutFlag)
          Setter method for disableServerTimeout flag.
 void setGatewayServer(PCREGateway newGatewayServer)
          Sets the gateway server object associated with this client.
 void setName(java.lang.String name)
          Set the client's name.
 void setPriority(int clientPriority)
          Setter method for priority member.
 void setReportEngineServer(PCREServer newReportEngineServer)
          Sets the pcreserver object associated with this client.
static void setSharedORB(org.omg.CORBA.ORB theSharedORB)
          Set the shared ORB instance.
static void setThreadConsole(PCREConsole console)
          Set the console for the current thread.
static void Terminate()
          Short-hand for Terminate(PCRE_FAIL);
static void Terminate(int code)
          Terminate the client application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PCRE_OK

public static final int PCRE_OK
Successful return code.

PCRE_FAIL

public static final int PCRE_FAIL
Failure return code.

PCRE_NAME

public static final java.lang.String PCRE_NAME
The default PCRE name

PRIORITY_HIGH

public static final int PRIORITY_HIGH
HIGH PRIORITY variable

PRIORITY_MEDIUM

public static final int PRIORITY_MEDIUM
MEDIUM PRIORITY variable

PRIORITY_LOW

public static final int PRIORITY_LOW
LOW PRIORITY variable

priority

public int priority
priority variable
Constructor Detail

PCREClient

public PCREClient(PCREConsole console,
                  java.lang.String host,
                  int port,
                  java.lang.String[] args,
                  java.util.Properties props,
                  org.omg.CORBA.ORB cltOrb)
           throws PCREClientError
Construct a PCRE client context for Java applications with given console, command-line arguments and property-array.
Parameters:
console - The application console.
args - The command-line arguments.
props - The properties array.

PCREClient

public PCREClient(PCREConsole console,
                  java.lang.String host,
                  int port,
                  java.applet.Applet applet,
                  java.util.Properties props,
                  org.omg.CORBA.ORB cltOrb)
           throws PCREClientError
Construct a PCRE client context for Java applets with the given applet, console and property array. Java applets must call this special constructor (or one of the two following variants) to ensure remote connections are made without raising security exceptions.
Parameters:
console - The applet console.
applet - The applet.
props - The properties array.
Method Detail

Connect

public void Connect()
             throws PCREError,
                    GatewayShuttingDown
Connect client to selected PCRE services. Clients should override.
Throws:
PCREError - Is thrown on error.

Connect

public void Connect(boolean useLoadBalancer)
             throws PCREError,
                    GatewayShuttingDown
Connect client to selected PCRE services. Clients should override.
Parameters:
useLoadBalancer - Boolean value used to connect a report server via a load balancer.
Throws:
PCREError - Is thrown on error.

Connected

public boolean Connected(java.lang.String name)
Is the Client is connected to named service. Clients may override.
Parameters:
name - The name of the service to test for.
Returns:
True if connected, false otherwise.F

DisableScripting

public void DisableScripting()
Disable event-driven scripting for this client.

Disconnect

public void Disconnect()
                throws PCREError
Disconnect client from all PCRE services. Clients may override.
Throws:
PCREError - is thrown on error.

EnableScripting

public void EnableScripting()
Enable event-driven scripting for this client.

GetAPI

public java.lang.Object GetAPI(java.lang.String name)
Get an API object from the registry.
Parameters:
name - The name of the object to be retrieved.
Returns:
The API object.

getApplet

public java.applet.Applet getApplet()
Return the applet hosting the client.
Returns:
The applet the client is running in.

getAppletHost

public java.lang.String getAppletHost()
If the client is running as an applet, return the host-name of the applet's code-base. Return null if the client is not running as an applet.
Returns:
The applets hostname or null on error.

getConfigServer

public PCREConfigServer getConfigServer()
Returns the config server object associated with this client.
Returns:
com.dynalivery.pcre.PCREConfigServer

getConsole

public static PCREConsole getConsole()
Return the client's console.
Returns:
The client's console.

getCustomServer

public PCRECustomServer getCustomServer()
Returns the custom server object associated with this client.
Returns:
com.dynalivery.pcre.PCRECustomServer

getDefaultConsole

public static PCREConsole getDefaultConsole()
Return the default console for the client.
Returns:
The default console.

getGateway

public PCREGateway getGateway()
Returns the gateway server object associated with this client.
Returns:
com.dynalivery.pcre.PCREGateway

getHost

public static java.lang.String getHost()
Return the PCRE client's host IP-address. Return null if the address cannot be derived.
Returns:
The host IP-address, or null on error.

getName

public java.lang.String getName()
Return the client's name.
Returns:
The clients name.

getORB

public org.omg.CORBA.ORB getORB()
Return the client orb.
Returns:
The orb in use.

GetPrinterInfo

public java.lang.String[] GetPrinterInfo(java.lang.String printerName,
                                         java.lang.StringBuffer driverName,
                                         PCREDEVMODE devMode)
                                  throws PCREAPIError,
                                         PCREServerError
This method returns the printer Info given the Printer Name
Parameters:
printerName, - Name of the Printer as String
driverName, - Holds the Driver Name of the Printer Name given as input
pcreMode, - Holds the PCREDEVMODE of this Printer
Returns:
String[], the String array consists of set of ports supported by this printer
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

GetPrinterNames

public java.lang.String[] GetPrinterNames()
                                   throws PCREAPIError,
                                          PCREServerError
This method returns the names of the printers attached to the report server
Throws:
PCREServerError - A fatal error occured during the remote call.
PCREAPIError - The remote print engine call returned a value indicating failure.

getServer

public PCREServer getServer()
Returns the pcreserver object associated with this client.
Returns:
com.dynalivery.pcre.PCREServer

GetService

public PCREService GetService(java.lang.String name)
Get a service from the client's registry.
Parameters:
name - The name of the service requested.
Returns:
The matching service, or null on error.

getThreadConsole

public static PCREConsole getThreadConsole()
Return the console for the current thread.
Returns:
The console associated with the current thread.

InvokeScript

public void InvokeScript(PCREScripting script,
                         java.awt.Event evt,
                         java.lang.Object arg)
Schedule a script triggered by the AWT event.

isAppletClient

public boolean isAppletClient()
Is the client is invoked in an applet?
Returns:
True if the client is inside an applet, False otherwise.

OpenEngine

public PCREEngine OpenEngine()
                      throws PCREError
Acquire a print-engine for this client.
Returns:
The new PCREEngine object.
Throws:
PCREError - is thrown on error

OpenEngine

public PCREEngine OpenEngine(boolean open)
                      throws PCREError
Acquire and optionally open a print-engine for this client.
Parameters:
open - If true, open the print-engine on the server.
Returns:
The PCREEngine.
Throws:
PCREError - is thrown on error.

PutAPI

public void PutAPI(java.lang.String name,
                   java.lang.Object api)
Put an API object into the registry.
Parameters:
name - The name of the API object.
api - The API object to be entered.

PutService

public void PutService(PCREService service)
Enter a PCRE service in the client's registry. Also creates a link to this client from the service.
Parameters:
service - The service that is going to be used.

Quit

public void Quit()
Short-hand for Quit(PCREClient.PCRE_OK).

Quit

public void Quit(int code)
Disconnect client from all PCRE services. Clients should override.
Parameters:
code - The termination code.

RemoveAPI

public void RemoveAPI(java.lang.String name)
Remove an API object from the registry.
Parameters:
name - The name of the API object to be removed.

RemoveService

public void RemoveService(java.lang.String name)
Remove a service from the client's registry.
Parameters:
name - The name of the service to remove.

ResetReportServer

public void ResetReportServer(PCREReportServerInfo rsinfo)
                       throws PCREClientError,
                              PCREServerError

SelectReportServer

public void SelectReportServer(java.lang.String method)
                        throws PCREClientError,
                               PCREServerError
Use the Load balancer to select a Gateway by the given method.

setConfigServer

public void setConfigServer(PCREConfigServer newConfigServer)
Sets the config server object associated with this client.
Parameters:
newConfigServer - com.dynalivery.pcre.PCREConfigServer

setCustomServer

public void setCustomServer(PCRECustomServer newCustomServer)
Sets the custom server object associated with this client.
Parameters:
newCustomServer - com.dynalivery.pcre.PCRECustomServer

setDefaultConsole

public static void setDefaultConsole(PCREConsole console)
Set the default console for the client.
Parameters:
console - The new console for this client.

setGatewayServer

public void setGatewayServer(PCREGateway newGatewayServer)
Sets the gateway server object associated with this client.
Parameters:
newGatewayServer - com.dynalivery.pcre.PCREGateway

setName

public void setName(java.lang.String name)
Set the client's name.
Parameters:
name - The new name for this client.

setReportEngineServer

public void setReportEngineServer(PCREServer newReportEngineServer)
Sets the pcreserver object associated with this client.
Parameters:
newReportEngineServer - com.dynalivery.pcre.PCREServer

setThreadConsole

public static void setThreadConsole(PCREConsole console)
Set the console for the current thread.
Parameters:
console - The new console to associate with this thread.

Terminate

public static void Terminate()
Short-hand for Terminate(PCRE_FAIL);

Terminate

public static void Terminate(int code)
Terminate the client application.
Parameters:
code - The termination code.

setPriority

public void setPriority(int clientPriority)
Setter method for priority member.
Parameters:
clientPriority - static integer variable

getPriority

public int getPriority()
Getter method for priority member.
Returns:
priority member

setArchiveFileReturnOption

public void setArchiveFileReturnOption(boolean zipOption)
Setter method for zipFlag member.
Parameters:
zipOption - boolean

getArchiveFileReturnOption

public boolean getArchiveFileReturnOption()
Getter method for zipFlag member.
Returns:
zipFlag member

setDisableServerTimeout

public void setDisableServerTimeout(boolean timeoutFlag)
Setter method for disableServerTimeout flag.
Parameters:
disableServerTimeout - boolean

getDisableServerTimeout

public boolean getDisableServerTimeout()
Getter method for disableServerTimeout flag.
Returns:
disableServerTimeout member

getSharedORB

public static org.omg.CORBA.ORB getSharedORB()
Get the shared ORB instance.
Returns:
shrOrb

setSharedORB

public static void setSharedORB(org.omg.CORBA.ORB theSharedORB)
Set the shared ORB instance.
Parameters:
org.omg.CORBA.ORB -