com.couchbase.client.java.repository.AsyncRepository Maven / Gradle / Ivy
/*
* Copyright (c) 2016 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.couchbase.client.java.repository;
import com.couchbase.client.core.annotations.InterfaceAudience;
import com.couchbase.client.core.annotations.InterfaceStability;
import com.couchbase.client.java.PersistTo;
import com.couchbase.client.java.ReplicaMode;
import com.couchbase.client.java.ReplicateTo;
import com.couchbase.client.java.document.EntityDocument;
import rx.Observable;
/**
* The async repository abstraction for entities on top of an AsyncBucket.
*
* @author Michael Nitschinger
* @since 2.2.0
*/
@InterfaceAudience.Public
@InterfaceStability.Experimental
public interface AsyncRepository {
Observable> get(String id, Class entityClass);
Observable> getFromReplica(String id, ReplicaMode type, Class entityClass);
Observable> getAndLock(String id, int lockTime, Class entityClass);
Observable> getAndTouch(String id, int expiry, Class entityClass);
Observable exists(String id);
Observable exists(EntityDocument document);
Observable> upsert(EntityDocument document);
Observable> upsert(EntityDocument document, PersistTo persistTo);
Observable> upsert(EntityDocument document, ReplicateTo replicateTo);
Observable> upsert(EntityDocument document, PersistTo persistTo, ReplicateTo replicateTo);
Observable> insert(EntityDocument document);
Observable> insert(EntityDocument document, PersistTo persistTo);
Observable> insert(EntityDocument document, ReplicateTo replicateTo);
Observable> insert(EntityDocument document, PersistTo persistTo, ReplicateTo replicateTo);
Observable> replace(EntityDocument document);
Observable> replace(EntityDocument document, PersistTo persistTo);
Observable> replace(EntityDocument document, ReplicateTo replicateTo);
Observable> replace(EntityDocument document, PersistTo persistTo, ReplicateTo replicateTo);
Observable> remove(EntityDocument document);
Observable> remove(EntityDocument document, PersistTo persistTo);
Observable> remove(EntityDocument document, ReplicateTo replicateTo);
Observable> remove(EntityDocument document, PersistTo persistTo, ReplicateTo replicateTo);
Observable> remove(String id, Class entityClass);
Observable> remove(String id, PersistTo persistTo, Class entityClass);
Observable> remove(String id, ReplicateTo replicateTo, Class entityClass);
Observable> remove(String id, PersistTo persistTo, ReplicateTo replicateTo, Class entityClass);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy