|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.adapter.ResourceAdapterBase
com.waveset.adapter.DB2ResourceAdapter
Resource Adapter for DB2 server. Was developed and tested using IBM DB2 Universal Database version 7. DB2 performs authentication externally, and authorization internally. Authentication is performed through an accountID/password that is passed on to an external certifier. By default this is the operating system, though it could be a third party package. Authorization is done by mapping the accountID internally to various permissions at the database, index, package, schema, server, table, view, nickname and/or table space level. Granting authorization does not automatically authenticate the accountID (hence you can authorize nonexistent accounts.) Revoking authorization does not remove publicly availably authority from an accountID. The current configuration is to have the DB2 Connection app installed on the Lighthouse machine. Within this app, a local alias is made to the remote database. This allows the Adapter to make local calls to the database that are automatically forwarded through the alias to the remote database. This is the IBM recommended method for interfacing an application to a remote database. The downside is 1) that it requires some (fairly easy) up front installation and configuration of DB2 Connection, and 2) it takes configuration of the DB remote location out of Lighthouse.
Nested Class Summary |
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase |
ResourceAdapterBase.SimpleAccountIterator |
Nested classes inherited from class com.waveset.adapter.ResourceAdapter |
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType |
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
RA_ADMINACCT
|
static java.lang.String |
RA_ADMINPWD
|
static java.lang.String |
RA_DBNAME
|
static java.lang.String |
RA_JDBC_DRIVER
|
static java.lang.String |
RA_JDBC_SUBPROTOCOL
|
static java.lang.String |
RA_REMOVE_FOREIGN_GRANTS
|
static java.lang.String |
USER_AUTH_GRANTS
|
static java.lang.String |
USER_PASSWORD
|
Fields inherited from class com.waveset.adapter.ResourceAdapterBase |
_cache, _context, _excludedAccountsRule, _excludedAccountsRuleInited, _listAllObjectsAttrParse, _listAllObjectsAttrParseName, _listUserAttrParse, _listUserAttrParseName, _listUserGroupsAttrParse, _listUserGroupsAttrParseName, _resource, _thread, _trace, displayInfoCode, RA_BLOCKCOUNT, RA_LOGIN_ACTION, RA_LOGOFF_ACTION, RA_MULTI_VALUED_ATTRS, RA_TEST_MODE |
Constructor Summary | |
DB2ResourceAdapter()
Default constructor. |
|
DB2ResourceAdapter(Resource res,
ObjectCache cache)
Constructor. |
Method Summary | |
WavesetResult |
authenticate(java.util.HashMap loginInfo)
Authenticate the user through the DB2 server based on username and password out of the login info. |
WavesetResult |
checkCreateAccount(WSUser user)
Checks to see whether a create account request for given user is likely to succeed. |
WavesetResult |
checkDeleteAccount(WSUser user)
Checks to see whether a delete account request for given user is likely to succeed. |
WavesetResult |
checkUpdateAccount(WSUser user)
Checks to see whether an update account request for given user is likely to succeed. |
Resource |
createPrototypeResource()
Utility method returns the static prototype resource. |
WSAttributes |
getAccountAttributes(java.lang.String accountIdentity)
DB2 Adapter has no account attributes, this returns empty attributes. |
AccountIterator |
getAccountIterator()
Constructs and returns an account iterator. |
GenericObject |
getFeatures()
Expose features supported by the Resource Adapter. |
WSUser |
getUser(WSUser user)
Returns a clone of the passed user if the user has any authority in the DB2 database, otherwise returns a null. |
protected WSUser |
getUser(WSUser user,
boolean closeConnection)
Returns a clone of the passed user if the user has any authority in the DB2 database, otherwise returns a null. |
java.util.ArrayList |
listAllObjects(java.lang.String objectType,
java.util.Map options,
java.lang.String runAsUser,
EncryptedData runAsPassword)
This method will return a list of object names of the specified object type. |
protected void |
realCreate(WSUser user,
WavesetResult result)
Create the user by granting and revoking the resource authorities. |
protected void |
realDelete(WSUser user,
WavesetResult result)
Deletes a user by deleting all grants, whether they were granted by Lighthouse or not. |
protected void |
realUpdate(WSUser user,
WavesetResult result)
Updates the user by granting and revoking the resource authorities. |
protected void |
startConnection()
Starts up the database connection, ensuring that the jdbc driver has been initialized. |
static Resource |
staticCreatePrototypeResource()
Returns the prototype resource. |
protected void |
stopConnection()
Delicately stops the database connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String RA_ADMINACCT
public static final java.lang.String RA_ADMINPWD
public static final java.lang.String RA_DBNAME
public static final java.lang.String RA_JDBC_DRIVER
public static final java.lang.String RA_JDBC_SUBPROTOCOL
public static final java.lang.String RA_REMOVE_FOREIGN_GRANTS
public static final java.lang.String USER_PASSWORD
public static final java.lang.String USER_AUTH_GRANTS
Constructor Detail |
public DB2ResourceAdapter(Resource res, ObjectCache cache) throws java.lang.Exception
public DB2ResourceAdapter() throws java.lang.Exception
Method Detail |
public static Resource staticCreatePrototypeResource() throws WavesetException
WavesetException
public GenericObject getFeatures()
getFeatures
in interface ResourceAdapter
getFeatures
in class ResourceAdapterBase
ResourceAdapter.Features
public WavesetResult authenticate(java.util.HashMap loginInfo) throws WavesetException
authenticate
in interface ResourceAdapter
authenticate
in class ResourceAdapterBase
WavesetException
public WavesetResult checkCreateAccount(WSUser user) throws WavesetException
checkCreateAccount
in interface ResourceAdapter
checkCreateAccount
in class ResourceAdapterBase
WavesetException
public WavesetResult checkDeleteAccount(WSUser user) throws WavesetException
checkDeleteAccount
in interface ResourceAdapter
checkDeleteAccount
in class ResourceAdapterBase
WavesetException
public WavesetResult checkUpdateAccount(WSUser user) throws WavesetException
checkUpdateAccount
in interface ResourceAdapter
checkUpdateAccount
in class ResourceAdapterBase
WavesetException
public Resource createPrototypeResource() throws WavesetException
createPrototypeResource
in interface ResourceAdapter
createPrototypeResource
in class ResourceAdapterBase
WavesetException
public WSAttributes getAccountAttributes(java.lang.String accountIdentity) throws WavesetException
getAccountAttributes
in interface ResourceAdapter
getAccountAttributes
in class ResourceAdapterBase
WavesetException
public AccountIterator getAccountIterator() throws WavesetException
getAccountIterator
in interface ResourceAdapter
getAccountIterator
in class ResourceAdapterBase
WavesetException
public WSUser getUser(WSUser user) throws WavesetException
getUser
in interface ResourceAdapter
getUser
in class ResourceAdapterBase
WavesetException
protected WSUser getUser(WSUser user, boolean closeConnection) throws WavesetException
WavesetException
protected void realCreate(WSUser user, WavesetResult result) throws WavesetException
realCreate
in class ResourceAdapterBase
WavesetException
protected void realDelete(WSUser user, WavesetResult result) throws WavesetException
realDelete
in class ResourceAdapterBase
WavesetException
protected void realUpdate(WSUser user, WavesetResult result) throws WavesetException
realUpdate
in class ResourceAdapterBase
WavesetException
protected void startConnection() throws WavesetException
startConnection
in class ResourceAdapterBase
WavesetException
protected void stopConnection() throws WavesetException
stopConnection
in class ResourceAdapterBase
WavesetException
public java.util.ArrayList listAllObjects(java.lang.String objectType, java.util.Map options, java.lang.String runAsUser, EncryptedData runAsPassword) throws WavesetException
ResourceAdapter
listAllObjects
in interface ResourceAdapter
listAllObjects
in class ResourceAdapterBase
objectType
- -
a type of object that is either well-known or is meaningful to
the resource. Every resource is expected to recognize certain
values. For example,
listAllObjects(ObjectType.ACCOUNT, null, null, null)
should return a list of all account names.options
- -
a map of optionsrunAsUser
- -
(optional) if specified, connect as this user to list all
objects of the specified type.runAsPassword
- -
(optional) if specified, connect with this password to list
all objects of the specified type.
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |