Cumulus4j API
(1.2.0)

org.cumulus4j.store.model
Class EncryptionCoordinateSetDAO

java.lang.Object
  extended by org.cumulus4j.store.model.AbstractDAO
      extended by org.cumulus4j.store.model.EncryptionCoordinateSetDAO

public class EncryptionCoordinateSetDAO
extends AbstractDAO


Field Summary
 
Fields inherited from class org.cumulus4j.store.model.AbstractDAO
pm
 
Constructor Summary
EncryptionCoordinateSetDAO()
           
EncryptionCoordinateSetDAO(PersistenceManager pm)
           
 
Method Summary
 EncryptionCoordinateSet createEncryptionCoordinateSet(String cipherTransformation, String macAlgorithm)
           Get an existing EncryptionCoordinateSet identified by its unique properties or create one if necessary.
 EncryptionCoordinateSet getEncryptionCoordinateSet(int encryptionCoordinateSetID)
          Get an existing EncryptionCoordinateSet identified by its encryptionCoordinateSetID.
 EncryptionCoordinateSet getEncryptionCoordinateSet(String cipherTransformation, String macAlgorithm)
           Get an existing EncryptionCoordinateSet identified by its unique properties.
 void setPersistenceManager(PersistenceManager pm)
          
 
Methods inherited from class org.cumulus4j.store.model.AbstractDAO
getPersistenceManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptionCoordinateSetDAO

public EncryptionCoordinateSetDAO()

EncryptionCoordinateSetDAO

public EncryptionCoordinateSetDAO(PersistenceManager pm)
Parameters:
pm - the backend-PersistenceManager (the one used for data, if there is a separate index-DB used).
Method Detail

setPersistenceManager

public void setPersistenceManager(PersistenceManager pm)

Overrides:
setPersistenceManager in class AbstractDAO
Parameters:
pm - the backend-PersistenceManager (the one used for data, if there is a separate index-DB used).

getEncryptionCoordinateSet

public EncryptionCoordinateSet getEncryptionCoordinateSet(int encryptionCoordinateSetID)
Get an existing EncryptionCoordinateSet identified by its encryptionCoordinateSetID.

Parameters:
encryptionCoordinateSetID - the identifier of the searched instance.
Returns:
the EncryptionCoordinateSet identified by the given encryptionCoordinateSetID or null, if no such instance exists in the datastore.

getEncryptionCoordinateSet

public EncryptionCoordinateSet getEncryptionCoordinateSet(String cipherTransformation,
                                                          String macAlgorithm)

Get an existing EncryptionCoordinateSet identified by its unique properties.

As each EncryptionCoordinateSet maps all encryption settings to an ID, all properties of this class except for the ID form a unique index together. At the moment, these are: cipher-transformation and MAC-algorithm.

Parameters:
cipherTransformation - the cipher-transformation of the searched instance. Must not be null.
macAlgorithm - the #getMACAlgorithm() of the searched instance. Must not be null (use for no MAC).
Returns:
the EncryptionCoordinateSet identified by the given properties or null, if no such instance exists in the datastore.
See Also:
#createEncryptionCoordinateSet(PersistenceManager, String, String)

createEncryptionCoordinateSet

public EncryptionCoordinateSet createEncryptionCoordinateSet(String cipherTransformation,
                                                             String macAlgorithm)

Get an existing EncryptionCoordinateSet identified by its unique properties or create one if necessary.

This method is similar to #getEncryptionCoordinateSet(PersistenceManager, String, String), but creates a new EncryptionCoordinateSet instead of returning null, if there is no existing instance, yet.

Parameters:
cipherTransformation - the cipher-transformation of the searched instance. Must not be null.
macAlgorithm - the #getMACAlgorithm() of the searched instance. Must not be null (use for no MAC).
Returns:
the EncryptionCoordinateSet identified by the given properties. This method never returns null, but instead creates and persists a new instance if needed.
See Also:
#getEncryptionCoordinateSet(PersistenceManager, String, String)

Cumulus4j API
(1.2.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.