net.tomp2p.storage
Class Storage

java.lang.Object
  extended by net.tomp2p.storage.Storage
All Implemented Interfaces:
Digest, Responsibility
Direct Known Subclasses:
StorageDisk, StorageMemory

public abstract class Storage
extends Object
implements Digest, Responsibility


Nested Class Summary
static class Storage.ProtectionEnable
           
static class Storage.ProtectionMode
           
 
Constructor Summary
Storage()
           
 
Method Summary
 Lock acquire(Number160 locationKey)
           
 Lock acquire(Number160 locationKey, Number160 domainKey)
           
 Lock acquire(Number160 locationKey, Number160 domainKey, Number160 contentKey)
           
 Lock acquire(Number320 locationDomainKey)
           
 Lock acquire(Number480 locationDomainContentKey)
           
abstract  void close()
           
 Collection<Number160> compareAndPut(Number160 locationKey, Number160 domainKey, Map<Number160,HashData> hashDataMap, PublicKey publicKey, boolean partial, boolean protectDomain)
          Compares and puts the data if the compare matches
abstract  boolean contains(Number480 key)
           
 SortedMap<Number480,Data> get(Number320 key)
           
abstract  Data get(Number480 key)
           
abstract  SortedMap<Number480,Data> get(Number480 fromKey, Number480 toKey)
           
 Storage.ProtectionEnable getProtectionDomainEnable()
           
 Storage.ProtectionMode getProtectionDomainMode()
           
 Storage.ProtectionEnable getProtectionEntryEnable()
           
 Storage.ProtectionMode getProtectionEntryMode()
           
abstract  void iterateAndRun(Number160 locationKey, StorageRunner runner)
           
abstract  boolean put(Number480 key, Data data, PublicKey publicKey, boolean putIfAbsent, boolean domainProtection)
           
 void release(Lock lock)
           
 SortedMap<Number480,Data> remove(Number320 number320, PublicKey publicKey)
           
abstract  SortedMap<Number480,Data> remove(Number480 fromKey, Number480 toKey, PublicKey publicKey)
           
abstract  Data remove(Number480 key, PublicKey publicKey)
           
 void removeDomainProtection(Number160 removeDomain)
           
 void setProtection(Storage.ProtectionEnable protectionDomainEnable, Storage.ProtectionMode protectionDomainMode, Storage.ProtectionEnable protectionEntryEnable, Storage.ProtectionMode protectionEntryMode)
           
 void setProtectionDomainEnable(Storage.ProtectionEnable protectionDomainEnable)
           
 void setProtectionDomainMode(Storage.ProtectionMode protectionDomainMode)
           
 void setProtectionEntryEnable(Storage.ProtectionEnable protectionEntryEnable)
           
 void setProtectionEntryMode(Storage.ProtectionMode protectionEntryMode)
           
abstract  Collection<Number480> storedDirectReplication()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.tomp2p.storage.Digest
digest, digest
 
Methods inherited from interface net.tomp2p.storage.Responsibility
findContentForResponsiblePeerID, findPeerIDForResponsibleContent, removeResponsibility, updateResponsibilities
 

Constructor Detail

Storage

public Storage()
Method Detail

put

public abstract boolean put(Number480 key,
                            Data data,
                            PublicKey publicKey,
                            boolean putIfAbsent,
                            boolean domainProtection)

get

public abstract Data get(Number480 key)

get

public abstract SortedMap<Number480,Data> get(Number480 fromKey,
                                              Number480 toKey)

remove

public abstract SortedMap<Number480,Data> remove(Number480 fromKey,
                                                 Number480 toKey,
                                                 PublicKey publicKey)

remove

public abstract Data remove(Number480 key,
                            PublicKey publicKey)

contains

public abstract boolean contains(Number480 key)

iterateAndRun

public abstract void iterateAndRun(Number160 locationKey,
                                   StorageRunner runner)

close

public abstract void close()

storedDirectReplication

public abstract Collection<Number480> storedDirectReplication()

remove

public SortedMap<Number480,Data> remove(Number320 number320,
                                        PublicKey publicKey)

get

public SortedMap<Number480,Data> get(Number320 key)

setProtection

public void setProtection(Storage.ProtectionEnable protectionDomainEnable,
                          Storage.ProtectionMode protectionDomainMode,
                          Storage.ProtectionEnable protectionEntryEnable,
                          Storage.ProtectionMode protectionEntryMode)

setProtectionDomainMode

public void setProtectionDomainMode(Storage.ProtectionMode protectionDomainMode)

getProtectionDomainMode

public Storage.ProtectionMode getProtectionDomainMode()

setProtectionDomainEnable

public void setProtectionDomainEnable(Storage.ProtectionEnable protectionDomainEnable)

getProtectionDomainEnable

public Storage.ProtectionEnable getProtectionDomainEnable()

setProtectionEntryMode

public void setProtectionEntryMode(Storage.ProtectionMode protectionEntryMode)

getProtectionEntryMode

public Storage.ProtectionMode getProtectionEntryMode()

setProtectionEntryEnable

public void setProtectionEntryEnable(Storage.ProtectionEnable protectionEntryEnable)

getProtectionEntryEnable

public Storage.ProtectionEnable getProtectionEntryEnable()

removeDomainProtection

public void removeDomainProtection(Number160 removeDomain)

compareAndPut

public Collection<Number160> compareAndPut(Number160 locationKey,
                                           Number160 domainKey,
                                           Map<Number160,HashData> hashDataMap,
                                           PublicKey publicKey,
                                           boolean partial,
                                           boolean protectDomain)
Compares and puts the data if the compare matches

Parameters:
locationKey - The location key
domainKey - The domain key
hashDataMap - The map with the data and the hashes to compare to
publicKey - The public key
partial - If set to true, then partial puts are OK, otherwise all the data needs to be absent.
protectDomain - Flag to protect domain
Returns:
The keys that have been stored

acquire

public Lock acquire(Number160 locationKey)

acquire

public Lock acquire(Number320 locationDomainKey)

acquire

public Lock acquire(Number160 locationKey,
                    Number160 domainKey)

acquire

public Lock acquire(Number480 locationDomainContentKey)

acquire

public Lock acquire(Number160 locationKey,
                    Number160 domainKey,
                    Number160 contentKey)

release

public void release(Lock lock)


Copyright © 2012. All Rights Reserved.