Class WarehouseService
java.lang.Object
com.gooddata.sdk.service.AbstractService
com.gooddata.sdk.service.warehouse.WarehouseService
Provide access to warehouse API - create, update, list and delete warehouses.
-
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.UriTemplateFields inherited from class com.gooddata.sdk.service.AbstractService
mapper, restTemplate -
Constructor Summary
ConstructorsConstructorDescriptionWarehouseService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings) Sets RESTful HTTP Spring template. -
Method Summary
Modifier and TypeMethodDescriptionaddUserToWarehouse(Warehouse warehouse, WarehouseUser user) Add given user to given warehouse.createWarehouse(Warehouse warehouse) Create new warehouse.getDefaultWarehouseSchema(Warehouse warehouse) get default warehouse schemaGet Warehouse identified by given id.getWarehouseByUri(String uri) Get Warehouse identified by given uri.getWarehouseSchemaByName(Warehouse warehouse, String name) get warehouse schema by nameget warehouse schema by uricom.gooddata.sdk.common.collections.PageBrowser<Warehouse>Lists Warehouses.com.gooddata.sdk.common.collections.PageBrowser<Warehouse>listWarehouses(com.gooddata.sdk.common.collections.PageRequest startPage) Lists Warehouses.com.gooddata.sdk.common.collections.PageBrowser<WarehouseSchema>listWarehouseSchemas(Warehouse warehouse) list schemas for Warehousecom.gooddata.sdk.common.collections.PageBrowser<WarehouseSchema>listWarehouseSchemas(Warehouse warehouse, com.gooddata.sdk.common.collections.PageRequest startPage) list schemas for Warehousecom.gooddata.sdk.common.collections.PageBrowser<WarehouseUser>listWarehouseUsers(Warehouse warehouse) Lists warehouse users.com.gooddata.sdk.common.collections.PageBrowser<WarehouseUser>listWarehouseUsers(Warehouse warehouse, com.gooddata.sdk.common.collections.PageRequest startPage) Lists warehouse users, starting with specified page.Remove given user from warehouse instancevoidremoveWarehouse(Warehouse warehouse) Delete Warehouse.updateWarehouse(Warehouse toUpdate) Updates given Warehouse.Methods inherited from class com.gooddata.sdk.service.AbstractService
extractData
-
Field Details
-
SCHEMAS_TEMPLATE
public static final org.springframework.web.util.UriTemplate SCHEMAS_TEMPLATE -
SCHEMA_TEMPLATE
public static final org.springframework.web.util.UriTemplate SCHEMA_TEMPLATE -
WAREHOUSE_TEMPLATE
public static final org.springframework.web.util.UriTemplate WAREHOUSE_TEMPLATE -
USERS_TEMPLATE
public static final org.springframework.web.util.UriTemplate USERS_TEMPLATE
-
-
Constructor Details
-
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
-
-
Method Details
-
createWarehouse
Create new warehouse.- Parameters:
warehouse- warehouse to create- Returns:
- created warehouse
-
removeWarehouse
Delete Warehouse.- Parameters:
warehouse- to delete
-
getWarehouseByUri
Get Warehouse identified by given uri.- Parameters:
uri- warehouse uri- Returns:
- Warehouse
- Throws:
com.gooddata.sdk.common.GoodDataException- when Warehouse can't be accessed
-
getWarehouseById
Get Warehouse identified by given id.- Parameters:
id- warehouse id- Returns:
- Warehouse
- Throws:
com.gooddata.sdk.common.GoodDataException- when Warehouse can't be accessed
-
listWarehouses
Lists Warehouses. Returns empty list in case there are no warehouses. Returns only first page if there's more instances than page limit. UsePageBrowser.allItemsStream()()} to iterate over all pages, orPageBrowser.getAllItems()()} to load the entire list.- Returns:
PageBrowserfirst page of list of warehouse instances or empty list
-
listWarehouses
public com.gooddata.sdk.common.collections.PageBrowser<Warehouse> listWarehouses(com.gooddata.sdk.common.collections.PageRequest 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:
PageBrowserrequested page of list of instances or empty list
-
listWarehouseUsers
public com.gooddata.sdk.common.collections.PageBrowser<WarehouseUser> listWarehouseUsers(Warehouse warehouse) Lists warehouse users. Returns empty list in case there are no users. UsePageBrowser.allItemsStream()()} to iterate over all pages, orPageBrowser.getAllItems()()} to load the entire list.- Parameters:
warehouse- warehouse- Returns:
PageBrowserrequested page of list of instances or empty list
-
listWarehouseUsers
public com.gooddata.sdk.common.collections.PageBrowser<WarehouseUser> listWarehouseUsers(Warehouse warehouse, com.gooddata.sdk.common.collections.PageRequest startPage) Lists warehouse users, starting with specified page. Returns empty list in case there are no users. UsePageBrowser.allItemsStream()()} to iterate over all pages, orPageBrowser.getAllItems()()} to load the entire list.- Parameters:
warehouse- warehousestartPage- page to start with- Returns:
PageBrowserrequested page of list of instances starting with startPage or empty list
-
addUserToWarehouse
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
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.sdk.common.GoodDataException- any other reason
-
updateWarehouse
Updates given Warehouse.- Parameters:
toUpdate- warehouse to be updated- Returns:
- updated warehouse
- Throws:
com.gooddata.sdk.common.GoodDataException- when update fails
-
listWarehouseSchemas
public com.gooddata.sdk.common.collections.PageBrowser<WarehouseSchema> listWarehouseSchemas(Warehouse warehouse) list schemas for Warehouse- Parameters:
warehouse- to list schemas for- Returns:
PageBrowserpageable list of warehouse schemas
-
listWarehouseSchemas
public com.gooddata.sdk.common.collections.PageBrowser<WarehouseSchema> listWarehouseSchemas(Warehouse warehouse, com.gooddata.sdk.common.collections.PageRequest startPage) list schemas for Warehouse- Parameters:
warehouse- to list schemas forstartPage- page to be listed- Returns:
PageBrowserpageable list of warehouse schemas
-
getWarehouseSchemaByName
get warehouse schema by name- Parameters:
warehouse- to get schema forname- of schema- Returns:
- warehouse schema
-
getWarehouseSchemaByUri
get warehouse schema by uri- Parameters:
uri- of schema- Returns:
- warehouse schema
-
getDefaultWarehouseSchema
get default warehouse schema- Parameters:
warehouse- to get default schema for- Returns:
- default warehouse schema
-