public class MetadataService extends AbstractService
AbstractService.OutputStreamResponseExtractormapper, noopRequestCallback, restTemplate, WAIT_BEFORE_RETRY_IN_MILLIS| Constructor and Description |
|---|
MetadataService(org.springframework.web.client.RestTemplate restTemplate) |
| 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.
|
<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}) |
<T extends Queryable> |
getObjUri(Project project,
Class<T> cls,
Restriction... restrictions)
Get metadata object URI by restrictions like identifier, title or summary.
|
extractDatapublic 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 creationGoodDataRestException - if GoodData REST API returns unexpected status code when getting
the new objectGoodDataException - if it encounters client-side HTTP errors 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 foundGoodDataRestException - if GoodData REST API returns unexpected status codeGoodDataException - if it encounters client-side HTTP errorspublic <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 foundGoodDataRestException - if GoodData REST API returns unexpected status codeGoodDataException - if it encounters client-side HTTP errorspublic <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 restrictionsGoodDataException - 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 restrictionsGoodDataException - if unable to query metadataCopyright © 2014. All Rights Reserved.