Class TransformerContainerImpl
- All Implemented Interfaces:
DSContainer
,DSData
,DSPacket
,DSSerializable
,TransformerContainer
,TransformerData
,TransformerFlags
,Iterable<DSField>
-
Field Summary
Fields inherited from class com.caplin.transformer.module.datasrc.TransformerDataImpl
modCount
Fields inherited from interface com.caplin.datasrc.interfaces.DSContainer
ADD_OBJECT_AND_REQUEST_FIELDNUM, ADD_OBJECT_FIELDNUM, CLEARDOWN_WITH_PREFIX_FIELDNUM, REMOVE_OBJECT_FIELDNUM
Fields inherited from interface com.caplin.datasrc.interfaces.DSData
CONTAINER_TYPE, F_AUTH_UPDATE, F_AUTHGLOBAL, F_CHANGEDFIELDS, F_CLEAR_PERMISSIONS, F_CLEAR_TYPE2, F_CLEAR_TYPE3, F_CREATEOBJECT, F_CREATEPARENT, F_DELETE_PERMISSION, F_FILTER_TYPE2, F_FILTER_TYPE3, F_IMAGE, F_NONACTIVE, GENERIC_TYPE, NEWS_TYPE, PAGE_TYPE, PERMISSION_TYPE, RECORD_TYPE, STORY_TYPE, TYPE2_RECORD_TYPE, TYPE3_RECORD_TYPE, UNKNOWN_TYPE
Fields inherited from interface com.caplin.transformer.module.TransformerFlags
MAINTAIN_TIMESTAMP, NO_FLAGS, NO_PERSISTENCE, PUBLISH_TO_PEERS, SILENT_SEND, STORE_IN_CACHE
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransformerContainerImpl
(long dsDataPointer) Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class.protected
TransformerContainerImpl
(long dsDataPointer, boolean freeDsDataPointer) Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an instruction to append an object to this container.void
Adds an instruction to append an object to this container.void
cleardownObjectsWithPrefix
(String prefix) Adds an instruction to remove all objects from the container that have an object name that matches the provided prefix.void
insertObject
(String objectName, int position) Adds an instruction to insert an object into this container, pushing any object currently at that position, and all objects at successive positions, up one place (to the next higher index position).void
removeObject
(String objectName) Adds an instruction to remove an object from this container.Methods inherited from class com.caplin.transformer.module.datasrc.TransformerDataImpl
addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addData, addData, addData, addData, addData, addData, addData, addData, addString, addString, clearFields, count, elements, finalize, getDSDataPointer, getFieldByFieldNumber, getFieldByFieldNumber, getFlags, getKeys, getObjectType, getSequenceNumber, getSubject, getType, getValues, iterator, merge, removeField, send, send, sendDirect, sendToPeer, setFlags, setSubject, setType, setType, toBytes, updateData, updateData
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.caplin.datasrc.interfaces.DSData
addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addBinaryData, addData, addData, addData, addData, addData, addData, addData, addData, clearFields, count, elements, getFieldByFieldNumber, getFieldByFieldNumber, getFlags, getKeys, getSubject, getType, getValues, iterator, removeField, setFlags, setSubject, setType, updateData, updateData
Methods inherited from interface com.caplin.datasrc.interfaces.DSPacket
send, sendDirect, sendToPeer
Methods inherited from interface com.caplin.datasrc.interfaces.DSSerializable
toBytes
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.caplin.transformer.module.datasrc.TransformerData
getDSDataPointer, getObjectType, getSequenceNumber, merge, send, setType
-
Constructor Details
-
TransformerContainerImpl
protected TransformerContainerImpl(long dsDataPointer) Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class.
A TransformerContainer created with this constructor will be responsible for freeing the memory for the underlying C ds_data struct.
This is equivalent to calling TransformerContainer(dsDataPointer, true).
- Parameters:
dsDataPointer
- The pointer to the C ds_data struct that holds the state information for the update.
-
TransformerContainerImpl
protected TransformerContainerImpl(long dsDataPointer, boolean freeDsDataPointer) Constructor is protected to prevent a TransformerContainer being instantiated except by the DSFactory class.
- Parameters:
dsDataPointer
- The pointer to the C ds_data struct that holds the state information for the update.freeDsDataPointer
- true if the TransformerContainer is responsible for freeing up the memory for the C ds_data struct, or false if the Transformer core is responsible.
-
-
Method Details
-
addObject
Description copied from interface:DSContainer
Adds an instruction to append an object to this container.
- Specified by:
addObject
in interfaceDSContainer
- Parameters:
objectName
- the name of the object to be appended to this container (e.g. /OBJ1).
-
addObject
Description copied from interface:DSContainer
Adds an instruction to append an object to this container.
- Specified by:
addObject
in interfaceDSContainer
- Parameters:
objectName
- the name of the object to be appended to this container (e.g. /OBJ1).makeRequest
- true if the receiving DataSource should make a request for this object, false if thisDataSource
will automatically send the object without it needing to be requested.
-
removeObject
Description copied from interface:DSContainer
Adds an instruction to remove an object from this container.
- Specified by:
removeObject
in interfaceDSContainer
- Parameters:
objectName
- the name of the object to be removed from this container (e.g. /OBJ1).
-
insertObject
Description copied from interface:DSContainer
Adds an instruction to insert an object into this container, pushing any object currently at that position, and all objects at successive positions, up one place (to the next higher index position).
If
insertObject
is called more than once on the same DSContainer, the subsequent inserts are relative to the earlier ones. For example, assume a container has objectX
at position9
and objectY
at position10
. Now insert objectA
at position5
, followed by objectB
at position10
. The insertion of objectA
movesX
to position10
andY
to position11
. WhenB
is subsequently inserted at position10
, it goes immediately beforeX
, not beforeY
;X
moves to position11
andY
moves to position12
.- Specified by:
insertObject
in interfaceDSContainer
- Parameters:
objectName
- the name of the object to be inserted into this container (e.g. /OBJ1).position
- the position in the container where the object is to be inserted, where position0
(zero) represents the position of the first object.
-
cleardownObjectsWithPrefix
Description copied from interface:DSContainer
Adds an instruction to remove all objects from the container that have an object name that matches the provided prefix.
Instructions are processed in the order that they are added to the container and affect earlier instructions. For example, if in the same message you add object
/A/1
, clear down based on the prefix/A
and add object/A/2
then the processed container will only contain object/A/2
because object/A/1
will be cleared.- Specified by:
cleardownObjectsWithPrefix
in interfaceDSContainer
- Parameters:
prefix
- The prefix to match object names against and remove from the container.
-