com.neeve.ods
Interface IStoreObject

All Superinterfaces:
UtlReferenceTracker.HasReferenceTracker
All Known Subinterfaces:
IRogCollectionNode<T>, IRogCollectionNodeElement, IRogContainerNode, IRogCopyableNode<T>, IRogDoubleMap<T>, IRogDoubleMapElement, IRogIntMap<T>, IRogIntMapElement, IRogList<T>, IRogListElement, IRogLongMap<T>, IRogLongMapElement, IRogMessage, IRogNode, IRogPojoShadowNode<T>, IRogQueue<T>, IRogQueueElement, IRogRawMessage, IRogSet<T>, IRogStringMap<T>, IRogStringMapElement, ISrvMonAppBusBindingCreatedMessage, ISrvMonAppBusBindingCreateFailedMessage, ISrvMonAppBusBindingCreateMessage, ISrvMonAppBusBindingDestroyedMessage, ISrvMonAppBusBindingDestroyMessage, ISrvMonAppBusBindingDownMessage, ISrvMonAppBusBindingOpenedMessage, ISrvMonAppBusBindingOpenFailedMessage, ISrvMonAppBusBindingOpeningMessage, ISrvMonAppBusBindingStateChangeMessage, ISrvMonAppBusBindingUpMessage, ISrvMonAppBusChannelClosedMessage, ISrvMonAppBusChannelOpenedMessage, ISrvMonAppChannelDownMessage, ISrvMonAppChannelUpMessage, ISrvMonAppClientConnectMessage, ISrvMonAppClientDisconnectMessage, ISrvMonAppDuplicateAcknowledgementAlertMessage, ISrvMonAppEngineActiveMessage, ISrvMonAppEngineCreatedMessage, ISrvMonAppEngineStartedMessage, ISrvMonAppEngineStoppedMessage, ISrvMonAppEngineStoppingMessage, ISrvMonAppExceptionMessage, ISrvMonAppFlowCreateMessage, ISrvMonAppInboundLogExceptionMessage, ISrvMonAppLoadedMessage, ISrvMonAppMessagingFailedMessage, ISrvMonAppMessagingPrestartMessage, ISrvMonAppMessagingStartedMessage, ISrvMonAppMessagingStartFailedMessage, ISrvMonAppOutboundLogExceptionMessage, ISrvMonAppOutOfOrderSendCommitCompletionAlertMessage, ISrvMonAppSendExceptionMessage, ISrvMonAppStateChangeMessage, ISrvMonAppStatsAlertMessage, ISrvMonAppStoreBindingFailedMessage, ISrvMonAppStoreBindingRoleChangedMessage, ISrvMonAppStoreMemberDownMessage, ISrvMonAppStoreMemberInitCompleteMessage, ISrvMonAppStoreMemberUpMessage, ISrvMonAppStoreTransactionLogRepairedMessage, ISrvMonAppStuckAlertMessage, ISrvMonAppUnhandledMessageMessage, ISrvMonAppUnloadedMessage, ISrvMonHeartbeatMessage, ISrvMonInvokeCommandRequest, ISrvMonInvokeCommandResponse, ISrvMonListCommandsRequest, ISrvMonListCommandsResponse, ISrvMonMessageBusBindingReconnectedMessage, ISrvMonMessageBusBindingReconnectingMessage, ISrvMonMessageTraceLoggingExceptionMessage, ISrvMonServerInfoRequest, ISrvMonServerInfoResponse, ISrvMonStartTraceWatchRequest, ISrvMonStartTraceWatchResponse, ISrvMonStopTraceWatchRequest, ISrvMonStopTraceWatchResponse, ISrvMonTraceRecord, ISrvMonUnhandledMessageMessage
All Known Implementing Classes:
AepEnvironmentData, com.neeve.rog.impl.RogNode, SrvMonAppBusBindingCreatedMessage, SrvMonAppBusBindingCreateFailedMessage, SrvMonAppBusBindingCreateMessage, SrvMonAppBusBindingDestroyedMessage, SrvMonAppBusBindingDestroyMessage, SrvMonAppBusBindingDownMessage, SrvMonAppBusBindingOpenedMessage, SrvMonAppBusBindingOpenFailedMessage, SrvMonAppBusBindingOpeningMessage, SrvMonAppBusBindingStateChangeMessage, SrvMonAppBusBindingUpMessage, SrvMonAppBusChannelClosedMessage, SrvMonAppBusChannelOpenedMessage, SrvMonAppChannelDownMessage, SrvMonAppChannelUpMessage, SrvMonAppClientConnectMessage, SrvMonAppClientDisconnectMessage, SrvMonAppDuplicateAcknowledgementAlertMessage, SrvMonAppEngineActiveMessage, SrvMonAppEngineCreatedMessage, SrvMonAppEngineStartedMessage, SrvMonAppEngineStoppedMessage, SrvMonAppEngineStoppingMessage, SrvMonAppExceptionMessage, SrvMonAppFlowCreateMessage, SrvMonAppInboundLogExceptionMessage, SrvMonAppLoadedMessage, SrvMonAppMessagingFailedMessage, SrvMonAppMessagingPrestartMessage, SrvMonAppMessagingStartedMessage, SrvMonAppMessagingStartFailedMessage, SrvMonAppOutboundLogExceptionMessage, SrvMonAppOutOfOrderSendCommitCompletionAlertMessage, SrvMonAppSendExceptionMessage, SrvMonAppStateChangeMessage, SrvMonAppStatsAlertMessage, SrvMonAppStoreBindingFailedMessage, SrvMonAppStoreBindingRoleChangedMessage, SrvMonAppStoreMemberDownMessage, SrvMonAppStoreMemberInitCompleteMessage, SrvMonAppStoreMemberUpMessage, SrvMonAppStoreTransactionLogRepairedMessage, SrvMonAppStuckAlertMessage, SrvMonAppUnhandledMessageMessage, SrvMonAppUnloadedMessage, SrvMonHeartbeatMessage, SrvMonInvokeCommandRequest, SrvMonInvokeCommandResponse, SrvMonListCommandsRequest, SrvMonListCommandsResponse, SrvMonMessageBusBindingReconnectedMessage, SrvMonMessageBusBindingReconnectingMessage, SrvMonMessageTraceLoggingExceptionMessage, SrvMonServerInfoRequest, SrvMonServerInfoResponse, SrvMonStartTraceWatchRequest, SrvMonStartTraceWatchResponse, SrvMonStopTraceWatchRequest, SrvMonStopTraceWatchResponse, SrvMonTraceRecord, SrvMonUnhandledMessageMessage

public interface IStoreObject
extends UtlReferenceTracker.HasReferenceTracker

Represents an ODS store object.

This interface defines the behavior of objects stored in ODSstores. An object can be stored in an ODS store if and only if it implements this interface.

Threading:
A store object is not safe for concurrent access by multiple threads.

Nested Class Summary
static class IStoreObject.EncodingType
          Defines the various supported encoding types.
 
Method Summary
 void acquire()
          Increase a store object's ownership count.
 IStoreObject deserialize(PktPacket serializedObject)
          Deserialize an object's data.
 IStoreObject deserializeMetadata(PktBuffer metadata)
          Deserialize an object's metadata from its serialized form.
 IStoreObject deserializeMetadata(PktBuffer metadata, boolean copyDeserialize)
          Deserialize an object's metadata from its serialized form.
 int dispose()
          Dispose a store object.
 com.eaio.uuid.UUID ensureId()
          Instructs the object to generate a UUID if not already generated.
 IStoreBinding getBinding()
          Get the store binding associated with an object.
 long getCheckpointVersion()
          Get an object's checkpoint version.
 IStoreObject.EncodingType getContentEncodingType()
          Get an object's content data encoding type.
 com.eaio.uuid.UUID getId()
          Get an object's id.
 boolean getIsReadOnly()
          Get whether a object is read only
 short getOfid()
          Get an object's factory id
 int getOwnershipCount()
          Get a store object's ownership count.
 int getSerializedMetadataLength()
          Get the length of an object's serialized metadata length
 long getStableTransactionId()
          Gets the transactionId considered stabilized by the application.
 long getTransactionId()
          Get the application transaction id.
 short getType()
          Get the object type.
 PktPacket serialize()
          Serialize an object's data.
 int serializeMetadata(com.neeve.io.IOElasticBuffer buffer, int offset)
          Serialize an object's metadata.
 IStoreObject setBinding(IStoreBinding binding)
          Set the store binding associated with an object.
 void setCheckpointVersion(long version)
          Update checkpoint version of an object
 IStoreObject setFieldValue(int id, Object val)
          Set the value of an object field.
 void setId(com.eaio.uuid.UUID id)
          Set an object'd id.
 IStoreObject setStableTransactionId(long id)
          Set the the transactionId considered stabilized by the application.
 IStoreObject setTransactionId(long id)
          Set the application transaction id.
 
Methods inherited from interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker
referenceTracker
 

Method Detail

setId

void setId(com.eaio.uuid.UUID id)
Set an object'd id. Each ODS store object is universally identified by a UUID. This method sets an object's id.

Note: This method may copy the uuid into a preallocated uuid instance in the interest of reducing garbage collection, so the caller should not rely on the instance subsequently returned from getId() to be the same instance, just an equivalent one.

Throws:
IllegalStateException - If the node already has an id set.
Threading:
This method can be concurrently invoked by multiple threads.

ensureId

com.eaio.uuid.UUID ensureId()
Instructs the object to generate a UUID if not already generated. After this call a call to getId() must return a non null value;

NOTE:
If this object is pooled, the validity of the returned UUID is only valid while the object remains undisposed (see dispose(). Once the object is returned to its pool the UUID may be wiped and reused. Consequently, callers that plan to use the returned id beyond this objects lifespan should either make a copy of it, or aquire this object to prevent it from be returned to its pool.

Returns:
the object's id.
Threading:
This method is not safe for use by multiple threads ... only one thread can initialize the UUID.

getId

com.eaio.uuid.UUID getId()
Get an object's id.

NOTE:
If this object is pooled, the validity of the returned UUID is only valid while the object remains, undisposed. Once the object is returned to its pool the UUID may be wiped and reused. Consequently, callers that plan to use the returned id beyond this objects lifespan should either make a copy of it, or aquire this object to prevent it from be returned to its pool.

Threading:
This method can be concurrently invoked by multiple threads.

Each ODS store object is universally identified by a UUID. This method returns an object's id.


getOfid

short getOfid()
Get an object's factory id

Threading:
This method can be concurrently invoked by multiple threads.

This method returns the id of the factory used to instantiate the object.


getType

short getType()
Get the object type.

Threading:
This method is safe for concurrent access by multiple threads

An object type uniquely identifies the object within its factory.


getIsReadOnly

boolean getIsReadOnly()
Get whether a object is read only


setTransactionId

IStoreObject setTransactionId(long id)
Set the application transaction id.

Parameters:
id - The transaction id to set

getTransactionId

long getTransactionId()
Get the application transaction id.


setStableTransactionId

IStoreObject setStableTransactionId(long id)
Set the the transactionId considered stabilized by the application.

Parameters:
id - The stable transaction id to set

getStableTransactionId

long getStableTransactionId()
Gets the transactionId considered stabilized by the application.

Returns:
the stable application transaction id.

setCheckpointVersion

void setCheckpointVersion(long version)
Update checkpoint version of an object

Parameters:
version - The new checkpoint version.
See Also:

Note: May only be called by an {@link IStoreBinding} to update the checkpoint version of the object.


getCheckpointVersion

long getCheckpointVersion()
Get an object's checkpoint version.

When an IStoreObject is added to a store or mutated its checkpoint modification counter is set to its IStoreBinding's next checkpoint number. This field can be used to perform 'change data capture' or CDC on stores that are checkpointed to see if a node has changed since a given store checkpoint.

When an object is removed for a store the store must set the checkpoint version of the object back to -1.

Returns:
The last checkpoint modification for the node.

setBinding

IStoreObject setBinding(IStoreBinding binding)
Set the store binding associated with an object.

Returns:
Returns this object for invocation chaining.

An object can be stored by one and only one store binding at any point in time. This method sets the binding associated with an object. The binding invokes this method when an object is put and removed from the store.

Threading:
This method can be concurrently invoked by multiple threads.

getBinding

IStoreBinding getBinding()
Get the store binding associated with an object.

Threading:
This method can be concurrently invoked by multiple threads.

setFieldValue

IStoreObject setFieldValue(int id,
                           Object val)
Set the value of an object field.

Returns:
Returns this object for invocation chaining.

This method is invoked during the rollback process to restore field values.

Threading:
This method will never be concurrently invoked by multiple threads.

getContentEncodingType

IStoreObject.EncodingType getContentEncodingType()
Get an object's content data encoding type.


getSerializedMetadataLength

int getSerializedMetadataLength()
Get the length of an object's serialized metadata length

Returns:
Returns the length, in bytes, of the serialzied metadata.
Threading:
This method will never be concurrently invoked by multiple threads.


serializeMetadata

int serializeMetadata(com.neeve.io.IOElasticBuffer buffer,
                      int offset)
Serialize an object's metadata.

Parameters:
buffer - The buffer to serialize the metadata to
offset - The offset within the buffer to serialize the metadata to.
Returns:
Returns the number of bytes serialized.
Threading:
This method will never be concurrently invoked by multiple threads.

This method is invoked during the commit process to serialize an object's metadata.


serialize

PktPacket serialize()
Serialize an object's data.

Threading:
This method will never be concurrently invoked by multiple threads.

This method is invoked during the commit process to serialize an object for replication and/or persistence and/or ICR send.


deserializeMetadata

IStoreObject deserializeMetadata(PktBuffer metadata)
Deserialize an object's metadata from its serialized form.

Parameters:
metadata - The metadata in serialized form.
Returns:
Returns 'this' object for invocation chaining.
Threading:
This method will never be concurrently invoked by multiple threads.

deserializeMetadata

IStoreObject deserializeMetadata(PktBuffer metadata,
                                 boolean copyDeserialize)
Deserialize an object's metadata from its serialized form.

Parameters:
metadata - The metadata in serialized form.
copyDeserialize - Whether the deserialization process should copy fields out of the serialized form into private members. A value of false could result in the metadata object holding onto the IOBuffer underlying the supplied metadata beyond the scope of this call.
Returns:
Returns 'this' object for invocation chaining.
Threading:
This method will never be concurrently invoked by multiple threads.

deserialize

IStoreObject deserialize(PktPacket serializedObject)
Deserialize an object's data.

Parameters:
serializedObject - The object in serialized form.
Returns:
Returns 'this' object for invocation chaining.
Threading:
This method will never be concurrently invoked by multiple threads.

acquire

void acquire()
Increase a store object's ownership count.

An object's ownership count starts at 1.


getOwnershipCount

int getOwnershipCount()
Get a store object's ownership count.


dispose

int dispose()
Dispose a store object.

This method should be invoked by the user when done with a store object. This allows the object implementation to track the lifetime of an object allow it to potentially implement faclities (such as object pooling) to improve performance. It is guaranteed however that not invoking this method will still cause the system to run correctly and in a stable fashion. However, in such a case, the performance may not be optimal.

Once disposed, all references to the disposed object should be discarded.

Returns:
The reference count after the dispose completed.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.