Package org.jgroups.protocols

Examples of org.jgroups.protocols.S3_PING$S3Object


   }

   private S3Object wrap(Map map) throws Exception
   {
      byte[] b = getMarshaller().objectToByteBuffer(map);
      return new S3Object(b);
   }
View Full Code Here


   }

   private S3Object wrap(Map map) throws Exception
   {
      byte[] b = getMarshaller().objectToByteBuffer(map);
      return new S3Object(b);
   }
View Full Code Here

   }

   private S3Object wrap(Map map) throws Exception
   {
      byte[] b = getMarshaller().objectToByteBuffer(map);
      return new S3Object(b);
   }
View Full Code Here

  @Override
  protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    Entry e = entry(req);
    S3Object remove = map.remove(e);
    if (remove == null) {
      resp.sendError(404, "Not found " + e);
    } else {
      resp.sendError(HttpURLConnection.HTTP_NO_CONTENT, "Deleted");
    }
View Full Code Here

    if ("/".equals(uri.getPath())) {
      list(req, resp);
    } else {
      String key = uri.getPath().substring(1);
      Entry e = new Entry(key);
      S3Object obj = map.get(e);
        if (debug)
          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
        return;
      }
      Headers h = new Headers();
      h = h.mergeMetadata(obj.getMetadata());
      for (Map.Entry<String, List<String>> me : h.getHeaders().entrySet()) {
        for (String v : me.getValue()) {
          resp.setHeader(me.getKey(), v);
        }
      }
      resp.getOutputStream().write(obj.getData());
    }

  }
View Full Code Here

        int len = is.read(b);
        if (len == -1)
          break;
        os.write(b, 0, len);
      }
      S3Object s3 = new S3Object(os.toByteArray());
      map.put(e, s3);
      Headers h = new Headers();
      @SuppressWarnings("unchecked")
      Enumeration<String> names = req.getHeaderNames();
      for (String n : Collections.list(names))
        h.put(n, req.getHeader(n));
      s3.setMetadata(h.extractMetadata());
      log("put '" + e + "' as: " + s3);
    }
  }
View Full Code Here

TOP

Related Classes of org.jgroups.protocols.S3_PING$S3Object

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.