|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.opensymphony.user.provider.ofbiz.OFBizAbstractProvider
An abstract provider which handles most of the init and life cycle tasks of the provider.
Here's a sample of the entitymodel.xml fragment required for the OFBiz OSUser providers:
<!-- OSUser implementation -->
<entity entity-name="OSUser" table-name="userBase">
<field name="id" type="numeric"/>
<field name="name" type="string"/>
<field name="passwordHash" type="string"/>
<prim-key field="id"/>
</entity>
<entity entity-name="OSMembership" table-name="membershipBase">
<field name="id" type="numeric"/>
<field name="userName" type="string"/>
<field name="groupName" type="string"/>
<prim-key field="id"/>
</entity>
<entity entity-name="OSGroup" table-name="groupBase">
<field name="id" type="numeric"/>
<field name="name" type="string"/>
<prim-key field="id"/>
</entity>
Settable properties (these must be set in all providers if changed from the default!):
delegator - the name of the OFBiz delegator (default: "default") userEntity - the name of the OFBiz group entity (default: "OSUser") exclusiveAccess - Whether or not the provider has exclusive access to the database (ie can take advantage of in memory caches) (default: "false")
| Field Summary | |
protected java.lang.String |
delegator
|
protected boolean |
exclusiveAccess
|
protected org.apache.log4j.Category |
LOG
|
protected java.util.Map |
nameCache
|
protected java.lang.String |
userEntity
|
| Constructor Summary | |
OFBizAbstractProvider()
|
|
| Method Summary | |
protected void |
clearAllCache()
If using exclusive access, this will clear the cache of all users |
protected void |
clearUserCache(java.lang.String name)
If using exclusive access, this will clear the cache of a particular user |
boolean |
create(java.lang.String s)
Create new Entity with given name. |
protected org.ofbiz.core.entity.GenericValue |
findUser(java.lang.String name)
|
void |
flushCaches()
Flush the providers caches - if it is caching. |
protected org.ofbiz.core.entity.GenericDelegator |
getDelegator()
|
boolean |
init(java.util.Properties properties)
Called by UserManager before any other method. |
java.util.List |
list()
Returns List of names (Strings) of all Entities that can be accessed by this UserProvider If this UserProvider cannot retrieve a list of names, null is to be returned. |
boolean |
load(java.lang.String s,
Entity.Accessor accessor)
Load Entity. |
boolean |
remove(java.lang.String s)
Remove Entity with given name. |
boolean |
store(java.lang.String s,
Entity.Accessor accessor)
Stores changes to Entity. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.opensymphony.user.provider.UserProvider |
handles |
| Field Detail |
protected final org.apache.log4j.Category LOG
protected java.util.Map nameCache
protected java.lang.String delegator
protected java.lang.String userEntity
protected boolean exclusiveAccess
| Constructor Detail |
public OFBizAbstractProvider()
| Method Detail |
public boolean create(java.lang.String s)
UserProvider
create in interface UserProviderpublic void flushCaches()
UserProvider
flushCaches in interface UserProviderpublic boolean init(java.util.Properties properties)
UserProvider
init in interface UserProviderproperties - Extra properties passed across by UserManager.public java.util.List list()
UserProvider
list in interface UserProvider
public boolean load(java.lang.String s,
Entity.Accessor accessor)
UserProvider
load in interface UserProviderpublic boolean remove(java.lang.String s)
UserProvider
remove in interface UserProvider
public boolean store(java.lang.String s,
Entity.Accessor accessor)
UserProvider
store in interface UserProviderprotected org.ofbiz.core.entity.GenericDelegator getDelegator()
protected void clearAllCache()
protected void clearUserCache(java.lang.String name)
name -
protected org.ofbiz.core.entity.GenericValue findUser(java.lang.String name)
throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
|
See www.opensymphony.com for more information. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||