本文整理匯總了Java中i5.las2peer.restMapper.annotations.PathParam類的典型用法代碼示例。如果您正苦於以下問題:Java PathParam類的具體用法?Java PathParam怎麽用?Java PathParam使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PathParam類屬於i5.las2peer.restMapper.annotations包,在下文中一共展示了PathParam類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getVisulaizationData
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
/**
*
* @param visId
* @return
*/
@GET
@Path("datasets/{datasetId}/visualizations/{visualizationId}")
@ResourceListApi(description = "Get the visualization graph")
@Produces(MediaType.APPLICATION_XML)
@Consumes(MediaType.TEXT_PLAIN)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success") })
@Summary("Returns the visualization graph to be consumed by the client.")
public HttpResponse getVisulaizationData(@PathParam("visualizationId") String visId) {
log.info("expertsId:: " + visId);
DatabaseHandler dbHandler = null;
dbHandler = new DatabaseHandler("healthcare", "root", "");
String visGraph = dbHandler.getVisGraph(Long.parseLong(visId));
String fileContentsString = "data:" + "text/xml" + ";base64," + Base64.encodeBase64String(visGraph.getBytes());
HttpResponse res = new HttpResponse(fileContentsString, 200);
res.setHeader("content-type", "text/xml");
res.setStatus(200);
return res;
}
示例2: getGraph
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("download/{filename}")
public HttpResponse getGraph(@PathParam("filename") String filename) {
byte[] data = LocalFileManager.getFile(filename);
String fileContentsString = null;
try {
fileContentsString = new String(data, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
log.info(fileContentsString);
HttpResponse res = new HttpResponse(fileContentsString, 200);
res.setHeader("content-type", "text/xml");
return res;
}
示例3: saveClickPositions
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@POST
@Path("datasets/{datasetId}/position")
public void saveClickPositions(@PathParam(value = "datasetId") String datasetId,
@QueryParam(name = "expertsId", defaultValue = "-1") String expertsId, @QueryParam(name = "position", defaultValue = "-1") int position) {
String databaseName = getDatabaseName(datasetId);
if (databaseName == null) {
// Throw custom exception.
}
DatabaseHandler dbHandler = null;
dbHandler = new DatabaseHandler(databaseName, "root", "");
// log.info("USRNAME:: " + username);
try {
TableUtils.createTableIfNotExists(dbHandler.getConnectionSource(), UserClickDetails.class);
} catch (SQLException e) {
e.printStackTrace();
}
dbHandler.saveClickPositions(expertsId, position);
}
示例4: getFile6
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}/{p3}/{p4}/{p5}/{p6}")
public HttpResponse getFile6(@PathParam("p1") String p1, @PathParam("p2") String p2,
@PathParam("p3") String p3, @PathParam("p4") String p4,
@PathParam("p5") String p5, @PathParam("p6") String p6)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2).append("/");
sb.append(p3).append("/");
sb.append(p4).append("/");
sb.append(p5).append("/");
sb.append(p6);
return getHttpResponse(sb.toString());
}
示例5: getFile7
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}/{p3}/{p4}/{p5}/{p6}/{p7}")
public HttpResponse getFile7(@PathParam("p1") String p1, @PathParam("p2") String p2,
@PathParam("p3") String p3, @PathParam("p4") String p4,
@PathParam("p5") String p5, @PathParam("p6") String p6,
@PathParam("p7") String p7)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2).append("/");
sb.append(p3).append("/");
sb.append(p4).append("/");
sb.append(p5).append("/");
sb.append(p6).append("/");
sb.append(p7);
return getHttpResponse(sb.toString());
}
示例6: getFile8
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}/{p3}/{p4}/{p5}/{p6}/{p7}/{p8}")
public HttpResponse getFile8(@PathParam("p1") String p1, @PathParam("p2") String p2,
@PathParam("p3") String p3, @PathParam("p4") String p4,
@PathParam("p5") String p5, @PathParam("p6") String p6,
@PathParam("p7") String p7, @PathParam("p8") String p8)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2).append("/");
sb.append(p3).append("/");
sb.append(p4).append("/");
sb.append(p4).append("/");
sb.append(p5).append("/");
sb.append(p7).append("/");
sb.append(p8);
return getHttpResponse(sb.toString());
}
示例7: getFile9
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}/{p3}/{p4}/{p5}/{p6}/{p7}/{p8}/{p9}")
public HttpResponse getFile9(@PathParam("p1") String p1, @PathParam("p2") String p2,
@PathParam("p3") String p3, @PathParam("p4") String p4,
@PathParam("p5") String p5, @PathParam("p6") String p6,
@PathParam("p7") String p7, @PathParam("p8") String p8,
@PathParam("p9") String p9)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2).append("/");
sb.append(p3).append("/");
sb.append(p4).append("/");
sb.append(p5).append("/");
sb.append(p6).append("/");
sb.append(p7).append("/");
sb.append(p8).append("/");
sb.append(p9);
return getHttpResponse(sb.toString());
}
示例8: getFile10
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}/{p3}/{p4}/{p5}/{p6}/{p7}/{p8}/{p9}/{p10}")
public HttpResponse getFile10(@PathParam("p1") String p1, @PathParam("p2") String p2,
@PathParam("p3") String p3, @PathParam("p4") String p4,
@PathParam("p5") String p5, @PathParam("p6") String p6,
@PathParam("p7") String p7, @PathParam("p8") String p8,
@PathParam("p9") String p9, @PathParam("p10") String p10)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2).append("/");
sb.append(p3).append("/");
sb.append(p4).append("/");
sb.append(p5).append("/");
sb.append(p6).append("/");
sb.append(p7).append("/");
sb.append(p8).append("/");
sb.append(p9).append("/");
sb.append(p10);
return getHttpResponse(sb.toString());
}
示例9: getSwaggerApiDeclaration
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("api-docs/{tlr}")
@Produces(MediaType.APPLICATION_JSON)
@Summary("retrieve Swagger 1.2 API declaration for given top-level resource.")
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Swagger 1.2 compliant API declaration"),
@ApiResponse(code = 404, message = "Swagger API declaration not available due to missing annotations."), })
public HttpResponse getSwaggerApiDeclaration(@PathParam("tlr") String tlr) {
return RESTMapper.getSwaggerApiDeclaration(this.getClass(), tlr, epUrl);
}
示例10: getEvaluationResults
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
/**
*
* @param datasetId
* @param evaluationId
* @return
*/
@GET
@Path("datasets/{datasetId}/evaluations/{evaluationId}")
@ResourceListApi(description = "Get the evaluation results.")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.TEXT_PLAIN)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success") })
@Summary("Returns the evaluation metrics computed if requested when applying algorithms. Evaluation Id is retrieved after applying algorithm on the dataset.")
public HttpResponse getEvaluationResults(@PathParam("datasetId") String datasetId, @PathParam("evaluationId") String evaluationId) {
String databaseName = getDatabaseName(datasetId);
if (databaseName == null) {
try {
throw new ERSException(ExceptionMessages.DATABASE_NOT_FOUND);
} catch (ERSException e) {
e.printStackTrace();
}
}
log.info("evaluationId:: " + evaluationId);
DatabaseHandler dbHandler = null;
dbHandler = new DatabaseHandler(databaseName, "root", "");
String evaluationMeasures = dbHandler.getEvaluationMetrics(Long.parseLong(evaluationId));
HttpResponse res = new HttpResponse(evaluationMeasures);
res.setStatus(200);
return res;
}
示例11: getTags
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
/**
*
* @param datasetId
* @param expertCollectionId
* @param expertId
* @return
*/
@GET
@Path("datasets/{datasetId}/experts/{expertsCollectionId}/expert/{expertId}/tags")
@ResourceListApi(description = "Retrieves the related tags for the user")
@Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.TEXT_PLAIN)
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success"), @ApiResponse(code = 401, message = "Unauthorized") })
@Summary("Returns tags associated with experts for the specific post.")
public HttpResponse getTags(@PathParam("datasetId") String datasetId, @PathParam("expertsCollectionId") String expertCollectionId,
@PathParam("expertId") String expertId) {
String databaseName = getDatabaseName(datasetId);
if (databaseName == null) {
try {
throw new ERSException(ExceptionMessages.DATABASE_NOT_FOUND);
} catch (ERSException e) {
e.printStackTrace();
}
}
DatabaseHandler dbHandler = null;
dbHandler = new DatabaseHandler(databaseName, "root", "");
TagExtractor extractor = new TagExtractor(dbHandler, expertCollectionId, expertId);
HttpResponse res = new HttpResponse(extractor.getTags());
res.setStatus(200);
return res;
}
示例12: getPosts
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
/**
*
* @param datasetId
* @param expertCollectionId
* @param expertId
* @return
*/
@GET
@Path("datasets/{datasetId}/experts/{expertsCollectionId}/expert/{expertId}/posts")
@ResourceListApi(description = "Returns the related post of the expert.")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success") })
@Summary("Returns the related posts of the expert user.")
public HttpResponse getPosts(@PathParam("datasetId") String datasetId, @PathParam("expertsCollectionId") String expertCollectionId,
@PathParam("expertId") String expertId) {
String databaseName = getDatabaseName(datasetId);
if (databaseName == null) {
try {
throw new ERSException(ExceptionMessages.DATABASE_NOT_FOUND);
} catch (ERSException e) {
e.printStackTrace();
}
}
DatabaseHandler dbHandler = null;
dbHandler = new DatabaseHandler(databaseName, "root", "");
RelatedPostsExtractor extractor = new RelatedPostsExtractor(dbHandler, expertCollectionId, expertId);
HttpResponse res = new HttpResponse(extractor.getPosts());
res.setStatus(200);
return res;
}
示例13: getSwaggerApiDeclaration
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("api-docs/{tlr}")
@Produces(MediaType.APPLICATION_JSON)
public HttpResponse getSwaggerApiDeclaration(@PathParam("tlr") String tlr) {
// return RESTMapper.getSwaggerApiDeclaration(this.getClass(), tlr,
// "http://127.0.0.1:8080/ocd/");
return RESTMapper.getSwaggerApiDeclaration(this.getClass(), tlr, "https://api.learning-layers.eu/ers/");
}
示例14: getFile1
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}")
public HttpResponse getFile1(@PathParam("p1") String p1)
{
StringBuilder sb = new StringBuilder();
sb.append(p1);
return getHttpResponse(sb.toString());
}
示例15: getFile2
import i5.las2peer.restMapper.annotations.PathParam; //導入依賴的package包/類
@GET
@Path("{p1}/{p2}")
public HttpResponse getFile2(@PathParam("p1") String p1, @PathParam("p2") String p2)
{
StringBuilder sb = new StringBuilder();
sb.append(p1).append("/");
sb.append(p2);
return getHttpResponse(sb.toString());
}