com.ibm.rfid.epc
Class EPC

java.lang.Object
  extended by com.ibm.rfid.epc.EPC
All Implemented Interfaces:
java.io.Serializable

public class EPC
extends java.lang.Object
implements java.io.Serializable

Represents an EPCglobal® EPC® (Electronic Product Code) which is a unique identifier with well-defined semantics sutiable for use with RFID (Radio Frequency IDentification) tags. These semantics are defined by the TDS (Tag Data Specification) published by EPCglobal. In order to be compliant with the TDS an EPC must be encoded in strict accordance with the rules defined in the TDS. An EPC consists of one or more data fields in which is encoded either metadata or regular data. The metadata is contained in the header field which specifies the standard format in which the tag data is encoded. The content and format of the remaining tag data fields is determined by the type of encoding specifed in the header and the tag memory size. In addition to other encoding specific fields, each tag data format includes a serialized field. This field in conjunction with all other fields other than the header and filter, ensure uniqueness. It is very important to note that neither the header or filter field may be used in assuring the uniqueness of an EPC. Please consult the latest version of the TDS for further details.

Since an EPC must be a unique identifer, it is the responsiblility of this class to ensure its uniqueness. This is accomplished through the of the EPC Serial Number Configuration services provided by the WRPS (Websphere RFID Premises Server). These serialization configurations determine how an EPC is generated for a given product, location or entity.

An EPC is constructed by specifying the encoding type, a filter value, and product/location/entity identity data. This data may be one of the EAN/UCC® numbering types such as GTIN, SSCC, GRAI, etc, or any other data type approved by the EPCglobal TDS.

EPCglobal, EPC, EAN and UCC are registered trademarks of the respective organizations.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
EPC(java.lang.String tagURIOrHexEPC)
          Construct an EPC given either an EPCglobal tag URI (e.g.
EPC(java.lang.String inputType, java.lang.String encodingType, int companyPrefixLength, java.lang.String filterValue, java.lang.String packUnitType, java.lang.String inputData, java.lang.String discriminator)
          Constructs an EPC object.
 
Method Summary
 byte[] getBytes()
          Gets the EPC as an array of bytes
 int getCompanyPrefixLength()
          Gets the length of the company prefix/general manager/CAGE/DoDAAC portion of the input data used to generate this EPC.
 java.lang.String getDiscriminator()
          Gets the discriminator used in generating this EPC
 java.lang.String getEncodingType()
          Gets the encoding type used in generating this EPC.
 java.lang.String getFilterValue()
          Gets the filter value used in generating this EPC.
 java.lang.String getInputData()
          Gets the input data used in generating this EPC
 java.lang.String getInputType()
          Gets the input type used in generating this EPC.
 java.lang.String getPackType()
          Gets the pack type used in generating this EPC
 java.lang.String toBinaryString()
          Gets a string version of this EPC in binary format, for example: 0001100111001111011111...
 java.lang.String toString()
          Gets a string version of this EPC in hexadecimal format, for example: 1234567890ABCDEF
 java.lang.String toStringIdURI()
          Gets a string version of this EPC in EPCglobal id URI format, for example: urn:epc:id:dod:1AB2C3.201
 java.lang.String toStringRawURI()
          Gets a string version of this EPC in EPCglobal raw URI format, for example: urn:epc:raw:96.x123456789012345678901234
 java.lang.String toStringTagURI()
          Gets a string version of this EPC in EPCglobal tag URI format, for example: urn:epc:tag:dod-96:1.1AB2C3.201
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

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

EPC

public EPC(java.lang.String inputType,
           java.lang.String encodingType,
           int companyPrefixLength,
           java.lang.String filterValue,
           java.lang.String packUnitType,
           java.lang.String inputData,
           java.lang.String discriminator)
    throws EPCException
Constructs an EPC object. The EPC will be generated based on the parameters specified and the serialization configuration associated with the supplied parameters. Serialization configs are maintained by WRPS (Websphere RFID Premises Server) and control the creation of the serial number portion of the EPC by defining a start and end range and an increment. The combination of the inputData parameter which contains product/location/entity identification info and a serialization config for that inputData determines the serial number portion of the EPC. Once constructed, the EPC may be expressed in a number of ways as specified by EPCglobal specifications. It may be accessed as a EPCglobal tag URI toStringTagURI, a raw URI toStringRawURI, an id URI toStringIdURI, or as a hexadecimal number toString. The format of the input data follows:
Input Type Format
GTIN14 fixed length, 12 (UCC12), 13 (EAN13) or 14 numeric characters
SSCC18 variable length, either 18 numeric characters representing a full EAN.UCC SSCC or just company prefix + extension digit. If full SSCC is specified, it is already serialized and thus no serial number will be created, only EPC encoding occurs. If a company prefix + extension digit is specified, a serial number will be generated and the EPC encoded
GIAI variable length, either up to 30 numeric characters representing a full EAN.UCC GIAI or just company prefix + asset reference. If full GIAI is specified, it is already serialized and thus no serial number will be created, only EPC encoding occurs. If a company prefix + asset reference is specified, a serial number will be generated and the EPC encoded
GID variable length, numeric characters representing a general manager identifier + object class.
GLN simple 13 digit number used to uniquely identify any legal, functional or physical entity. Its basic components are: EAN.UCC Company Prefix, some company defined location reference, and a check digit.
DOD variable length, 5 or 6 alphanumeric characters representing a Dept. of Defense CAGE or DoDAAC, characters 'I' (eye) and 'O' (oh) are not allowed.

Parameters:
inputType - string name of one of the supported data types, currently GTIN14, SSCC18, GIAI, GID, GLN and DOD. Unlike the others, there are no associated EAN.UCC datatypes for the GID and DOD inputs, these input types exist solely to support creation of an EPC.
encodingType - string name of one of the supported encoding types
companyPrefixLength - integer length of company prefix portion of the inputType parameter. For the GID inputType, this is the length of the General Manager portion of the inputData parameter. For the DOD inputType, this is the length of the Government Managed Identifier or CAGE/DoDAAC portion of the inputData parameter.
filterValue - string binary value indicating filter value. Valid filter values can be determined by consulting the TDS. May be null if the encoding type specified doesn't have filters defined for it (like the gid-96 encoding type)
packUnitType - string name of a pack type to be used in generating this EPC
inputData - string input data to be used to generate the EPC. The format and content of these fields is described above.
discriminator - string that can be used assign ranges of serial numbers for the same product to different entities. This string can be a location or other identifier, or an empty string if it is not desired to use this feature.
Throws:
EPCException - if generation of the EPC fails

EPC

public EPC(java.lang.String tagURIOrHexEPC)
    throws EPCException
Construct an EPC given either an EPCglobal tag URI (e.g. "urn:epc:tag:gid-96:123.456.789") or a hex string representing an encoded EPC (e.g. "35000007b0001c8000000315"). Since the tag URI or hex string already represents a serialized identity, no serialization will be performed. This constructor is useful for converting from the tag id URI form of an EPC to the associated hex value of the EPC and vice-versa.

Parameters:
tagURIOrHexEPC - string tag URI or hexadecimal value
Throws:
EPCException - if generation of the EPC fails
Method Detail

getEncodingType

public java.lang.String getEncodingType()
Gets the encoding type used in generating this EPC.

Returns:
string encoding type

getInputType

public java.lang.String getInputType()
Gets the input type used in generating this EPC.

Returns:
string input type

getCompanyPrefixLength

public int getCompanyPrefixLength()
Gets the length of the company prefix/general manager/CAGE/DoDAAC portion of the input data used to generate this EPC.

Returns:
integer length

getFilterValue

public java.lang.String getFilterValue()
Gets the filter value used in generating this EPC.

Returns:
string filter value

getPackType

public java.lang.String getPackType()
Gets the pack type used in generating this EPC

Returns:
string pack type

toStringTagURI

public java.lang.String toStringTagURI()
Gets a string version of this EPC in EPCglobal tag URI format, for example: urn:epc:tag:dod-96:1.1AB2C3.201

Returns:
tag URI string

toStringIdURI

public java.lang.String toStringIdURI()
Gets a string version of this EPC in EPCglobal id URI format, for example: urn:epc:id:dod:1AB2C3.201

Returns:
id URI string

toStringRawURI

public java.lang.String toStringRawURI()
Gets a string version of this EPC in EPCglobal raw URI format, for example: urn:epc:raw:96.x123456789012345678901234

Returns:
raw URI string

toString

public java.lang.String toString()
Gets a string version of this EPC in hexadecimal format, for example: 1234567890ABCDEF

Overrides:
toString in class java.lang.Object
Returns:
hexadecimal string

toBinaryString

public java.lang.String toBinaryString()
Gets a string version of this EPC in binary format, for example: 0001100111001111011111...

Returns:
binary string

getBytes

public byte[] getBytes()
Gets the EPC as an array of bytes

Returns:
array of bytes of EPC

getInputData

public java.lang.String getInputData()
Gets the input data used in generating this EPC

Returns:
string input data

getDiscriminator

public java.lang.String getDiscriminator()
Gets the discriminator used in generating this EPC

Returns:
string discriminator


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