Package com.dbxml.labrador

Examples of com.dbxml.labrador.Response


         boolean restHandler = handler instanceof RESTHandler;
         boolean httpEndpoint = endpoint instanceof HTTPServerBase;

         if ( restHandler && httpEndpoint ) {
            Request request = context.getRequest();
            Response response = context.getResponse();

            RecordMetaData meta = col.getRecordMetaData(tx, key);
            if ( meta != null ) {
               Long lm = (Long)meta.getValue(RecordMetaData.MODIFIED);
               if ( lm != null ) {
                  String lastModified = GDF.format(new Date(lm.longValue()));

                  response.setHeader(HTTP.HEADER_CACHE_CONTROL, HTTP.VALUE_CACHE);
                  response.setHeader(HTTP.HEADER_LAST_MODIFIED, lastModified);

                  String since = request.getHeader(HTTP.HEADER_IF_MODIFIED_SINCE);
                  if ( since != null && since.length() > 0 && since.equals(lastModified) )
                     throw new HTTPException(HTTP.CODE_NOT_MODIFIED, HTTP.STATUS_NOT_MODIFIED);
               }
View Full Code Here


         // Connect to the server and make the request
         conn.connect();

         // Yank some reponse headers from the server and pass them through
         if ( browserClient ) {
            Response response = context.getResponse();

            for ( int i = 0; i < PASSTHRU_RESPONSE_HEADERS.length; i++ ) {
               String key = PASSTHRU_RESPONSE_HEADERS[i];
               String value = conn.getHeaderField(key);
               if ( value != null && value.length() > 0 ) {
                  response.setHeader(key, value);
                  if ( key == HTTP.HEADER_LAST_MODIFIED ) {
                     lastMod = value;
                     response.setHeader(HTTP.HEADER_CACHE_CONTROL, HTTP.VALUE_CACHE);
                  }
               }
            }

            // If we get a doc that hasn't been modified just short curcuit
View Full Code Here

TOP

Related Classes of com.dbxml.labrador.Response

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.