Class ExternalEntry

java.lang.Object
com.j_spaces.core.client.ExternalEntry
All Implemented Interfaces:
IGSEntry, Serializable, Cloneable, Entry

@Deprecated public class ExternalEntry extends Object implements Entry, IGSEntry, Cloneable
Deprecated.
Since 8.0 - This class has been deprecated and will be removed in future versions. For id-based queries, use the GigaSpace.readById/readByIds and related overloades. For extended matching, use SQLQuery. For weak-type entries, use SpaceDocument.
See Also:
  • Field Details

    • m_UID

      public String m_UID
      Deprecated.
       Store Entry Unique ID.
       If this field is not null then this UID will be used
       by the Space, otherwise the space will generate it automatically.
       When entry have all its fields null (null template) and its UID is assigned,
       matching will be done using the UID only.
      
       The UID is a String based identifier and composed of the following parts:
       - Class information class Hashcode and name size
       - Space node name At clustered environment combined from container-name :space name. At
       non-clustered environment combined from dummy name.
       - Timestamp
       - Counter
       
    • m_ClassName

      public String m_ClassName
      Deprecated.
      The Entry class name.
    • m_SuperClassesNames

      public String[] m_SuperClassesNames
      Deprecated.
      The Entry super classes names array. The order of the values in the array is the class inheritance hierarchy.
    • m_FieldsNames

      public String[] m_FieldsNames
      Deprecated.
      The Entry field names array.
    • m_FieldsTypes

      public String[] m_FieldsTypes
      Deprecated.
      The Entry field Types.
    • m_FieldsValues

      public Object[] m_FieldsValues
      Deprecated.
      The Entry field values.
    • m_IndexIndicators

      public boolean[] m_IndexIndicators
      Deprecated.
      Contains array of boolean values that indicate which of the class fields are index fields.
    • m_PrimaryKeyName

      public String m_PrimaryKeyName
      Deprecated.
      The field name representing the primary key. Usually the field name of the first indexed field.
      See Also:
    • m_Replicatable

      public boolean m_Replicatable
      Deprecated.
      Contains a tag that indicates whether the class should be replicated or not. Used only in the case of partial replication.
    • m_Broadcast

      public boolean m_Broadcast
      Deprecated.
      If true m_Broadcast enabled.
    • m_MultipleUIDs

      public String[] m_MultipleUIDs
      Deprecated.
      Contains array of UIDs. Used in readMultiple/takeMultiple operations. holds the UIDs of the Objects that are going to be read or take. when using m_ReturnOnlyUids=true the returned UIDs are are kept here in the first Entry returned.
    • m_ReturnOnlyUids

      public boolean m_ReturnOnlyUids
      Deprecated.
      If true readMultiple/takeMultiple return only UIDs.
    • m_isFifo

      public boolean m_isFifo
      Deprecated.
      FIFO Indication, if true the entry will be returned in a FIFO way.
    • m_VersionID

      public int m_VersionID
      Deprecated.
      Contains a version number that is incremented each time the entry is updated. The initial value to be stored in the space is 1, and is incremented after each update. Value is used for optimistic locking.
    • m_ExtendedMatchCodes

      public short[] m_ExtendedMatchCodes
      Deprecated.
      Codes for extending matching.
      See Also:
    • m_ExtendedMatchCodeColumns

      public short[] m_ExtendedMatchCodeColumns
      Deprecated.
      Codes for extending matching with columns in comparison.
      See Also:
    • m_RangeValues

      public Object[] m_RangeValues
      Deprecated.
      range values- correspond to m_ExtendedMatchCodes, this is UP-TO and include values.
    • m_RangeValuesInclusion

      public boolean[] m_RangeValuesInclusion
      Deprecated.
      boolean array that indicates for each range value if it is included in range or not
    • m_TimeToLive

      public long m_TimeToLive
      Deprecated.
      Read only field. Time (in milliseconds) left for this entry to live. This value is correct for the operation time.
    • m_isTransient

      public boolean m_isTransient
      Deprecated.
      If true will be transient.
    • m_NOWriteLeaseMode

      public boolean m_NOWriteLeaseMode
      Deprecated.
      If true Lease object would not return from the write/writeMultiple operations.
    • routingFieldName

      public String routingFieldName
      Deprecated.
      The field name representing routing field name. on that is taken as the first index for partition.
      See Also:
    • _primitiveFields

      public boolean[] _primitiveFields
      Deprecated.
    • _returnTrueType

      public boolean _returnTrueType
      Deprecated.
  • Constructor Details

    • ExternalEntry

      public ExternalEntry()
      Deprecated.
      Default constructor required for java.io.Externalizable interface.
    • ExternalEntry

      public ExternalEntry(String entryUID)
      Deprecated.
      Constructs an ExternalEntry object that will be used as a template. The template matching will be done based on the entry UId only.
      Parameters:
      entryUID - entry UID.
    • ExternalEntry

      protected ExternalEntry(ExternalEntry entry)
      Deprecated.
      Copy constructor, creates a copy of this entry.
      Parameters:
      entry - another ExternalEntry
    • ExternalEntry

      public ExternalEntry(String[] multipleUIDs)
      Deprecated.
      Constructs an ExternalEntry object that will be used as a template for readMultiple/takeMultiple operations.
      You can read/take multiple Entries from the space using their UID's in one space operation. You should construct ExternalEntry template that includes array of the Entry's UID and use this template with the readMultiple operation. See below example:
      The Entry Class:
       
      
       public class MyEntry extends MetaDataEntry{
       public MyEntry (){}
       public MyEntry (int num)
       {
       this.attr1 = "attr1 " + num;
       this.attr2 = "attr2 " + num;
       }
       public String attr1,attr2;
       public String toString()
       {
       return "UID:"  + __getEntryInfo().m_UID + " attr1:" + attr1 + " attr2:"+ attr2;
       }
       }
       
       
      The Application code:
       
       IJSpace space = (IJSpace )SpaceFinder.find("/./mySpace");
       String uid[] = new String[10];
       for (int i=0; i < 10 ;i++ )
       {
       uid[i] = ClientUIDHandler.createUIDFromName(i , MyEntry.class.getName());
       MyEntry entry = new MyEntry(i);
       entry.__setEntryInfo(new EntryInfo(uid[i],0));
       space.write(entry , null ,Lease.FOREVER );
       }
       ExternalEntry multiUIDtemplate = new ExternalEntry(uid);
       Entry[] result = space.readMultiple(multiUIDtemplate , null , Integer.MAX_VALUE);
       for (int i=0; i < result.length ;i++ )
       {
       ExternalEntry ee = (ExternalEntry)result[i];
       System.out.println(ee.getEntry(space));
       }
      
       
       
      Parameters:
      multipleUIDs - Entries UIDs array.
    • ExternalEntry

      public ExternalEntry(String className, Object[] fieldsValues, String[] fieldsNames, String[] fieldsTypes)
      Deprecated.
      Constructs an ExternalEntry object. Use this constructor to introduce a new class to the space.
      Parameters:
      className - The entry class name
      fieldsValues - The entry field values array
      fieldsNames - The entry field names array
      fieldsTypes - The entry field types array. Field types should be Java full class names.
    • ExternalEntry

      public ExternalEntry(String className, Object[] fieldsValues, String[] fieldsNames)
      Deprecated.
      Constructs an ExternalEntry object. Use this constructor to introduce a new class to the space.
      Parameters:
      className - The Entry class name
      fieldsValues - The Entry field values array
      fieldsNames - The Entry field names array
    • ExternalEntry

      public ExternalEntry(String className, Object[] fieldsValues)
      Deprecated.
      Constructs an ExternalEntry object. Do not use this constructor to introduce new the class to the space.
      Parameters:
      className - The class name
      fieldsValues - Entry field values array
  • Method Details

    • getPrimitiveFields

      public boolean[] getPrimitiveFields()
      Deprecated.
    • hasExtendedInfo

      public boolean hasExtendedInfo()
      Deprecated.
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Deprecated.
      Save the object contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
      Parameters:
      out - the stream to write the object to
      Throws:
      IOException - Includes any I/O exceptions that may occur
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Deprecated.
      Restore the class contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
      Parameters:
      in - the stream to read data from in order to restore the object
      Throws:
      IOException - if I/O errors occur
      ClassNotFoundException - If the class for an object being restored cannot be found.
    • equals

      public boolean equals(Object obj)
      Deprecated.
      Checks for identical UIDs and field values.
      Overrides:
      equals in class Object
      Parameters:
      obj - the ExternalEntry to compare
      Returns:
      Returns true if identical UID and field values.
    • equals

      public static boolean equals(Object o1, Object o2)
      Deprecated.
      General equals method that compares two objects considering null values and multi-dimensional arrays. In case of arrays - their members are compared recursively.
      Returns:
      true if two objects are equal
    • hashCode

      public int hashCode()
      Deprecated.
      Entry UID hashCode.
      Overrides:
      hashCode in class Object
      Returns:
      Returns the Entry UID hashCode.
    • getClassName

      public String getClassName()
      Deprecated.
      Entry class Name.
      Specified by:
      getClassName in interface IGSEntry
      Returns:
      Returns the Entry class Name.
    • setClassName

      public void setClassName(String className)
      Deprecated.
      This method should be used for new Entry classes introduced to the space.
      Parameters:
      className - The Entry class Name to set.
    • getExtendedMatchCodes

      public short[] getExtendedMatchCodes()
      Deprecated.
      Matching codes array.
      Returns:
      Returns the Matching codes array.
    • getExtendedMatchCodeColumns

      public short[] getExtendedMatchCodeColumns()
      Deprecated.
      Matching code columns array.
      Returns:
      Returns the Matching code columns array.
    • setExtendedMatchCodes

      public void setExtendedMatchCodes(short[] extendedMatchCodes)
      Deprecated.
      The matching codes.
      Parameters:
      extendedMatchCodes - The matching codes to set for template objects.
                                                           This array should match the field values
                                 array.
                                                           Optional Values:
                                                           TemplateMatchCodes.EQ - equal
                                                           TemplateMatchCodes.NE - not equal
                                                           TemplateMatchCodes.GT - greater than
                                                           TemplateMatchCodes.GE - grater-equal
                                                           TemplateMatchCodes.LT - less than
                                                           TemplateMatchCodes.LE - less-equal
                                                           TemplateMatchCodes.IS_NULL - entry field
                                 is null (template field
                                                           not relevant)
                                                           TemplateMatchCodes.NOT_NULL - entry field
                                 is not null (template
                                                           field not relevant)
                                                           
    • setExtendedMatchCodeColumns

      public void setExtendedMatchCodeColumns(short[] extendedMatchCodeColumns)
      Deprecated.
    • getFieldsNames

      public String[] getFieldsNames()
      Deprecated.
      Entry fields names.
      Specified by:
      getFieldsNames in interface IGSEntry
      Returns:
      Returns the entry fields names.
    • setFieldsNames

      public void setFieldsNames(String[] fieldsNames)
      Deprecated.
      Set the entry field names.
      Parameters:
      fieldsNames - The entry field names
    • getFieldsTypes

      public String[] getFieldsTypes()
      Deprecated.
      Entry Fields Types.
      Specified by:
      getFieldsTypes in interface IGSEntry
      Returns:
      Returns The entry Fields Types
    • setFieldsTypes

      public void setFieldsTypes(String[] fieldsTypes)
      Deprecated.
      Entry fields types to set.
      Parameters:
      fieldsTypes - The Entry fields types to set. Field types are Java classes full names.
    • getFieldsValues

      public Object[] getFieldsValues()
      Deprecated.
      Entry field Values.
      Specified by:
      getFieldsValues in interface IGSEntry
      Returns:
      Returns the entry field Values
    • setFieldsValues

      public void setFieldsValues(Object[] fieldsValues)
      Deprecated.
      Entry field values to set.
      Parameters:
      fieldsValues - Entry field values to set
    • getRangeValues

      public Object[] getRangeValues()
      Deprecated.
      Entry range Values.
      Returns:
      Returns the entry range Values
    • setRangeValues

      public void setRangeValues(Object[] rangeValues)
      Deprecated.
      Entry range values to set.
      Parameters:
      rangeValues - Entry range values to set
    • isFifo

      public boolean isFifo()
      Deprecated.
      FIFO Indication.
      Specified by:
      isFifo in interface IGSEntry
      Returns:
      Returns the FIFO Indication.
    • setFifo

      public void setFifo(boolean fifo)
      Deprecated.
      Set the FIFO indication.
      Parameters:
      fifo - FIFO indication. This method should be used for new Entry Classes introduced to the space and for templates objects used for matching.
    • getIndexIndicators

      public boolean[] getIndexIndicators()
      Deprecated.
      Indexed fields array indication.
      Specified by:
      getIndexIndicators in interface IGSEntry
      Returns:
      Returns the indexed fields array indication
    • setIndexIndicators

      public void setIndexIndicators(boolean[] indexIndicators)
      Deprecated.
      indexed fields array indication to set.
      Parameters:
      indexIndicators - Array of fields to Index. The values of this array should match the fields array
    • getPrimaryKeyName

      public String getPrimaryKeyName()
      Deprecated.
      The field name representing the primary key. Usually the field name of the first indexed field (can be null).
      Specified by:
      getPrimaryKeyName in interface IGSEntry
      Returns:
      field name of the primary key.
      See Also:
    • setPrimaryKeyName

      public void setPrimaryKeyName(String fieldName)
      Deprecated.
      Sets the field name representing the primary key. Usually the field name of the first indexed field.
      Parameters:
      fieldName - field name of the primary key.
      See Also:
    • getMultipleUIDs

      public String[] getMultipleUIDs()
      Deprecated.
      Array of Entry UIDs.
      Returns:
      Returns Array of Entry UIDs
    • setMultipleUIDs

      public void setMultipleUIDs(String[] multipleUIDs)
      Deprecated.
      Array of Entry UIDs to read.
      Parameters:
      multipleUIDs - Array of Entry UIDs to read.
    • isReplicatable

      public boolean isReplicatable()
      Deprecated.
      Check if replicatable, applicable only when used with partial replication.
      Specified by:
      isReplicatable in interface IGSEntry
      Returns:
      true if this entry is replicatable.
    • setReplicatable

      public void setReplicatable(boolean replicatable)
      Deprecated.
      Set the replicatable indication value.
      Parameters:
      replicatable - The replicatable indication value. This method should be used with clustered spaces.
    • isBroadcast

      public boolean isBroadcast()
      Deprecated.
      Check if broadcast, applicable only when used with partial replication.
      Specified by:
      isBroadcast in interface IGSEntry
      Returns:
      true if this entry is broadcast.
    • setBroadcast

      public void setBroadcast(boolean broadcast)
      Deprecated.
      Set the Broadcast indication value.
      Parameters:
      Broadcast - The Broadcast indication value.
    • isReturnOnlyUids

      public boolean isReturnOnlyUids()
      Deprecated.
      ReturnOnlyUids indication.
      Returns:
      Returns the ReturnOnlyUids indication
    • setReturnOnlyUids

      public void setReturnOnlyUids(boolean returnOnlyUids)
      Deprecated.
      set the ReturnOnlyUids indication.
      Parameters:
      returnOnlyUids - set the returnOnlyUids indication value
    • getSuperClassesNames

      public String[] getSuperClassesNames()
      Deprecated.
      Entry Super Classes Names.
      Specified by:
      getSuperClassesNames in interface IGSEntry
      Returns:
      Returns the Entry Super Classes Names.
    • getCodebase

      public String getCodebase()
      Deprecated.
      Entry-class codebase.
      Specified by:
      getCodebase in interface IGSEntry
      Returns:
      default implementation returns null.
    • setSuperClassesNames

      public void setSuperClassesNames(String[] superClassesNames)
      Deprecated.
      set the Super Classes Names Array.
      Parameters:
      superClassesNames - The Super Classes Names Array
    • getTimeToLive

      public long getTimeToLive()
      Deprecated.
      Entry time to live.
      Specified by:
      getTimeToLive in interface IGSEntry
      Returns:
      the Entry's time to live in milliseconds.
      See Also:
    • setTimeToLive

      public ExternalEntry setTimeToLive(long timeToLive)
      Deprecated.
      Set the time left for this entry to live.
      Parameters:
      timeToLive - in milliseconds
    • getVersion

      public int getVersion()
      Deprecated.
      Ascending version of this Entry Inherited from IGSEntry and is equivalent to calling getVersionID()
      Specified by:
      getVersion in interface IGSEntry
      Returns:
      the version of this entry.
      See Also:
    • setVersion

      public void setVersion(int version)
      Deprecated.
    • isTransient

      public boolean isTransient()
      Deprecated.
      Check if Transient entry.
      Specified by:
      isTransient in interface IGSEntry
      Returns:
      Returns true if Transient Entry.
    • setTransient

      public void setTransient(boolean isTransient)
      Deprecated.
      Sets the entry to be transient (true) or persistent (false).
    • makeTransient

      public void makeTransient()
      Deprecated.
      Construct Transient Entry. This method should be used with Persistent spaces. This method should be used with new entries.
    • makePersistent

      public void makePersistent()
      Deprecated.
      Construct Persistent Entry. This method should be used with Persistent spaces. This method should be used with new entries.
    • getMapEntry

      public Map.Entry getMapEntry()
      Deprecated.
      Returns a Map.Entry (key-value pair) representation of this entity. Relevant when interacting with the Space using Map API; otherwise a null is returned.
      Specified by:
      getMapEntry in interface IGSEntry
      Returns:
      a Map.Entry representation of this entity; null if no representation.
      See Also:
    • getUID

      public String getUID()
      Deprecated.
      Entry UID.
      Specified by:
      getUID in interface IGSEntry
      Returns:
      Returns the Entry UID
    • setUID

      public void setUID(String m_uid)
      Deprecated.
      Set Entry UID.
      Parameters:
      m_uid - The Entry UID to set. When using this method make sure you are using unique value. This method should get as input returned value from ClientUIDHandler.createUIDFromName
                                 The UID is a String based identifier and composed of the following
                    parts:
                                 - Class information  class Hashcode and name size
                                 - Space node name At clustered environment combined from
                    container-name :space
                                 name. At non-clustered environment combined from dummy name.
                                 - Timestamp
                                 - Counter
                                 
    • getVersionID

      public int getVersionID()
      Deprecated.
      Entry Version ID.
      Returns:
      Returns the Entry Version ID. The version number is incremented each time an entry is updated. The initial value to be stored in the space is 1, and is incremented after each update. This value is used when running in optimistic locking mode.
    • setVersionID

      public void setVersionID(int versionID)
      Deprecated.
      Entry Version ID.
      Parameters:
      versionID - The Entry Version ID to set.
    • setNOWriteLeaseMode

      public void setNOWriteLeaseMode(boolean noWriteLeaseMode)
      Deprecated.
      Set true do not return Lease object after write, false return Lease object after write.
      Parameters:
      noWriteLeaseMode - write mode.
    • isNOWriteLeaseMode

      public boolean isNOWriteLeaseMode()
      Deprecated.
      Check write mode.
      Returns:
      true if do not return Lease object after write, otherwise false.
    • getFieldValue

      public Object getFieldValue(String fieldName)
      Deprecated.
      Retrieves the given field value.
      Specified by:
      getFieldValue in interface IGSEntry
      Parameters:
      fieldName - name of the field (e.g. Field.getName().
      Returns:
      the field value.
    • setFieldValue

      public Object setFieldValue(String fieldName, Object value)
      Deprecated.
      Associates the specified value with the specified field.
      Specified by:
      setFieldValue in interface IGSEntry
      Parameters:
      fieldName - the field name.
      value - value to be associated with the specified field.
      Returns:
      the value that was associated with the specified field.
    • getFieldType

      public String getFieldType(String fieldName)
      Deprecated.
      Retries the given field its type class name.
      Specified by:
      getFieldType in interface IGSEntry
      Parameters:
      fieldName - the field name.
      Returns:
      the field type class name.
    • isIndexedField

      public boolean isIndexedField(String fieldName)
      Deprecated.
      Checks if the given field is indexed.
      Specified by:
      isIndexedField in interface IGSEntry
      Parameters:
      fieldName - the field name.
      Returns:
      true if the the field is indexed.
    • getFieldValue

      public Object getFieldValue(int index) throws IllegalArgumentException, IllegalStateException
      Deprecated.
      Retrieves the given field value by position.
      Specified by:
      getFieldValue in interface IGSEntry
      Parameters:
      index - the field position.
      Returns:
      the field value.
      Throws:
      IllegalArgumentException - if field name is not avaliable
      IllegalStateException - if field values array was not properly set
    • setFieldValue

      public Object setFieldValue(int index, Object value) throws IllegalArgumentException, IllegalStateException
      Deprecated.
      Associates the specified value with the specified field position.
      Specified by:
      setFieldValue in interface IGSEntry
      Parameters:
      index - the field position.
      value - value to be associated with the specified field.
      Returns:
      the value that was associated with the specified field.
      Throws:
      IllegalArgumentException - if field name is not avaliable
      IllegalStateException - if field values array was not properly set
    • getFieldPosition

      public int getFieldPosition(String fieldName)
      Deprecated.
      Return the the field position in the FieldsValues array.
      Specified by:
      getFieldPosition in interface IGSEntry
      Parameters:
      fieldName - name of the field (e.g. Field.getName().
      Returns:
      the field position in the field values array returned by {IGSEntry.getFieldsValues().
    • getEntry

      public Entry getEntry(IJSpace space) throws UnusableEntryException
      Deprecated.
      Throws:
      UnusableEntryException
    • getObject

      public Object getObject(IJSpace space) throws UnusableEntryException
      Deprecated.
      Converts to object.
      Notice: The returned object is a transformation of this IGSEntry and each change in entry fields should be using IGSEntry.setFieldValue(int, Object) or IGSEntry.setFieldValue(String, Object).
      Specified by:
      getObject in interface IGSEntry
      Parameters:
      space - Space proxy.
      Returns:
      Returns converted Object.
      Throws:
      UnusableEntryException - One or more fields in the entry cannot be deserialized, or the class for the entry type itself cannot be deserialized.
    • getRoutingFieldName

      public String getRoutingFieldName()
      Deprecated.
      Get the routing field name that was selected to be the first index for partition.
      Specified by:
      getRoutingFieldName in interface IGSEntry
      Returns:
      the routing field name
    • setRoutingFieldName

      public void setRoutingFieldName(String routingFieldName)
      Deprecated.
      Set the routing field name that was selected to be the first index for partition.
      Parameters:
      routingFieldName - the routing field name
    • clone

      public Object clone()
      Deprecated.
      Shallow clone
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of this instance
    • getExtendedMatchCode

      public short getExtendedMatchCode(int index)
      Deprecated.
      Get extended match code at specified index
      Returns:
      the match code for the given property index
    • getExtendedMatchCodeColumn

      public int getExtendedMatchCodeColumn(int index)
      Deprecated.
      Get extended match code at specified index
      Returns:
      the match code for the given property index
    • getRangeValue

      public Object getRangeValue(int index)
      Deprecated.
      Get range value at specified index
      Returns:
      the range value for the given property index
    • getRangeValueInclusion

      public boolean getRangeValueInclusion(int index)
      Deprecated.
      Get range value inclusion indicator at specified index
      Returns:
      the inclusion indicator for the given property index
    • isExtended

      public boolean isExtended()
      Deprecated.
      Returns:
      true if external entry has extended matching
    • toString

      public String toString()
      Deprecated.
      Returns a string representation of the ExternalEntry.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the ExternalEntry.