Package com.cedarsoft.couchdb

Examples of com.cedarsoft.couchdb.Revision


    super.beforeTypeAndVersion( wrapper );

    wrapper.nextFieldValue( "_id" );
    final DocId id = new DocId( wrapper.getText() );
    wrapper.nextFieldValue( "_rev" );
    final Revision revision = new Revision( wrapper.getText() );

    current = new UniqueId( id, revision );
  }
View Full Code Here


    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_ID );
    String id = deserializeFrom.getText();
    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_REV );
    String rev = deserializeFrom.getText();
    AbstractJacksonSerializer.closeObject( deserializeFrom );
    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

    //the attachments - if there are any....
    List<? extends CouchDoc.Attachment> attachments = deserializeAttachments( parser );

    AbstractJacksonSerializer.ensureObjectClosed( parser );
    CouchDoc<T> doc = new CouchDoc<T>( new DocId( id ), rev == null ? null : new Revision( rev ), wrapped );
    doc.addAttachments( attachments );
    return doc;
  }
View Full Code Here

    super.beforeTypeAndVersion( wrapper );

    wrapper.nextFieldValue( "_id" );
    final DocId id = new DocId( wrapper.getText() );
    wrapper.nextFieldValue( "_rev" );
    final Revision revision = new Revision( wrapper.getText() );

    current = new UniqueId( id, revision );
  }
View Full Code Here

    String rev = parser.getText();

    parser.nextToken();

    AbstractJacksonSerializer.ensureObjectClosed( parser );
    return new RawCouchDoc( new DocId( id ), new Revision( rev ) );
  }
View Full Code Here

  }

  public static void serializeIdAndRev( @Nonnull JsonGenerator serializeTo, @Nonnull RawCouchDoc doc ) throws IOException, JsonProcessingException {
    serializeTo.writeStringField( PROPERTY_ID, doc.getId().asString() );

    Revision rev = doc.getRev();
    if ( rev != null ) {
      serializeTo.writeStringField( PROPERTY_REV, rev.asString() );
    }
  }
View Full Code Here

   * @throws IOException
   * @throws ActionFailedException
   */
  @Nullable
  public DesignDocumentsVersionInfo updateIfNecessary( @Nonnull DesignDocumentsProvider provider ) throws IOException, ActionFailedException {
    Revision rev = null;
    try {
      CouchDoc<DesignDocumentsVersionInfo> doc = queryCurrentVersionInfoDoc();
      rev = doc.getRev();
      DesignDocumentsVersionInfo currentVersionInfo = doc.getObject();

View Full Code Here

    super.beforeTypeAndVersion( wrapper );

    wrapper.nextFieldValue( "_id" );
    final DocId id = new DocId( wrapper.getText() );
    wrapper.nextFieldValue( "_rev" );
    final Revision revision = new Revision( wrapper.getText() );

    current = new UniqueId( id, revision );
  }
View Full Code Here

    String rev = parser.getText();

    parser.nextToken();

    AbstractJacksonSerializer.ensureObjectClosed( parser );
    return new RawCouchDoc( new DocId( id ), new Revision( rev ) );
  }
View Full Code Here

  }

  public static void serializeIdAndRev( @Nonnull JsonGenerator serializeTo, @Nonnull RawCouchDoc doc ) throws IOException {
    serializeTo.writeStringField( PROPERTY_ID, doc.getId().asString() );

    Revision rev = doc.getRev();
    if ( rev != null ) {
      serializeTo.writeStringField( PROPERTY_REV, rev.asString() );
    }
  }
View Full Code Here

TOP

Related Classes of com.cedarsoft.couchdb.Revision

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.