|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.useradmin.impl.UserAdminServiceImpl
public class UserAdminServiceImpl
This UserAdminServiceImpl class implementing a contract UserAdmin. It represents UserAdmin service is exposed as a OSGi service in the ServiceRegistry.
Its used to manage a database of named Role objects, which can be used for authentication and authorization purposes. This version of the User Admin service defines two types of Role objects: User and Group. Each type of role is represented by an int constant and an interface. The range of positive integers is reserved for new types of roles that may be added in the future. When defining proprietary role types, negative constant values must be used. Every role has a name and a type. A User object can be configured with credentials (e.g., a password) and properties (e.g., a street address, phone number, etc.). A Group object represents an aggregation of User and Group objects. In other words, the members of a Group object are roles themselves. Every User Admin service manages and maintains its own namespace of Role objects, in which each Role object has a unique name.
UserAdmin
,
ServiceFactory
,
UserAdminRepositoryManager
,
UserAdminEventDispatcher
Constructor Summary | |
---|---|
UserAdminServiceImpl(BundleContext bc,
UserAdminRepositoryManager repositoryManager,
Logger logger,
UserAdminEventDispatcher dispatcher)
This constructor is creating new UserAdmin service. |
Method Summary | |
---|---|
void |
checkPermission(UserAdminPermission permission)
Checking permission with security manager. |
Role |
createRole(String name,
int type)
|
void |
destroy()
This method is closing UserAdmin resources. |
CredentialAuthenticator |
getAuthenticator()
This method returns CredentialAuthenticator instance. |
Authorization |
getAuthorization(User user)
|
UserAdminEventDispatcher |
getEventAdminDispatcher()
This method returns UserAdminEvent dispatcher. |
UserAdminRepositoryManager |
getRepositoryManager()
This method returns repository manager instance. |
Role |
getRole(String name)
|
Role[] |
getRoles(String filter)
|
Object |
getService(Bundle bundle,
ServiceRegistration reg)
|
ServiceReference |
getServiceRef()
This method returns ServiceReference for this service needed for UserAdminEvent. |
User |
getUser(String key,
String value)
|
UserAdminPermission |
getUserAdminPermission()
This method returns UserAdminPermission with name admin. |
boolean |
isAlive()
Checks if UserAdmin service is alive. |
boolean |
removeRole(String name)
|
void |
setServiceRef(ServiceReference serviceRef)
This method is used for setting ServiceReference of this service. |
void |
ungetService(Bundle bundle,
ServiceRegistration reg,
Object obj)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserAdminServiceImpl(BundleContext bc, UserAdminRepositoryManager repositoryManager, Logger logger, UserAdminEventDispatcher dispatcher)
bc
- BundleContext of a bundle which creating this service instance.repositoryManager
- repository manager.logger
- Logger instance.dispatcher
- UserAdmin event dispatcher instance.Method Detail |
---|
public Role createRole(String name, int type)
createRole
in interface UserAdmin
UserAdmin.createRole(String, int)
public void checkPermission(UserAdminPermission permission)
permission
- UserAdminPermission for which check will e performed.SecurityManager.checkPermission(java.security.Permission)
public Authorization getAuthorization(User user)
getAuthorization
in interface UserAdmin
UserAdmin.getAuthorization(User)
public Role getRole(String name)
getRole
in interface UserAdmin
UserAdmin.getRole(String)
public Role[] getRoles(String filter) throws InvalidSyntaxException
getRoles
in interface UserAdmin
InvalidSyntaxException
UserAdmin.getRoles(String)
,
Filter
public User getUser(String key, String value)
getUser
in interface UserAdmin
UserAdmin.getUser(String, String)
public boolean removeRole(String name)
removeRole
in interface UserAdmin
UserAdmin.removeRole(String)
public Object getService(Bundle bundle, ServiceRegistration reg)
getService
in interface ServiceFactory
ServiceFactory.ungetService(Bundle, ServiceRegistration, Object)
public void ungetService(Bundle bundle, ServiceRegistration reg, Object obj)
ungetService
in interface ServiceFactory
ServiceFactory.ungetService(Bundle, ServiceRegistration, Object)
public void destroy()
This method is closing UserAdmin resources. Should be used when UserAdmin service is unregistred. Alive flag is set to true, eventDispacther is closed and ServiceReference is set to null.
public boolean isAlive()
public void setServiceRef(ServiceReference serviceRef)
serviceRef
- ServiceReference of this service.public ServiceReference getServiceRef()
public UserAdminPermission getUserAdminPermission()
public UserAdminEventDispatcher getEventAdminDispatcher()
UserAdminEventDispatcher
public UserAdminRepositoryManager getRepositoryManager()
public CredentialAuthenticator getAuthenticator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |