Package freenet.client

Examples of freenet.client.InsertException


      }
    }
    try {
      makePutter(context);
    } catch (TooManyFilesInsertException e) {
      this.onFailure(new InsertException(e), null);
    }
    start(context);
    return true;
  }
View Full Code Here


      onFailure(e, null);
    } catch (Throwable t) {
      synchronized(this) {
        started = true;
      }
      onFailure(new InsertException(InsertExceptionMode.INTERNAL_ERROR, t, null), null);
    }
  }
View Full Code Here

  public void requestWasRemoved(ClientContext context) {
    // if request is still running, send a PutFailed with code=cancelled
    if( !finished ) {
      synchronized(this) {
        finished = true;
        InsertException cancelled = new InsertException(InsertExceptionMode.CANCELLED);
        putFailedMessage = new PutFailedMessage(cancelled, identifier, global);
      }
      trySendFinalMessage(null);
    }
    // notify client that request was removed
View Full Code Here

        if(cancelled) return;
        super.cancel();
        oldState = currentState;
      }
      if(oldState != null) oldState.cancel(context);
      onFailure(new InsertException(InsertExceptionMode.CANCELLED), oldState, context);
    }
View Full Code Here

          bucket = baseMetadata.toBucket(context.getBucketFactory(persistent()));
        if(logMINOR)
          Logger.minor(this, "Metadata bucket is "+bucket.size()+" bytes long");
        break;
      } catch (IOException e) {
        fail(new InsertException(InsertExceptionMode.BUCKET_ERROR, e, null), context);
        return;
      } catch (MetadataUnresolvedException e) {
        try {
          // Start the insert for the sub-Metadata.
          // Eventually it will generate a URI and call onEncode(), which will call back here.
          if(logMINOR) Logger.minor(this, "Main metadata needs resolving: "+e);
          resolve(e, context);
          return;
        } catch (IOException e1) {
          fail(new InsertException(InsertExceptionMode.BUCKET_ERROR, e, null), context);
          return;
        } catch (InsertException e2) {
          fail(e2, context);
          return;
        }
View Full Code Here

    // Also doing it this way means we don't need to worry about
    cb.onSuccess(this);
  }

  private void fail(Exception e, ClientContext context) {
    InsertException ie = new InsertException(InsertExceptionMode.INTERNAL_ERROR, e, null);
    fail(ie, context);
  }
View Full Code Here

  public void cancel(ClientContext context) {
    synchronized(this) {
      if(finished) return;
      if(super.cancel()) return;
    }
    fail(new InsertException(InsertExceptionMode.CANCELLED), context);
  }
View Full Code Here

          hm.put(ph.itemName, m);
          putHandlersTransformMap.remove(ph);
          try {
            tryStartParentContainer(ph.parentPutHandler, context);
          } catch (InsertException e) {
            fail(new InsertException(InsertExceptionMode.INTERNAL_ERROR, e, null), context);
            return;
          }
        }
        putHandlersArchiveTransformMap.remove(this);
      }
View Full Code Here

              throw new MetadataUnresolvedException(new Metadata[] { m }, "Too big");
          } catch (MetadataUnresolvedException e) {
            try {
              resolve(e, context);
            } catch (IOException e1) {
              fail(new InsertException(InsertExceptionMode.BUCKET_ERROR, e1, null), context);
              return;
            } catch (InsertException e1) {
              fail(e1, context);
            }
          }
View Full Code Here

        } catch (Throwable t) {
            Logger.error(this, "Caught in OffThreadCompressor: "+t, t);
            System.err.println("Caught in OffThreadCompressor: "+t);
            t.printStackTrace();
            // Try to fail gracefully
      cb.onFailure(new InsertException(InsertExceptionMode.INTERNAL_ERROR, t, null), SingleFileInserter.this, context);
    }
  }
View Full Code Here

TOP

Related Classes of freenet.client.InsertException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.