Open SiteSearch 4.1.1
Final

ORG.oclc.zbase.access
Class ZBaseAccessClient

java.lang.Object
  |
  +--ORG.oclc.zbase.access.ZBaseAccessClient

public class ZBaseAccessClient
extends Object
implements AccessClient

The ZBaseAccessClient connects to the SiteSearch AccessServer to get user specific information.


Constructor Summary
ZBaseAccessClient()
          Constructs a ZBaseAccessClient object.
 
Method Summary
 String autho()
          Retrieves the String containing the authorization associated with the user.
 boolean authorizeByDNS(String IPAddress)
          Dummy method in ZBase to perform a Domain Name authorization.
 boolean authorizeByIP(String IPAddress)
          Dummy method in ZBase to perform an IP Address authorization.
 boolean authorizeByName(String autho, String password)
          Performs an autho/password Authorization.
 boolean authorizedByDNS()
          Determines whether the user has been authorized by DNS address.
 boolean authorizedByIP()
          Determines whether the user has been authorized by IP address.
 boolean authorizedByName()
          Determines whether the user has been authorized by Name.
 int authorizeErrorCode()
          Retrieves an integer containing the error code for failed authorizations which is the appropriate Z3950 init failure code reason.
 String authorizeErrorMessage()
          Retrieves 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 to check for equality.
 void close()
          Cleans-up the connection to the Access Server.
 boolean dbAccessAllowed(String dbname)
          Determines whether access to the input database is allowed.
 void delete(String resourceName, Object resourceObject)
          Deletes the resource name from the user's profile data.
 Object get(String resourceName, Object resourceObject)
          Gets the value for the resource name from the user's profile data.
 Object getDbList()
          Returns a String array object containing the authorized database list for the user.
 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: database).
 String getRemotePassword(String resourceName)
          Returns a String containing the remote service password for the input resource name(ie: database).
 void initialize(Object serverObj, Object user)
          Initialzes a SiteSearch Access Client that will connect to the the input server object for the input ZBase user object.
 String IP()
          Retrieves the String containing the IP address associated with the user.
 String password()
          Retrieves the String containing the password associated with the user.
 void put(String resourceName, Object value, Object resourceObject)
          Stores the value for the resource name from the user's profile data.
 void setAuthoPassword(String authorization, String password)
          Sets the user authorization/password to the input strings.
 void setDbList(Object dbs)
          Sets up the String array object of authorized database names for user using the input database list object.
 void setLog(Log log)
          Associates the input Log object to the Access Client object.
 String toString()
          Generates a String representation of the Object.
 Object user()
          Retrieves the Object defining the user data associated with the AccessClient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZBaseAccessClient

public ZBaseAccessClient()
Constructs a ZBaseAccessClient object.
Method Detail

initialize

public void initialize(Object serverObj,
                       Object user)
Initialzes a SiteSearch Access Client that will connect to the the input server object for the input ZBase user object.
Specified by:
initialize in interface AccessClient
Parameters:
serverObj - the application's Access Server Object
userObj - a user context object

setLog

public void setLog(Log log)
Associates the input Log object to the Access Client object.
Specified by:
setLog in interface AccessClient
Parameters:
log - the logging object.

authorizeByName

public boolean authorizeByName(String autho,
                               String password)
Performs an autho/password Authorization.
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

getMetaData

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

authorizeByIP

public boolean authorizeByIP(String IPAddress)
Dummy method in ZBase to perform an IP Address authorization.
Specified by:
authorizeByIP in interface AccessClient
Parameters:
IPAddress - the input IP
Returns:
true always.

authorizeByDNS

public boolean authorizeByDNS(String IPAddress)
Dummy method in ZBase to perform a Domain Name authorization.
Specified by:
authorizeByDNS in interface AccessClient
Parameters:
IPAddress - the IP address that can look upt the Domain Name
Returns:
true always.

getDbList

public Object getDbList()
Returns a String array object containing the authorized database list for the user.
Specified by:
getDbList in interface AccessClient

setDbList

public void setDbList(Object dbs)
Sets up the String array object of authorized database names for user using the input database list object.
Specified by:
setDbList in interface AccessClient
Parameters:
dbs - either a Hashtable object of dbnames or a String[] of dbnames

getRemoteAutho

public String getRemoteAutho(String resourceName)
Returns a String containing the remote service authorization for the input resource name(ie: database).
Specified by:
getRemoteAutho in interface AccessClient
Returns:
String

getRemotePassword

public String getRemotePassword(String resourceName)
Returns a String containing the remote service password for the input resource name(ie: database).
Specified by:
getRemotePassword in interface AccessClient
Returns:
String

dbAccessAllowed

public boolean dbAccessAllowed(String dbname)
Determines whether access to the input database is allowed.
Specified by:
dbAccessAllowed in interface AccessClient
Returns:
boolean true is authorized/false is unauthorized.

authorizedByName

public boolean authorizedByName()
Determines whether the user has been authorized by Name.
Specified by:
authorizedByName in interface AccessClient
Returns:
boolean

authorizedByIP

public boolean authorizedByIP()
Determines whether the user has been authorized by IP address.
Specified by:
authorizedByIP in interface AccessClient
Returns:
true always

authorizedByDNS

public boolean authorizedByDNS()
Determines whether the user has been authorized by DNS address.
Specified by:
authorizedByDNS in interface AccessClient
Returns:
true always

authosEquals

public boolean authosEquals(String autho,
                            String password)
Compares the input autho and password to the existing autho/password to check for equality.
Specified by:
authosEquals in interface AccessClient
Returns:
boolean true=equal/false=not equal

authorizeErrorCode

public int authorizeErrorCode()
Retrieves an integer containing the error code for failed authorizations which is the appropriate Z3950 init failure code reason.
Specified by:
authorizeErrorCode in interface AccessClient
Returns:
int

authorizeErrorMessage

public String authorizeErrorMessage()
Retrieves a String containing the error message for failed authorizations.
Specified by:
authorizeErrorMessage in interface AccessClient
Returns:
String or empty string("") when no authorizations fail.

setAuthoPassword

public void setAuthoPassword(String authorization,
                             String password)
Sets the user authorization/password to the input strings.
Specified by:
setAuthoPassword in interface AccessClient
Parameters:
authorization - the user's authorization
password - the user's password

autho

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

password

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

IP

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

user

public Object user()
Retrieves the Object defining the user data associated with the AccessClient.
Specified by:
user in interface AccessClient
Returns:
user - a ZBaseUser Object

get

public Object get(String resourceName,
                  Object resourceObject)
Gets the value for the resource name from the user's profile data.
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 - ignored.
Returns:
the value of the requested resource

put

public void put(String resourceName,
                Object value,
                Object resourceObject)
Stores the value for the resource name from the user's profile data.
Specified by:
put 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 - ignored
value - the value for the resourceName

delete

public void delete(String resourceName,
                   Object resourceObject)
Deletes the resource name from the user's profile data.
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 - ignored

close

public void close()
Cleans-up the connection to the Access Server.
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