Package com.couchace.core.api.http

Examples of com.couchace.core.api.http.CouchStatusCode


            WebTarget webTarget = newWebTarget(databaseName);
            Response response = webTarget.request(MediaType.APPLICATION_JSON_TYPE)
                .put(entity);

            CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
            String eTag = getETag(response);
            byte[] content = response.readEntity(byte[].class);
            CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());
            int contentLength = response.getLength();
            return CouchHttpResponse.builder(CouchMethodType.PUT, webTarget.getUri(), statusCode)
View Full Code Here


    public CouchHttpResponse deleteDatabase(String databaseName) {
        try {
            WebTarget webTarget = newWebTarget(databaseName);
            Response response = webTarget.request().delete();

            CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
            String eTag = getETag(response);
            byte[] content = response.readEntity(byte[].class);
            CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());
            int contentLength = response.getLength();
            return CouchHttpResponse.builder(CouchMethodType.DELETE, webTarget.getUri(), statusCode)
View Full Code Here

        }
        return eTag;
    }

    protected CouchHttpResponse buildCouchResponse(HttpRequest request, URI uri, Response response, String documentId) {
        CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
        String eTag = getETag(response);
        CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());

        Object content;
        if (mediaType.isTextType()) {
View Full Code Here

            WebTarget webTarget = newWebTarget(databaseName);
            Response response = webTarget.request(MediaType.APPLICATION_JSON_TYPE)
                .put(entity);

            CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
            String eTag = getETag(response);
            byte[] content = response.readEntity(byte[].class);
            CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());
            int contentLength = response.getLength();
            return CouchHttpResponse.builder(CouchMethodType.PUT, webTarget.getUri(), statusCode)
View Full Code Here

    public CouchHttpResponse deleteDatabase(String databaseName) {
        try {
            WebTarget webTarget = newWebTarget(databaseName);
            Response response = webTarget.request().delete();

            CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
            String eTag = getETag(response);
            byte[] content = response.readEntity(byte[].class);
            CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());
            int contentLength = response.getLength();
            return CouchHttpResponse.builder(CouchMethodType.DELETE, webTarget.getUri(), statusCode)
View Full Code Here

        }
        return eTag;
    }

    protected CouchHttpResponse buildCouchResponse(HttpRequest request, URI uri, Response response, String documentId) {
        CouchStatusCode statusCode = CouchStatusCode.findByCode(response.getStatus());
        String eTag = getETag(response);
        CouchMediaType mediaType = CouchMediaType.fromString(response.getMediaType().toString());

        Object content;
        if (mediaType.isTextType()) {
View Full Code Here

TOP

Related Classes of com.couchace.core.api.http.CouchStatusCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.