Package com.google.gwt.dev.shell.remoteui

Examples of com.google.gwt.dev.shell.remoteui.RemoteMessageProto$Message$Response


  public void deleteAttachment(ERS3Attachment attachment)
      throws MalformedURLException, IOException {
    AWSAuthConnection conn = attachment.awsConnection();
    String bucket = attachment.bucket();
    String key = attachment.key();
    Response response = conn.delete(bucket, key, null);
    if (failed(response)) {
      throw new IOException("Failed to delete '" + bucket + "/" + key
          + "' to S3: Error " + response.connection.getResponseCode()
          + ": " + response.connection.getResponseMessage());
    }
View Full Code Here


          headers.put("Content-Disposition", Arrays
              .asList(new String[] { "attachment; filename="
                  + originalFileName }));
        }

        Response response = conn.putStream(bucket, key,
            attachmentStreamObject, headers);
        if (failed(response)) {
          throw new IOException("Failed to write '" + bucket + "/"
              + key + "' to S3: Error "
              + response.connection.getResponseCode() + ": "
View Full Code Here

    try {
      send_raw(q.build().toByteArray());
    } catch (IOException ex) {
      throw new RqlDriverException(ex.getMessage());
    }
    Response rsp = get();

    // For this version we only support success :-(
    switch(rsp.getType()) {
    case SUCCESS_ATOM:
    case SUCCESS_SEQUENCE:
    case SUCCESS_PARTIAL:
      return new RqlCursor(this,rsp);
    case CLIENT_ERROR:
    case COMPILE_ERROR:
    case RUNTIME_ERROR:
    default:
      throw new RqlDriverException(rsp.toString());             
    }             
  }
View Full Code Here

        ExecuteMethod executeMethod = new ExecuteMethod();
        executeMethod.setParameters(parameters);
        executeMethod.setUrl(path);
        executeMethod.setHttpMethod(methodName);

        Response response = method.getResponse();
        if (response != null) {
            Representation representation = response.getRepresentation();
            if (representation != null) {
                String mediaType = representation.getMediaType();
                executeMethod.setResponseType(mediaType);
            }
        }
View Full Code Here

    // verify correctness
    Assert.assertEquals("server content length unequal", contents.length, req.getContent().length);
    Assert.assertTrue("server contents do not match", Arrays.equals(contents, req.getContent()));

    // echo message back to client
    final Response rsp = new Response();
    rsp.setPayload(contents);
    Assert.assertTrue(Arrays.equals(contents, rsp.getPayload()));
    handler.sendResponse(rsp, req);

    // read out message at client
    final byte[] msg1 = readInputStream(in, true);
    Assert.assertTrue("zero-length message", msg1.length > 0);
View Full Code Here

    // verify correctness
    Assert.assertEquals("server content length unequal", contents.length, req.getContent().length);
    Assert.assertTrue("server contents do not match", Arrays.equals(contents, req.getContent()));

    // echo message back to client
    final Response rsp = new Response();
    rsp.setPayload(contents);
    Assert.assertTrue(Arrays.equals(contents, rsp.getPayload()));
    handler.sendResponse(rsp, req);
    // handler.sendResponse(rsp, req);

    // read out message at client
    final byte[] msg1 = readInputStream(in, true);
View Full Code Here

                    "This encoder can decode only Netty Messages.");
        }

        for (;;) {
            ByteBuffer buf = ByteBuffer.allocate(8192);
            Message m = (Message) message;
            try {
                if (m.write(buf.buf())) {
                    break;
                }
            } finally {
                buf.flip();
                if (buf.hasRemaining()) {
View Full Code Here

    public void decode(IoSession session, ByteBuffer in,
            ProtocolDecoderOutput out) throws Exception {
        put(in);

        Message m = readingMessage;
        try {
            for (;;) {
                readBuf.flip();
                if (m == null) {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try {
                        m = recognizer.recognize(readBuf);
                        failed = false;
                    } finally {
                        if (failed) {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        } else {
                            if (m == null) {
                                readBuf.limit(readBuf.capacity());
                                readBuf.position(limit);
                                break; // finish decoding
                            } else {
                                // reset buffer for read
                                readBuf.limit(limit);
                                readBuf.position(0);
                            }
                        }
                    }
                }

                if (m != null) {
                    try {
                        if (m.read(readBuf)) {
                            out.write(m);
                            m = null;
                        } else {
                            break;
                        }
View Full Code Here

        }

        for( ;; )
        {
            ByteBuffer buf = ByteBuffer.allocate( 8192 );
            Message m = ( Message ) message;
            try
            {
                if( m.write( buf.buf() ) )
                {
                    break;
                }
            }
            finally
View Full Code Here

    public void decode( IoSession session, ByteBuffer in, ProtocolDecoderOutput out ) throws Exception
    {
        put( in );

        Message m = readingMessage;
        try
        {
            for( ;; )
            {
                readBuf.flip();
                if( m == null )
                {
                    int limit = readBuf.limit();
                    boolean failed = true;
                    try
                    {
                        m = recognizer.recognize( readBuf );
                        failed = false;
                    }
                    finally
                    {
                        if( failed )
                        {
                            // clear the read buffer if failed to recognize
                            readBuf.clear();
                            break;
                        }
                        else
                        {
                            if( m == null )
                            {
                                readBuf.limit( readBuf.capacity() );
                                readBuf.position( limit );
                                break; // finish decoding
                            }
                            else
                            {
                                // reset buffer for read
                                readBuf.limit( limit );
                                readBuf.position( 0 );
                            }
                        }
                    }
                }

                if( m != null )
                {
                    try
                    {
                        if( m.read( readBuf ) )
                        {
                            out.write( m );
                            m = null;
                        } else {
                            break;
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.shell.remoteui.RemoteMessageProto$Message$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.