Tabnine Logo
HTTPResponder.respondWith
Code IndexAdd Tabnine to your IDE (free)

How to use
respondWith
method
in
com.ociweb.gl.api.HTTPResponder

Best Java code snippets using com.ociweb.gl.api.HTTPResponder.respondWith (Showing top 5 results out of 315)

origin: oci-pronghorn/GreenLightning

/**
 *
 * @param statusCode int arg used in commandChannel.publishHTTPResponse
 * @param hasContinuation boolean arg
 * @param contentType HTTPContentType arg used in commandChannel.publishHTTPResponse
 * @param writable Writable arg used in commandChannel.publishHTTPResponse
 * @return publishResult if connectionId GTE 0 AND sequenceCode GTE 0 <p> <code>false</code> if Pipe.hasContentToRead(pipe) else <code>true</code>
 */
public boolean respondWith(int statusCode, boolean hasContinuation, 
             HTTPContentType contentType, Writable writable) {
  return respondWith(statusCode, hasContinuation, null, contentType, writable);
}
origin: oci-pronghorn/GreenLightning

public boolean respondWith(boolean hasContinuation, HeaderWritable headers, HTTPContentType contentType, Writable writable) {
  return respondWith(200,hasContinuation,headers,contentType,writable);
}

origin: oci-pronghorn/GreenLightning

@Override
public boolean message(CharSequence topic, ChannelReader payload) {
  
  if (responder.readHandoffData(payload)) {
    return responder.respondWith(200, false, HTTPContentTypeDefaults.TXT, (w)->{w.writeUTF("sent by responder");});
  } else {
    return false;
  }
  
}

origin: oci-pronghorn/GreenLightning

@Override
public boolean message(CharSequence topic, ChannelReader payload) {
  
  boolean result = responder.readHandoffData(payload);
  if (result) {
    responder.respondWith(200, false, HTTPContentTypeDefaults.TXT, (w)->{w.writeUTF8Text("sent by responder");});
  }
  
  return result;
}

origin: oci-pronghorn/GreenLightning

@Override
public boolean responseHTTP(HTTPResponseReader reader) {
  if (reader.isConnectionClosed()) {
    return responder.closed();			
  } else {
    return responder.respondWith(200, !reader.isEndOfResponse(),

        (headWriter) -> {
          reader.structured().visit(HTTPHeader.class, (header,r,id)->{
            //we are a proxy, our response has its own length, connection and status
            if (header != HTTPHeaderDefaults.CONTENT_LENGTH 
              && header != HTTPHeaderDefaults.CONNECTION
              && header != HTTPHeaderDefaults.STATUS ) {                                
              headWriter.write(header, reader.getSpec(), r);
            }
          });
        },
        reader.contentType(), 
        (payloadWriter) -> {
          payloadWriter.write(reader.structured().readPayload());
        });
    
  }
}
com.ociweb.gl.apiHTTPResponderrespondWith

Popular methods of HTTPResponder

  • <init>
  • readHandoffData
  • clearAll
  • closed
  • publishCanceledResponse

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Option (scala)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now