Open SiteSearch 4.1.1
Final

ORG.oclc.jassi.access
Class DefaultAccessClient

java.lang.Object
  |
  +--ORG.oclc.jassi.access.DefaultAccessClient
Direct Known Subclasses:
RBAccessClient

public class DefaultAccessClient
extends Object
implements AccessClient

The DefaultAccessClient class provides a default authorization client for the JaSSI when none is provided. It returns valid authorizations for all authorization requests.


Field Summary
protected  String autho
          String data type containing the user's input authorization.
protected  int authorizationStatus
          The user's authorizationStatus;
protected  boolean authorized
          boolean data type indicating whether this user has been authorized.
protected  Vector authorizedDbs
          the list of authorized dbs from the access server.
protected  int errorCode
          The error code for authorization failure.
protected  String errorMessage
          The error message for authorization failure.
protected  boolean initted
           
protected  String IP
          String data type containing the user's ip.
protected  Log log
          The user's log object.
protected  String password
          String data type containing the user's input password.
protected  UserStateObject user
          User object;
 
Constructor Summary
DefaultAccessClient()
          Constructs a DefaultAccessClient object.
 
Method Summary
 String autho()
          Returns a String containing the authorization associated with the user.
 boolean authorizeByDNS(String IPAddress)
          Saves the input IP address and always returns true.
 boolean authorizeByIP(String IPAddress)
          Saves the input IP Address authorization and always returns true.
 boolean authorizeByName(String autho, String password)
          Saves the input autho/password Authorization and always returns true.
 boolean authorizedByDNS()
          Returns a boolean indicating whether the user is authorized by DNS address which is always true.
 boolean authorizedByIP()
          Returns a boolean indicating whether the user is authorized by IP address which is always true.
 boolean authorizedByName()
          Returns a boolean indicating whether the user is authorized by Name which is always true.
 int authorizeErrorCode()
          Returns an int containing the the error code for failed authorizations.
 String authorizeErrorMessage()
          Returns a String containing the error message for failed authorizations.
 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 which is always true.
 void delete(String resourceName, Object resourceObject)
          Deletes the resource name from the user's profile data where no action is taken here.
 Object get(String resourceName, Object resourceObject)
          Returns an Object containing the value for the input resource name from the user's profile data and optionally uses the resourceObject to locate the data where null is always returned.
 Object getDbList()
          Returns a Vector object containing Strings for all available database names defined in the JaSSI system.
 Object getMetaData()
          Gets the MetaData object which describes the available profile data.
 String getRemoteAutho(String resourceName)
          Retrieves the remote service authorization for the input resourceName which is always null.
 String getRemotePassword(String resourceName)
          Retrieves the remote service password for the input resourceName which is always null.
 void initialize(Object serverObj, Object user)
          Initialzes the SiteSearch Access Client for the JaSSI using the data found in the input server object for the input 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 for the given resource name in the user's profile data where no action is taken.
 void setAuthoPassword(String authorization, String password)
          Sets the authorization/password associated with the user to the input autho and password.
 void setDbList(Object dbs)
          Sets up the Vector of database names using the list of database names input.
 void setLog(Log log)
          Sets the log that logging will write to.
 String toString()
          Generates a String representation of the Object.
 Object user()
          Returns a UserStateObject containing user information which has been associated with the AccessClient object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initted

protected boolean initted

authorized

protected boolean authorized
boolean data type indicating whether this user has been authorized.

authorizationStatus

protected int authorizationStatus
The user's authorizationStatus;

autho

protected String autho
String data type containing the user's input authorization.

password

protected String password
String data type containing the user's input password.

IP

protected String IP
String data type containing the user's ip.

errorCode

protected int errorCode
The error code for authorization failure.

errorMessage

protected String errorMessage
The error message for authorization failure.

log

protected Log log
The user's log object.

user

protected UserStateObject user
User object;

authorizedDbs

protected Vector authorizedDbs
the list of authorized dbs from the access server.
Constructor Detail

DefaultAccessClient

public DefaultAccessClient()
Constructs a DefaultAccessClient object.
Method Detail

initialize

public void initialize(Object serverObj,
                       Object user)
Initialzes the SiteSearch Access Client for the JaSSI using the data found in the input server object for the input 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)
Saves the input autho/password Authorization and always returns true.
Specified by:
authorizeByName in interface AccessClient
Parameters:
autho - the user's authorization
password - the user's password
Returns:
true always

authorizeByIP

public boolean authorizeByIP(String IPAddress)
Saves the input IP Address authorization and always returns true.
Specified by:
authorizeByIP in interface AccessClient
Parameters:
IPAddress - the input IP
Returns:
true always.

authorizeByDNS

public boolean authorizeByDNS(String IPAddress)
Saves the input IP address and always returns true.
Specified by:
authorizeByDNS in interface AccessClient
Parameters:
IPAddress - for the user.
Returns:
true always.

getMetaData

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

getDbList

public Object getDbList()
Returns a Vector object containing Strings for all available database names defined in the JaSSI system.
Specified by:
getDbList in interface AccessClient
Returns:
Vector object

setDbList

public void setDbList(Object dbs)
Sets up the Vector of database names using the list of database names input. If the input Object is not a Vector, the information is retrieved from the object and stored in a Vector of Strings.
Specified by:
setDbList in interface AccessClient
Parameters:
dbs - the Object containing a dblist.

getRemoteAutho

public String getRemoteAutho(String resourceName)
Retrieves the remote service authorization for the input resourceName which is always null.
Specified by:
getRemoteAutho in interface AccessClient
Parameters:
resourceName - the name of the server
Returns:
String - null always

getRemotePassword

public String getRemotePassword(String resourceName)
Retrieves the remote service password for the input resourceName which is always null.
Specified by:
getRemotePassword in interface AccessClient
Parameters:
resourceName - the name of the server
Returns:
String - null always

dbAccessAllowed

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

authorizedByName

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

authorizedByIP

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

authorizedByDNS

public boolean authorizedByDNS()
Returns a boolean indicating whether the user is authorized by DNS address which is always true.
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 int containing the the error code for failed authorizations.
Specified by:
authorizeErrorCode in interface AccessClient
Returns:
0 always; no authorizations fail.

authorizeErrorMessage

public String authorizeErrorMessage()
Returns a String containing the error message for failed authorizations.
Specified by:
authorizeErrorMessage in interface AccessClient

setAuthoPassword

public void setAuthoPassword(String authorization,
                             String password)
Sets the authorization/password associated with the user to the input autho 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:
String

password

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

IP

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

user

public Object user()
Returns a UserStateObject containing user information which has been associated with the AccessClient object.
Specified by:
user in interface AccessClient
Returns:
Object

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 and optionally uses the resourceObject to locate the data where null is always returned.
Specified by:
get in interface AccessClient
Parameters:
resourceName - the name of the data to update
resourceObject - the name of the category or the category object itself where the resource can be located.
Returns:
null always

put

public void put(String resourceName,
                Object value,
                Object resourceObject)
Stores the input Object for the given resource name in the user's profile data where no action is taken.
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.

delete

public void delete(String resourceName,
                   Object resourceObject)
Deletes the resource name from the user's profile data where no action is taken here.
Specified by:
delete in interface AccessClient
Parameters:
resourceName - the name to delete
resourceObject - the name of the category or the category object itself where the resource can be located.

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
Returns:
String
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final