Class AdminAPIImpl
- java.lang.Object
-
- net.anotheria.anoplass.api.AbstractAPIImpl
-
- net.anotheria.portalkit.adminapi.api.admin.AdminAPIImpl
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAdminAPIImpl(boolean unitTest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminAccountAOaddAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status)Adds a status to provided accountDataspaceAOcreateDataspace(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.util.List<DataspaceAttributeAO> attributes)Creates dataspace with for account with specific id and attributes.voiddeleteDataspace(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId)Removes dataspace completely by account and dataspace id.AdminAccountAOgetAccountById(net.anotheria.portalkit.services.common.AccountId accountId)Returns account by accountIdPageResult<AdminAccountAO>getAccounts(int pageNumber, int itemsOnPage, java.lang.String searchTerm)Returns paginated list of created in system accounts.PageResult<AdminAccountAO>getAccounts(AccountsGetRequest request)Returns paginated list of created in system accounts.java.util.List<AdminAPIConfig.AccountStatusConfig>getAccountStatuses()Returns all account statusesjava.util.List<AdminAPIConfig.AccountTypeConfig>getAccountTypes()Returns all account typesjava.util.List<DataspaceAO>getAllDataspaces(net.anotheria.portalkit.services.common.AccountId accountId)Returns all account's dataspacesjava.util.List<AdminAPIConfig.DataspaceConfig>getDataspaces()java.lang.StringgetSignAsToken(net.anotheria.portalkit.services.common.AccountId accountId)Creates a token that can be used to log in as provided user.AdminAccountAOremoveAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status)Removes a status from provided accountDataspaceAOremoveDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.lang.String attributeName)Removes an attribute from existing dataspace.DataspaceAOsaveDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.lang.String attributeName, java.lang.String attributeValue, net.anotheria.portalkit.services.accountsettings.attribute.AttributeType type)Saves an attribute to existing dataspace.voidsetNewAccountPassword(net.anotheria.portalkit.services.common.AccountId accountId, java.lang.String newPassword)Sets a new password for provided accountAdminAccountAOupdateAccount(AccountUpdateRequest updateRequest)Updates account information.-
Methods inherited from class net.anotheria.anoplass.api.AbstractAPIImpl
addValidationError, addValidationError, checkValidationAndThrowException, deInit, getApiConfig, getAttributeFromSession, getCallContext, getCurrentLocale, getCurrentUserId, getDefaultExpirePeriodForAttribute, getExpirePeriodForAttribute, getLoggedInUserId, getPrivateAttributeName, getSession, init, removeAttributeFromSession, setAttributeInSession, setAttributeInSession, setAttributeInSession, setAttributeInSession
-
-
-
-
Method Detail
-
getAccountStatuses
public java.util.List<AdminAPIConfig.AccountStatusConfig> getAccountStatuses() throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIReturns all account statuses- Specified by:
getAccountStatusesin interfaceAdminAPI- Returns:
- list of
AdminAPIConfig.AccountStatusConfig - Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getAccountTypes
public java.util.List<AdminAPIConfig.AccountTypeConfig> getAccountTypes() throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIReturns all account types- Specified by:
getAccountTypesin interfaceAdminAPI- Returns:
- list of
AdminAPIConfig.AccountTypeConfig - Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getAccounts
public PageResult<AdminAccountAO> getAccounts(int pageNumber, int itemsOnPage, java.lang.String searchTerm) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIReturns paginated list of created in system accounts.- Specified by:
getAccountsin interfaceAdminAPI- Parameters:
pageNumber- number of pageitemsOnPage- amount of items on pagesearchTerm- some term like email, name to filter accounts- Returns:
- list of paginated
AdminAccountAO - Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getAccounts
public PageResult<AdminAccountAO> getAccounts(AccountsGetRequest request) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIReturns paginated list of created in system accounts.- Specified by:
getAccountsin interfaceAdminAPI- Parameters:
request- criteria request- Returns:
- list of paginated
AdminAccountAO - Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getAccountById
public AdminAccountAO getAccountById(net.anotheria.portalkit.services.common.AccountId accountId) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIReturns account by accountId- Specified by:
getAccountByIdin interfaceAdminAPI- Parameters:
accountId- accountId- Returns:
AdminAccountAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
updateAccount
public AdminAccountAO updateAccount(AccountUpdateRequest updateRequest) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIUpdates account information. Only email, name, brand, type or tenant can be updated.- Specified by:
updateAccountin interfaceAdminAPI- Parameters:
updateRequest-AccountUpdateRequest- Returns:
AdminAccountAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
addAccountStatus
public AdminAccountAO addAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIAdds a status to provided account- Specified by:
addAccountStatusin interfaceAdminAPI- Parameters:
accountId- accountIdstatus- status to add- Returns:
AdminAccountAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
removeAccountStatus
public AdminAccountAO removeAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIRemoves a status from provided account- Specified by:
removeAccountStatusin interfaceAdminAPI- Parameters:
accountId- accountIdstatus- status to remove- Returns:
AdminAccountAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
setNewAccountPassword
public void setNewAccountPassword(net.anotheria.portalkit.services.common.AccountId accountId, java.lang.String newPassword) throws net.anotheria.anoplass.api.APIExceptionDescription copied from interface:AdminAPISets a new password for provided account- Specified by:
setNewAccountPasswordin interfaceAdminAPI- Parameters:
accountId- accountIdnewPassword- new password to set- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getSignAsToken
public java.lang.String getSignAsToken(net.anotheria.portalkit.services.common.AccountId accountId) throws net.anotheria.anoplass.api.APIExceptionDescription copied from interface:AdminAPICreates a token that can be used to log in as provided user.- Specified by:
getSignAsTokenin interfaceAdminAPI- Parameters:
accountId- account whose token will be created to perform log in- Returns:
- authToken
- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
getDataspaces
public java.util.List<AdminAPIConfig.DataspaceConfig> getDataspaces() throws net.anotheria.anoplass.api.APIException
- Specified by:
getDataspacesin interfaceAdminAPI- Throws:
net.anotheria.anoplass.api.APIException
-
getAllDataspaces
public java.util.List<DataspaceAO> getAllDataspaces(net.anotheria.portalkit.services.common.AccountId accountId)
Description copied from interface:AdminAPIReturns all account's dataspaces- Specified by:
getAllDataspacesin interfaceAdminAPI- Parameters:
accountId- dataspaces owner- Returns:
DataspaceAO
-
createDataspace
public DataspaceAO createDataspace(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.util.List<DataspaceAttributeAO> attributes) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPICreates dataspace with for account with specific id and attributes.- Specified by:
createDataspacein interfaceAdminAPI- Parameters:
accountId- owner of dataspacedataspaceId- id of dataspaceattributes- list of attributes- Returns:
DataspaceAO- Throws:
net.anotheria.anoplass.api.APIException
-
saveDataspaceAttribute
public DataspaceAO saveDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.lang.String attributeName, java.lang.String attributeValue, net.anotheria.portalkit.services.accountsettings.attribute.AttributeType type) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPISaves an attribute to existing dataspace. If there is no dataspace with provided id, exception will be thrown.- Specified by:
saveDataspaceAttributein interfaceAdminAPI- Parameters:
accountId- dataspace ownerdataspaceId- id of dataspaceattributeName- name of attributeattributeValue- value of attributetype- type of attribute- Returns:
DataspaceAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
removeDataspaceAttribute
public DataspaceAO removeDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.lang.String attributeName) throws net.anotheria.anoplass.api.APIException
Description copied from interface:AdminAPIRemoves an attribute from existing dataspace. If there is no dataspace with provided id, exception will be thrown.- Specified by:
removeDataspaceAttributein interfaceAdminAPI- Parameters:
accountId- dataspace ownerdataspaceId- id of dataspaceattributeName- name of attribute- Returns:
DataspaceAO- Throws:
net.anotheria.anoplass.api.APIException- in case of error
-
deleteDataspace
public void deleteDataspace(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId) throws net.anotheria.anoplass.api.APIExceptionDescription copied from interface:AdminAPIRemoves dataspace completely by account and dataspace id.- Specified by:
deleteDataspacein interfaceAdminAPI- Parameters:
accountId- dataspace ownerdataspaceId- dataspace type (id)- Throws:
net.anotheria.anoplass.api.APIException
-
-