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

public class AdminAPIImpl extends net.anotheria.anoplass.api.AbstractAPIImpl implements AdminAPI
  • Constructor Details

    • AdminAPIImpl

      protected AdminAPIImpl(boolean unitTest)
  • Method Details

    • getAccountStatuses

      public List<AdminAPIConfig.AccountStatusConfig> getAccountStatuses() throws net.anotheria.anoplass.api.APIException
      Description copied from interface: AdminAPI
      Returns all account statuses
      Specified by:
      getAccountStatuses in interface AdminAPI
      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.APIException
      Description copied from interface: AdminAPI
      Returns all account types
      Specified by:
      getAccountTypes in interface AdminAPI
      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: AdminAPI
      Returns paginated list of created in system accounts.
      Specified by:
      getAccounts in interface AdminAPI
      Parameters:
      pageNumber - number of page
      itemsOnPage - amount of items on page
      searchTerm - 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: AdminAPI
      Returns paginated list of created in system accounts.
      Specified by:
      getAccounts in interface AdminAPI
      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: AdminAPI
      Returns account by accountId
      Specified by:
      getAccountById in interface AdminAPI
      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: AdminAPI
      Updates account information. Only email, name, brand, type or tenant can be updated.
      Specified by:
      updateAccount in interface AdminAPI
      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: AdminAPI
      Adds a status to provided account
      Specified by:
      addAccountStatus in interface AdminAPI
      Parameters:
      accountId - accountId
      status - 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: AdminAPI
      Removes a status from provided account
      Specified by:
      removeAccountStatus in interface AdminAPI
      Parameters:
      accountId - accountId
      status - 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: AdminAPI
      Sets a new password for provided account
      Specified by:
      setNewAccountPassword in interface AdminAPI
      Parameters:
      accountId - accountId
      newPassword - 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: AdminAPI
      Creates a token that can be used to log in as provided user.
      Specified by:
      getSignAsToken in interface AdminAPI
      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:
      getDataspaces in interface AdminAPI
      Throws:
      net.anotheria.anoplass.api.APIException
    • getAllDataspaces

      public List<DataspaceAO> getAllDataspaces(net.anotheria.portalkit.services.common.AccountId accountId)
      Description copied from interface: AdminAPI
      Returns all account's dataspaces
      Specified by:
      getAllDataspaces in interface AdminAPI
      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: AdminAPI
      Creates dataspace with for account with specific id and attributes.
      Specified by:
      createDataspace in interface AdminAPI
      Parameters:
      accountId - owner of dataspace
      dataspaceId - id of dataspace
      attributes - 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: AdminAPI
      Saves an attribute to existing dataspace. If there is no dataspace with provided id, exception will be thrown.
      Specified by:
      saveDataspaceAttribute in interface AdminAPI
      Parameters:
      accountId - dataspace owner
      dataspaceId - id of dataspace
      attributeName - name of attribute
      attributeValue - value of attribute
      type - 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: AdminAPI
      Removes an attribute from existing dataspace. If there is no dataspace with provided id, exception will be thrown.
      Specified by:
      removeDataspaceAttribute in interface AdminAPI
      Parameters:
      accountId - dataspace owner
      dataspaceId - id of dataspace
      attributeName - 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: AdminAPI
      Removes dataspace completely by account and dataspace id.
      Specified by:
      deleteDataspace in interface AdminAPI
      Parameters:
      accountId - dataspace owner
      dataspaceId - dataspace type (id)
      Throws:
      net.anotheria.anoplass.api.APIException