[Major] Added export to inspector REST API
This commit is contained in:
parent
5afacfb1c4
commit
3e116b6b34
|
@ -22,8 +22,11 @@ import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
import javax.xml.parsers.SAXParser;
|
import javax.xml.parsers.SAXParser;
|
||||||
import javax.xml.parsers.SAXParserFactory;
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
import javax.xml.stream.XMLStreamException;
|
||||||
|
import javax.xml.stream.XMLStreamWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
@ -50,9 +53,7 @@ import li.strolch.model.query.OrderQuery;
|
||||||
import li.strolch.model.query.ResourceQuery;
|
import li.strolch.model.query.ResourceQuery;
|
||||||
import li.strolch.model.query.StrolchTypeNavigation;
|
import li.strolch.model.query.StrolchTypeNavigation;
|
||||||
import li.strolch.model.query.parser.QueryParser;
|
import li.strolch.model.query.parser.QueryParser;
|
||||||
import li.strolch.model.xml.SimpleStrolchElementListener;
|
import li.strolch.model.xml.*;
|
||||||
import li.strolch.model.xml.StrolchElementToXmlStringVisitor;
|
|
||||||
import li.strolch.model.xml.XmlModelSaxReader;
|
|
||||||
import li.strolch.persistence.api.StrolchPersistenceException;
|
import li.strolch.persistence.api.StrolchPersistenceException;
|
||||||
import li.strolch.persistence.api.StrolchTransaction;
|
import li.strolch.persistence.api.StrolchTransaction;
|
||||||
import li.strolch.privilege.model.Certificate;
|
import li.strolch.privilege.model.Certificate;
|
||||||
|
@ -75,6 +76,8 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* The RESTful inspector for Strolch. It allows to inspect the realms, and their respective elements. Supporting querying and retrieving, in multiple formats: XML, JSON and flat JSON
|
||||||
|
*
|
||||||
* @author Robert von Burg <eitch@eitchnet.ch>
|
* @author Robert von Burg <eitch@eitchnet.ch>
|
||||||
*/
|
*/
|
||||||
@Path("strolch/inspector")
|
@Path("strolch/inspector")
|
||||||
|
@ -92,22 +95,9 @@ public class Inspector {
|
||||||
return gson.toJson(jsonObject);
|
return gson.toJson(jsonObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Root path of the inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* <p>
|
|
||||||
* Returns the root element, which is an overview of the configured realms
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return the root element, which is an overview of the configured realms
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Response getAgent(@Context HttpServletRequest request) {
|
public Response getAgentOverview(@Context HttpServletRequest request) {
|
||||||
try {
|
|
||||||
|
|
||||||
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
JsonObject agentOverview = new JsonObject();
|
JsonObject agentOverview = new JsonObject();
|
||||||
|
@ -133,28 +123,12 @@ public class Inspector {
|
||||||
}
|
}
|
||||||
|
|
||||||
return Response.ok().entity(toString(agentOverview)).build();
|
return Response.ok().entity(toString(agentOverview)).build();
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Realm inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* <p>
|
|
||||||
* Returns the overview of a specific relam
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the overview is to be returned
|
|
||||||
* @return the overview of a specific relam
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}")
|
@Path("{realm}")
|
||||||
public Response getRealm(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
public Response getRealmOverview(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
||||||
|
|
||||||
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
@ -204,17 +178,35 @@ public class Inspector {
|
||||||
return Response.ok().entity(toString(realmDetailJ)).build();
|
return Response.ok().entity(toString(realmDetailJ)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@GET
|
||||||
* <p>
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
* Resource inspector
|
@Path("{realm}/xml")
|
||||||
* </p>
|
public Response exportRealmToXml(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
||||||
* <p>
|
|
||||||
* Returns an overview of the {@link Resource Resources}. This is a list of all the types and the size each type has
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
* </p>
|
|
||||||
*
|
StreamingOutput streamingOutput = stream -> {
|
||||||
* @param realm the realm for which the resource overview is to be returned
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
* @return an overview of the {@link Resource Resources}. This is a list of all the types and the size each type has
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
*/
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.getResourceMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
tx.getOrderMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
tx.getActivityMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/resources")
|
@Path("{realm}/resources")
|
||||||
|
@ -248,17 +240,6 @@ public class Inspector {
|
||||||
return Response.ok().entity(toString(mapOverview)).build();
|
return Response.ok().entity(toString(mapOverview)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Order inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Returns an overview of the {@link Order Orders}. This is a list of all the types and the size each type has
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the order overview is to be returned
|
|
||||||
* @return an overview of the {@link Order Orders}. This is a list of all the types and the size each type has
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/orders")
|
@Path("{realm}/orders")
|
||||||
|
@ -292,19 +273,6 @@ public class Inspector {
|
||||||
return Response.ok().entity(toString(mapOverview)).build();
|
return Response.ok().entity(toString(mapOverview)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Activity inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Returns an overview of the {@link Activity Activities}. This is a list of all the types and the size each type
|
|
||||||
* has
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the activity overview is to be returned
|
|
||||||
* @return an overview of the {@link Activity Activities}. This is a list of all the types and the size each type
|
|
||||||
* has
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/activities")
|
@Path("{realm}/activities")
|
||||||
|
@ -338,22 +306,87 @@ public class Inspector {
|
||||||
return Response.ok().entity(toString(mapOverview)).build();
|
return Response.ok().entity(toString(mapOverview)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO for the get element type details, we should not simply query all objects, but rather find a solution to query only the id, name, type and date, state for the order
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/resources/xml")
|
||||||
|
public Response exportResourcesToXml(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.getResourceMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_resources_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/orders/xml")
|
||||||
|
public Response exportOrdersToXml(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.getOrderMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_orders_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/activities/xml")
|
||||||
|
public Response exportActivitiesToXml(@Context HttpServletRequest request, @PathParam("realm") String realm) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.getActivityMap().getAllElements(tx).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_activities_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Resource type inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Returns an overview of the {@link Resource Resources} with the given type. This is a list of overviews of the
|
|
||||||
* resources
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the resource type overview is to be returned
|
|
||||||
* @param type marshall
|
|
||||||
* @return an overview of the {@link Resource Resources} with the given type. This is a list of overviews of the
|
|
||||||
* resources
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/resources/{type}")
|
@Path("{realm}/resources/{type}")
|
||||||
|
@ -390,18 +423,6 @@ public class Inspector {
|
||||||
return Response.ok(toString(root)).build();
|
return Response.ok(toString(root)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Order type inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* Returns an overview of the {@link Order Orders} with the given type. This is a list of overviews of the orders
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the order type overview is to be returned
|
|
||||||
* @param type
|
|
||||||
* @return an overview of the {@link Order Orders} with the given type. This is a list of overviews of the orders
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/orders/{type}")
|
@Path("{realm}/orders/{type}")
|
||||||
|
@ -470,6 +491,105 @@ public class Inspector {
|
||||||
return Response.ok(toString(root)).build();
|
return Response.ok(toString(root)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/resources/{type}/xml")
|
||||||
|
public Response exportResourcesOfTypeToXml(@BeanParam QueryData queryData, @PathParam("realm") String realm,
|
||||||
|
@PathParam("type") String type, @Context HttpServletRequest request) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
queryData.initializeUnsetFields();
|
||||||
|
ResourceQuery<Resource> query = QueryParser.parseToResourceQuery(queryData.getQuery(), true, true, false);
|
||||||
|
query.setNavigation(new StrolchTypeNavigation(type));
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.doQuery(query).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_resources_" + type + "_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/orders/{type}/xml")
|
||||||
|
public Response exportOrdersOfTypeToXml(@BeanParam QueryData queryData, @PathParam("realm") String realm,
|
||||||
|
@PathParam("type") String type, @Context HttpServletRequest request) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
queryData.initializeUnsetFields();
|
||||||
|
OrderQuery<Order> query = QueryParser.parseToOrderQuery(queryData.getQuery(), true, true, false);
|
||||||
|
query.setNavigation(new StrolchTypeNavigation(type));
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.doQuery(query).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_orders_" + type + "_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_XML)
|
||||||
|
@Path("{realm}/activities/{type}/xml")
|
||||||
|
public Response exportActivitiesOfTypeToXml(@BeanParam QueryData queryData, @PathParam("realm") String realm,
|
||||||
|
@PathParam("type") String type, @Context HttpServletRequest request) {
|
||||||
|
|
||||||
|
Certificate cert = (Certificate) request.getAttribute(StrolchRestfulConstants.STROLCH_CERTIFICATE);
|
||||||
|
|
||||||
|
queryData.initializeUnsetFields();
|
||||||
|
ActivityQuery<Activity> query = QueryParser.parseToActivityQuery(queryData.getQuery(), true, true, false);
|
||||||
|
query.setNavigation(new StrolchTypeNavigation(type));
|
||||||
|
|
||||||
|
StreamingOutput streamingOutput = stream -> {
|
||||||
|
try (StrolchTransaction tx = openTx(cert, realm)) {
|
||||||
|
|
||||||
|
XMLStreamWriter writer = StrolchXmlHelper.openXmlStreamWriter(stream);
|
||||||
|
StrolchElementToSaxWriterVisitor visitor = new StrolchElementToSaxWriterVisitor(writer);
|
||||||
|
|
||||||
|
tx.doQuery(query).forEach(e -> e.accept(visitor));
|
||||||
|
|
||||||
|
writer.writeEndDocument();
|
||||||
|
stream.flush();
|
||||||
|
|
||||||
|
} catch (XMLStreamException e) {
|
||||||
|
throw new IllegalStateException("Failed to write XML to " + stream, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName = "strolch_export_activities_" + type + "_" + realm + "_" + System.currentTimeMillis() + ".xml";
|
||||||
|
return Response.ok(streamingOutput, MediaType.APPLICATION_XML)
|
||||||
|
.header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build();
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/resources/{type}/{id}")
|
@Path("{realm}/resources/{type}/{id}")
|
||||||
|
@ -554,20 +674,6 @@ public class Inspector {
|
||||||
return Response.ok().type(MediaType.APPLICATION_XML).entity(asXml).build();
|
return Response.ok().type(MediaType.APPLICATION_XML).entity(asXml).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Activity inspector
|
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* <p>
|
|
||||||
* Returns the activity with the given id
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param realm the realm for which the activity is to be returned
|
|
||||||
* @param type the type of the activity
|
|
||||||
* @param id the id of the activity
|
|
||||||
* @return the activity with the given id
|
|
||||||
*/
|
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{realm}/activities/{type}/{id}")
|
@Path("{realm}/activities/{type}/{id}")
|
||||||
|
|
Loading…
Reference in New Issue