org.jclouds.karaf.commands.blobstore
Class BlobStoreCommandSupport

java.lang.Object
  extended by org.apache.karaf.shell.console.AbstractAction
      extended by org.apache.karaf.shell.console.OsgiCommandSupport
          extended by org.jclouds.karaf.commands.blobstore.BlobStoreCommandSupport
All Implemented Interfaces:
org.apache.felix.gogo.commands.Action, org.apache.karaf.shell.console.BundleContextAware
Direct Known Subclasses:
BlobCreateCommand, BlobDeleteCommand, BlobListCommand, BlobReadCommand, BlobStoreListCommand, BlobWriteCommand

public abstract class BlobStoreCommandSupport
extends org.apache.karaf.shell.console.OsgiCommandSupport

Author:
iocanel

Field Summary
protected  String provider
           
static String PROVIDERFORMAT
           
 
Fields inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
bundleContext, usedReferences
 
Fields inherited from class org.apache.karaf.shell.console.AbstractAction
log, session
 
Constructor Summary
BlobStoreCommandSupport()
           
 
Method Summary
 Set<String> getBlobCache()
           
 InputStream getBlobInputStream(String containerName, String blobName)
          Returns an InputStream to a Blob.
protected  org.jclouds.blobstore.BlobStore getBlobStore()
           
protected  List<org.jclouds.blobstore.BlobStore> getBlobStoreServices()
           
 Set<String> getContainerCache()
           
protected  void printBlobStoreProviders(List<org.jclouds.blobstore.BlobStore> blobStores, String indent, PrintStream out)
           
 Object read(String containerName, String blobName)
          Reads an Object from the blob store.
 byte[] readFromUrl(URL url)
          Reads a bye[] from a URL.
 void setBlobCache(Set<String> blobCache)
           
 void setBlobStoreServices(List<org.jclouds.blobstore.BlobStore> services)
           
 void setContainerCache(Set<String> containerCache)
           
 byte[] toBytes(Object object)
           
 void write(String bucket, String blobName, InputStream is)
          Writes to the Blob using an InputStream.
 void write(String containerName, String blobName, Object object)
          Writes to the Blob by serializing an Object.
 
Methods inherited from class org.apache.karaf.shell.console.OsgiCommandSupport
execute, getAllServices, getBundleContext, getService, setBundleContext, ungetServices
 
Methods inherited from class org.apache.karaf.shell.console.AbstractAction
doExecute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDERFORMAT

public static final String PROVIDERFORMAT
See Also:
Constant Field Values

provider

protected String provider
Constructor Detail

BlobStoreCommandSupport

public BlobStoreCommandSupport()
Method Detail

setBlobStoreServices

public void setBlobStoreServices(List<org.jclouds.blobstore.BlobStore> services)

getBlobStoreServices

protected List<org.jclouds.blobstore.BlobStore> getBlobStoreServices()

getBlobStore

protected org.jclouds.blobstore.BlobStore getBlobStore()

read

public Object read(String containerName,
                   String blobName)
Reads an Object from the blob store.

Parameters:
containerName -
blobName -
Returns:

getBlobInputStream

public InputStream getBlobInputStream(String containerName,
                                      String blobName)
                               throws Exception
Returns an InputStream to a Blob.

Parameters:
containerName -
blobName -
Returns:
Throws:
Exception

write

public void write(String containerName,
                  String blobName,
                  Object object)
Writes to the Blob by serializing an Object.

Parameters:
containerName -
blobName -
object -

write

public void write(String bucket,
                  String blobName,
                  InputStream is)
Writes to the Blob using an InputStream.

Parameters:
bucket -
blobName -
is -

toBytes

public byte[] toBytes(Object object)

readFromUrl

public byte[] readFromUrl(URL url)
Reads a bye[] from a URL.

Parameters:
url -
Returns:

printBlobStoreProviders

protected void printBlobStoreProviders(List<org.jclouds.blobstore.BlobStore> blobStores,
                                       String indent,
                                       PrintStream out)

getContainerCache

public Set<String> getContainerCache()

setContainerCache

public void setContainerCache(Set<String> containerCache)

getBlobCache

public Set<String> getBlobCache()

setBlobCache

public void setBlobCache(Set<String> blobCache)


Copyright © 2012. All Rights Reserved.