org.jclouds.blobstore.BlobStore.getContext()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中org.jclouds.blobstore.BlobStore.getContext()方法的一些代码示例,展示了BlobStore.getContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlobStore.getContext()方法的具体详情如下:
包路径:org.jclouds.blobstore.BlobStore
类名称:BlobStore
方法名:getContext

BlobStore.getContext介绍

暂无

代码示例

代码示例来源:origin: rackerlabs/blueflood

public void close() throws IOException {
  Closeables.close(blobStore.getContext(), true);
}

代码示例来源:origin: gaul/s3proxy

private static String getBlobStoreType(BlobStore blobStore) {
  return blobStore.getContext().unwrap().getProviderMetadata().getId();
}

代码示例来源:origin: gaul/s3proxy

blobStore.getContext().utils().date()
    .iso8601DateFormat(creationDate).trim());

代码示例来源:origin: gaul/s3proxy

blobStore.getContext().utils().date()
    .iso8601DateFormat(new Date()));

代码示例来源:origin: jclouds/legacy-jclouds

@AfterClass
  void close() {
   if (blobstore != null)
     Closeables.closeQuietly(blobstore.getContext());
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

@AfterMethod
void close() {
 Closeables.closeQuietly(blobstore.getContext());
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
  public void updateOnRemoved(BlobStore blobStore) {
   for (String cacheKey : ServiceHelper.findCacheKeysForService(blobStore)) {
    cache.removeAll(blobStore.getContext().unwrap().getId());
   }
  }
}

代码示例来源:origin: apache/jclouds

@AfterClass
  void close() {
   if (blobstore != null)
     Closeables2.closeQuietly(blobstore.getContext());
  }
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
  protected Object doExecute() throws Exception {
   BlobStore blobStore = getBlobStore();

   for (String container : containerNames) {
     blobStore.deleteContainer(container);
     cacheProvider.getProviderCacheForType("container").remove(blobStore.getContext().unwrap().getId(),
         container);
   }
   return null;
  }
}

代码示例来源:origin: org.apache.jclouds.karaf/commands

@Override
  protected Object doExecute() throws Exception {
   BlobStore blobStore = getBlobStore();
   for (String blobName : blobNames) {
     blobStore.removeBlob(container, blobName);
     cacheProvider.getProviderCacheForType("blob").remove(blobStore.getContext().unwrap().getId(),
         blobName);
   }
   return null;
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignRemoveBlob() {
 BlobStore removeBlob = requestsSendResponses(init());
 assertEquals(removeBlob.getContext().getSigner().signRemoveBlob(container, name), removeBlob());
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignGetBlobWithOptions() {
 BlobStore getBlobWithOptions = requestsSendResponses(init());
 assertEquals(getBlobWithOptions.getContext().getSigner().signGetBlob(container, name, options),
    getBlobWithOptions());
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignGetBlob() {
 BlobStore getBlob = requestsSendResponses(init());
 assertEquals(getBlob.getContext().getSigner().signGetBlob(container, name), getBlob());
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignGetBlobWithTime() {
 BlobStore getBlobWithTime = requestsSendResponses(init());
 HttpRequest compare = getBlobWithTime();
 assertEquals(getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 3l /* seconds */),
    compare);
}

代码示例来源:origin: org.apache.james/blob-objectstorage

@AfterEach
void tearDown() throws Exception {
  blobStore.deleteContainer(containerName.value());
  blobStore.getContext().close();
}

代码示例来源:origin: apache/jclouds

@Override
@Test
public void testSignGetBlobWithTime() {
 BlobStore getBlobWithTime = requestsSendResponses(init());
 HttpRequest compare = getBlobWithTime();
 HttpRequest request = getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 900L /* seconds */);
 compareRequestComponents(request, compare);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignPutBlobWithTime() throws Exception {
 BlobStore signPutBloblWithTime = requestsSendResponses(init());
 Blob blob = signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();
 HttpRequest compare = putBlobWithTime();
 compare.setPayload(blob.getPayload());
 assertEquals(signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 3l /* seconds */),
    compare);
}

代码示例来源:origin: jclouds/legacy-jclouds

@Test
public void testSignPutBlob() throws Exception {
 BlobStore signPutBlob = requestsSendResponses(init());
 Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2l).contentMD5(new byte[] { 0, 2, 4, 8 })
    .contentType("text/plain").expires(new Date(1000)).build();
 HttpRequest compare = putBlob();
 compare.setPayload(blob.getPayload());
 assertEquals(signPutBlob.getContext().getSigner().signPutBlob(container, blob), compare);
}

代码示例来源:origin: apache/jclouds

@Test
public void testSignPutBlob() throws Exception {
 HashCode hashCode = HashCode.fromBytes(new byte[16]);
 BlobStore signPutBlob = requestsSendResponses(init());
 Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2L).contentMD5(hashCode)
    .contentType("text/plain").expires(new Date(1000)).build();
 HttpRequest compare = putBlob();
 compare.setPayload(blob.getPayload());
 assertEquals(signPutBlob.getContext().getSigner().signPutBlob(container, blob), compare);
}

代码示例来源:origin: apache/jclouds

@Override
@Test
public void testSignPutBlobWithTime() throws Exception {
 BlobStore signPutBloblWithTime = requestsSendResponses(init());
 Blob blob = signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();
 HttpRequest compare = putBlobWithTime();
 compare.setPayload(blob.getPayload());
 HttpRequest request = signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 900L /* seconds */);
 compareRequestComponents(request, compare);
 assertEquals(request.getPayload(), compare.getPayload());
}

相关文章