Package com.gooddata.sdk.service.account
Class AccountService
java.lang.Object
com.gooddata.sdk.service.AbstractService
com.gooddata.sdk.service.account.AccountService
Service to access and manipulate account.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.gooddata.sdk.service.AbstractService
AbstractService.OutputStreamResponseExtractor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.web.util.UriTemplatestatic final org.springframework.web.util.UriTemplatestatic final org.springframework.web.util.UriTemplatestatic final org.springframework.web.util.UriTemplatestatic final org.springframework.web.util.UriTemplateFields inherited from class com.gooddata.sdk.service.AbstractService
mapper, restTemplate -
Constructor Summary
ConstructorsConstructorDescriptionAccountService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings) Constructs service for GoodData account management. -
Method Summary
Modifier and TypeMethodDescriptioncreateAccount(Account account, String organizationName) Creates new account in given organization (domain).getAccountById(String id) Get account for given account idgetAccountByLogin(String email, String organizationName) Get account by given login.getAccountByUri(String uri) Get account for given account idGets current account of logged user.getSeparatorSettings(Account account) Returns default thousand and decimal separator settings for the given account.voidlogout()Performs user logout.voidremoveAccount(Account account) Delete given accountvoidupdateAccount(Account account) Updates accountMethods inherited from class com.gooddata.sdk.service.AbstractService
extractData
-
Field Details
-
ACCOUNT_TEMPLATE
public static final org.springframework.web.util.UriTemplate ACCOUNT_TEMPLATE -
ACCOUNTS_TEMPLATE
public static final org.springframework.web.util.UriTemplate ACCOUNTS_TEMPLATE -
ACCOUNT_BY_LOGIN_TEMPLATE
public static final org.springframework.web.util.UriTemplate ACCOUNT_BY_LOGIN_TEMPLATE -
LOGIN_TEMPLATE
public static final org.springframework.web.util.UriTemplate LOGIN_TEMPLATE -
SEPARATORS_TEMPLATE
public static final org.springframework.web.util.UriTemplate SEPARATORS_TEMPLATE
-
-
Constructor Details
-
AccountService
public AccountService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings) Constructs service for GoodData account management.- Parameters:
restTemplate- RESTful HTTP Spring templatesettings- settings
-
-
Method Details
-
getCurrent
Gets current account of logged user.- Returns:
- current account
- Throws:
com.gooddata.sdk.common.GoodDataException- when current account can't be accessed.
-
logout
public void logout()Performs user logout.- Throws:
com.gooddata.sdk.common.GoodDataException- when logout failed.
-
createAccount
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 createorganizationName- (domain) in which account should be created- Returns:
- new account
- Throws:
com.gooddata.sdk.common.GoodDataException- when account can't be created
-
removeAccount
Delete given account- Parameters:
account- to remove- Throws:
AccountNotFoundException- when given account wasn't foundcom.gooddata.sdk.common.GoodDataException- when account can't be removed for other reason
-
getAccountById
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 foundcom.gooddata.sdk.common.GoodDataException- when different error occurs
-
getAccountByLogin
Get account by given login. Only domain admin is allowed to search users by login.- Parameters:
email- used as loginorganizationName- (domain) in which account is present- Returns:
- account found by given login
- Throws:
AccountNotFoundException- when given account wasn't foundcom.gooddata.sdk.common.GoodDataException- when different error occurs
-
getAccountByUri
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 foundcom.gooddata.sdk.common.GoodDataException- when different error occurs
-
updateAccount
Updates account- Parameters:
account- to be updated- Throws:
AccountNotFoundException- when account for given uri can't be found
-
getSeparatorSettings
Returns default thousand and decimal separator settings for the given account.- Parameters:
account- account- Returns:
- default
SeparatorSettingsfor the account
-