public final class StoreBinding extends Object implements IStoreBinding
IStoreBinding.InterClusterReplicationRole, IStoreBinding.Operation, IStoreBinding.Role, IStoreBinding.StartupExpectation, IStoreBinding.StateNO_COMMIT_COMPLETIONS, PRESERVE_ICR_CHANNEL_JOINS, SUPPRESS_COMPLETION_EVENT_DISPATCH_IF_SYNC_COMPLETIONpublic static final IStoreBinding create(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, IStoreReplicatorNotificationHandler replicatorNotificationHandler, int flags) throws OdsException
OdsExceptionpublic static final IStoreBinding create(String memberName, StoreDescriptor descriptor, IStoreEventHandler eventHandler, int flags) throws OdsException
OdsExceptionpublic final String getName()
IEventSource.getName()getName in interface IEventSourcepublic final void open()
throws OdsException
IStoreBinding.open(java.util.Map<com.neeve.ods.IStoreBinding.StartupExpectation, java.lang.Enum<?>>)open in interface IStoreBindingOdsExceptionpublic final void open(Map<IStoreBinding.StartupExpectation,Enum<?>> expectations) throws OdsException
IStoreBinding.open(java.util.Map<com.neeve.ods.IStoreBinding.StartupExpectation, java.lang.Enum<?>>)open in interface IStoreBindingexpectations - The set of expectations to open the store with.
This method will throw an exception if any of the expectations specified
are not met.OdsExceptionpublic final IStoreMember getMember()
IStoreBinding.getMember()getMember in interface IStoreBindingpublic final StoreDescriptor getDescriptor()
IStoreBinding.getDescriptor()getDescriptor in interface IStoreBindingpublic final IStoreEventHandler getEventHandler()
IStoreBinding.getEventHandler()getEventHandler in interface IStoreBindingpublic final IStoreBinding.State getState()
IStoreBinding.getState()getState in interface IStoreBindingpublic final IStoreBindingStats getStats()
IStoreBinding.getStats()getStats in interface IStoreBindingpublic final IStoreBinding.Role getRole()
IStoreBinding.getRole()getRole in interface IStoreBindingpublic final IStoreBinding.InterClusterReplicationRole getInterClusterReplicationRole()
IStoreBinding.getInterClusterReplicationRole()getInterClusterReplicationRole in interface IStoreBindingpublic final int getMemberCount()
IStoreBinding.getMemberCount()getMemberCount in interface IStoreBindingpublic final boolean isPersistenceQuorumMet()
IStoreBinding.isPersistenceQuorumMet()isPersistenceQuorumMet in interface IStoreBindingpublic final IStorePersister getPersister()
IStoreBinding.getPersister()getPersister in interface IStoreBindingpublic final IStoreSender getICRSender()
IStoreBinding.getICRSender()getICRSender in interface IStoreBindingpublic final IStoreTransactionLog getTransactionLog()
IStoreBinding.getTransactionLog()getTransactionLog in interface IStoreBindingpublic final IStoreQueryEngine getQueryEngine()
IStoreBinding.getQueryEngine()getQueryEngine in interface IStoreBindingpublic final IStoreQueryRepository asQueryRepository()
IStoreBinding.asQueryRepository()asQueryRepository in interface IStoreBindingIStoreQueryRepository for this engine or null, if it is not configured for query.public final IStoreCommitCompletionEvent createCommitCompletionEvent()
IStoreBinding.createCommitCompletionEvent()createCommitCompletionEvent in interface IStoreBindingpublic final int sizeUnprotected()
IStoreBinding.sizeUnprotected()sizeUnprotected in interface IStoreBindingpublic final int size()
IStoreBinding.size()size in interface IStoreBindingpublic final void processMemberControlEvent(IStoreMemberControlEvent event)
processMemberControlEvent in interface IStoreBindingevent - The event to process
This method should be invoked in response when the following events are
received from the store binding.
- IStoreMemberFoundEvent
- IStoreMemberConnectEvent
- IStoreMemberHandshakeStartReadyEvent
- IStoreMemberHandshakePrimaryHelloEvent
- IStoreMemberHandshakeBackupHelloEvent
- IStoreMemberInitReadyEvent
- IStoreMemberLostEvent
The method should be invoked serialized with the invocation of other binding
'action' methods. Users of the StoreBinding do not have to invoke this
method since the StoreBinding automatically invokes this method. This
method only needs to be invoked by users who want to control the scheduling of
the above event with other user events.
public final <T> void recordFieldUpdate(IStoreObject object, IStoreField<T> field, T oldValue, T newValue)
IStoreBinding.recordFieldUpdate(com.neeve.ods.IStoreObject, com.neeve.ods.IStoreField<T>, T, T)recordFieldUpdate in interface IStoreBindingobject - The object being updated.field - The field that can be used to access the field value. If the
field is not supplied it will not be indexed even if the store supports indexing.oldValue - The old field value.newValue - The new field value.public final IStoreBinding put(IStoreObject object)
IStoreBinding.put(com.neeve.ods.IStoreObject)put in interface IStoreBindingobject - The object to be added to the store.public final IStoreBinding send(IStoreObject object)
IStoreBinding.send(com.neeve.ods.IStoreObject)send in interface IStoreBindingobject - The object sent via the store.public final IStoreObject get(com.eaio.uuid.UUID id)
IStoreBinding.get(com.eaio.uuid.UUID)get in interface IStoreBindingid - The object's idpublic final IStoreBinding remove(IStoreObject object)
IStoreBinding.remove(com.neeve.ods.IStoreObject)remove in interface IStoreBindingpublic final IStoreCommitCompletionEvent commit(long transactionId, long stableTransactionId, IStoreObject[] messages, int messageCount, IStoreCommitCompletionEvent completionEvent, int flags) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)commit in interface IStoreBindingtransactionId - A user supplied transaction id that will be
set in each of the objects committed by this method. This id is
not interpreted by ODS. It is only accepted here to set in objects
in the transaction to tie the objects committed by the store with
other objects in the same transaction.stableTransactionId - A user supplied stable transaction id
that will be set in each of the objects committed by this method.
This id is not interpreted by ODS. It is only accepted here to set
in objects in the transaction to tie the objects committed by the
store with other objects in the same transaction.completionEvent - The completion event that will be used to
communicate the completion of and replication status for the commit
operation. A value of null indicates the caller is not interested
in the results of the commit operation.flags - Flags that qualify the commit operation. The following
flags are permitted for use:IStoreBinding.SUPPRESS_COMPLETION_EVENT_DISPATCH_IF_SYNC_COMPLETIONOdsException - Thrown if and only if an error is encountered before
the replication phse of the the commit process. In such as case, it is
guaranteed that the state of the store and transaction log is restored
to pre-commit state before the exception is thrown.
This method commits all changes made to a store via a binding using the
calling thread since the last commit. The commit operation essentially
consists of replicating changes recorded in a store's transaction log to
other (backup) store members. When invoked, this method first prepares
for the replication process. Any failure in this pre-replication phase
is reported to the user via an exception thrown by this method. If the
replication preparation completes successfully, the commit kicks off
the replication and returns to the caller. Any failure in the replication
is now reported to the user via the commit completion event object
supplied to this method (the user should not modify the completion event
until the commit has completed). Upon completion of the replication, the
ODS runtime sets a commit completion status in the completion event
(see IStoreCommitCompletionStatus) and notifies the user of the
completion. The notification is performed using the the notification
mode set by the user in the completion event object.
This method can be only be invoked on a binding in the open state.
This method cannot be invoked from within an event handler. Doing so can result in a deadlock.
public final IStoreCommitCompletionEvent commit(long transactionId, long stableTransactionId, IStoreCommitCompletionEvent completionEvent, int flags) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)commit in interface IStoreBindingOdsExceptionpublic final IStoreCommitCompletionEvent commit(IStoreCommitCompletionEvent completionEvent) throws OdsException
IStoreBinding.commit(long, long, com.neeve.ods.IStoreObject[], int, com.neeve.ods.IStoreCommitCompletionEvent, int)commit in interface IStoreBindingOdsExceptionpublic final int createSavepoint()
IStoreBinding
A savepoint serves as a delimiter that can used to partially rollback a transaction.
A subsequent call to IStoreBinding.rollback(int) with the returned savepoint version will
roll the transaction back to the state at the time of this call.
createSavepoint in interface IStoreBindingpublic final int getLastSavepoint()
IStoreBinding
Returns the savepoint version created by the last call to IStoreBinding.createSavepoint()
or the transaction's initial savepoint (0) if no savepoint has been created.
getLastSavepoint in interface IStoreBindingpublic final IStoreBinding rollback()
IStoreBinding.rollback()rollback in interface IStoreBindingpublic final IStoreBinding rollback(int savepoint)
IStoreBinding.rollback()rollback in interface IStoreBindingsavepoint - The savepoint to roll back to.IStoreBinding.createSavepoint()public final void fail(Exception e)
IStoreBinding.fail(java.lang.Exception)fail in interface IStoreBindinge - The exception that describes the failures. This exception
object will be attached to the binding failed event dispatched to
the user as a consequence of this method.public final void close(int flags)
IStoreBinding.close(int)close in interface IStoreBindingflags - Flags that qualify the close operation. The following
are the permissible flags that can be used with this method:IStoreBinding.NO_COMMIT_COMPLETIONS
- IStoreBinding.PRESERVE_ICR_CHANNEL_JOINSpublic final IStoreBinding getUnderlyingBinding()
public void setQueryAPICallerContext(IQueryAPICallerContext queryAPICallerContext)
IStoreBindingsetQueryAPICallerContext in interface IStoreBindingqueryAPICallerContext - The API context to set.public <K,T extends IStoreObject> IStoreUniqueIndex<K,T> createUniqueIndex(String fieldPath, String name)
IStoreBindingcreateUniqueIndex in interface IStoreBindingfieldPath - Field path for the object field on which index is created.name - Index name. The name is required.QueryEngine, else null.public <K,T extends IStoreObject> IStoreNonUniqueIndex<K,T> createNonUniqueIndex(String fieldPath, String name)
IStoreBindingcreateNonUniqueIndex in interface IStoreBindingfieldPath - Field path for the object field on which index is created.name - Index name. The name is required.QueryEngine, else null.public boolean dropIndexByName(String name)
IStoreBindingIStoreIndex is no longer valid.
Store must be queryable to support this operation.dropIndexByName in interface IStoreBindingname - Name of index to drop.true if index was successfully dropped, else false.public boolean dropIndex(String fieldPath)
IStoreBindingIStoreIndex is no longer valid.
Store must be queryable to support this operation.dropIndex in interface IStoreBindingfieldPath - Field path for the object field on which index is created.true if index was successfully dropped, else false.public boolean dropIndex(IStoreIndex<?,?> index)
IStoreBindingIStoreIndex is no longer valid.
Store must be queryable to support this operation.dropIndex in interface IStoreBindingindex - Store index reference to be dropped.true if index was successfully dropped, else false.public <K,T extends IStoreObject> IStoreUniqueIndex<K,T> getUniqueIndex(String fieldPath)
IStoreBindinggetUniqueIndex in interface IStoreBindingfieldPath - Field path for the object field on which index is created.IStoreUniqueIndex instance if index exists, else nullpublic <K,T extends IStoreObject> IStoreNonUniqueIndex<K,T> getNonUniqueIndex(String fieldPath)
IStoreBindinggetNonUniqueIndex in interface IStoreBindingfieldPath - Field path for the object field on which index is created.IStoreNonUniqueIndex instance if index exists, else null.Copyright © 2019 Neeve Research, LLC. All Rights Reserved.