net.tomp2p.p2p.config
Class ConfigurationStore

java.lang.Object
  extended by net.tomp2p.p2p.config.ConfigurationBase
      extended by net.tomp2p.p2p.config.ConfigurationBaseDHT
          extended by net.tomp2p.p2p.config.ConfigurationStore

public class ConfigurationStore
extends ConfigurationBaseDHT


Constructor Summary
ConfigurationStore()
           
 
Method Summary
 FutureCreate<FutureDHT> getFutureCreate()
           
 int getRefreshSeconds()
           
 boolean isProtectDomain()
           
 boolean isStoreIfAbsent()
           
 ConfigurationStore setFutureCreate(FutureCreate<FutureDHT> futureCreate)
           
 ConfigurationBase setProtectDomain(boolean protectDomain)
           
 ConfigurationStore setRefreshSeconds(int refreshSeconds)
           
 ConfigurationStore setStoreIfAbsent(boolean absent)
          If set to true, it only stores data on peers that do not have it.
 
Methods inherited from class net.tomp2p.p2p.config.ConfigurationBaseDHT
getRequestP2PConfiguration, isAutomaticCleanup, setAutomaticCleanup, setRequestP2PConfiguration
 
Methods inherited from class net.tomp2p.p2p.config.ConfigurationBase
getContentKey, getDomain, getRoutingConfiguration, isSignMessage, setContentKey, setDomain, setRoutingConfiguration, setSignMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationStore

public ConfigurationStore()
Method Detail

isStoreIfAbsent

public boolean isStoreIfAbsent()

setStoreIfAbsent

public ConfigurationStore setStoreIfAbsent(boolean absent)
If set to true, it only stores data on peers that do not have it. FutureDHT reports back what keys have been stored on which peers ( FutureDHT.getRawKeys(). The evaluation if it was successful or not cannot be done by TomP2P, since FutureDHT e.g. may report that it was stored on peer A, but peer B already has it. Instead a Map> is returned, which tells you on what peer the value has been stored. If you store key1 and key2 and FutureDHT tells you peerA:key1, then you know, that key1 was absent, while key2 was already there.

Parameters:
absent - True if the value should only be stored if not already present
Returns:
This instance.

setProtectDomain

public ConfigurationBase setProtectDomain(boolean protectDomain)

isProtectDomain

public boolean isProtectDomain()

setRefreshSeconds

public ConfigurationStore setRefreshSeconds(int refreshSeconds)

getRefreshSeconds

public int getRefreshSeconds()

setFutureCreate

public ConfigurationStore setFutureCreate(FutureCreate<FutureDHT> futureCreate)

getFutureCreate

public FutureCreate<FutureDHT> getFutureCreate()


Copyright © 2012. All Rights Reserved.