Codota Logo
HTTPResponder
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
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

/**
 *
 * @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

@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());
        });
    
  }
}
origin: oci-pronghorn/GreenLightning

public ExternalResponse(GreenRuntime runtime) {
  responder = new HTTPResponder(runtime.newCommandChannel(), 300);	
}
origin: oci-pronghorn/GreenLightning

@Override
public boolean message(CharSequence topic, ChannelReader payload) {
  return responder.readHandoffData(payload);
}
origin: oci-pronghorn/GreenLightning

clearAll();
clearAll();				
if (publishCanceledResponse()) {
  clearAll();
  return true;
} else {
origin: oci-pronghorn/GreenLightning

public HTTPResponder(MsgCommandChannel<?> commandChannel, int maximumPayloadSize) {
  clearAll();
  
  int maximumMessages = 4;
  this.responseService = commandChannel.newHTTPResponseService(maximumMessages, maximumPayloadSize);
      
}
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

public RestBehaviorHandoffResponder(GreenRuntime runtime, AppendableProxy console) {
  
  responder = new HTTPResponder(runtime.newCommandChannel(),256*1024);
      
}
origin: oci-pronghorn/GreenLightning

private boolean publishCanceledResponse() {
  //send the cancel response....
  if (responseService.publishHTTPResponse(
      connectionId, sequenceCode, 
      cancelStatusCode, false, cancelHeaderWritable,                      
      cancelType, cancelPayload)) {
    
    //keep in case we see it again.
    lastCancelledConnectionId = connectionId;
    
    clearAll();
    return true;
  } else {
    return false;
  }
}
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

public RestBehaviorHandoffResponder(GreenRuntime runtime, AppendableProxy console) {
  
  responder = new HTTPResponder(runtime.newCommandChannel(), 256*1024);
      
}
origin: oci-pronghorn/GreenLightning

                    statusCode, hasContinuation, headers,                      
                    contentType, writable)) {
  clearAll();
  return true;
} else {
                  statusCode, hasContinuation, 
                  contentType, writable)) {
    clearAll();
    return true;
} else {
com.ociweb.gl.apiHTTPResponder

Most used methods

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

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now