Open SiteSearch 4.1.1
Final

ORG.oclc.access.api
Class AccessConnection

java.lang.Object
  |
  +--ORG.oclc.access.api.AccessConnection

public class AccessConnection
extends Object
implements AccessBerApi

The AccessConnection connects to the SiteSearch AccessServer and provides the BER interface coding and decoding.


Constructor Summary
AccessConnection(String host, int port, int timeout)
          Constructs an AccessConnection object
 
Method Summary
 AuthoResults authoByDomain(String ip, String serverType)
          Returns profiling information by performing authorization by domain name Looks up DNS with the ip.
 AuthoResults authoByIP(String ip, String serverType)
          Returns profiling information by performing authorization by IP.
 AuthoResults authoByName(String userid, String password, String serverType)
          Returns profiling information by performing authorization by name and password.
 AuthoResults authoByName(String userid, String system, String password, String serverType)
          Returns profiling information by performing authorization by name, system, and password.
 void deleteResource(String table, String colName, Object value, String oper)
          Deletes a particular row from a table in the database.
 void endUserSession(String serverType, String userAutho)
          Removes this user from the AuthoMgr in the AccessServer.
 Hashtable getAuthoByName(String autho, String system, String password, String serverType)
          Returns authos information by performing authorization by name, password and system.
 Vector getList(String uid, String accessType, String objectType)
          Retrieves a Vector for ECat
 MetaData getMetaData()
          Retrieves MetaData object which contains information about the database tables.
 void insertResource(String table, Hashtable row)
          Adds a new row of information to the database.
 Vector selectResource(String table, String colName, Object value, String op)
          Retrieves specified information from the database.
 void setLog(Log log)
          Sets the log object.
 void updateResource(String table, Hashtable changes, String colName, Object colValue, String oper)
          Updates a database table with changes provided.
 boolean validAuthoName(String userid)
          Returns a boolean indicating whether this autho name is valid.
 boolean validAuthoName(String userid, String password)
          Returns a boolean indicating whether this autho and password are valid.
 boolean validIP(String ip)
          Returns a boolean indicating whether this ip is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessConnection

public AccessConnection(String host,
                        int port,
                        int timeout)
Constructs an AccessConnection object
Parameters:
host - the host to connect to
port - the port to connect to
timeout - how long to wait for a connection
Method Detail

setLog

public void setLog(Log log)
Sets the log object.
Parameters:
log - the log to write to

authoByName

public AuthoResults authoByName(String userid,
                                String password,
                                String serverType)
                         throws Exception
Returns profiling information by performing authorization by name and password.
Parameters:
userid - the user's id
password - the user's password
serverType - JaSSI or ZBase
Returns:
AuthoResults Hashtable of Vector of Hashtables
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoResults, AuthoException, AccessException

authoByName

public AuthoResults authoByName(String userid,
                                String system,
                                String password,
                                String serverType)
                         throws Exception
Returns profiling information by performing authorization by name, system, and password.
Parameters:
userid - the user's id
system - the system requested
password - the user's password
serverType - JaSSI or ZBase
Returns:
AuthoResults Hashtable of Vector of Hashtables
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoResults, AuthoException, AccessException

validAuthoName

public boolean validAuthoName(String userid,
                              String password)
                       throws Exception
Returns a boolean indicating whether this autho and password are valid.
Parameters:
userid - this user's id
password - this user's password
Returns:
true always
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

validAuthoName

public boolean validAuthoName(String userid)
                       throws Exception
Returns a boolean indicating whether this autho name is valid.
Parameters:
userid - this user's id
Returns:
true always
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

getAuthoByName

public Hashtable getAuthoByName(String autho,
                                String system,
                                String password,
                                String serverType)
                         throws Exception
Returns authos information by performing authorization by name, password and system.
Parameters:
autho - the user's id
system - the system to log in to
password - the user's password
serverType - JaSSI or ZBase
Returns:
Hashtable of autho results
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoResults, AuthoException, AccessException

authoByIP

public AuthoResults authoByIP(String ip,
                              String serverType)
                       throws Exception
Returns profiling information by performing authorization by IP.
Parameters:
ip - ip address for this user
serverType - JaSSI or ZBase
Returns:
AuthoResults Hashtable of Vector of Hashtables
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoResults, AuthoException, AccessException

validIP

public boolean validIP(String ip)
                throws Exception
Returns a boolean indicating whether this ip is valid.
Parameters:
ip - this user's ip
Returns:
true always
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

authoByDomain

public AuthoResults authoByDomain(String ip,
                                  String serverType)
                           throws Exception
Returns profiling information by performing authorization by domain name Looks up DNS with the ip.
Parameters:
ip - this user's ip address
serverType - JaSSI or ZBase
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoResults, AuthoException, AccessException

selectResource

public Vector selectResource(String table,
                             String colName,
                             Object value,
                             String op)
                      throws Exception
Retrieves specified information from the database.
Parameters:
table - the database table
colName - the column in the table
value - the value to find the the column
Returns:
Vector of Hashtables with columnname/data
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

getList

public Vector getList(String uid,
                      String accessType,
                      String objectType)
               throws Exception
Retrieves a Vector for ECat

updateResource

public void updateResource(String table,
                           Hashtable changes,
                           String colName,
                           Object colValue,
                           String oper)
                    throws Exception
Updates a database table with changes provided.
Parameters:
table - table name
changes - Hashtable of column/value pairs
colName - column to look in
colValue - this value in the column
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

insertResource

public void insertResource(String table,
                           Hashtable row)
                    throws Exception
Adds a new row of information to the database.
Parameters:
table - the table name
row - a Hashtable of the row of data to add.
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

deleteResource

public void deleteResource(String table,
                           String colName,
                           Object value,
                           String oper)
                    throws Exception
Deletes a particular row from a table in the database.
Parameters:
table - the table name
colName - the column to look into
value - the value in the column
oper - "=" or "LIKE"
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

endUserSession

public void endUserSession(String serverType,
                           String userAutho)
                    throws Exception
Removes this user from the AuthoMgr in the AccessServer.
Parameters:
serverType - JaSSI or ZBase
userAutho - the string user autho'd with
Throws:
all - errors, both system and authorization, throw Exceptions
See Also:
AuthoException, AccessException

getMetaData

public MetaData getMetaData()
                     throws Exception
Retrieves MetaData object which contains information about the database tables.
Returns:
MetaData object
Throws:
system - errors.
See Also:
MetaData, AccessException

Open SiteSearch 4.1.1
Final