Class AdminAPIImpl
java.lang.Object
net.anotheria.anoplass.api.AbstractAPIImpl
net.anotheria.portalkit.adminapi.api.admin.AdminAPIImpl
- All Implemented Interfaces:
net.anotheria.anoplass.api.API,AdminAPI
-
Field Summary
Fields inherited from class net.anotheria.anoplass.api.AbstractAPIImpl
DAY, HOUR, MINUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status) Adds a status to provided accountcreateDataspace(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, 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.getAccountById(net.anotheria.portalkit.services.common.AccountId accountId) Returns account by accountIdgetAccounts(int pageNumber, int itemsOnPage, String searchTerm) Returns paginated list of created in system accounts.getAccounts(AccountsGetRequest request) Returns paginated list of created in system accounts.Returns all account statusesReturns all account typesgetAllDataspaces(net.anotheria.portalkit.services.common.AccountId accountId) Returns all account's dataspacesgetSignAsToken(net.anotheria.portalkit.services.common.AccountId accountId) Creates a token that can be used to log in as provided user.removeAccountStatus(net.anotheria.portalkit.services.common.AccountId accountId, int status) Removes a status from provided accountremoveDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, String attributeName) Removes an attribute from existing dataspace.saveDataspaceAttribute(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, String attributeName, String attributeValue, net.anotheria.portalkit.services.accountsettings.attribute.AttributeType type) Saves an attribute to existing dataspace.voidsetNewAccountPassword(net.anotheria.portalkit.services.common.AccountId accountId, String newPassword) Sets a new password for provided accountupdateAccount(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, setAttributeInSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.anotheria.anoplass.api.API
deInit, init
-
Constructor Details
-
AdminAPIImpl
protected AdminAPIImpl(boolean unitTest)
-
-
Method Details
-
getAccountStatuses
public List<AdminAPIConfig.AccountStatusConfig> getAccountStatuses() throws net.anotheria.anoplass.api.APIExceptionDescription 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 List<AdminAPIConfig.AccountTypeConfig> getAccountTypes() throws net.anotheria.anoplass.api.APIExceptionDescription 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, 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, String newPassword) throws net.anotheria.anoplass.api.APIException Description 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 String getSignAsToken(net.anotheria.portalkit.services.common.AccountId accountId) throws net.anotheria.anoplass.api.APIException Description 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 List<AdminAPIConfig.DataspaceConfig> getDataspaces() throws net.anotheria.anoplass.api.APIException- Specified by:
getDataspacesin interfaceAdminAPI- Throws:
net.anotheria.anoplass.api.APIException
-
getAllDataspaces
public 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, 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, String attributeName, 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, 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.APIException Description 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
-