bda-controller/src/main/java/gr/ntua/ece/cslab/selis/bda/controller/resources/DatastoreResource.java
@POST
    @Path("{slug}")
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(@PathParam("slug") String slug,
                           Message m) {
        LOGGER.log(Level.INFO, m.toString());
        try {
            new StorageBackend(slug).insert(m);
        } catch (Exception e) {
            e.printStackTrace();
            return Response.serverError().entity(
                    new RequestResponse("ERROR", "Could not insert new message.")
            ).build();
        }
        return Response.ok(
                new RequestResponse("OK", "")
        ).build();
    }
/**
     * Message insertion method
     * @param m the message to insert
     */
Message insertion method
@param m the message to insert
Message insertion method @param m the message to insert
@POST
    @Path("{slug}")
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response insert(@PathParam("slug") String slug,
                           Message m) {
        LOGGER.log(Level.INFO, m.toString());
        try {
            new StorageBackend(slug).insert(m);
        } catch (Exception e) {
            e.printStackTrace();
            return Response.serverError().entity(
                    new RequestResponse("ERROR", "Could not insert new message.")
            ).build();
        }
        return Response.ok(
                new RequestResponse("OK", "")
        ).build();
    }
@ POST @ Path ( "{slug}" ) @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response insert ( @ PathParam ( "slug" ) String slug , Message m ) { LOGGER . log ( Level . INFO , m . toString ( ) ) ; try { new StorageBackend ( slug ) . insert ( m ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return Response . serverError ( ) . entity ( new RequestResponse ( "ERROR" , "Could not insert new message." ) ) . build ( ) ; } return Response . ok ( new RequestResponse ( "OK" , "" ) ) . build ( ) ; }
Message insertion method
 @param m the message to insert
Message insertion method @param m the message to insert