com.ibm.tspaces.examples.services
Class PrintTester

java.lang.Object
  |
  +--com.ibm.tspaces.examples.services.PrintTester

public class PrintTester
extends java.lang.Object
implements java.lang.Runnable

PrintTester will send print requests to the PrintText Service A client that wants to use the PrintText services needs to only do the following

      TupleSpace servers = new TupleSpace("Services",servicehost);	    
	    
	    servers.write(TServices.PRINT,Printer1,"Line1 \n Line2");
The above is the simple PrintText command. The client can optionally add both fields to send Printer Options and an ID value that is used to get back a return value that will indicate if the request was sucessful. A client that wants to print the contents of a file needs to specify the File as a URL and pass it via the URLCopy facility
      TupleSpace servers = new TupleSpace("Services",servicehost);	       
	    servers.write(TServices.PRINT,Printer1,
              new URLCopy(filepath)),"opts",new Long(id));
where "filepath" points to a printable file. This could also be in the form "file:/filepath/filename" or "http://server/file"

Author:
John Thomas
See Also:
TupleSpace

Constructor Summary
PrintTester()
           
 
Method Summary
static void emailText(java.lang.String user, java.lang.String msg)
           
static void main(java.lang.String[] argv)
          Test the PrintText Service Client.
static void printText(java.lang.String printername, java.lang.String text, java.lang.String options)
           
static void printText(java.lang.String printername, java.net.URL url, java.lang.String options)
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintTester

public PrintTester()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

printText

public static void printText(java.lang.String printername,
                             java.lang.String text,
                             java.lang.String options)

printText

public static void printText(java.lang.String printername,
                             java.net.URL url,
                             java.lang.String options)

emailText

public static void emailText(java.lang.String user,
                             java.lang.String msg)

main

public static void main(java.lang.String[] argv)
Test the PrintText Service Client. Syntax: java ...PrintTester host name "url or string" options host - TSpaces server. name = Name to be used to contact server url = file:... or http:... string = "anything that does not look like an URL options = Print options (not implemented).