Class DataSourceUserDatabaseFactory

java.lang.Object
org.apache.catalina.users.DataSourceUserDatabaseFactory
All Implemented Interfaces:
ObjectFactory

public class DataSourceUserDatabaseFactory extends Object implements ObjectFactory

JNDI object creation factory for DataSourceUserDatabase instances. This makes it convenient to configure a user database in the global JNDI resources associated with this Catalina instance, and then link to that resource for web applications that administer the contents of the user database.

The DataSourceUserDatabase instance is configured based on the following parameter values:

  • dataSourceName - JNDI name of the DataSource, which must be located in the same Context environment as the UserDatabase
  • readonly - whether the user database is read only
  • userTable - table that holds user data
  • groupTable - table that holds group data
  • roleTable - table that holds role data
  • userRoleTable - table that holds the relation between users and roles
  • userGroupTable - table that holds the relation between users and groups
  • groupRoleTable - table that holds the relation between groups and roles
  • roleNameCol - column in the user role table that names a role
  • roleAndGroupDescriptionCol - column used for role and group descriptions
  • groupNameCol - column used for group names
  • userCredCol - column in the user table that holds the user's credentials
  • userFullNameCol - column used for user full names
  • userNameCol - column in the user table that holds the user's name
  • Constructor Details

    • DataSourceUserDatabaseFactory

      public DataSourceUserDatabaseFactory()
      Default constructor.
  • Method Details

    • getObjectInstance

      public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception

      Create and return a new DataSourceUserDatabase instance that has been configured according to the properties of the specified Reference. If the instance cannot be created, return null instead.

      Specified by:
      getObjectInstance in interface ObjectFactory
      Parameters:
      obj - The possibly null object containing location or reference information that can be used in creating an object
      name - The name of this object relative to nameCtx
      nameCtx - The context relative to which the name parameter is specified, or null if name is relative to the default initial context
      environment - The possibly null environment that is used in creating this object
      Throws:
      Exception