bda-controller/src/main/java/gr/ntua/ece/cslab/selis/bda/controller/resources/ConnectorResource.java
@POST
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response createNewConnector(Connector connector) {
        LOGGER.log(Level.INFO, connector.toString());

        String details = "";
        try {
            connector.save();
            details = Integer.toString(connector.getId());
        } catch (Exception e) {
            e.printStackTrace();

            return Response.serverError().entity(
                    new RequestResponse("ERROR", "Could not register new Connector.")
            ).build();
        }

        return Response.ok(
                new RequestResponse("OK", details)
        ).build();
    }
/**
     * Create new SCN Connector.
     * @param connector a Connector description.
     */
Create new SCN Connector.
@param connector a Connector description.
Create new SCN Connector . @param connector a Connector description .
@POST
    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response createNewConnector(Connector connector) {
        LOGGER.log(Level.INFO, connector.toString());
        String details = "";
        try {
            connector.save();
            details = Integer.toString(connector.getId());
        } catch (Exception e) {
            e.printStackTrace();
            return Response.serverError().entity(
                    new RequestResponse("ERROR", "Could not register new Connector.")
            ).build();
        }
        return Response.ok(
                new RequestResponse("OK", details)
        ).build();
    }
@ POST @ Consumes ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) @ Produces ( { MediaType . APPLICATION_JSON , MediaType . APPLICATION_XML } ) public Response createNewConnector ( Connector connector ) { LOGGER . log ( Level . INFO , connector . toString ( ) ) ; String details = "" ; try { connector . save ( ) ; details = Integer . toString ( connector . getId ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return Response . serverError ( ) . entity ( new RequestResponse ( "ERROR" , "Could not register new Connector." ) ) . build ( ) ; } return Response . ok ( new RequestResponse ( "OK" , details ) ) . build ( ) ; }
Create new SCN Connector.
Create new SCN Connector .