public class LoginComponent extends DefaultComponent implements LoginService
Modifier and Type | Class and Description |
---|---|
static class |
LoginComponent.SystemID |
Modifier and Type | Field and Description |
---|---|
static String |
CLIENT_LOGIN |
static ComponentName |
NAME |
static String |
SYSTEM_LOGIN |
static String |
SYSTEM_USERNAME |
Constructor and Description |
---|
LoginComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
void |
addSecurityDomain(SecurityDomain domain) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class
associated with this object.
|
AppConfigurationEntry[] |
getAppConfigurationEntry(String name) |
SecurityDomain |
getSecurityDomain(String name) |
SecurityDomain[] |
getSecurityDomains() |
boolean |
isSystemId(Principal principal) |
static boolean |
isSystemLogin(Object principal) |
LoginContext |
login()
System login, using a private principal that has all privileges.
|
LoginContext |
login(CallbackHandler cbHandler)
Client login using a custom callback handler to retrieve login info.
|
LoginContext |
login(String username,
Object credentials)
Client login using the given username and password.
|
LoginContext |
loginAs(String username)
System login, using a private principal that has all privileges.
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
removeSecurityDomain(String name) |
void |
removeSecurityDomains() |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
applicationStarted, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
public static final ComponentName NAME
public static final String SYSTEM_LOGIN
public static final String CLIENT_LOGIN
public static final String SYSTEM_USERNAME
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public AppConfigurationEntry[] getAppConfigurationEntry(String name)
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if
no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classpublic SecurityDomain getSecurityDomain(String name)
getSecurityDomain
in interface LoginService
public void addSecurityDomain(SecurityDomain domain)
addSecurityDomain
in interface LoginService
public void removeSecurityDomain(String name)
removeSecurityDomain
in interface LoginService
public SecurityDomain[] getSecurityDomains()
getSecurityDomains
in interface LoginService
public void removeSecurityDomains()
removeSecurityDomains
in interface LoginService
public LoginContext login() throws LoginException
LoginService
The method requires the caller to have the SystemLoginPermission
permission.
login
in interface LoginService
LoginException
public LoginContext loginAs(String username) throws LoginException
LoginService
The method requires the caller to have the SystemLoginPermission
permission.
loginAs
in interface LoginService
username
- the username that originated the system loginLoginException
public LoginContext login(String username, Object credentials) throws LoginException
LoginService
login
in interface LoginService
LoginException
public LoginContext login(CallbackHandler cbHandler) throws LoginException
LoginService
login
in interface LoginService
cbHandler
- the callback handler to use to retrieve the login infoLoginException
public boolean isSystemId(Principal principal)
isSystemId
in interface LoginService
public static boolean isSystemLogin(Object principal)
Copyright © 2013 Nuxeo SA. All Rights Reserved.