net.tomp2p.p2p.config
Class ConfigurationStore

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

public class ConfigurationStore
extends ConfigurationBase


Constructor Summary
ConfigurationStore()
           
 
Method Summary
 FutureCreate<FutureDHT> getFutureCreate()
           
 int getRefreshSeconds()
           
 RequestP2PConfiguration getRequestP2PConfiguration()
           
 boolean isProtectDomain()
           
 boolean isStoreIfAbsent()
           
 ConfigurationStore setFutureCreate(FutureCreate<FutureDHT> futureCreate)
           
 ConfigurationBase setProtectDomain(boolean protectDomain)
           
 ConfigurationStore setRefreshSeconds(int refreshSeconds)
           
 ConfigurationBase setRequestP2PConfiguration(RequestP2PConfiguration requestP2PConfiguration)
           
 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.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.

setRequestP2PConfiguration

public ConfigurationBase setRequestP2PConfiguration(RequestP2PConfiguration requestP2PConfiguration)

getRequestP2PConfiguration

public RequestP2PConfiguration getRequestP2PConfiguration()

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 © 2011. All Rights Reserved.