Class MongoDbResource


  • @Path("/mongodb")
    @ApplicationScoped
    public class MongoDbResource
    extends Object
    • Field Detail

      • producerTemplate

        @Inject
        org.apache.camel.ProducerTemplate producerTemplate
      • camelContext

        @Inject
        org.apache.camel.CamelContext camelContext
      • results

        @Inject
        @Named("results")
        Map<String,​List<org.bson.Document>> results
    • Constructor Detail

      • MongoDbResource

        public MongoDbResource()
    • Method Detail

      • writeToCollection

        @POST
        @Path("/collection/{collectionName}")
        @Consumes("application/json")
        public javax.ws.rs.core.Response writeToCollection​(@PathParam("collectionName")
                                                           String collectionName,
                                                           String content,
                                                           @HeaderParam("mongoClientName")
                                                           String mongoClientName)
                                                    throws URISyntaxException
        Throws:
        URISyntaxException
      • getCollection

        @GET
        @Path("/collection/{collectionName}")
        @Produces("application/json")
        public javax.json.JsonArray getCollection​(@PathParam("collectionName")
                                                  String collectionName,
                                                  @HeaderParam("mongoClientName")
                                                  String mongoClientName)
      • getCollectionAsList

        @GET
        @Path("/collectionAsList/{collectionName}")
        @Produces("application/json")
        public List getCollectionAsList​(@PathParam("collectionName")
                                        String collectionName,
                                        @HeaderParam("mongoClientName")
                                        String mongoClientName)
      • searchByNameAsDocument

        @GET
        @Path("/searchByNameAsDocument/{collectionName}/{name}")
        @Produces("application/json")
        public org.bson.Document searchByNameAsDocument​(@PathParam("collectionName")
                                                        String collectionName,
                                                        @PathParam("name")
                                                        String name,
                                                        @HeaderParam("mongoClientName")
                                                        String mongoClientName)
      • dynamic

        @POST
        @Path("/collection/dynamic/{collectionName}")
        @Consumes("application/json")
        @Produces("application/json")
        public Object dynamic​(@PathParam("collectionName")
                              String collectionName,
                              String content,
                              @HeaderParam("mongoClientName")
                              String mongoClientName,
                              @HeaderParam("dynamicOperation")
                              String operation)
                       throws URISyntaxException
        Throws:
        URISyntaxException
      • restartRoute

        @GET
        @Path("/route/{routeId}/{operation}")
        @Produces("text/plain")
        public String restartRoute​(@PathParam("routeId")
                                   String routeId,
                                   @PathParam("operation")
                                   String operation)
                            throws Exception
        Throws:
        Exception
      • getResults

        @GET
        @Path("/results/{resultId}")
        @Produces("application/json")
        public Map getResults​(@PathParam("resultId")
                              String resultId)
      • resetResults

        @GET
        @Path("/resultsReset/{resultId}")
        public void resetResults​(@PathParam("resultId")
                                 String resultId)
      • convertMapToDocument

        @Path("/convertMapToDocument")
        @POST
        @Consumes("application/json")
        @Produces("application/json")
        public Map convertMapToDocument​(Map input)
      • convertMapToDocument

        @Path("/convertAnyObjectToDocument")
        @POST
        @Consumes("text/plain")
        @Produces("application/json")
        public Map convertMapToDocument​(String input)