Package org.jgroups.protocols

Examples of org.jgroups.protocols.S3_PING$ListAllMyBucketsResponse


    request.setSignature(listAllMyBuckets.getSignature());
    return request;
  }
 
  public static ListAllMyBucketsResponse toListAllMyBucketsResponse(S3ListAllMyBucketsResponse engineResponse) {
    ListAllMyBucketsResponse response = new ListAllMyBucketsResponse();
    ListAllMyBucketsResult result = new ListAllMyBucketsResult();
    ListAllMyBucketsEntry[] entries = null;
   
    S3CanonicalUser ownerEngine = engineResponse.getOwner();
    CanonicalUser owner = new CanonicalUser();
    owner.setID(ownerEngine.getID());
    owner.setDisplayName(ownerEngine.getDisplayName());
    result.setOwner(owner);
    S3ListAllMyBucketsEntry[] engineEntries = engineResponse.getBuckets();
    if (engineEntries != null) {
      entries = new ListAllMyBucketsEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new ListAllMyBucketsEntry();
        entries[i].setName(engineEntries[i].getName());
        entries[i].setCreationDate(engineEntries[i].getCreationDate());   //setTimeZone(TimeZone.getTimeZone("Z"));
      }

      ListAllMyBucketsList list = new ListAllMyBucketsList();
        list.setBucket(entries);
        result.setBuckets(list);
    }
    response.setListAllMyBucketsResponse(result);
    return response;
  }
View Full Code Here


        S3ListAllMyBucketsResponse engineResponse = ServiceProvider
                .getInstance().getS3Engine().handleRequest(engineRequest);

        // To allow the all buckets list to be serialized via Axiom classes
        ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation
                .toListAllMyBucketsResponse(engineResponse);

        OutputStream outputStream = response.getOutputStream();
        response.setStatus(200);
        response.setContentType("application/xml");
View Full Code Here

        engineRequest.setSignature("");

        S3ListAllMyBucketsResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);

        // To allow the all buckets list to be serialized via Axiom classes
        ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation.toListAllMyBucketsResponse(engineResponse);

        OutputStream outputStream = response.getOutputStream();
        response.setStatus(200);
        response.setContentType("application/xml");
        // The content-type literally should be "application/xml; charset=UTF-8"
View Full Code Here

        request.setSignature(listAllMyBuckets.getSignature());
        return request;
    }

    public static ListAllMyBucketsResponse toListAllMyBucketsResponse(S3ListAllMyBucketsResponse engineResponse) {
        ListAllMyBucketsResponse response = new ListAllMyBucketsResponse();
        ListAllMyBucketsResult result = new ListAllMyBucketsResult();
        ListAllMyBucketsEntry[] entries = null;

        S3CanonicalUser ownerEngine = engineResponse.getOwner();
        CanonicalUser owner = new CanonicalUser();
        owner.setID(ownerEngine.getID());
        owner.setDisplayName(ownerEngine.getDisplayName());
        result.setOwner(owner);
        S3ListAllMyBucketsEntry[] engineEntries = engineResponse.getBuckets();
        if (engineEntries != null) {
            entries = new ListAllMyBucketsEntry[engineEntries.length];
            for (int i = 0; i < engineEntries.length; i++) {
                entries[i] = new ListAllMyBucketsEntry();
                entries[i].setName(engineEntries[i].getName());
                entries[i].setCreationDate(engineEntries[i].getCreationDate());   //setTimeZone(TimeZone.getTimeZone("Z"));
            }

            ListAllMyBucketsList list = new ListAllMyBucketsList();
            list.setBucket(entries);
            result.setBuckets(list);
        }
        response.setListAllMyBucketsResponse(result);
        return response;
    }
View Full Code Here

    request.setSignature(listAllMyBuckets.getSignature());
    return request;
  }
 
  public static ListAllMyBucketsResponse toListAllMyBucketsResponse(S3ListAllMyBucketsResponse engineResponse) {
    ListAllMyBucketsResponse response = new ListAllMyBucketsResponse();
    ListAllMyBucketsResult result = new ListAllMyBucketsResult();
    ListAllMyBucketsEntry[] entries = null;
   
    S3CanonicalUser ownerEngine = engineResponse.getOwner();
    CanonicalUser owner = new CanonicalUser();
    owner.setID(ownerEngine.getID());
    owner.setDisplayName(ownerEngine.getDisplayName());
    result.setOwner(owner);
    S3ListAllMyBucketsEntry[] engineEntries = engineResponse.getBuckets();
    if (engineEntries != null) {
      entries = new ListAllMyBucketsEntry[engineEntries.length];
      for(int i = 0; i < engineEntries.length; i++) {
        entries[i] = new ListAllMyBucketsEntry();
        entries[i].setName(engineEntries[i].getName());
        entries[i].setCreationDate(engineEntries[i].getCreationDate());
      }

      ListAllMyBucketsList list = new ListAllMyBucketsList();
        list.setBucket(entries);
        result.setBuckets(list);
    }
    response.setListAllMyBucketsResponse(result);
    return response;
  }
View Full Code Here

    engineRequest.setSignature( "" );

    S3ListAllMyBucketsResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
   
    // -> serialize using the apache's Axiom classes
    ListAllMyBucketsResponse allBuckets = S3SoapServiceImpl.toListAllMyBucketsResponse( engineResponse );

    OutputStream os = response.getOutputStream();
    response.setStatus(200)
      response.setContentType("text/xml; charset=UTF-8");
    XMLStreamWriter xmlWriter = xmlOutFactory.createXMLStreamWriter( os );
    String documentStart = new String( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" );
    os.write( documentStart.getBytes());
    MTOMAwareXMLSerializer MTOMWriter = new MTOMAwareXMLSerializer( xmlWriter );
        allBuckets.serialize( new QName( "http://s3.amazonaws.com/doc/2006-03-01/", "ListAllMyBucketsResponse", "ns1" ), factory, MTOMWriter );
        xmlWriter.flush();
        xmlWriter.close();
        os.close();
  }
View Full Code Here

  S3ListAllMyBucketsResponse engineResponse = ServiceProvider
    .getInstance().getS3Engine().handleRequest(engineRequest);

  // To allow the all buckets list to be serialized via Axiom classes
  ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation
    .toListAllMyBucketsResponse(engineResponse);

  OutputStream outputStream = response.getOutputStream();
  response.setStatus(200);
  response.setContentType("application/xml");
View Full Code Here

        S3ListAllMyBucketsResponse engineResponse = ServiceProvider
                .getInstance().getS3Engine().handleRequest(engineRequest);

        // To allow the all buckets list to be serialized via Axiom classes
        ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation
                .toListAllMyBucketsResponse(engineResponse);

        OutputStream outputStream = response.getOutputStream();
        response.setStatus(200);
        response.setContentType("application/xml");
View Full Code Here

TOP

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

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.