Class AdminAPIImpl

  • All Implemented Interfaces:
    net.anotheria.anoplass.api.API, AdminAPI

    public class AdminAPIImpl
    extends net.anotheria.anoplass.api.AbstractAPIImpl
    implements AdminAPI
    • Field Summary

      • Fields inherited from class net.anotheria.anoplass.api.AbstractAPIImpl

        DAY, HOUR, MINUTE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AdminAPIImpl​(boolean unitTest)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AdminAccountAO addAccountStatus​(net.anotheria.portalkit.services.common.AccountId accountId, int status)
      Adds a status to provided account
      DataspaceAO createDataspace​(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.util.List<DataspaceAttributeAO> attributes)
      Creates dataspace with for account with specific id and attributes.
      void deleteDataspace​(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId)
      Removes dataspace completely by account and dataspace id.
      AdminAccountAO getAccountById​(net.anotheria.portalkit.services.common.AccountId accountId)
      Returns account by accountId
      PageResult<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 statuses
      java.util.List<AdminAPIConfig.AccountTypeConfig> getAccountTypes()
      Returns all account types
      java.util.List<DataspaceAO> getAllDataspaces​(net.anotheria.portalkit.services.common.AccountId accountId)
      Returns all account's dataspaces
      java.util.List<AdminAPIConfig.DataspaceConfig> getDataspaces()  
      java.lang.String getSignAsToken​(net.anotheria.portalkit.services.common.AccountId accountId)
      Creates a token that can be used to log in as provided user.
      AdminAccountAO removeAccountStatus​(net.anotheria.portalkit.services.common.AccountId accountId, int status)
      Removes a status from provided account
      DataspaceAO removeDataspaceAttribute​(net.anotheria.portalkit.services.common.AccountId accountId, int dataspaceId, java.lang.String attributeName)
      Removes an attribute from existing dataspace.
      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)
      Saves an attribute to existing dataspace.
      void setNewAccountPassword​(net.anotheria.portalkit.services.common.AccountId accountId, java.lang.String newPassword)
      Sets a new password for provided account
      AdminAccountAO updateAccount​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.anotheria.anoplass.api.API

        deInit, init
    • Constructor Detail

      • AdminAPIImpl

        protected AdminAPIImpl​(boolean unitTest)
    • Method Detail

      • getAccounts

        public PageResult<AdminAccountAO> getAccounts​(int pageNumber,
                                                      int itemsOnPage,
                                                      java.lang.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
      • 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,
                                          java.lang.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 java.lang.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
      • getAllDataspaces

        public java.util.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,
                                           java.util.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,
                                                  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: 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,
                                                    java.lang.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