Package com.cedarsoft.couchdb.core

Examples of com.cedarsoft.couchdb.core.Revision


    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


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

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

    String rev = parser.getText();

    parser.nextToken();

    parserWrapper.ensureObjectClosed();
    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

      }
      String path = designDocument.getDesignDocumentPath();
      WebResource resource = database.getDbRoot().path( path );


      @Nullable Revision currentRevision = getRevision( resource );

      if ( LOG.isLoggable( Level.FINE ) ) {
        LOG.fine( "PUT: " + resource.toString() );
      }
      ClientResponse response = resource.put( ClientResponse.class, createJson( designDocument, currentRevision ) );
View Full Code Here

        wrapper.nextToken( JsonToken.START_OBJECT );

        wrapper.nextFieldValue( "_id" );
        wrapper.nextFieldValue( "_rev" );
        return new Revision( wrapper.getText() );
      }
    } finally {
      response.close();
    }
  }
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

      EntityTag entityTag = response.getEntityTag();
      if ( entityTag == null ) {
        throw new IllegalArgumentException( "No Etag found" );
      }
      return new Revision( entityTag.getValue() );
    } finally {
      response.close();
    }
  }
View Full Code Here

TOP

Related Classes of com.cedarsoft.couchdb.core.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.