Class AccountService


  • public class AccountService
    extends AbstractService
    Service to access and manipulate account.
    • Constructor Detail

      • AccountService

        public AccountService​(org.springframework.web.client.RestTemplate restTemplate,
                              GoodDataSettings settings)
        Constructs service for GoodData account management.
        Parameters:
        restTemplate - RESTful HTTP Spring template
        settings - settings
      • AccountService

        @Deprecated
        public AccountService​(org.springframework.web.client.RestTemplate restTemplate)
        Deprecated.
        use AccountService(RestTemplate, GoodDataSettings) constructor instead
        Constructs service for GoodData account management.
        Parameters:
        restTemplate - RESTful HTTP Spring template
    • Method Detail

      • getCurrent

        public Account getCurrent()
        Gets current account of logged user.
        Returns:
        current account
        Throws:
        com.gooddata.GoodDataException - when current account can't be accessed.
      • logout

        public void logout()
        Performs user logout.
        Throws:
        com.gooddata.GoodDataException - when logout failed.
      • createAccount

        public Account createAccount​(Account account,
                                     String organizationName)
        Creates new account in given organization (domain). Only domain admin is allowed create new accounts! This means rest request has to authorized as domain admin.
        Parameters:
        account - to create
        organizationName - (domain) in which account should be created
        Returns:
        new account
        Throws:
        com.gooddata.GoodDataException - when account can't be created
      • removeAccount

        public void removeAccount​(Account account)
        Delete given account
        Parameters:
        account - to remove
        Throws:
        AccountNotFoundException - when given account wasn't found
        com.gooddata.GoodDataException - when account can't be removed for other reason
      • getAccountById

        public Account getAccountById​(String id)
        Get account for given account id
        Parameters:
        id - to search for
        Returns:
        account for id
        Throws:
        AccountNotFoundException - when account for given id can't be found
        com.gooddata.GoodDataException - when different error occurs
      • getAccountByUri

        public Account getAccountByUri​(String uri)
        Get account for given account id
        Parameters:
        uri - to search for
        Returns:
        account for uri
        Throws:
        AccountNotFoundException - when account for given uri can't be found
        com.gooddata.GoodDataException - when different error occurs
      • updateAccount

        public void updateAccount​(Account account)
        Updates account
        Parameters:
        account - to be updated
        Throws:
        AccountNotFoundException - when account for given uri can't be found