Open SiteSearch 4.1.1
Final

ORG.oclc.jassi.access
Class JaSSIAccessClient

java.lang.Object
  |
  +--ORG.oclc.jassi.access.JaSSIAccessClient

public class JaSSIAccessClient
extends Object
implements AccessClient

The JaSSIAccessClient class provides access to the SiteSearch AccessServer for authentication and profiling. It also serves as a container for authorization and profiling information.

The JaSSIAccessClient class is initialized with information from a server object and a user object.

See Also:
AccessConnectInfo, UserStateObject

Constructor Summary
JaSSIAccessClient()
          Constructs a JaSSIAccessClient object.
 
Method Summary
protected  void addRow(String tableName, Hashtable row)
          Adds a row to the input table the database.
 String autho()
          Returns a String containing the authorization associated with the user.
 int authorizationStatus()
          Returns an integer containing the Authorization status for the user.
 boolean authorizeByDNS(String IPAddress)
          Performs a Domain Name type authorization using the input IP address and returns a boolean indicating success or failure.
 boolean authorizeByIP(String IPAddress)
          Performs an IP Address type authorization using the input IP address and returns a boolean indicating success or failure.
 boolean authorizeByName(String autho, String password)
          Performs an authorization by name using the input authorization and password and returns a boolean indicating success or failure.
 boolean authorizedByDNS()
          Returns a boolean indicating whether the user is authorized by DNS address.
 boolean authorizedByIP()
          Returns a boolean indicating whether the user is authorized by IP address.
 boolean authorizedByName()
          Returns a boolean indicating whether this user is authorized by Name.
 int authorizeErrorCode()
          Returns an integer containing the error code for failed authorizations which is an error Code from AccessClient.
 String authorizeErrorMessage()
          Returns a String containing the error message for failed authorizations which is the error Message from AccessClient or empty string("").
 boolean authosEquals(String autho, String password)
          Compares the input autho and password to the existing autho/password.
 void close()
          Cleans up the connection to the AccessServer.
 boolean dbAccessAllowed(String dbname)
          Returns a boolean indicating whether access to the input database is allowed.
 void delete(String resourceName, Object resourceObject)
          Deletes the input resource name from the user's profile data.
protected  void deleteRow(String tableName, String colName, Object cellValue)
          Deletes a row from a table in the database for the input table name, column, and cell.
 Object get(String resourceName, Object resourceObject)
          Returns an Object containing the value for the input resource name from the user's profile data from the category defined in the input resourceObject.
 Object getDbList()
          Gets the authorized database list for the user where the Object returned is a Vector object containing a list of database names.
 Object getMetaData()
          Gets the MetaData object which describes the available profile data.
 String getRemoteAutho(String resourceName)
          Returns a String containing the remote service authorization for the input resource name (ie: server name).
 String getRemotePassword(String resourceName)
          Returns a String containing the remote service password for the input resource name (ie: server name).
protected  Vector getRows(String tableName, String colName, Object cellValue)
          Returns a Vector containing a row or rows from a table in the database for the input database table, column and cell.
 void initialize(Object serverObj, Object user)
          Initializes the SiteSearch Access Client for the JaSSI using the configuration information held in the input AccessConnectInfo object and the UserStateObject.
 String IP()
          Returns a String containing the IP Address associated with the user.
 String password()
          Returns a String containing the password associated with the user.
 void put(String resourceName, Object value, Object resourceObject)
          Stores the input Object into the user's profile data into the the input resource name and category.
protected  void replaceRow(String tableName, Hashtable changes, String colName, Object cellValue)
          Replaces a row in a table in the database for the input database table, column, and cell.
 void setAuthoPassword(String authorization, String password)
          Sets the authorization/password associated with the user to the input authorization and password.
 void setDbList(Object dbs)
          Sets the database list for the user.
 void setLog(Log log)
          Sets the log that logging will write to.
 String toString()
          Generates a String representation of the Object.
 Object user()
          Returns an Object containing user information which has been associated with the AccessClient object - in this client, a UserStateObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JaSSIAccessClient

public JaSSIAccessClient()
Constructs a JaSSIAccessClient object.
Method Detail

initialize

public void initialize(Object serverObj,
                       Object user)
Initializes the SiteSearch Access Client for the JaSSI using the configuration information held in the input AccessConnectInfo object and the UserStateObject.
Specified by:
initialize in interface AccessClient
Parameters:
serverObj - the application's Access Server Information Object
userObj - a user context object

setLog

public void setLog(Log log)
Sets the log that logging will write to. If not reset, defaults to the System log.
Specified by:
setLog in interface AccessClient
Parameters:
log - the log to write to

authorizeByName

public boolean authorizeByName(String autho,
                               String password)
Performs an authorization by name using the input authorization and password and returns a boolean indicating success or failure.
Specified by:
authorizeByName in interface AccessClient
Parameters:
autho - the user's authorization
password - the user's password
Returns:
true when the user is authorized, false for invalid authorization

authorizeByIP

public boolean authorizeByIP(String IPAddress)
Performs an IP Address type authorization using the input IP address and returns a boolean indicating success or failure.
Specified by:
authorizeByIP in interface AccessClient
Parameters:
IPAddress - the input IP
Returns:
true when the user is authorized, false for invalid authorization.

authorizeByDNS

public boolean authorizeByDNS(String IPAddress)
Performs a Domain Name type authorization using the input IP address and returns a boolean indicating success or failure.
Specified by:
authorizeByDNS in interface AccessClient
Parameters:
IPAddress - the IPAddress of the user the Domain Name will be retrieved thru the IP address.
Returns:
true/false

getMetaData

public Object getMetaData()
Gets the MetaData object which describes the available profile data.
Specified by:
getMetaData in interface AccessClient
Returns:
Object the MetaData object for the SiteSearch AccessServer

getDbList

public Object getDbList()
Gets the authorized database list for the user where the Object returned is a Vector object containing a list of database names. return Object a Vector of database names.
Specified by:
getDbList in interface AccessClient

setDbList

public void setDbList(Object dbs)
Sets the database list for the user.
Specified by:
setDbList in interface AccessClient
Parameters:
dbs - the Object containing a dblist

getRemoteAutho

public String getRemoteAutho(String resourceName)
Returns a String containing the remote service authorization for the input resource name (ie: server name).
Specified by:
getRemoteAutho in interface AccessClient
Parameters:
resourceName - the name of server to get the authorization for.
Returns:
String. If the authorization if found in the user's profile for the service return it. If the user is authorized by name, return the autho value; otherwise, if the user is authorized by IP Address or DNS, return the ip address or null.

getRemotePassword

public String getRemotePassword(String resourceName)
Returns a String containing the remote service password for the input resource name (ie: server name).
Specified by:
getRemotePassword in interface AccessClient
Parameters:
resourceName - the name of the resource.
Returns:
String the password if found, otherwise null.

dbAccessAllowed

public boolean dbAccessAllowed(String dbname)
Returns a boolean indicating whether access to the input database is allowed.
Specified by:
dbAccessAllowed in interface AccessClient
Parameters:
dbname - the name of the database.
Returns:
boolean

authorizedByName

public boolean authorizedByName()
Returns a boolean indicating whether this user is authorized by Name.
Specified by:
authorizedByName in interface AccessClient
Returns:
boolean

authorizedByIP

public boolean authorizedByIP()
Returns a boolean indicating whether the user is authorized by IP address.
Specified by:
authorizedByIP in interface AccessClient
Returns:
boolean

authorizedByDNS

public boolean authorizedByDNS()
Returns a boolean indicating whether the user is authorized by DNS address.
Specified by:
authorizedByDNS in interface AccessClient
Returns:
boolean

authosEquals

public boolean authosEquals(String autho,
                            String password)
Compares the input autho and password to the existing autho/password.
Specified by:
authosEquals in interface AccessClient
Parameters:
autho - the authorization name to compare
password - the password to compare.

authorizeErrorCode

public int authorizeErrorCode()
Returns an integer containing the error code for failed authorizations which is an error Code from AccessClient.
Specified by:
authorizeErrorCode in interface AccessClient
Returns:
int
See Also:
AccessClient

authorizeErrorMessage

public String authorizeErrorMessage()
Returns a String containing the error message for failed authorizations which is the error Message from AccessClient or empty string("").
Specified by:
authorizeErrorMessage in interface AccessClient
See Also:
AccessClient

setAuthoPassword

public void setAuthoPassword(String authorization,
                             String password)
Sets the authorization/password associated with the user to the input authorization and password.
Specified by:
setAuthoPassword in interface AccessClient
Parameters:
authorization - the name used to authorize.
password - the password used to authorize.

autho

public String autho()
Returns a String containing the authorization associated with the user.
Specified by:
autho in interface AccessClient
Returns:
autho

password

public String password()
Returns a String containing the password associated with the user.
Specified by:
password in interface AccessClient
Returns:
password

IP

public String IP()
Returns a String containing the IP Address associated with the user.
Specified by:
IP in interface AccessClient
Returns:
IP

authorizationStatus

public int authorizationStatus()
Returns an integer containing the Authorization status for the user.
Returns:
authorizationStatus
See Also:
AccessClient

user

public Object user()
Returns an Object containing user information which has been associated with the AccessClient object - in this client, a UserStateObject.
Specified by:
user in interface AccessClient
Returns:
Object - a UserStateObject
See Also:
UserStateObject

get

public Object get(String resourceName,
                  Object resourceObject)
Returns an Object containing the value for the input resource name from the user's profile data from the category defined in the input resourceObject.
Specified by:
get in interface AccessClient
Parameters:
resourceName - the name of the data to retrieve
resourceObject - the name of the category or the category object itself where the resource can be located. null can be passed in; this is here for extensibility purposes. Defaults to the "authos" table.
Returns:
Object the value of the requested resource

put

public void put(String resourceName,
                Object value,
                Object resourceObject)
Stores the input Object into the user's profile data into the the input resource name and category.
Specified by:
put in interface AccessClient
Parameters:
resourceName - the name of the data to update
value - the value for the resourceName
resourceObject - the name of the category or the category object itself where the resource can be located. null can be passed in, this is here for extensibility purposes. Only valid value is the "authos" table. If resourceObject is null, assume "authos".

delete

public void delete(String resourceName,
                   Object resourceObject)
Deletes the input resource name from the user's profile data.
Specified by:
delete in interface AccessClient
Parameters:
resourceName - the name of the object to delete
resourceObject - the name of the category or the category object itself where the resource can be located. null can be passed in, this is here for extensibility purposes. Only valid value is the "authos" table. If resourceObject is null, assume "authos."

getRows

protected Vector getRows(String tableName,
                         String colName,
                         Object cellValue)
Returns a Vector containing a row or rows from a table in the database for the input database table, column and cell. For authorization information already retrieved, use AuthoResults.getRow().
Parameters:
tableName - the name of the database table
colName - the name of the column in which to look for the cellValue
cellValue - the value to look for the the colName
Returns:
Vector

replaceRow

protected void replaceRow(String tableName,
                          Hashtable changes,
                          String colName,
                          Object cellValue)
Replaces a row in a table in the database for the input database table, column, and cell.
Parameters:
tableName - the name of the database table
changes - the column names and values
colName - the name of the column in which to look for the cellValue
cellValue - the value to look for the the colName

addRow

protected void addRow(String tableName,
                      Hashtable row)
Adds a row to the input table the database.
Parameters:
tableName - the name of the database table
row - the column names and values

deleteRow

protected void deleteRow(String tableName,
                         String colName,
                         Object cellValue)
Deletes a row from a table in the database for the input table name, column, and cell.
Parameters:
tableName - the name of the database table
colName - the name of the column in which to look for the cellValue
cellValue - the value to look for the the colName

close

public void close()
Cleans up the connection to the AccessServer.
Specified by:
close in interface AccessClient

toString

public String toString()
Generates a String representation of the Object.
Specified by:
toString in interface AccessClient
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final