public class MetadataService extends AbstractService
AbstractService.OutputStreamResponseExtractor
mapper, restTemplate
Constructor and Description |
---|
MetadataService(org.springframework.web.client.RestTemplate restTemplate)
Deprecated.
use MetadataService(RestTemplate, GoodDataSettings) constructor instead
|
MetadataService(org.springframework.web.client.RestTemplate restTemplate,
GoodDataSettings settings) |
Modifier and Type | Method and Description |
---|---|
<T extends Obj> |
createObj(Project project,
T obj)
Create metadata object in given project
|
<T extends Queryable> |
find(Project project,
Class<T> cls,
Restriction... restrictions)
Find metadata by restrictions like identifier, title or summary.
|
<T extends Queryable> |
findUris(Project project,
Class<T> cls,
Restriction... restrictions)
Find metadata URIs by restrictions like identifier, title or summary.
|
Collection<String> |
findUris(Project project,
Restriction... restrictions)
Find metadata URIs by restrictions.
|
List<AttributeElement> |
getAttributeElements(Attribute attribute)
Fetches attribute elements for given attribute using default display form.
|
List<AttributeElement> |
getAttributeElements(DisplayForm displayForm)
Fetches attribute elements by given display form.
|
<T extends Queryable> |
getObj(Project project,
Class<T> cls,
Restriction... restrictions)
Get metadata object by restrictions like identifier, title or summary.
|
<T extends Obj> |
getObjById(Project project,
String id,
Class<T> cls)
Get metadata object by id.
|
<T extends Obj> |
getObjByUri(String uri,
Class<T> cls)
Get metadata object by URI (format is
/gdc/md/{PROJECT_ID}/obj/{OBJECT_ID} ) |
Collection<Obj> |
getObjsByUris(Project project,
Collection<String> uris)
Retrieves a collection of objects corresponding to the supplied collection of URIs.
|
<T extends Queryable> |
getObjUri(Project project,
Class<T> cls,
Restriction... restrictions)
Get metadata object URI by restrictions like identifier, title or summary.
|
Map<String,String> |
identifiersToUris(Project project,
Collection<String> identifiers)
Find metadata URIs for given identifiers.
|
void |
removeObj(Obj obj)
Remove metadata object URI
|
void |
removeObjByUri(String uri)
Remove metadata object by URI (format is
/gdc/md/{PROJECT_ID}/obj/{OBJECT_ID} ) |
<T extends Updatable> |
updateObj(T obj)
Update given metadata object.
|
Collection<Usage> |
usedBy(Project project,
Collection<String> uris,
boolean nearest,
Class<? extends Obj>... types)
Find all objects which use the given objects.
|
Collection<Entry> |
usedBy(Project project,
Obj obj,
boolean nearest,
Class<? extends Obj>... types)
Find all objects which use the given object.
|
Collection<Entry> |
usedBy(Project project,
String uri,
boolean nearest,
Class<? extends Obj>... types)
Find all objects which use the given object.
|
extractData
public MetadataService(org.springframework.web.client.RestTemplate restTemplate, GoodDataSettings settings)
@Deprecated public MetadataService(org.springframework.web.client.RestTemplate restTemplate)
public <T extends Obj> T createObj(Project project, T obj)
T
- type of the object to be createdproject
- projectobj
- metadata object to be createdObjCreateException
- if creation failedObjNotFoundException
- if new metadata object not found after creationcom.gooddata.GoodDataRestException
- if GoodData REST API returns unexpected status code when getting
the new objectcom.gooddata.GoodDataException
- if no response from API or client-side HTTP error when getting the new objectpublic <T extends Obj> T getObjByUri(String uri, Class<T> cls)
/gdc/md/{PROJECT_ID}/obj/{OBJECT_ID}
)T
- type of the object to be returneduri
- URI in format /gdc/md/{PROJECT_ID}/obj/{OBJECT_ID}
cls
- class of the resulting objectObjNotFoundException
- if metadata object not foundcom.gooddata.GoodDataRestException
- if GoodData REST API returns unexpected status codecom.gooddata.GoodDataException
- if no response from API or client-side HTTP errorpublic Collection<Obj> getObjsByUris(Project project, Collection<String> uris)
project
- project that contains the objects to be retrieveduris
- collection of URIspublic <T extends Updatable> T updateObj(T obj)
T
- type of the updated objectobj
- object to updateObjUpdateException
- in case of errorpublic void removeObj(Obj obj)
obj
- metadata object to removeObjNotFoundException
- if metadata object not foundcom.gooddata.GoodDataRestException
- if GoodData REST API returns unexpected status codecom.gooddata.GoodDataException
- if no response from API or client-side HTTP errorpublic void removeObjByUri(String uri)
/gdc/md/{PROJECT_ID}/obj/{OBJECT_ID}
)uri
- URI in format /gdc/md/{PROJECT_ID}/obj/{OBJECT_ID}
ObjNotFoundException
- if metadata object not foundcom.gooddata.GoodDataRestException
- if GoodData REST API returns unexpected status codecom.gooddata.GoodDataException
- if no response from API or client-side HTTP errorpublic <T extends Obj> T getObjById(Project project, String id, Class<T> cls)
T
- type of the object to be returnedproject
- project where to search for the objectid
- id of the objectcls
- class of the resulting objectObjNotFoundException
- if metadata object not foundcom.gooddata.GoodDataRestException
- if GoodData REST API returns unexpected status codecom.gooddata.GoodDataException
- if no response from API or client-side HTTP errorpublic <T extends Queryable> String getObjUri(Project project, Class<T> cls, Restriction... restrictions)
T
- type of the object to be returnedproject
- project where to search for the objectcls
- class of the resulting objectrestrictions
- query restrictionsObjNotFoundException
- if metadata object not foundNonUniqueObjException
- if more than one object corresponds to search restrictionspublic <T extends Queryable> T getObj(Project project, Class<T> cls, Restriction... restrictions)
T
- type of the object to be returnedproject
- project where to search for the objectcls
- class of the resulting objectrestrictions
- query restrictionsObjNotFoundException
- if metadata object not foundNonUniqueObjException
- if more than one object corresponds to search restrictionspublic <T extends Queryable> Collection<Entry> find(Project project, Class<T> cls, Restriction... restrictions)
T
- type of the metadata referenced in returned entriesproject
- project where to search for the metadatacls
- class of searched metadatarestrictions
- query restrictionscom.gooddata.GoodDataException
- if unable to query metadatapublic <T extends Queryable> Collection<String> findUris(Project project, Class<T> cls, Restriction... restrictions)
T
- type of the metadata referenced by returned URIsproject
- project where to search for the metadatacls
- class of searched metadatarestrictions
- query restrictionscom.gooddata.GoodDataException
- if unable to query metadatapublic Collection<Entry> usedBy(Project project, Obj obj, boolean nearest, Class<? extends Obj>... types)
project
- projectobj
- object to find using objects fornearest
- find nearest objects onlytypes
- what types (categories) to search for (for example 'reportDefinition', 'report', 'tableDataLoad',
'table'...)public Collection<Entry> usedBy(Project project, String uri, boolean nearest, Class<? extends Obj>... types)
project
- projecturi
- URI of object to find using objects fornearest
- find nearest objects onlytypes
- what types (categories) to search for (for example 'reportDefinition', 'report', 'tableDataLoad',
'table'...)usedBy(Project, Collection, boolean, Class[])
public Collection<Usage> usedBy(Project project, Collection<String> uris, boolean nearest, Class<? extends Obj>... types)
usedBy(Project, String, boolean, Class[])
project
- projecturis
- URIs of object to find using objects fornearest
- find nearest objects onlytypes
- what types (categories) to search for (for example 'reportDefinition', 'report', 'tableDataLoad',
'table'...), returns all objects if no type is providedusedBy(Project, String, boolean, Class[])
public Collection<String> findUris(Project project, Restriction... restrictions)
project
- project where to search for the metadatarestrictions
- query restrictionscom.gooddata.GoodDataException
- if unable to query metadatapublic Map<String,String> identifiersToUris(Project project, Collection<String> identifiers)
project
- project where to search for the metadataidentifiers
- query restrictionscom.gooddata.GoodDataException
- if unable to query metadatafindUris(Project, Restriction...)
public List<AttributeElement> getAttributeElements(Attribute attribute)
attribute
- attribute to fetch elements forpublic List<AttributeElement> getAttributeElements(DisplayForm displayForm)
displayForm
- display form to fetch attributes forCopyright © 2019. All rights reserved.