com.ibm.rfid.epc.datahandler
Class SSCC18

java.lang.Object
  extended by com.ibm.rfid.epc.datahandler.AbstractHandler
      extended by com.ibm.rfid.epc.datahandler.SSCC18
All Implemented Interfaces:
DataHandler

public class SSCC18
extends AbstractHandler
implements DataHandler

Manages an instance of a data handler for an EAN.UCC Serialized Shipping Container Code (SSCC18) data type. The input data for this handler may be 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:
    Extension digit - has no defined logic, and is available to the member company to increase the capacity of the Serial Reference.
    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.
    Serial Reference - variable length number assigned by the holder of the Company Prefix to uniquely identify the logistic unit. The Serial Reference varies in length as a function of the EAN.UCC Company Prefix length. Note: The combined length of the EAN.UCC Company Prefix, Extension digit and Serial Reference is always 17 digits. If necessary the serial reference is zero-padded on the left to accomodate this requirement.
    Check Digit – a calculated one-digit number used to ensure data integrity.
    An example of this input would be:
    "123456789012345675"
    where if the company prefix length were specified as 6, the extension digit would be the leading 1, the company prefix would be the next 6 digits "234567" and the serial reference would be the next 10 digits "8901234567" and the check digit would be the final digit "5". 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 user to ensure unqiueness.

  • The second form is similar to tha first except the serial number and check digit are not supplied, the serial number will be generated by the ECM and the check digit will be calculated. The second form is a simple string of the following concatenated data fields:
    Extension digit - see above
    EAN.UCC Company Prefix - see above
    An example of this input would be:
    "1234567"
    where if the company prefix length were specified as 6, the extension digit would be the leading 1, the company prefix would be the next 6 digits "234567". This input form will commission an EPC and generate a serial number that is unique with respect to the company prefix and calculate the check digit.

  • The third form is a formatted string of the following fields with literal field labels and explicit seperators:
    SSCC18 - a complete EAN.UCC 18 digit SSCC with all of the fields described above already properly encoded. An example of this input would be:
    "sscc=123456789012345675"
    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 user to ensure unqiueness.

  • Field Summary
    static java.lang.String COPYRIGHT
               
     
    Fields inherited from class com.ibm.rfid.epc.datahandler.AbstractHandler
    companyPrefix, companyPrefixLength, handlerType, inputData, maxCompanyPrefixLength, minCompanyPrefixLength, pureId, serialNumber, useLocalConfigMgr
     
    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
    SSCC18(java.lang.String inputData, int companyPrefixLength, java.lang.String encodingType)
              Creates an instance of a data handler for an SSCC18 data type.
     
    Method Summary
     java.lang.String getCheckDigit()
              Gets the check digit of the input data string.
     java.lang.String getExtensionDigit()
              Gets the EAN.UCC extension digit
     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 SSCC.
     void setCheckDigit(java.lang.String checkDigit)
              Sets the check digit of the input data string.
     void setExtensionDigit(java.lang.String extensionDigit)
              Sets the EAN.UCC extension digit
     
    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
     
    Methods inherited from interface com.ibm.rfid.epc.datahandler.DataHandler
    getCompanyPrefix, getHandlerType, getInputData, getMaxCompanyPrefixLength, getMinCompanyPrefixLength, getSerialNumber
     

    Field Detail

    COPYRIGHT

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

    SSCC18

    public SSCC18(java.lang.String inputData,
                  int companyPrefixLength,
                  java.lang.String encodingType)
           throws InvalidFormatException
    Creates an instance of a data handler for an SSCC18 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 string
    encodingType - string encoding type
    Throws:
    InvalidFormatException - if any of the input data fails validation
    Method Detail

    getExtensionDigit

    public java.lang.String getExtensionDigit()
    Gets the EAN.UCC extension digit

    Returns:
    the extension digit of this data handler

    setExtensionDigit

    public void setExtensionDigit(java.lang.String extensionDigit)
    Sets the EAN.UCC extension digit

    Parameters:
    extensionDigit - the extension digit of this data handler

    getCheckDigit

    public java.lang.String getCheckDigit()
    Gets the check digit of the input data string. For a SSCC, the checkdigit is the last digit of the number.

    Returns:
    the check digit of this data handler

    setCheckDigit

    public void setCheckDigit(java.lang.String checkDigit)
    Sets the check digit of the input data string. For a SSCC, the checkdigit is the last digit of the number.

    Parameters:
    checkDigit - the check digit of this data handler

    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 serial number Thus, the unserialized uri returned will be:
    urn:epc:id:sscc:<CompanyPrefix>.<ExtensionDigit>
    where <CompanyPrefix> and <ExtensionDigit> are 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 SSCC. Based on whether the input data held by this handler is just a company prefix and extension digit, or already a complete SSCC, either:
    - uses the CP and ext. digit 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 serial reference portion of the SSCC.
    OR
    - creates a ID URI for the underlying SSCC of this data handler based on the fields of the SSCC
    An ID URI is an EPCglobal pure identity, which is a string URI that uniquely identitifies an object. For an SSCC, it consists of a company prefix and a serial 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


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