com.iphrase.runtime
Class Connector

java.lang.Object
  |
  +--com.iphrase.runtime.Connector

public class Connector
extends java.lang.Object

Maintains a collection of iPhrase servers and properties for failover, and creates Query objects that can execute themselves against those servers.

An instance can be obtained from ConnectorFactory.getConnector(java.util.List, float, float).


Method Summary
 void close()
          Release this Connector object's resources immediately instead of waiting for them to be automatically released.
 Query createQuery()
          Create a new Query with no prior state.
 Query createQuery(java.lang.String state)
          Create a new Query from a query state string.
 QueryResult execute(Query query)
          Submit a Query to an iPhrase server.
 java.lang.String getPassword()
          Get the authentication password.
 float getRetrySeconds()
          Get the retry interval in seconds used by this instance.
 java.util.List getServers()
          Get the list of servers used by this instance.
 float getTimeoutSeconds()
          Get the timeout in seconds used by this instance.
 java.lang.String getUsername()
          Get the authentication username.
 boolean isClosed()
          Determine whether this Connector object has been closed via the close() method.
 void setCredentials(java.lang.String username, java.lang.String password)
          Pass login credentials to the underlying web service layer in order to authenticate requests to basic auth and (perhaps) other kinds of protected servers.
 void setPassword(java.lang.String password)
          Set the authentication password.
 void setUsername(java.lang.String username)
          Set the authentication username.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServers

public java.util.List getServers()
Get the list of servers used by this instance.
Returns:
List of servers passed to the Connector ctor

getTimeoutSeconds

public float getTimeoutSeconds()
Get the timeout in seconds used by this instance.
Returns:
timeoutSeconds passed to the Connector ctor

getRetrySeconds

public float getRetrySeconds()
Get the retry interval in seconds used by this instance.
Returns:
retrySeconds passed to the Connector ctor

setCredentials

public void setCredentials(java.lang.String username,
                           java.lang.String password)
Pass login credentials to the underlying web service layer in order to authenticate requests to basic auth and (perhaps) other kinds of protected servers.
Parameters:
username - login username
password - login password

setUsername

public void setUsername(java.lang.String username)
Set the authentication username.
Parameters:
username - login username
See Also:
setCredentials(java.lang.String, java.lang.String)

getUsername

public java.lang.String getUsername()
Get the authentication username.
Returns:
login username
See Also:
setCredentials(java.lang.String, java.lang.String)

setPassword

public void setPassword(java.lang.String password)
Set the authentication password.
Parameters:
password - login password
See Also:
setCredentials(java.lang.String, java.lang.String)

getPassword

public java.lang.String getPassword()
Get the authentication password.
Returns:
login password
See Also:
setCredentials(java.lang.String, java.lang.String)

createQuery

public Query createQuery()
Create a new Query with no prior state.
Returns:
new Query

createQuery

public Query createQuery(java.lang.String state)
                  throws ArgumentError
Create a new Query from a query state string.
Parameters:
state - obtained from Query.getState() or ResultSet.getResolvedQueryState()
Returns:
new Query

execute

public QueryResult execute(Query query)
                    throws WebServiceError
Submit a Query to an iPhrase server. This method is public only for Query.execute().
Parameters:
query - a fully-configured Query that's ready to go.
Returns:
new QueryResult object.
Throws:
WebServiceError -  

close

public void close()
Release this Connector object's resources immediately instead of waiting for them to be automatically released.

isClosed

public boolean isClosed()
Determine whether this Connector object has been closed via the close() method.
Returns:
true if closed

© Copyright 2005, 2006. IBM Corporation. All rights reserved.