com.atlassian.jira.user.osuser
Class JiraOFBizAbstractProvider

java.lang.Object
  extended by com.atlassian.jira.user.osuser.JiraOFBizAbstractProvider
All Implemented Interfaces:
UserProvider, Serializable
Direct Known Subclasses:
JiraOFBizProfileProvider

public abstract class JiraOFBizAbstractProvider
extends Object
implements UserProvider

A copy of OSUser's OFBizAbstractProvider, with some performance tweaks.

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")

Since:
v4.0
Author:
Victor Salaman, Mike Cannon-Brookes
See Also:
Serialized Form

Field Summary
protected  String delegator
           
protected  boolean exclusiveAccess
           
protected  CacheMap<String,org.ofbiz.core.entity.GenericValue> nameCache
           
protected  String userEntity
           
 
Constructor Summary
JiraOFBizAbstractProvider()
           
 
Method Summary
protected  void clearAllCache()
          If using exclusive access, this will clear the cache of all users
protected  void clearUserCache(String name)
          If using exclusive access, this will clear the cache of a particular user
 boolean create(String s)
           
protected  org.ofbiz.core.entity.GenericValue findUser(String name)
           
 void flushCaches()
           
protected  org.ofbiz.core.entity.GenericDelegator getDelegator()
           
 boolean init(Properties properties)
           
 List<String> list()
           
 boolean load(String s, Entity.Accessor accessor)
           
 boolean remove(String s)
           
 boolean store(String s, Entity.Accessor accessor)
           
 
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

nameCache

protected CacheMap<String,org.ofbiz.core.entity.GenericValue> nameCache

delegator

protected String delegator

userEntity

protected String userEntity

exclusiveAccess

protected volatile boolean exclusiveAccess
Constructor Detail

JiraOFBizAbstractProvider

public JiraOFBizAbstractProvider()
Method Detail

create

public boolean create(String s)
Specified by:
create in interface UserProvider

flushCaches

public void flushCaches()
Specified by:
flushCaches in interface UserProvider

init

public boolean init(Properties properties)
Specified by:
init in interface UserProvider

list

public List<String> list()
Specified by:
list in interface UserProvider

load

public boolean load(String s,
                    Entity.Accessor accessor)
Specified by:
load in interface UserProvider

remove

public boolean remove(String s)
Specified by:
remove in interface UserProvider

store

public boolean store(String s,
                     Entity.Accessor accessor)
Specified by:
store in interface UserProvider

getDelegator

protected org.ofbiz.core.entity.GenericDelegator getDelegator()

clearAllCache

protected void clearAllCache()
If using exclusive access, this will clear the cache of all users


clearUserCache

protected void clearUserCache(String name)
If using exclusive access, this will clear the cache of a particular user

Parameters:
name - username

findUser

protected org.ofbiz.core.entity.GenericValue findUser(String name)
                                               throws org.ofbiz.core.entity.GenericEntityException
Throws:
org.ofbiz.core.entity.GenericEntityException


Copyright © 2002-2010 Atlassian. All Rights Reserved.