org.eaglei.repository.auth
Class AuthUserTomcatFactory

java.lang.Object
  extended by org.eaglei.repository.auth.AuthUserTomcatFactory
All Implemented Interfaces:
AuthUserFactory

public class AuthUserTomcatFactory
extends java.lang.Object
implements AuthUserFactory

Simple lightweight class to manage RDBMS authorization system users for the purpose of importing and exporting auth. users.

Author:
Larry Stone Started June 24 2010

Method Summary
 void commitMultiple(javax.servlet.http.HttpServletRequest request, java.util.Collection<? extends AuthUser> authUsers)
          Commit a group of modified (or created) entries, more efficient for use by import.
 AuthUser create(java.lang.String username)
          Create a new auth user in the DB with indicated username.
 AuthUserTomcat find(java.lang.String targetUsername)
          Get the auth-db description of the indicated user, if present.
 java.util.Map<java.lang.String,AuthUserTomcat> findAllAsMap()
          Get a Map of each username key to AuthUserTomcat object.
static java.sql.Connection getConnection()
          Get a jdbc Connection to the authentication RDBMS Has to be public so AuthUserTomcat can use it.
static AuthUserTomcatFactory getInstance()
          Getter for singleton.
 org.openrdf.model.URI getType()
          get the URI identifying this AuthUser implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AuthUserTomcatFactory getInstance()
Getter for singleton.


find

public AuthUserTomcat find(java.lang.String targetUsername)
                    throws javax.servlet.ServletException
Get the auth-db description of the indicated user, if present.

Specified by:
find in interface AuthUserFactory
Parameters:
targetUsername - the username to look up
Returns:
a new AuthUserTomcat object or null if not found.
Throws:
javax.servlet.ServletException

findAllAsMap

public java.util.Map<java.lang.String,AuthUserTomcat> findAllAsMap()
                                                            throws javax.servlet.ServletException
Get a Map of each username key to AuthUserTomcat object.

Specified by:
findAllAsMap in interface AuthUserFactory
Returns:
Map from username to AuthUser object, never null but maybe empty
Throws:
javax.servlet.ServletException

create

public AuthUser create(java.lang.String username)
Create a new auth user in the DB with indicated username. See implementation in AuthUserTomcat

Specified by:
create in interface AuthUserFactory
Parameters:
username - the username to look up
Returns:
the new AuthUser that was created

getConnection

public static java.sql.Connection getConnection()
                                         throws javax.naming.NamingException,
                                                java.sql.SQLException
Get a jdbc Connection to the authentication RDBMS Has to be public so AuthUserTomcat can use it.

Throws:
javax.naming.NamingException
java.sql.SQLException

commitMultiple

public void commitMultiple(javax.servlet.http.HttpServletRequest request,
                           java.util.Collection<? extends AuthUser> authUsers)
                    throws javax.servlet.ServletException
Commit a group of modified (or created) entries, more efficient for use by import.

Specified by:
commitMultiple in interface AuthUserFactory
Parameters:
request - the servlet request
authUsers - the users to commit
Throws:
javax.servlet.ServletException

getType

public org.openrdf.model.URI getType()
get the URI identifying this AuthUser implementation.

Specified by:
getType in interface AuthUserFactory
Returns:
the identifying URI


Copyright © 2009-2011 Eagle-I. All Rights Reserved.