Package com.cedarsoft.couchdb.core

Examples of com.cedarsoft.couchdb.core.UniqueId


    InputStream entityInputStream = response.getEntityInputStream();

    try {
      //Wrap the input stream
      try ( MaxLengthByteArrayOutputStream teedOut = new MaxLengthByteArrayOutputStream(); TeeInputStream teeInputStream = new TeeInputStream( entityInputStream, teedOut ) ) {
        UniqueId uniqueId = deserialize( teeInputStream );

        return new ActionResponse( uniqueId, response.getStatus(), response.getLocation(), teedOut.toByteArray() );
      }
    } catch ( IOException e ) {
      throw new RuntimeException( e );
View Full Code Here


    JsonParser parser = jsonFactory.createJsonParser( in );
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( parser );
    parserWrapper.nextToken( JsonToken.START_OBJECT );

    UniqueId deserialized = deserialize( parser );

    parserWrapper.ensureObjectClosed();

    return deserialized;
  }
View Full Code Here

    assert rev != null;
    assert id != null;

    parser.ensureObjectClosed();

    return new UniqueId( new DocId( id ), new Revision( rev ) );

    //    AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.FIELD_NAME );
    //    if ( deserializeFrom.getCurrentName().equals( PROPERTY_OK ) ) {
    //    } else {
    //      AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.VALUE_STRING );
View Full Code Here

    delegate.serialize( serializeTo, object, formatVersion );
  }

  @Override
  protected void beforeTypeAndVersion( @Nonnull T object, @Nonnull JsonGenerator serializeTo ) throws IOException {
    UniqueId uniqueId = getUniqueId();

    serializeTo.writeStringField( ID, uniqueId.getId().asString() );
    serializeTo.writeStringField( REV, uniqueId.getRevision().asString() );
    super.beforeTypeAndVersion( object, serializeTo );
  }
View Full Code Here

   * @param id       the document id
   * @param revision the revision
   */
  @Deprecated
  public void serialize( @Nonnull T object, @WillNotClose @Nonnull OutputStream out, @Nonnull DocId id, @Nonnull Revision revision ) throws IOException {
    storeUniqueId( new UniqueId( id, revision ) );
    super.serialize( object, out );
  }
View Full Code Here

  }

  @Deprecated
  @Nonnull
  private static UniqueId getUniqueId() {
    @Nullable UniqueId resolved = uniqueIdThreadLocal.get();
    if ( resolved == null ) {
      throw new IllegalStateException( "No unique id found" );
    }

    uniqueIdThreadLocal.remove();
View Full Code Here

TOP

Related Classes of com.cedarsoft.couchdb.core.UniqueId

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.