use of org.apache.atlas.catalog.BaseRequest in project incubator-atlas by apache.
the class EntityService method getEntity.
@GET
@Path("{entityId}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response getEntity(@Context HttpHeaders headers, @Context UriInfo ui, @PathParam("entityId") String entityId) throws CatalogException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityService.getEntity(" + entityId + ")");
}
BaseRequest request = new InstanceRequest(Collections.<String, Object>singletonMap("id", entityId));
Result result = getResource(entityResourceProvider, request);
return Response.status(Response.Status.OK).entity(getSerializer().serialize(result, ui)).build();
} finally {
AtlasPerfTracer.log(perf);
}
}
use of org.apache.atlas.catalog.BaseRequest in project incubator-atlas by apache.
the class EntityService method getEntities.
@GET
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response getEntities(@Context HttpHeaders headers, @Context UriInfo ui) throws CatalogException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityService.getEntities()");
}
String queryString = decode(getQueryString(ui));
BaseRequest request = new CollectionRequest(Collections.<String, Object>emptyMap(), queryString);
Result result = getResources(entityResourceProvider, request);
return Response.status(Response.Status.OK).entity(getSerializer().serialize(result, ui)).build();
} finally {
AtlasPerfTracer.log(perf);
}
}
use of org.apache.atlas.catalog.BaseRequest in project incubator-atlas by apache.
the class EntityService method getEntityTags.
@GET
@Path("{entityId}/tags")
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response getEntityTags(@Context HttpHeaders headers, @Context UriInfo ui, @PathParam("entityId") String entityGuid) throws CatalogException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityService.getEntityTags(" + entityGuid + ")");
}
BaseRequest request = new CollectionRequest(Collections.<String, Object>singletonMap("id", entityGuid), decode(getQueryString(ui)));
Result result = getResources(entityTagResourceProvider, request);
return Response.status(Response.Status.OK).entity(getSerializer().serialize(result, ui)).build();
} finally {
AtlasPerfTracer.log(perf);
}
}
Aggregations