com.ibm.rfid.epc.datahandler
Class GIAI
java.lang.Object
com.ibm.rfid.epc.datahandler.AbstractHandler
com.ibm.rfid.epc.datahandler.GIAI
- All Implemented Interfaces:
- DataHandler
public class GIAI
- extends AbstractHandler
- implements DataHandler
Manages an instance of a data handler for an EAN.UCC Global Individual Asset Identifier
(GIAI) data type.
The input data for this handler may be specified in one of three forms, all of which are strings.
The first form is a simple string of the following concatenated data fields:
EAN.UCC Company Prefix - variable length number assigned to a company by EAN.UCC.
The inclusion of the EAN.UCC Company Prefix ensures uniqueness
throughout the world. The EAN.UCC Company Prefix is assigned to companies in varying lengths.
Note: A UCC Company Prefix is converted to an EAN.UCC Company Prefix by adding a leading zero.
Examples: the UCC Company Prefix 614141 will be 0614141 and the UCC Company Prefix 81123456
will be 081123456.
Individual Asset Reference - variable length number assigned by the holder of the Company Prefix to
uniquely identify an asset. The Asset Reference varies in length as a function of the EAN.UCC
Company Prefix length. Note: The combined length of the EAN.UCC Company Prefix and Asset
Reference cannot exceed 30 digits.
An example of this input would be:
"12345678901234567"
where if the company prefix length were specified as 6,
the company prefix would be the first 6 digits "123456" and the asset reference would
be the next 11 digits "78901234567".
This input form will commission an EPC using the specified fields; it will not generate a serial number,
instead it will use the one provided, as such, it is the responsiblity of the provider to ensureness
unqiueness.
The second form is similar to tha first except the asset reference is not supplied,
instead a unique asset reference will be generated by the ECM. The second
form is a simple string of the following data field:
EAN.UCC Company Prefix - see above.
An example of this input would be:
"1234567"
where the company prefix length would be specified as 7 and the company prefix would be
the entire string "1234567". This input form will commission an EPC and generate a unique number for the
asset reference.
The third form is a formatted string of the following fields with literal field labels and
explicit seperators:
GIAI - a complete EAN.UCC GIAI with all of the field described above already properly
encoded. An example of this input would be:
"giai=12345678901234567".
This input form will commission
an EPC using the specified fields, it will not generate a serial number, instead it will use the one
provided, as such, it is the responsiblity of the provider to ensure unqiueness.
Field Summary |
static java.lang.String |
COPYRIGHT
|
Fields inherited from interface com.ibm.rfid.epc.datahandler.DataHandler |
DOD, GIAI, GID, GLN, GRAI, GTIN14, MAX_CAGE_DODAAC_LENGTH, MAX_EAN_UCC_COMPANY_PREFIX_LENGTH, MAX_GID_GENERAL_MANAGER_LENGTH, MAX_NDC10_COMPANY_PREFIX_LENGTH, MIN_CAGE_DODAAC_LENGTH, MIN_EAN_UCC_COMPANY_PREFIX_LENGTH, MIN_GID_GENERAL_MANAGER_LENGTH, MIN_NDC10_COMPANY_PREFIX_LENGTH, NDC10, SSCC18 |
Constructor Summary |
GIAI(java.lang.String inputData,
int companyPrefixLength,
java.lang.String encodingType)
Creates an instance of a data handler for a GIAI data type. |
Method Summary |
java.lang.String |
getAssetReference()
Gets the asset reference of this data handler |
java.lang.String |
getUnserializedPureId()
Create 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)
Override the base implementation to correctly create a serialized GIAI. |
void |
setAssetReference(java.lang.String assetReference)
Sets the asset reference of this data handler |
Methods inherited from class com.ibm.rfid.epc.datahandler.AbstractHandler |
getCompanyPrefix, getCompanyPrefixLength, getHandlerType, getInputData, getMaxCompanyPrefixLength, getMinCompanyPrefixLength, getPureId, getSerialNumber, setCompanyPrefix, setCompanyPrefixLength, setHandlerType, toString, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
GIAI
public GIAI(java.lang.String inputData,
int companyPrefixLength,
java.lang.String encodingType)
throws InvalidFormatException
- Creates an instance of a data handler for a GIAI data type.
- Parameters:
inputData
- numeric string data to be managed by this handler. Input data may be any of
the three forms discussed above.companyPrefixLength
- length of CP portion of the data stringencodingType
- string encoding type
- Throws:
InvalidFormatException
- if any of the input data fails validation
getUnserializedPureId
public java.lang.String getUnserializedPureId()
- Create 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.
- Specified by:
getUnserializedPureId
in interface DataHandler
- Returns:
- string EPCglobal ID URI excluding the asset reference portion of the ID URI which acts
as a serialized number
Thus, the unserialized id URI returned will be:
urn:epc:id:giai:<CompanyPrefix>.
where the trailing period is included as it seperates the next field (asset reference) and
<CompanyPrefix> is defined above.
serialize
public java.lang.String serialize(java.lang.String discriminator)
throws com.ibm.rfid.epc.config.SerialGenerationException
- Override the base implementation to correctly create a serialized GIAI.
Based on whether the input data held by this handler is just a company prefix,
or already a complete GIAI, either:
- uses the CP to create the next ID URI in a sequence based on any
previously generated for the same unserialized portion of the ID. This involves generation of the
asset reference portion of the GIAI.
OR
- creates a ID URI for the underlying GIAI of this data handler based on the fields of the GIAI
An ID URI is an EPCglobal pure identity, which
is a string URI that uniquely identitifies an object.
For an GIAI, it consists of a company prefix and a asset reference
field that provide unique identification. A pure id contains no
infomation about the encoding of the id into a particular RFID tag format.
- Specified by:
serialize
in interface DataHandler
- Overrides:
serialize
in class AbstractHandler
- Parameters:
discriminator
- string that can be used assign ranges of serial numbers for the
same product to different entities/locations/objects. This string can be an
an empty string if it is not desired to use this feature.
- Returns:
- string ID URI in EPCglobal ID format
- Throws:
com.ibm.rfid.epc.config.SerialGenerationException
- if a serial number cannot be commissioned for the pure
id and discriminator associated with this data handler
getAssetReference
public java.lang.String getAssetReference()
- Gets the asset reference of this data handler
- Returns:
- the string asset reference
setAssetReference
public void setAssetReference(java.lang.String assetReference)
- Sets the asset reference of this data handler
- Parameters:
assetReference
- asset reference
Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.