public class ClientContext
extends java.lang.Object
Constructor and Description |
---|
ClientContext(long bootID,
ClientLayerPersister jobRunner,
Executor mainExecutor,
ArchiveManager archiveManager,
PersistentTempBucketFactory ptbf,
TempBucketFactory tbf,
PersistentFileTracker tracker,
HealingQueue hq,
USKManager uskManager,
RandomSource strongRandom,
java.util.Random fastWeakRandom,
Ticker ticker,
MemoryLimitedJobRunner memoryLimitedJobRunner,
FilenameGenerator fg,
FilenameGenerator persistentFG,
LockableRandomAccessBufferFactory rafFactory,
LockableRandomAccessBufferFactory persistentRAFFactory,
FileRandomAccessBufferFactory fileRAFTransient,
FileRandomAccessBufferFactory fileRAFPersistent,
RealCompressor rc,
DatastoreChecker checker,
PersistentRequestRoot persistentRoot,
MasterSecret cryptoSecretTransient,
LinkFilterExceptionProvider linkFilterExceptionProvider,
FetchContext defaultPersistentFetchContext,
InsertContext defaultPersistentInsertContext,
Config config) |
public final transient Executor mainExecutor
public final transient PersistentJobRunner jobRunner
public final transient RandomSource random
public final transient ArchiveManager archiveManager
public final transient PersistentTempBucketFactory persistentBucketFactory
public transient PersistentFileTracker persistentFileTracker
public final transient TempBucketFactory tempBucketFactory
public final transient LockableRandomAccessBufferFactory tempRAFFactory
public final transient LockableRandomAccessBufferFactory persistentRAFFactory
public final transient HealingQueue healingQueue
public final transient USKManager uskManager
public final transient java.util.Random fastWeakRandom
public final transient long bootID
public final transient Ticker ticker
public final transient FilenameGenerator fg
public final transient FilenameGenerator persistentFG
public final transient RealCompressor rc
public final transient DatastoreChecker checker
public transient DownloadCache downloadCache
public final transient MemoryLimitedJobRunner memoryLimitedJobRunner
public final transient PersistentRequestRoot persistentRoot
public final transient MasterSecret cryptoSecretTransient
public final transient LinkFilterExceptionProvider linkFilterExceptionProvider
public PersistentJobRunner dummyJobRunner
public ClientContext(long bootID, ClientLayerPersister jobRunner, Executor mainExecutor, ArchiveManager archiveManager, PersistentTempBucketFactory ptbf, TempBucketFactory tbf, PersistentFileTracker tracker, HealingQueue hq, USKManager uskManager, RandomSource strongRandom, java.util.Random fastWeakRandom, Ticker ticker, MemoryLimitedJobRunner memoryLimitedJobRunner, FilenameGenerator fg, FilenameGenerator persistentFG, LockableRandomAccessBufferFactory rafFactory, LockableRandomAccessBufferFactory persistentRAFFactory, FileRandomAccessBufferFactory fileRAFTransient, FileRandomAccessBufferFactory fileRAFPersistent, RealCompressor rc, DatastoreChecker checker, PersistentRequestRoot persistentRoot, MasterSecret cryptoSecretTransient, LinkFilterExceptionProvider linkFilterExceptionProvider, FetchContext defaultPersistentFetchContext, InsertContext defaultPersistentInsertContext, Config config)
public void init(RequestStarterGroup starters, UserAlertManager alerts)
public void setPersistentMasterSecret(MasterSecret secret)
public MasterSecret getPersistentMasterSecret()
public ClientRequestScheduler getSskFetchScheduler(boolean realTime)
public ClientRequestScheduler getChkFetchScheduler(boolean realTime)
public ClientRequestScheduler getSskInsertScheduler(boolean realTime)
public ClientRequestScheduler getChkInsertScheduler(boolean realTime)
public void start(ClientPutter inserter) throws InsertException, PersistenceDisabledException
inserter
- The insert to start.earlyEncode
- Whether to try to encode the data and insert the upper layers as soon as possible.
Normally we wait for each layer to complete before inserting the next one because an attacker may be
able to identify lower blocks once the top block has been inserted (e.g. if it's a known SSK).InsertException
- If the insert is transient and it fails to start.DatabaseDisabledException
- If the insert is persistent and the database is disabled (e.g.
because it is encrypted and the user hasn't entered the password yet).PersistenceDisabledException
public void start(ClientGetter getter) throws FetchException, PersistenceDisabledException
getter
- The request to start.FetchException
- If the request is transient and failed to start.DatabaseDisabledException
- If the request is persistent and the database is disabled.PersistenceDisabledException
public void start(BaseManifestPutter inserter) throws InsertException, PersistenceDisabledException
inserter
- The request to start.InsertException
- If the insert is transient and failed to start.DatabaseDisabledException
- If the insert is persistent and the database is disabled.PersistenceDisabledException
public BucketFactory getBucketFactory(boolean persistent)
persistent
- If true, get the persistent temporary bucket factory. This creates buckets which
persist across restarts of the node. If false, get the temporary bucket factory, which creates buckets
which will be deleted once the node is restarted.public RequestScheduler getFetchScheduler(boolean ssk, boolean realTime)
ssk
- If true, get the SSK request scheduler. If false, get the CHK request scheduler.public void postUserAlert(UserAlert alert)
public void setDownloadCache(DownloadCache cache)
public FetchContext getDefaultPersistentFetchContext()
public InsertContext getDefaultPersistentInsertContext()
public PersistentJobRunner getJobRunner(boolean persistent)
public FileRandomAccessBufferFactory getFileRandomAccessBufferFactory(boolean persistent)
public LockableRandomAccessBufferFactory getRandomAccessBufferFactory(boolean persistent)
public Config getConfig()