@ApplicationScoped public class AccountServiceImpl extends Object implements AccountService
| Constructor and Description |
|---|
AccountServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRole(UserAccount account,
String role)
Add a single role to the roles of the given
UserAccount |
boolean |
checkPassword(String login,
String passwd)
Check the credentials for the given login
|
boolean |
checkPassword(UserAccount account,
String passwd)
Check the credentials for the given
UserAccount |
UserAccount |
createAccount(String login)
Create an user account
|
UserAccount |
createAccount(String login,
String firstName,
String lastName)
Create an user account and set first- and lastName in the user profile (foaf)
|
void |
createDefaultAccounts()
Create the default accounts, currently only admin
|
void |
deleteAccount(UserAccount account)
Deletes the given user account.
|
UserAccount |
getAccount(org.apache.marmotta.platform.core.model.user.MarmottaUser user)
Retrieve the user account for a given
MarmottaUser (facaded user resource) |
UserAccount |
getAccount(String login)
Retrieve the user account for the given login name
|
UserAccount |
getAccount(org.openrdf.model.URI resource)
Retrieve the user account for the given (User)-Resource
|
Set<String> |
getRoles(UserAccount account)
Retrieve the roles for the given
UserAccount |
boolean |
hasRole(UserAccount account,
String role)
Check whether the given
UserAccount has the role in question. |
void |
initialize() |
List<UserAccount> |
listAccounts()
List all
UserAccount. |
List<UserAccount> |
listAccounts(String role)
Returns a
List of UserAccount that have the given role associated. |
void |
onConfigurationChange(org.apache.marmotta.platform.core.events.ConfigurationChangedEvent event) |
void |
removeRole(UserAccount account,
String role)
Remove a single role from the roles of the given
UserAccount |
UserAccount |
setPassword(UserAccount account,
String passwd)
Update/Set the password for the given
UserAccount |
void |
setRoles(UserAccount account,
Set<String> roles)
Set the roles for the given
UserAccount |
void |
systemStartup(org.apache.marmotta.platform.core.events.SystemStartupEvent event) |
@PostConstruct public void initialize()
public void systemStartup(@Observes
org.apache.marmotta.platform.core.events.SystemStartupEvent event)
public void onConfigurationChange(@Observes
org.apache.marmotta.platform.core.events.ConfigurationChangedEvent event)
public void createDefaultAccounts()
AccountServicecreateDefaultAccounts in interface AccountServicepublic List<UserAccount> listAccounts()
AccountServiceUserAccount.listAccounts in interface AccountServiceList of all UserAccountpublic List<UserAccount> listAccounts(String role)
AccountServiceList of UserAccount that have the given role associated.listAccounts in interface AccountServicerole - the role(-name)List of UserAccount that have the given role associated.public UserAccount createAccount(String login)
AccountServicecreateAccount in interface AccountServicelogin - the unique username/loginUserAccountpublic UserAccount createAccount(String login, String firstName, String lastName)
AccountServicecreateAccount in interface AccountServicelogin - the unique username/login (also foaf:nick)firstName - the value for foaf:firstName, may be nulllastName - the value for foaf:lastName, may be nullUserAccountpublic void deleteAccount(UserAccount account)
AccountServicedeleteAccount in interface AccountServiceaccount - the UserAccount to delete.public UserAccount getAccount(String login)
AccountServicegetAccount in interface AccountServicelogin - the login nameUserAccount for the given login namepublic UserAccount getAccount(org.openrdf.model.URI resource)
AccountServicegetAccount in interface AccountServiceresource - the user resource (foaf:person)UserAccount, or null if no account present.public UserAccount getAccount(org.apache.marmotta.platform.core.model.user.MarmottaUser user)
AccountServiceMarmottaUser (facaded user resource)getAccount in interface AccountServiceuser - the MarmottaUserUserAccount, of null if none present.AccountService.getAccount(org.openrdf.model.URI)public UserAccount setPassword(UserAccount account, String passwd)
AccountServiceUserAccountsetPassword in interface AccountServiceaccount - the UserAccount to modifypasswd - the new passwordUserAccountpublic boolean checkPassword(UserAccount account, String passwd)
AccountServiceUserAccountcheckPassword in interface AccountServiceaccount - the UserAccount to authenticatepasswd - the password (plain)true if the password matched the password of the UserAccountpublic boolean checkPassword(String login, String passwd)
AccountServicecheckPassword in interface AccountServicelogin - the login/account name/user namepasswd - the password (plain)true if the password matched the logins' UserAccount passwordpublic void setRoles(UserAccount account, Set<String> roles)
AccountServiceUserAccountsetRoles in interface AccountServiceaccount - the UserAccount to modifyroles - the roles (names) of the accountUserAccount.setRoles(Set)public Set<String> getRoles(UserAccount account)
AccountServiceUserAccountgetRoles in interface AccountServiceaccount - the UserAccountSet containing the role-names of the given UserAccountUserAccount.getRoles()public void addRole(UserAccount account, String role)
AccountServiceUserAccountaddRole in interface AccountServiceaccount - the UserAccount to modifyrole - the role(-name) to addpublic void removeRole(UserAccount account, String role)
AccountServiceUserAccountremoveRole in interface AccountServiceaccount - the UserAccount to modifyrole - the role(-name) to removepublic boolean hasRole(UserAccount account, String role)
AccountServiceUserAccount has the role in question.hasRole in interface AccountServiceaccount - the UserAccount to queryrole - the role(-name) in question.UserAccount has the role in questionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.