com.ibm.rfid.epc.datahandler
Interface DataHandler

All Known Implementing Classes:
AbstractHandler, DOD, GIAI, GID, GRAI, GTIN14, SSCC18

public interface DataHandler

DataHandler is the common interface for all of the input handler classes used to represent data to be encoded into an EPC. This interface provides setters/getters for the common fields of the input handlers. An instance of a data handler is associated with a specific type of input data and understands how to parse that input data into fields. Those fields include a company prefix and other fields determined by the ECPglobal Tag Data Spec. For some input data types, the input may include a serial number, if so, it will be used to serialize the input data, if not provided, it will be generated. In combination with the fields parsed out of the input data, this serial number is used to create an EPCglobal ID URI which uniquely identifies a specific object/location/entity or collection thereof. This unique ID URI may then be used to create an EPC using the appropriate encoder(s) associated with the input type. Each input type has one or more encoders associated with it, they are identical in functionality, but differ in the length of the EPC that they generate from the ID URI.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String DOD
           
static java.lang.String GIAI
           
static java.lang.String GID
           
static java.lang.String GLN
           
static java.lang.String GRAI
           
static java.lang.String GTIN14
           
static int MAX_CAGE_DODAAC_LENGTH
           
static int MAX_EAN_UCC_COMPANY_PREFIX_LENGTH
           
static int MAX_GID_GENERAL_MANAGER_LENGTH
           
static int MAX_NDC10_COMPANY_PREFIX_LENGTH
           
static int MIN_CAGE_DODAAC_LENGTH
           
static int MIN_EAN_UCC_COMPANY_PREFIX_LENGTH
           
static int MIN_GID_GENERAL_MANAGER_LENGTH
           
static int MIN_NDC10_COMPANY_PREFIX_LENGTH
           
static java.lang.String NDC10
           
static java.lang.String SSCC18
           
 
Method Summary
 java.lang.String getCompanyPrefix()
          Gets the company prefix portion of the input data that was used to construct this instance of a data handler.
 java.lang.String getHandlerType()
          Gets the string name of the input handler used to construct this insntance.
 java.lang.String getInputData()
          Gets the input data that was used to construct this instance of a data handler
 int getMaxCompanyPrefixLength()
          Gets the maximum length that a company prefix can be for this input handler type.
 int getMinCompanyPrefixLength()
          Gets the minimum length that a company prefix can be for this input handler type.
 java.lang.String getSerialNumber()
          Gets the serial number associated with this instance of a data handler.
 java.lang.String getUnserializedPureId()
          Gets the portion of the ID URI (pure id) associated with this handler this is not serialized, i.e.
 java.lang.String serialize(java.lang.String discriminator)
          Generates a unique EPCglobal ID URI from the input data of this instance of data handler.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

GTIN14

static final java.lang.String GTIN14
See Also:
Constant Field Values

SSCC18

static final java.lang.String SSCC18
See Also:
Constant Field Values

GRAI

static final java.lang.String GRAI
See Also:
Constant Field Values

GIAI

static final java.lang.String GIAI
See Also:
Constant Field Values

NDC10

static final java.lang.String NDC10
See Also:
Constant Field Values

DOD

static final java.lang.String DOD
See Also:
Constant Field Values

GID

static final java.lang.String GID
See Also:
Constant Field Values

GLN

static final java.lang.String GLN
See Also:
Constant Field Values

MIN_EAN_UCC_COMPANY_PREFIX_LENGTH

static final int MIN_EAN_UCC_COMPANY_PREFIX_LENGTH
See Also:
Constant Field Values

MAX_EAN_UCC_COMPANY_PREFIX_LENGTH

static final int MAX_EAN_UCC_COMPANY_PREFIX_LENGTH
See Also:
Constant Field Values

MAX_CAGE_DODAAC_LENGTH

static final int MAX_CAGE_DODAAC_LENGTH
See Also:
Constant Field Values

MIN_CAGE_DODAAC_LENGTH

static final int MIN_CAGE_DODAAC_LENGTH
See Also:
Constant Field Values

MIN_NDC10_COMPANY_PREFIX_LENGTH

static final int MIN_NDC10_COMPANY_PREFIX_LENGTH
See Also:
Constant Field Values

MAX_NDC10_COMPANY_PREFIX_LENGTH

static final int MAX_NDC10_COMPANY_PREFIX_LENGTH
See Also:
Constant Field Values

MIN_GID_GENERAL_MANAGER_LENGTH

static final int MIN_GID_GENERAL_MANAGER_LENGTH
See Also:
Constant Field Values

MAX_GID_GENERAL_MANAGER_LENGTH

static final int MAX_GID_GENERAL_MANAGER_LENGTH
See Also:
Constant Field Values
Method Detail

getInputData

java.lang.String getInputData()
Gets the input data that was used to construct this instance of a data handler

Returns:
string input data

getCompanyPrefix

java.lang.String getCompanyPrefix()
Gets the company prefix portion of the input data that was used to construct this instance of a data handler. This interface refers to this field by the same name for all input types, however this field is named "Government Managed Identifier" for DoD encoding types and "General Manager Number" for the GID encoding type. This common field name is used because the field actaully serves the same function across all encoding types regardless of the exact semantics of the field name.

Returns:
string company prefix

getSerialNumber

java.lang.String getSerialNumber()
Gets the serial number associated with this instance of a data handler. This may have been included in the input data or generated during encoding. This interface refers to this field by the same name for all input types, although some encoding types may refer to it by a different name, for example, SGLN encoding type refers to it as an Exntension Component, SSCC18 encoding type refers to it as Serial Reference, etc. This common field name is used because the field actaully serves the same function across all encoding types regardless of the exact semantics of the field name.

Returns:
string numeric serial number

getHandlerType

java.lang.String getHandlerType()
Gets the string name of the input handler used to construct this insntance.

Returns:
string data handler name

getMaxCompanyPrefixLength

int getMaxCompanyPrefixLength()
Gets the maximum length that a company prefix can be for this input handler type.

Returns:
integer length

getMinCompanyPrefixLength

int getMinCompanyPrefixLength()
Gets the minimum length that a company prefix can be for this input handler type.

Returns:
integer length

serialize

java.lang.String serialize(java.lang.String discriminator)
                           throws com.ibm.rfid.epc.config.SerialGenerationException
Generates a unique EPCglobal ID URI from the input data of this instance of data handler. If a serial number was specified in the input data, it will be used to create the ID URI and it is the responsibility of the provider to manage it's uniqueness. It not provided in the input data, it will be generated and it's uniqueness will be managed by this system.

Parameters:
discriminator - a string that can refer to a location/entity/object with which to associate a serial number. This allows for managing of ranges of serial numbers, if this feature is not desired, an empty or null value may be passed.
Returns:
string in EPCglobal ID URI format. This format is used instead of the Tag URI format which specifies an encoding type, because the serialization must be unique at the ID URI level, not at the Tag URI level. Range checking of the serial number cannot be performed at this stage because the maximum serial number is dependent on the encoding type.
Throws:
com.ibm.rfid.epc.config.SerialGenerationException - if an error occurs during serialization. Range checking on the serial number is not performed during serialization and thus cannot be the cause of this exception.

getUnserializedPureId

java.lang.String getUnserializedPureId()
Gets the portion of the ID URI (pure id) associated with this handler this is not serialized, i.e. is determined by the input data only, and thus not unique. This string can be combined (in the method prescribed by the EPCglobasl Tag Data Spec) with a serial number to create a unique ID URI.

Returns:
string EPCglobal ID URI excluding the serial number


Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.