org.datanucleus.store.json
Class CloudStoragePersistenceHandler

java.lang.Object
  extended by org.datanucleus.store.AbstractPersistenceHandler
      extended by org.datanucleus.store.json.JsonPersistenceHandler
          extended by org.datanucleus.store.json.CloudStoragePersistenceHandler
All Implemented Interfaces:
org.datanucleus.store.StorePersistenceHandler
Direct Known Subclasses:
AmazonS3PersistenceHandler, GoogleStoragePersistenceHandler

public abstract class CloudStoragePersistenceHandler
extends JsonPersistenceHandler


Field Summary
 
Fields inherited from class org.datanucleus.store.json.JsonPersistenceHandler
LOCALISER, storeMgr
 
Method Summary
protected  void createBucket(java.net.URLConnection conn, java.util.Map headers)
           
protected  java.util.Map getHeaderForBucket()
           
protected  java.util.Map<java.lang.String,java.lang.String> getHeaders(java.lang.String httpVerb, java.util.Map<java.lang.String,java.lang.String> options)
           
 java.util.List getObjectsOfCandidateType(org.datanucleus.store.ExecutionContext ec, org.datanucleus.store.connection.ManagedConnection mconn, java.lang.Class candidateClass, boolean subclasses, boolean ignoreCache, java.util.Map options)
          Convenience method to get all objects of the candidate type from the specified connection.
protected abstract  java.lang.String getRealmName()
           
 java.lang.String getURLPathForQuery(org.datanucleus.metadata.AbstractClassMetaData acmd)
          URL path for querying in the cloud storage.
 void insertObject(org.datanucleus.store.ObjectProvider op)
           
 
Methods inherited from class org.datanucleus.store.json.JsonPersistenceHandler
close, deleteObject, fetchObject, findObject, getURLPath, getURLPath, handleHTTPErrorCode, locateObject, read, updateObject, write
 
Methods inherited from class org.datanucleus.store.AbstractPersistenceHandler
batchEnd, batchStart, deleteObjects, findObjects, insertObjects, locateObjects, useReferentialIntegrity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

insertObject

public void insertObject(org.datanucleus.store.ObjectProvider op)
Specified by:
insertObject in interface org.datanucleus.store.StorePersistenceHandler
Overrides:
insertObject in class JsonPersistenceHandler

createBucket

protected void createBucket(java.net.URLConnection conn,
                            java.util.Map headers)

getHeaders

protected java.util.Map<java.lang.String,java.lang.String> getHeaders(java.lang.String httpVerb,
                                                                      java.util.Map<java.lang.String,java.lang.String> options)
Overrides:
getHeaders in class JsonPersistenceHandler

getRealmName

protected abstract java.lang.String getRealmName()

getHeaderForBucket

protected java.util.Map getHeaderForBucket()

getObjectsOfCandidateType

public java.util.List getObjectsOfCandidateType(org.datanucleus.store.ExecutionContext ec,
                                                org.datanucleus.store.connection.ManagedConnection mconn,
                                                java.lang.Class candidateClass,
                                                boolean subclasses,
                                                boolean ignoreCache,
                                                java.util.Map options)
Convenience method to get all objects of the candidate type from the specified connection.

Overrides:
getObjectsOfCandidateType in class JsonPersistenceHandler
Parameters:
ec - ObjectManager
mconn - Managed Connection
candidateClass - Candidate
subclasses - Whether to include subclasses
ignoreCache - Whether to ignore the cache
Returns:
List of objects of the candidate type

getURLPathForQuery

public java.lang.String getURLPathForQuery(org.datanucleus.metadata.AbstractClassMetaData acmd)
URL path for querying in the cloud storage. it lists all entries for the bucket+a prefix

Overrides:
getURLPathForQuery in class JsonPersistenceHandler


Copyright © 2012. All Rights Reserved.