/** Restart the insert. * @return True if the insert restarted successfully. * @throws InsertException If the insert could not be restarted for some reason. * */ public boolean restart(ClientContext context) throws InsertException { return start(true, context); }
/** Start the insert. * @param earlyEncode If true, try to find the final URI as quickly as possible, and insert the upper * layers as soon as we can, rather than waiting for the lower layers. The default behaviour is safer, * because an attacker can usually only identify the datastream once he has the top block, or once you * have announced the key. * @param context Contains some useful transient fields such as the schedulers. * @throws InsertException If the insert cannot be started for some reason. */ public void start(ClientContext context) throws InsertException { start(false, context); }
@Override public boolean run(ClientContext context) { try { inserter.start(false, context); } catch (InsertException e) { inserter.client.onFailure(e, inserter); } return true; }
/** * Start an insert. Queue a database job if it is a persistent insert, otherwise start it right now. * @param inserter The insert to start. * @param 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). * @throws InsertException If the insert is transient and it fails to start. * @throws 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). */ public void start(final ClientPutter inserter) throws InsertException, PersistenceDisabledException { if(inserter.persistent()) { jobRunner.queue(new PersistentJob() { @Override public boolean run(ClientContext context) { try { inserter.start(false, context); } catch (InsertException e) { inserter.client.onFailure(e, inserter); } return true; } }, NativeThread.NORM_PRIORITY); } else { inserter.start(false, this); } }
putter.start(false, context); if(persistence != Persistence.CONNECTION && !finished) { FCPMessage msg = persistentTagMessage();