com.jthomas.mailfaces
Class PiconDBServer

java.lang.Object
  |
  +--com.jthomas.mailfaces.PiconDBServer

public class PiconDBServer
extends java.lang.Object

Maintains the Interface to an instance of a PICON Database.


 


Constructor Summary
PiconDBServer()
          PiconDBServer constructor.
PiconDBServer(java.lang.String url, java.lang.String types)
          Method: PiconDBServer(String url, String types) - PiconDBServer constructor
PiconDBServer(java.lang.String url, java.lang.String types, java.lang.String proxy, int port)
          Method: PiconDBServer(String url, String types, String proxy, String port) - PiconDB constructor
 
Method Summary
 java.lang.String getHost()
          getHost() returns the hostname for this PIconDB.
 java.io.InputStream getInputStream(java.lang.String urlstr)
          getInputStream will return an input stream for the specified URL.
 int getPort()
          getPort() returns the Proxy hostname for this PIconDB.
 java.lang.String getProxy()
          getProxy() returns the Proxy hostname for this PIconDB.
 java.lang.String search(java.lang.String mailhost, java.lang.String mailuserid)
          search(String mailhost, String mailuserid) will invoke a query to the Picon Database.
 void setProxyUser(java.lang.String user, java.lang.String password)
          setProxyUser will setup the username and password for the Proxy if the user specified them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PiconDBServer

public PiconDBServer()
PiconDBServer constructor.

This will just create the object with the default parameters


PiconDBServer

public PiconDBServer(java.lang.String url,
                     java.lang.String types)
Method: PiconDBServer(String url, String types) - PiconDBServer constructor


PiconDBServer

public PiconDBServer(java.lang.String url,
                     java.lang.String types,
                     java.lang.String proxy,
                     int port)
Method: PiconDBServer(String url, String types, String proxy, String port) - PiconDB constructor

Method Detail

setProxyUser

public void setProxyUser(java.lang.String user,
                         java.lang.String password)
setProxyUser will setup the username and password for the Proxy if the user specified them.

Parameters:
user - The Username required by the Proxy
password - The password required by the Proxy

getHost

public java.lang.String getHost()
getHost() returns the hostname for this PIconDB. Needed so we can retrieve the image using any proxy that may be required.


getProxy

public java.lang.String getProxy()
getProxy() returns the Proxy hostname for this PIconDB.


getPort

public int getPort()
getPort() returns the Proxy hostname for this PIconDB.


search

public java.lang.String search(java.lang.String mailhost,
                               java.lang.String mailuserid)
                        throws java.io.IOException
search(String mailhost, String mailuserid) will invoke a query to the Picon Database.

Input is the mailhost name for the user and the userid A search of the remote database will be invoked and the results will be parsed to determine the URL of the GIF for the best match.

Returns:
String url - Returns the URL needed to access the image or null
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream(java.lang.String urlstr)
                                   throws java.io.IOException,
                                          java.net.MalformedURLException
getInputStream will return an input stream for the specified URL.

This method will take care of making a connection to the specified URL (taking care to use a Proxy if required) and return an InputStream that will access the contents of the URL

Parameters:
urlstr - Specifies the URL that should be connected to.
Returns:
InputStream
Throws:
java.io.IOException - MalformedURLException
java.net.MalformedURLException