All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gemstone.gemfire.internal.DSCODE Maven / Gradle / Ivy

There is a newer version: 2.0-BETA
Show newest version
/*
 * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License. You
 * may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License. See accompanying
 * LICENSE file.
 */
package com.gemstone.gemfire.internal;

import com.gemstone.gemfire.DataSerializer;

/**
 * An interface that contains a bunch of static final values used for the
 * implementation of {@link DataSerializer}.
 * It is basically an Enum and could be changed to one once we drop 1.4.
 * The allowed range of these codes is -128..127 inclusive (i.e. byte).
 *
 * @author Darrel Schneider
 * @since 5.7
 */
public interface DSCODE {
  /**
   * This byte value, -128, has never been used in any GemFire release
   * so far. It might get used in the future to introduce DataSerializer
   * versioning.
   */
  public static final byte RESERVED_FOR_FUTURE_USE = -128;

  public static final byte ILLEGAL = -127;

  // -126..0 unused

  /**
   * A header byte meaning that the next element in the stream is a
   * {@link DataSerializableFixedID} whose id is a single signed byte.
   * @since 5.7
   */
  public static final byte DS_FIXED_ID_BYTE = 1;
  /**
   * A header byte meaning that the next element in the stream is a
   * {@link DataSerializableFixedID} whose id is a single signed short.
   * @since 5.7
   */
  public static final byte DS_FIXED_ID_SHORT = 2;
  /**
   * A header byte meaning that the next element in the stream is a
   * {@link DataSerializableFixedID} whose id is a single signed int.
   * @since 5.7
   */
  public static final byte DS_FIXED_ID_INT = 3;
  /**
   * A header byte meaning that the next element in the stream is a
   * {@link DataSerializableFixedID} whose id is NO_FIXED_ID.
   * @since 5.7
   */
  public static final byte DS_NO_FIXED_ID = 4;

  /** A header byte meaning that the object was serialized by a user's
   * DataSerializer and the id is encoded with 2 bytes.
   * @since 5.7
   */
  public static final byte USER_CLASS_2 = 5;

  /** A header byte meaning that the object was serialized by a user's
   * DataSerializer and the id is encoded with 4 bytes.
   * @since 5.7
   */
  public static final byte USER_CLASS_4 = 6;

  // TypeIds 7 and 8 reserved for use by C# Serializable and XmlSerializable.

  // 9 unused

  /** A header byte meaning that the next element in the stream is a
   * LinkedList.
   */
  public static final byte LINKED_LIST = 10;

  /** A header byte meaning that the next element in the stream is a
   * Properties.
   * @since 5.7
   */
  public static final byte PROPERTIES = 11;

  // 12..16 unused

  /** Codes for the primitive classes, which cannot be recreated with
   * Class.forName(String,boolean,ClassLoader) like other classes
   */
  public static final byte BOOLEAN_TYPE = 17;
  public static final byte CHARACTER_TYPE = 18;
  public static final byte BYTE_TYPE = 19;
  public static final byte SHORT_TYPE = 20;
  public static final byte INTEGER_TYPE = 21;
  public static final byte LONG_TYPE = 22;
  public static final byte FLOAT_TYPE = 23;
  public static final byte DOUBLE_TYPE = 24;
  public static final byte VOID_TYPE = 25;

  /**
   * @since 5.7
   */
  public static final byte BOOLEAN_ARRAY = 26;
  /**
   * @since 5.7
   */
  public static final byte CHAR_ARRAY = 27;
  
  // 28..36 unused

  /** A header byte meaning that a DataSerializable that was
   * registered with the Instantiator was data serialized
   * using four bytes for its ID.
   * @since 5.7
   */
  public static final byte USER_DATA_SERIALIZABLE_4 = 37;

  /** A header byte meaning that a DataSerializable that was
   * registered with the Instantiator was data serialized
   * using two bytes for its ID.
   * @since 5.7
   */
  public static final byte USER_DATA_SERIALIZABLE_2 = 38;

  /** A header byte meaning that a DataSerializable that was
   * registered with the Instantiator was data serialized
   * using a single byte for its ID.
   */
  public static final byte USER_DATA_SERIALIZABLE = 39;

  /** A header byte meaning that the object was serialized by a user's
   * DataSerializer. */
  public static final byte USER_CLASS = 40;

  /** A header byte meaning that the next element in the stream is a
   * null */
  public static final byte NULL = 41;

  /** A header byte meaning that the next element in the stream is a
   * String */
  public static final byte STRING = 42;

  /** A header byte meaning that the next element in the stream is a
   *  (non-primitive) Class */
  public static final byte CLASS = 43;

  /** A header byte meaning that the next element in the stream is a
   * serialized object */
  public static final byte SERIALIZABLE = 44;

  /** A header byte meaning that the next element in the stream is a
   * DataSerializable object */
  public static final byte DATA_SERIALIZABLE = 45;

  /** A header byte meaning that the next element in the stream is a
   * byte array. */
  public static final byte BYTE_ARRAY = 46;

  /** A header byte meaning that the next element in the stream is a
   * short array. */
  public static final byte SHORT_ARRAY = 47;

  /** A header byte meaning that the next element in the stream is a
   * int array. */
  public static final byte INT_ARRAY = 48;

  /** A header byte meaning that the next element in the stream is a
   * long array. */
  public static final byte LONG_ARRAY = 49;

  /** A header byte meaning that the next element in the stream is a
   * float array. */
  public static final byte FLOAT_ARRAY = 50;

  /** A header byte meaning that the next element in the stream is a
   * double array. */
  public static final byte DOUBLE_ARRAY = 51;

  /** A header byte meaning that the next element in the stream is a
   * Object array. */
  public static final byte OBJECT_ARRAY = 52;

  /** A header boolean meaning that the next element in the stream is a
   * Boolean. */
  public static final byte BOOLEAN = 53;

  /** A header byte meaning that the next element in the stream is a
   * Character. */
  public static final byte CHARACTER = 54;

  /** A header byte meaning that the next element in the stream is a
   * Byte. */
  public static final byte BYTE = 55;

  /** A header byte meaning that the next element in the stream is a
   * Short. */
  public static final byte SHORT = 56;

  /** A header byte meaning that the next element in the stream is a
   * Integer. */
  public static final byte INTEGER = 57;

  /** A header byte meaning that the next element in the stream is a
   * Long. */
  public static final byte LONG = 58;

  /** A header byte meaning that the next element in the stream is a
   * Float. */
  public static final byte FLOAT = 59;

  /** A header byte meaning that the next element in the stream is a
   * Double. */
  public static final byte DOUBLE = 60;

  /** A header byte meaning that the next element in the stream is a
   * Date. */
  public static final byte DATE = 61;

  /** A header byte meaning that the next element in the stream is a
   * InetAddress. */
  public static final byte INET_ADDRESS = 62;

  /** A header byte meaning that the next element in the stream is a
   * File. */
  public static final byte FILE = 63;

  /** A header byte meaning that the next element in the stream is a
   * String array. */
  public static final byte STRING_ARRAY = 64;

  /** A header byte meaning that the next element in the stream is a
   * ArrayList. */
  public static final byte ARRAY_LIST = 65;

  /** A header byte meaning that the next element in the stream is a
   * HashSet. */
  public static final byte HASH_SET = 66;

  /** A header byte meaning that the next element in the stream is a
   * HashMap. */
  public static final byte HASH_MAP = 67;

  /** A header byte meaning that the next element in the stream is a
   * TimeUnit. */
  public static final byte TIME_UNIT = 68;

  /** A header byte meaning that the next element in the stream is a
   * null String. */
  public static final byte NULL_STRING = 69;

  /** A header byte meaning that the next element in the stream is a
   * Hashtable.
   * @since 5.7
   */
  public static final byte HASH_TABLE = 70;

  /** A header byte meaning that the next element in the stream is a
   * Vector.
   * @since 5.7
   */
  public static final byte VECTOR = 71;

  /** A header byte meaning that the next element in the stream is a
   * IdentityHashMap.
   * @since 5.7
   */
  public static final byte IDENTITY_HASH_MAP = 72;

  /** A header byte meaning that the next element in the stream is a
   * LinkedHashSet.
   * @since 5.7
   */
  public static final byte LINKED_HASH_SET = 73;

  /** A header byte meaning that the next element in the stream is a
   * Stack.
   * @since 5.7
   */
  public static final byte STACK = 74;

  /** A header byte meaning that the next element in the stream is a
   * TreeMap.
   * @since 5.7
   */
  public static final byte TREE_MAP = 75;

  /** A header byte meaning that the next element in the stream is a
   * TreeSet.
   * @since 5.7
   */
  public static final byte TREE_SET = 76;

  // 75..86 unused

  /** A header byte meaning that the next element in the stream is a
   *  buffer of 1-byte characters to turn into a String whose length
   * is <= 0xFFFF
   */
  public static final byte STRING_BYTES = 87;

  /**
   * A header byte meaning that the next element in the stream is a
   * buffer of 1-byte characters to turn into a String whose length
   * is > 0xFFFF.
   * @since 5.7
   */
  public static final byte HUGE_STRING_BYTES = 88;

  /**
   * A header byte meaning that the next element in the stream is a
   * buffer of 2-byte characters to turn into a String whose length
   * is > 0xFFFF.
   * @since 5.7
   */
  public static final byte HUGE_STRING = 89;

  /**
   * A header byte meaning that the next element in the stream is an
   * GemFireXD DataValueDescriptor array.
   * 
   * @since 6.0
   */
  public static final byte GFXD_DVD_ARR = 90;

  /** A header byte meaning that the next element in the stream is a
   * byte[][]. */
  public static final byte ARRAY_OF_BYTE_ARRAYS = 91;

  /**
   * A header byte meaning that the next element in the stream is an
   * object of GemFireXD XML type.
   * 
   * @since 6.5
   */
  public static final byte GFXD_XML = 92;

  /**
   * A header byte meaning that the next element in the stream is a
   * PdxSerializable object.
   * 
   * @since 6.6
   */
  public static final byte PDX = 93;
  
  /**
   * A header byte meaning that the next element in the stream is an
   * enum whose type is defined in the pdx registry.
   * 
   * @since 6.6.2
   */
  public static final byte PDX_ENUM = 94;

  /**
   * java.math.BigInteger
   * @since 6.6.2
   */
  public static final byte BIG_INTEGER = 95;
  /**
   * java.math.BigDecimal
   * @since 6.6.2
   */
  public static final byte BIG_DECIMAL = 96;
 
  /**
   * This code can only be used by PDX. It can't be used for normal
   * DataSerializer writeObject because it would break backward compatibility. A
   * header byte meaning that the next element in the stream is a
   * ConcurrentHashMap object.
   * 
   * @since 6.6
   */
  public static final byte CONCURRENT_HASH_MAP = 97;

  /**
   * java.util.UUID
   * @since 6.6.2
   */
  public static final byte UUID = 98;
  /**
   * java.sql.Timestamp
   * @since 6.6.2
   */
  public static final byte TIMESTAMP = 99;

  /**
   * Used for enums that need to always be deserialized into their enum domain class.
   * @since 6.6.2
   */
  public static final byte GEMFIRE_ENUM = 100;

  /**
   * Used for enums that need to be encoded inline because
   * the pdx registry may not be available.
   * During deserialization this type of enum may be deserialized as a PdxInstance.
   * @since 6.6.2
   */
  public static final byte PDX_INLINE_ENUM = 101;

  /**
   * Used for wildcard searches in soplogs with composite keys.
   * @since 7.5 
   */
  public static final byte WILDCARD = 102;
  
  /**
   * Used for GFXD JSON type
   */
  public static final byte GFXD_JSON = 103;
  
  // 104..127 unused

  // DO NOT USE CODES > 127. They are not "byte".
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy