|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.SessionControl net.sf.basedb.core.PluginSessionControl
class PluginSessionControl
This is a special session control implementation that is used for executing plugins that prevents them from logging in or out. If the plugin has enabled permissions those permissions are also loaded and taken into account when checking access to items.
Field Summary | |
---|---|
private SessionControl |
parent
|
Constructor Summary | |
---|---|
PluginSessionControl(String id,
SessionControl parent,
PluginDefinition plugin,
Job job)
Create a new plugin session control |
Method Summary | |
---|---|
PluginSessionControl |
getPluginSessionControl(PluginDefinition plugin,
Job job)
Create a new session control for executing a plugin using the same parent as this session control has. |
SessionControl |
impersonateLogin(int userId,
String comment)
Log in as another user. |
SessionControl |
impersonateLogin(Ownable item,
String comment)
Log in as the owner of the specified item. |
(package private) void |
login(Keyring keyring)
|
void |
login(String login,
String password,
String comment,
boolean encryptedPassword)
Log in to BASE. |
void |
logout()
Do nothing, a plugin is not allowed to log out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final SessionControl parent
Constructor Detail |
---|
PluginSessionControl(String id, SessionControl parent, PluginDefinition plugin, Job job)
id
- The ID of the session controlparent
- The parent session control which settings and permissions
should be copied fromplugin
- The plugin that is executingMethod Detail |
---|
void login(Keyring keyring)
login
in class SessionControl
PermissionDeniedException
- Alwayspublic void login(String login, String password, String comment, boolean encryptedPassword) throws ItemNotFoundException, PermissionDeniedException, InvalidPasswordException, BaseException
SessionControl
The encryptedPassword
parameter is used if the client
application sends the password encrypted. See SessionControl.getChallenge()
for information about how to encrypt the password.
login
in class SessionControl
login
- The login of the userpassword
- The UTF-8 encoded password for the usercomment
- A comment for the login, which will show in the Session
encryptedPassword
- A flag indicating if the password has been encrypted
or not
PermissionDeniedException
- Always
ItemNotFoundException
- If a user with the specified username is not found
InvalidPasswordException
- If the specified password is incorrect
BaseException
- If there is any other errorSessionControl.logout()
,
SessionControl.isLoggedIn()
,
SessionControl.getLoggedInUserId()
public void logout() throws BaseException
logout
in class SessionControl
BaseException
- If there is an errorSessionControl.login(String, String, String, boolean)
,
SessionControl.isLoggedIn()
,
SessionControl.impersonateLogin(int, String)
,
SessionControl.isImpersonated()
public SessionControl impersonateLogin(int userId, String comment) throws ItemNotFoundException, PermissionDeniedException, BaseException
SessionControl
SessionControl
object which is equivalent to a SessionControl
where that user logged in by normal means. This method requires that the logged
in user has Permission.ACT_AS_ANOTHER_USER
permission.
impersonateLogin
in class SessionControl
userId
- The id of the user to login ascomment
- A comment that will be placed in the Session
information
SessionControl
object
PermissionDeniedException
- Always
ItemNotFoundException
- If no user with the specified id exists
BaseException
- If there is another errorpublic SessionControl impersonateLogin(Ownable item, String comment)
SessionControl
impersonateLogin
in class SessionControl
item
- Login as the owner of this Item. Null is not allowedcomment
- A comment that will be placed in the Session
information
SessionControl
for the created session.
PermissionDeniedException
- AlwaysSessionControl.impersonateLogin(int, String)
public PluginSessionControl getPluginSessionControl(PluginDefinition plugin, Job job)
getPluginSessionControl
in class SessionControl
plugin
- The plugin to executejob
- The job that executes the plug-in, or null
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |