Package com.gooddata.warehouse
Class WarehouseService
- java.lang.Object
-
- com.gooddata.AbstractService
-
- com.gooddata.warehouse.WarehouseService
-
public class WarehouseService extends AbstractService
Provide access to warehouse API - create, update, list and delete warehouses.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.gooddata.AbstractService
AbstractService.OutputStreamResponseExtractor
-
-
Field Summary
-
Fields inherited from class com.gooddata.AbstractService
mapper, restTemplate
-
-
Constructor Summary
Constructors Constructor Description WarehouseService(org.springframework.web.client.RestTemplate restTemplate)Deprecated.use WarehouseService(RestTemplate, GoodDataSettings) constructor insteadWarehouseService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings)Sets RESTful HTTP Spring template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FutureResult<WarehouseS3Credentials>addS3Credentials(Warehouse warehouse, WarehouseS3Credentials s3Credentials)add new S3 credentials to the WarehouseFutureResult<WarehouseUser>addUserToWarehouse(Warehouse warehouse, WarehouseUser user)Add given user to given warehouse.FutureResult<Warehouse>createWarehouse(Warehouse warehouse)Create new warehouse.WarehouseSchemagetDefaultWarehouseSchema(Warehouse warehouse)get default warehouse schemaWarehousegetWarehouseById(String id)Get Warehouse identified by given id.WarehousegetWarehouseByUri(String uri)Get Warehouse identified by given uri.WarehouseS3CredentialsgetWarehouseS3Credentials(Warehouse warehouse, String region, String accessKey)Get S3 credentials for the Warehouse based onregionandaccessKey.WarehouseSchemagetWarehouseSchemaByName(Warehouse warehouse, String name)get warehouse schema by nameWarehouseSchemagetWarehouseSchemaByUri(String uri)get warehouse schema by uricom.gooddata.collections.PageableList<Warehouse>listWarehouses()Lists Warehouses.com.gooddata.collections.PageableList<Warehouse>listWarehouses(com.gooddata.collections.Page startPage)Lists Warehouses.com.gooddata.collections.PageableList<WarehouseS3Credentials>listWarehouseS3Credentials(Warehouse warehouse)List S3 credentials for the Warehouse.com.gooddata.collections.PageableList<WarehouseSchema>listWarehouseSchemas(Warehouse warehouse)list schemas for Warehousecom.gooddata.collections.PageableList<WarehouseSchema>listWarehouseSchemas(Warehouse warehouse, com.gooddata.collections.Page startPage)list schemas for Warehousecom.gooddata.collections.PageableList<WarehouseUser>listWarehouseUsers(Warehouse warehouse)Lists warehouse users.com.gooddata.collections.PageableList<WarehouseUser>listWarehouseUsers(Warehouse warehouse, com.gooddata.collections.Page startPage)Lists warehouse users, starting with specified page.FutureResult<Void>removeS3Credentials(WarehouseS3Credentials s3Credentials)delete S3 credentials in the WarehouseFutureResult<Void>removeUserFromWarehouse(WarehouseUser user)Remove given user from warehouse instancevoidremoveWarehouse(Warehouse warehouse)Delete Warehouse.FutureResult<WarehouseS3Credentials>updateS3Credentials(WarehouseS3Credentials s3Credentials)update S3 credentials in the WarehouseWarehouseupdateWarehouse(Warehouse toUpdate)Updates given Warehouse.-
Methods inherited from class com.gooddata.AbstractService
extractData
-
-
-
-
Constructor Detail
-
WarehouseService
public WarehouseService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings)Sets RESTful HTTP Spring template. Should be called from constructor of concrete service extending this abstract one.- Parameters:
restTemplate- RESTful HTTP Spring templatesettings- settings
-
WarehouseService
@Deprecated public WarehouseService(org.springframework.web.client.RestTemplate restTemplate)
Deprecated.use WarehouseService(RestTemplate, GoodDataSettings) constructor insteadSets RESTful HTTP Spring template. Should be called from constructor of concrete service extending this abstract one.- Parameters:
restTemplate- RESTful HTTP Spring template
-
-
Method Detail
-
createWarehouse
public FutureResult<Warehouse> createWarehouse(Warehouse warehouse)
Create new warehouse.- Parameters:
warehouse- warehouse to create- Returns:
- created warehouse
-
removeWarehouse
public void removeWarehouse(Warehouse warehouse)
Delete Warehouse.- Parameters:
warehouse- to delete
-
getWarehouseByUri
public Warehouse getWarehouseByUri(String uri)
Get Warehouse identified by given uri.- Parameters:
uri- warehouse uri- Returns:
- Warehouse
- Throws:
com.gooddata.GoodDataException- when Warehouse can't be accessed
-
getWarehouseById
public Warehouse getWarehouseById(String id)
Get Warehouse identified by given id.- Parameters:
id- warehouse id- Returns:
- Warehouse
- Throws:
com.gooddata.GoodDataException- when Warehouse can't be accessed
-
listWarehouses
public com.gooddata.collections.PageableList<Warehouse> listWarehouses()
Lists Warehouses. Returns empty list in case there are no warehouses. Returns only first page if there's more instances than page limit. UseCollection.stream()to iterate over all pages, orMultiPageList.collectAll()to load the entire list.- Returns:
- MultiPageList first page of list of warehouse instances or empty list
-
listWarehouses
public com.gooddata.collections.PageableList<Warehouse> listWarehouses(com.gooddata.collections.Page startPage)
Lists Warehouses. Returns empty list in case there are no warehouses. Returns requested page (by page limit and offset). UselistWarehouses()to get first page with default setting.- Parameters:
startPage- page to be listed- Returns:
- MultiPageList requested page of list of instances or empty list
-
listWarehouseUsers
public com.gooddata.collections.PageableList<WarehouseUser> listWarehouseUsers(Warehouse warehouse)
Lists warehouse users. Returns empty list in case there are no users. UseCollection.stream()to iterate over all pages, orMultiPageList.collectAll()to load the entire list.- Parameters:
warehouse- warehouse- Returns:
- MultiPageList requested page of list of instances or empty list
-
listWarehouseUsers
public com.gooddata.collections.PageableList<WarehouseUser> listWarehouseUsers(Warehouse warehouse, com.gooddata.collections.Page startPage)
Lists warehouse users, starting with specified page. Returns empty list in case there are no users. UseCollection.stream()to iterate over all pages, orMultiPageList.collectAll()to load the entire list.- Parameters:
warehouse- warehousestartPage- page to start with- Returns:
- MultiPageList requested page of list of instances starting with startPage or empty list
-
addUserToWarehouse
public FutureResult<WarehouseUser> addUserToWarehouse(Warehouse warehouse, WarehouseUser user)
Add given user to given warehouse.- Parameters:
warehouse- warehouse the user should be added touser- user to be added- Returns:
- added user in warehouse
-
removeUserFromWarehouse
public FutureResult<Void> removeUserFromWarehouse(WarehouseUser user)
Remove given user from warehouse instance- Parameters:
user- to remove from warehouse- Returns:
- empty future result
- Throws:
WarehouseUserNotFoundException- when user for removal can't be foundcom.gooddata.GoodDataException- any other reason
-
updateWarehouse
public Warehouse updateWarehouse(Warehouse toUpdate)
Updates given Warehouse.- Parameters:
toUpdate- warehouse to be updated- Returns:
- updated warehouse
- Throws:
com.gooddata.GoodDataException- when update fails
-
listWarehouseSchemas
public com.gooddata.collections.PageableList<WarehouseSchema> listWarehouseSchemas(Warehouse warehouse)
list schemas for Warehouse- Parameters:
warehouse- to list schemas for- Returns:
- MultiPageList pageable list of warehouse schemas
-
listWarehouseSchemas
public com.gooddata.collections.PageableList<WarehouseSchema> listWarehouseSchemas(Warehouse warehouse, com.gooddata.collections.Page startPage)
list schemas for Warehouse- Parameters:
warehouse- to list schemas forstartPage- page to be listed- Returns:
- MultiPageList pageable list of warehouse schemas
-
getWarehouseSchemaByName
public WarehouseSchema getWarehouseSchemaByName(Warehouse warehouse, String name)
get warehouse schema by name- Parameters:
warehouse- to get schema forname- of schema- Returns:
- warehouse schema
-
getWarehouseSchemaByUri
public WarehouseSchema getWarehouseSchemaByUri(String uri)
get warehouse schema by uri- Parameters:
uri- of schema- Returns:
- warehouse schema
-
getDefaultWarehouseSchema
public WarehouseSchema getDefaultWarehouseSchema(Warehouse warehouse)
get default warehouse schema- Parameters:
warehouse- to get default schema for- Returns:
- default warehouse schema
-
listWarehouseS3Credentials
public com.gooddata.collections.PageableList<WarehouseS3Credentials> listWarehouseS3Credentials(Warehouse warehouse)
List S3 credentials for the Warehouse. Returns empty list if no credentials are found.- Parameters:
warehouse- warehouse to get S3 credentials for- Returns:
- PageableList with all S3 credentials belonging to the Warehouse (not null)
- Throws:
WarehouseS3CredentialsException- in case of failure during the REST operation
-
getWarehouseS3Credentials
public WarehouseS3Credentials getWarehouseS3Credentials(Warehouse warehouse, String region, String accessKey)
Get S3 credentials for the Warehouse based onregionandaccessKey.- Parameters:
warehouse- warehouse to get S3 credentials for- Returns:
- single S3 credentials record (not null)
- Throws:
WarehouseS3CredentialsNotFoundException- if no S3 credentials for the given parameters were foundWarehouseS3CredentialsException- in case of failure during the REST operation
-
addS3Credentials
public FutureResult<WarehouseS3Credentials> addS3Credentials(Warehouse warehouse, WarehouseS3Credentials s3Credentials)
add new S3 credentials to the Warehouse- Parameters:
warehouse- warehouse the S3 credentials should be added tos3Credentials- the credentials to store- Returns:
- added credentials (not null)
- Throws:
WarehouseS3CredentialsException- in case of failure during the REST operation
-
updateS3Credentials
public FutureResult<WarehouseS3Credentials> updateS3Credentials(WarehouseS3Credentials s3Credentials)
update S3 credentials in the Warehouse- Parameters:
s3Credentials- the credentials to update- Returns:
- updated credentials (not null)
- Throws:
WarehouseS3CredentialsException- in case of failure during the REST operation
-
removeS3Credentials
public FutureResult<Void> removeS3Credentials(WarehouseS3Credentials s3Credentials)
delete S3 credentials in the Warehouse- Parameters:
s3Credentials- the credentials to delete- Returns:
- nothing (Void)
- Throws:
WarehouseS3CredentialsException- in case of failure during the REST operation
-
-