Class TemplateImpl

java.lang.Object
com.j_spaces.jmx.TemplateImpl
All Implemented Interfaces:
IGSEntry, Serializable

public class TemplateImpl extends Object implements IGSEntry
Implements IGSTemplate
Since:
6.0
Version:
1.0
Author:
Guyk
See Also:
  • Constructor Details

    • TemplateImpl

      public TemplateImpl()
    • TemplateImpl

      public TemplateImpl(TemplateInfo template, ITypeDesc typeDesc)
      Parameters:
      template -
      typeDesc -
  • Method Details

    • getClassName

      public String getClassName()
      Description copied from interface: IGSEntry
      Entry class Name.
      Specified by:
      getClassName in interface IGSEntry
      Returns:
      Returns the Entry class Name.
    • getCodebase

      public String getCodebase()
      Description copied from interface: IGSEntry
      Entry-class codebase.
      Specified by:
      getCodebase in interface IGSEntry
      Returns:
      returns the codebase of this entry.
    • getSuperClassesNames

      public String[] getSuperClassesNames()
      Description copied from interface: IGSEntry
      Entry Super Classes Names.
      Specified by:
      getSuperClassesNames in interface IGSEntry
      Returns:
      Returns the Entry Super Classes Names.
    • getFieldsNames

      public String[] getFieldsNames()
      Description copied from interface: IGSEntry
      Entry fields names.
      Specified by:
      getFieldsNames in interface IGSEntry
      Returns:
      Returns the entry fields names.
    • getFieldsTypes

      public String[] getFieldsTypes()
      Description copied from interface: IGSEntry
      Entry Fields Types.
      Specified by:
      getFieldsTypes in interface IGSEntry
      Returns:
      Returns The entry Fields Types
    • getIndexIndicators

      public boolean[] getIndexIndicators()
      Description copied from interface: IGSEntry
      Indexed fields array indication.
      Specified by:
      getIndexIndicators in interface IGSEntry
      Returns:
      Returns the indexed fields array indication
    • getRoutingFieldName

      public String getRoutingFieldName()
      Specified by:
      getRoutingFieldName in interface IGSEntry
    • getPrimaryKeyName

      public String getPrimaryKeyName()
      Description copied from interface: IGSEntry
      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.
    • getFieldType

      public String getFieldType(String fieldName)
      Description copied from interface: IGSEntry
      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)
      Description copied from interface: IGSEntry
      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.
    • isReplicatable

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

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

      public Object getFieldValue(String fieldName) throws IllegalArgumentException, IllegalStateException
      Description copied from interface: IGSEntry
      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.
      Throws:
      IllegalArgumentException - if field name is not avaliable
      IllegalStateException - if field values array was not properly set
    • getFieldValue

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

      public int getFieldPosition(String fieldName)
      Description copied from interface: IGSEntry
      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

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

      public Object[] getFieldsValues()
      Description copied from interface: IGSEntry
      Entry field Values.
      Specified by:
      getFieldsValues in interface IGSEntry
      Returns:
      Returns the entry field Values
    • getMapEntry

      public Map.Entry getMapEntry()
      Description copied from interface: IGSEntry
      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:
    • getObject

      public Object getObject(IJSpace space) throws UnusableEntryException
      Description copied from interface: IGSEntry
      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.
    • getTimeToLive

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

      public String getUID()
      Description copied from interface: IGSEntry
      Entry UID.
      Specified by:
      getUID in interface IGSEntry
      Returns:
      Returns the Entry UID
    • getVersion

      public int getVersion()
      Description copied from interface: IGSEntry
      Ascending version of this Entry
      Specified by:
      getVersion in interface IGSEntry
      Returns:
      the version of this entry.
    • isFifo

      public boolean isFifo()
      Description copied from interface: IGSEntry
      If true operations will be done using FIFO ordering when multiple match found.
      Specified by:
      isFifo in interface IGSEntry
      Returns:
      true if FIFO ordering is used
    • setFieldValue

      public Object setFieldValue(String fieldName, Object value) throws IllegalArgumentException, IllegalStateException
      Description copied from interface: IGSEntry
      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.
      Throws:
      IllegalArgumentException - if field name is not avaliable
      IllegalStateException - if field values array was not properly set
    • setFieldValue

      public Object setFieldValue(int position, Object value) throws IllegalArgumentException, IllegalStateException
      Description copied from interface: IGSEntry
      Associates the specified value with the specified field position.
      Specified by:
      setFieldValue in interface IGSEntry
      Parameters:
      position - 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
    • isTransient

      public boolean isTransient()
      Description copied from interface: IGSEntry
      Checks entry is transient even if space is persistent.
      Specified by:
      isTransient in interface IGSEntry
      Returns:
      true if entry is transient