クラス org.objectweb.cjdbc.controller.authentication.AuthenticationManager

すべてのメンバ一覧

説明

The AuthenticationManager manages the mapping between virtual login/password (to the VirtualDatabase) and the real login/password for each backend.

作者:
Emmanuel Cecchet

Mathieu Peltier

Nicolas Modrzyk

バージョン:
1.0

AuthenticationManager.java47 行で定義されています。

Public メソッド

 AuthenticationManager ()
boolean isValidAdminUser (AdminUser user)
boolean isValidVirtualUser (VirtualDatabaseUser vUser)
boolean isValidVirtualLogin (String vLogin)
synchronized void addVirtualUser (VirtualDatabaseUser vUser)
void addRealUser (String vLogin, DatabaseBackendUser rUser) throws AuthenticationManagerException
DatabaseBackendUser getDatabaseBackendUser (String vLogin, String backendName)
HashMap getRealLogins ()
ArrayList getVirtualLogins ()
String getXml ()
void addAdminUser (AdminUser user)
boolean removeAdminUser (AdminUser user)
ArrayList getAdminUsers ()

Private 変数

ArrayList virtualLogins
ArrayList adminUsers
HashMap realLogins


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.authentication.AuthenticationManager.AuthenticationManager  ) 
 

Creates a new AuthenticationManager instance. AuthenticationManager.java77 行で定義されています。

参照先 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.adminUsers, org.objectweb.cjdbc.controller.authentication.AuthenticationManager.realLogins, と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.virtualLogins.

00078 { 00079 virtualLogins = new ArrayList(); 00080 adminUsers = new ArrayList(); 00081 realLogins = new HashMap(); 00082 }


メソッド

void org.objectweb.cjdbc.controller.authentication.AuthenticationManager.addAdminUser AdminUser  user  ) 
 

Add an admin user for this authentication manager.

引数:
user the AdminUser to add to this AuthenticationManager
AuthenticationManager.java266 行で定義されています。
00267 { 00268 adminUsers.add(user); 00269 }

void org.objectweb.cjdbc.controller.authentication.AuthenticationManager.addRealUser String  vLogin,
DatabaseBackendUser  rUser
throws AuthenticationManagerException
 

Associates a new database backend user to a virtual database login.

引数:
vLogin the virtual database login.
rUser the database backend user to add.
例外:
AuthenticationManagerException if a real user already exists for this backend.
AuthenticationManager.java165 行で定義されています。

参照先 org.objectweb.cjdbc.common.users.AbstractDatabaseUser.getLogin(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.realLogins.

00167 { 00168 HashMap list = (HashMap) realLogins.get(vLogin); 00169 if (list == null) 00170 { 00171 list = new HashMap(); 00172 list.put(rUser.getBackendName(), rUser); 00173 realLogins.put(vLogin, list); 00174 } 00175 else 00176 { 00177 DatabaseBackendUser u = (DatabaseBackendUser) list.get(rUser 00178 .getBackendName()); 00179 if (u != null) 00180 throw new AuthenticationManagerException( 00181 Translate.get("authentication.failed.add.user.already.exists", 00182 new String[]{rUser.getLogin(), vLogin, rUser.getBackendName(), 00183 u.getLogin()})); 00184 list.put(rUser.getBackendName(), rUser); 00185 } 00186 }

synchronized void org.objectweb.cjdbc.controller.authentication.AuthenticationManager.addVirtualUser VirtualDatabaseUser  vUser  ) 
 

Registers a new virtual database user.

引数:
vUser the VirtualDatabaseUser to register.
AuthenticationManager.java152 行で定義されています。

参照先 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.virtualLogins.

00153 { 00154 virtualLogins.add(vUser); 00155 }

ArrayList org.objectweb.cjdbc.controller.authentication.AuthenticationManager.getAdminUsers  ) 
 

戻り値:
Returns the adminUsers.
AuthenticationManager.java285 行で定義されています。
00286 { 00287 return adminUsers; 00288 }

DatabaseBackendUser org.objectweb.cjdbc.controller.authentication.AuthenticationManager.getDatabaseBackendUser String  vLogin,
String  backendName
 

Gets the DatabaseBackendUser given a virtual database login and a database backend logical name.

引数:
vLogin virtual database login.
backendName database backend logical name.
戻り値:
a DatabaseBackendUser value or null if not found.
AuthenticationManager.java197 行で定義されています。
00199 { 00200 Object list = realLogins.get(vLogin); 00201 if (list == null) 00202 return null; 00203 else 00204 return (DatabaseBackendUser) ((HashMap) list).get(backendName); 00205 }

HashMap org.objectweb.cjdbc.controller.authentication.AuthenticationManager.getRealLogins  ) 
 

戻り値:
Returns the realLogins.
AuthenticationManager.java217 行で定義されています。
00218 { 00219 return realLogins; 00220 }

ArrayList org.objectweb.cjdbc.controller.authentication.AuthenticationManager.getVirtualLogins  ) 
 

戻り値:
Returns the virtualLogins.
AuthenticationManager.java225 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getTablePrivileges(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().

00226 { 00227 return virtualLogins; 00228 }

String org.objectweb.cjdbc.controller.authentication.AuthenticationManager.getXml  ) 
 

Format to xml

戻り値:
xml formatted representation
AuthenticationManager.java238 行で定義されています。

参照先 org.objectweb.cjdbc.common.users.VirtualDatabaseUser.getXml(), と org.objectweb.cjdbc.common.users.AdminUser.getXml().

00239 { 00240 StringBuffer info = new StringBuffer(); 00241 info.append("<" + DatabasesXmlTags.ELT_AuthenticationManager + ">"); 00242 info.append("<" + DatabasesXmlTags.ELT_Admin + ">"); 00243 for (int i = 0; i < adminUsers.size(); i++) 00244 { 00245 AdminUser vu = (AdminUser) adminUsers.get(i); 00246 info.append(vu.getXml()); 00247 } 00248 info.append("</" + DatabasesXmlTags.ELT_Admin + ">"); 00249 00250 info.append("<" + DatabasesXmlTags.ELT_VirtualUsers + ">"); 00251 for (int i = 0; i < virtualLogins.size(); i++) 00252 { 00253 VirtualDatabaseUser vu = (VirtualDatabaseUser) virtualLogins.get(i); 00254 info.append(vu.getXml()); 00255 } 00256 info.append("</" + DatabasesXmlTags.ELT_VirtualUsers + ">"); 00257 info.append("</" + DatabasesXmlTags.ELT_AuthenticationManager + ">"); 00258 return info.toString(); 00259 }

boolean org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidAdminUser AdminUser  user  ) 
 

Checks whether this administrator user has been registered to this AuthenticationManager or not. Returns false if no admin user has been set.

引数:
user administrator user login/password to check.
戻り値:
true if it matches the registered admin user.
AuthenticationManager.java95 行で定義されています。

参照先 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.adminUsers.

00096 { 00097 return adminUsers.contains(user); 00098 }

boolean org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualLogin String  vLogin  ) 
 

Checks whether a given virtual login has been registered to this AuthenticationManager or not.

引数:
vLogin the virtual database login.
戻り値:
true if the virtual database login is valid.
AuthenticationManager.java119 行で定義されています。

参照先 org.objectweb.cjdbc.common.users.AbstractDatabaseUser.getLogin(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.virtualLogins.

00120 { 00121 Iterator iter = virtualLogins.iterator(); 00122 VirtualDatabaseUser u; 00123 while (iter.hasNext()) 00124 { 00125 u = (VirtualDatabaseUser) iter.next(); 00126 if (u.getLogin().equals(vLogin)) 00127 { 00128 return true; 00129 } 00130 } 00131 return false; 00132 }

boolean org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualUser VirtualDatabaseUser  vUser  ) 
 

Checks whether a given virtual database user has been registered to this AuthenticationManager or not.

引数:
vUser the virtual database user.
戻り値:
true if the user login/password is valid.
AuthenticationManager.java107 行で定義されています。

参照先 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.virtualLogins.

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00108 { 00109 return virtualLogins.contains(vUser); 00110 }

boolean org.objectweb.cjdbc.controller.authentication.AuthenticationManager.removeAdminUser AdminUser  user  ) 
 

Remove an admin user from the admin list

引数:
user the admin to remove
戻り値:
true if was removed.
AuthenticationManager.java277 行で定義されています。
00278 { 00279 return adminUsers.remove(user); 00280 }


変数

ArrayList org.objectweb.cjdbc.controller.authentication.AuthenticationManager.adminUsers [private]
 

ArrayList of AdminUser objects. AuthenticationManager.java59 行で定義されています。

参照元 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.AuthenticationManager(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidAdminUser().

HashMap org.objectweb.cjdbc.controller.authentication.AuthenticationManager.realLogins [private]
 

HashMap of HashMap of DatabaseBackendUser objects hashed by the backend name, hashed by their virtual database login. A virtual user can have several real logins, but has only one real login for a given backend. AuthenticationManager.java68 行で定義されています。

参照元 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.addRealUser(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.AuthenticationManager().

ArrayList org.objectweb.cjdbc.controller.authentication.AuthenticationManager.virtualLogins [private]
 

ArrayList of VirtualDatabaseUser objects. AuthenticationManager.java56 行で定義されています。

参照元 org.objectweb.cjdbc.controller.authentication.AuthenticationManager.addVirtualUser(), org.objectweb.cjdbc.controller.authentication.AuthenticationManager.AuthenticationManager(), org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualLogin(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualUser().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:35 2004に生成されました。 doxygen 1.3.8