Class AccountManagementPlugin
- java.lang.Object
-
- systems.dmx.core.osgi.PluginActivator
-
- systems.dmx.accountmanagement.AccountManagementPlugin
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
,DeprecatedUserAccountMethods
,AccountManagementService
,PluginContext
,PostDeleteTopic
,PostUpdateTopic
,PreDeleteTopic
,PreUpdateTopic
,EventListener
public class AccountManagementPlugin extends PluginActivator implements AccountManagementService, PreDeleteTopic, PreUpdateTopic, PostDeleteTopic, PostUpdateTopic, DeprecatedUserAccountMethods
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface systems.dmx.accesscontrol.DeprecatedUserAccountMethods
DeprecatedUserAccountMethods.CallableException, DeprecatedUserAccountMethods.DeprecatedAccountManagementServiceCallable<T>
-
-
Field Summary
-
Fields inherited from class systems.dmx.core.osgi.PluginActivator
bundle, dmx, mf
-
Fields inherited from interface systems.dmx.accountmanagement.AccountManagementService
DEFAULT_PRIVATE_WORKSPACE_NAME
-
-
Constructor Summary
Constructors Constructor Description AccountManagementPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Topic
_createUserAccount(Credentials cred)
Creates a user account.void
changePassword(Credentials currentCred, Credentials newCred)
Changes the password of an account to the newly given credentials.Topic
createUserAccount(Credentials cred)
Creates a user account.Topic
createUsername(String username)
Deprecated.List<String>
getAccountManagerNames()
Returns a list of known registered account manager names.String
getConfiguredAccountManagerName()
Returns the account manager name that is configured to be used by the platform by default.void
postDeleteTopic(TopicModel topic)
void
postUpdateTopic(Topic topic, ChangeReport report, TopicModel updateModel)
void
preDeleteTopic(Topic topic)
void
preUpdateTopic(Topic topic, TopicModel updateModel)
void
registerAccountManager(AccountManager accountManager)
Register anAccountManager
instance with the platform.void
serviceArrived(Object service)
void
serviceGone(Object service)
void
unregisterAccountManager(AccountManager accountManager)
Unregisters anAccountManager
instance from the platform.-
Methods inherited from class systems.dmx.core.osgi.PluginActivator
getBundleContext, getPluginName, getStaticResource, getUri, init, preInstall, publishFileSystem, setCoreService, shutdown, start, stop, toString
-
-
-
-
Method Detail
-
serviceArrived
public void serviceArrived(Object service)
- Specified by:
serviceArrived
in interfacePluginContext
- Overrides:
serviceArrived
in classPluginActivator
-
serviceGone
public void serviceGone(Object service)
- Specified by:
serviceGone
in interfacePluginContext
- Overrides:
serviceGone
in classPluginActivator
-
registerAccountManager
public void registerAccountManager(AccountManager accountManager)
Description copied from interface:AccountManagementService
Register anAccountManager
instance with the platform. The instance is used to derive anAuthorizationMethod
instance that is registered with the same name.- Specified by:
registerAccountManager
in interfaceAccountManagementService
-
unregisterAccountManager
public void unregisterAccountManager(AccountManager accountManager)
Description copied from interface:AccountManagementService
Unregisters anAccountManager
instance from the platform. AnAuthorizationMethod
instance with the same is unregistered automatically as well.- Specified by:
unregisterAccountManager
in interfaceAccountManagementService
-
getAccountManagerNames
public List<String> getAccountManagerNames()
Description copied from interface:AccountManagementService
Returns a list of known registered account manager names.- Specified by:
getAccountManagerNames
in interfaceAccountManagementService
- Returns:
-
getConfiguredAccountManagerName
public String getConfiguredAccountManagerName()
Description copied from interface:AccountManagementService
Returns the account manager name that is configured to be used by the platform by default.- Specified by:
getConfiguredAccountManagerName
in interfaceAccountManagementService
- Returns:
-
createUserAccount
public Topic createUserAccount(Credentials cred)
Description copied from interface:AccountManagementService
Creates a user account. Only DMX admins are allowed to create user accounts.The user is created either with the configured account manager of the platform or with the account manager that is specified throught the "method" property of the
Credentials
instance.- Specified by:
createUserAccount
in interfaceAccountManagementService
- Specified by:
createUserAccount
in interfaceDeprecatedUserAccountMethods
- Returns:
- The "Username" topic of the created user account.
-
_createUserAccount
public Topic _createUserAccount(Credentials cred)
Description copied from interface:AccountManagementService
Creates a user account. This is a privileged method: no permissions are checked.The user is created either with the configured account manager of the platform or with the account manager that is specified throught the "method" property of the
Credentials
instance.Security: this method is not callable from outside as it has no REST interface. So the DMX platform is still secure. On the other hand, a 3rd-party plugin which provides a RESTful interface to this method is required to apply an additional authorization measure, e.g. a short-living access token sent via email.
- Specified by:
_createUserAccount
in interfaceAccountManagementService
- Specified by:
_createUserAccount
in interfaceDeprecatedUserAccountMethods
- Returns:
- The "Username" topic of the created user account.
-
createUsername
@Deprecated public Topic createUsername(String username)
Deprecated.- Specified by:
createUsername
in interfaceDeprecatedUserAccountMethods
-
changePassword
public void changePassword(Credentials currentCred, Credentials newCred)
Description copied from interface:AccountManagementService
Changes the password of an account to the newly given credentials.Depending on the system that ultimately performs the password change, the current credentials are necessary. It can be
null
if not necessary.- Specified by:
changePassword
in interfaceAccountManagementService
- Parameters:
currentCred
- Current credentials of the account whose password is to be changed.newCred
- Credentials containing the new password.
-
preUpdateTopic
public void preUpdateTopic(Topic topic, TopicModel updateModel)
- Specified by:
preUpdateTopic
in interfacePreUpdateTopic
-
preDeleteTopic
public void preDeleteTopic(Topic topic)
- Specified by:
preDeleteTopic
in interfacePreDeleteTopic
-
postDeleteTopic
public void postDeleteTopic(TopicModel topic)
- Specified by:
postDeleteTopic
in interfacePostDeleteTopic
-
postUpdateTopic
public void postUpdateTopic(Topic topic, ChangeReport report, TopicModel updateModel)
- Specified by:
postUpdateTopic
in interfacePostUpdateTopic
-
-