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.voidchangePassword(Credentials currentCred, Credentials newCred)Changes the password of an account to the newly given credentials.TopiccreateUserAccount(Credentials cred)Creates a user account.TopiccreateUsername(String username)Deprecated.List<String>getAccountManagerNames()Returns a list of known registered account manager names.StringgetConfiguredAccountManagerName()Returns the account manager name that is configured to be used by the platform by default.voidpostDeleteTopic(TopicModel topic)voidpostUpdateTopic(Topic topic, ChangeReport report, TopicModel updateModel)voidpreDeleteTopic(Topic topic)voidpreUpdateTopic(Topic topic, TopicModel updateModel)voidregisterAccountManager(AccountManager accountManager)Register anAccountManagerinstance with the platform.voidserviceArrived(Object service)voidserviceGone(Object service)voidunregisterAccountManager(AccountManager accountManager)Unregisters anAccountManagerinstance 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:
serviceArrivedin interfacePluginContext- Overrides:
serviceArrivedin classPluginActivator
-
serviceGone
public void serviceGone(Object service)
- Specified by:
serviceGonein interfacePluginContext- Overrides:
serviceGonein classPluginActivator
-
registerAccountManager
public void registerAccountManager(AccountManager accountManager)
Description copied from interface:AccountManagementServiceRegister anAccountManagerinstance with the platform. The instance is used to derive anAuthorizationMethodinstance that is registered with the same name.- Specified by:
registerAccountManagerin interfaceAccountManagementService
-
unregisterAccountManager
public void unregisterAccountManager(AccountManager accountManager)
Description copied from interface:AccountManagementServiceUnregisters anAccountManagerinstance from the platform. AnAuthorizationMethodinstance with the same is unregistered automatically as well.- Specified by:
unregisterAccountManagerin interfaceAccountManagementService
-
getAccountManagerNames
public List<String> getAccountManagerNames()
Description copied from interface:AccountManagementServiceReturns a list of known registered account manager names.- Specified by:
getAccountManagerNamesin interfaceAccountManagementService- Returns:
-
getConfiguredAccountManagerName
public String getConfiguredAccountManagerName()
Description copied from interface:AccountManagementServiceReturns the account manager name that is configured to be used by the platform by default.- Specified by:
getConfiguredAccountManagerNamein interfaceAccountManagementService- Returns:
-
createUserAccount
public Topic createUserAccount(Credentials cred)
Description copied from interface:AccountManagementServiceCreates 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
Credentialsinstance.- Specified by:
createUserAccountin interfaceAccountManagementService- Specified by:
createUserAccountin interfaceDeprecatedUserAccountMethods- Returns:
- The "Username" topic of the created user account.
-
_createUserAccount
public Topic _createUserAccount(Credentials cred)
Description copied from interface:AccountManagementServiceCreates 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
Credentialsinstance.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:
_createUserAccountin interfaceAccountManagementService- Specified by:
_createUserAccountin interfaceDeprecatedUserAccountMethods- Returns:
- The "Username" topic of the created user account.
-
createUsername
@Deprecated public Topic createUsername(String username)
Deprecated.- Specified by:
createUsernamein interfaceDeprecatedUserAccountMethods
-
changePassword
public void changePassword(Credentials currentCred, Credentials newCred)
Description copied from interface:AccountManagementServiceChanges 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
nullif not necessary.- Specified by:
changePasswordin 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:
preUpdateTopicin interfacePreUpdateTopic
-
preDeleteTopic
public void preDeleteTopic(Topic topic)
- Specified by:
preDeleteTopicin interfacePreDeleteTopic
-
postDeleteTopic
public void postDeleteTopic(TopicModel topic)
- Specified by:
postDeleteTopicin interfacePostDeleteTopic
-
postUpdateTopic
public void postUpdateTopic(Topic topic, ChangeReport report, TopicModel updateModel)
- Specified by:
postUpdateTopicin interfacePostUpdateTopic
-
-