Example usage for javax.xml.datatype DatatypeConfigurationException printStackTrace

List of usage examples for javax.xml.datatype DatatypeConfigurationException printStackTrace

Introduction

In this page you can find the example usage for javax.xml.datatype DatatypeConfigurationException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:org.ow2.aspirerfid.demos.warehouse.management.beg.CaptureReport.java

private void handleReports(ECReports reports) throws IOException, JAXBException {
    log.debug("**********************Handling incomming reports****************************");

    // get the current time and set the eventTime
    XMLGregorianCalendar now = null;
    try {/*from  w w  w . java 2s .  c  o  m*/
        DatatypeFactory dataFactory = DatatypeFactory.newInstance();
        now = dataFactory.newXMLGregorianCalendar(new GregorianCalendar());

        log.debug("Event Time:" + now.getHour() + ":" + now.getMinute() + ":" + ":" + now.getSecond() + "\n");

    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    }

    List<ECReport> theReports = reports.getReports().getReport();
    // collect all the tags
    List<EPC> epcs = new LinkedList<EPC>();
    if (theReports != null) {
        for (ECReport report : theReports) {
            // log.debug("Report Count: "+report.getGroup().size());
            log.debug("***************Report Name:" + report.getReportName() + "**************");
            if (report.getGroup() != null) {
                for (ECReportGroup group : report.getGroup()) {

                    if (WarehouseManagement.getEntryDateTextField().equals("")) {
                        WarehouseManagement.setEntryDateTextField(
                                now.getDay() + "/" + now.getMonth() + "/" + now.getYear());
                    }
                    if (WarehouseManagement.getEntryHourTextField().equals("")) {
                        WarehouseManagement.setEntryHourTextField(
                                now.getHour() + ":" + now.getMinute() + ":" + now.getSecond());
                    }

                    WarehouseManagement.setZoneIDTextField(zoneID);
                    WarehouseManagement.setWarehouseIDTextField(warehouseID);

                    log.debug("Group Count: " + group.getGroupCount().getCount());
                    log.debug("Group Name: " + group.getGroupName());
                    if (group.getGroupList() != null) {
                        deliveredItem = null;

                        // warehousemen
                        if (group.getGroupName().equals(warehousemenGroupName)) {
                            for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                                if (member.getEpc() != null) {
                                    WarehouseManagement
                                            .setUserIDTextField(member.getTag().getValue().split(":")[4]);
                                }
                            }
                        }

                        // Invoice
                        if (group.getGroupName().equals(invoiceGroupName)) {
                            for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                                if (member.getEpc() != null) {
                                    WarehouseManagement
                                            .setInvoiceIDTextField(member.getTag().getValue().split(":")[4]);
                                    WarehouseManagement.setOfferingDateTextField("22/05/08");
                                    WarehouseManagement.setOfferingHourTextField("10:53:22");
                                }
                            }
                        }
                        //                     // Small Packets
                        //                     if (group.getGroupName().equals("urn:epc:pat:gid-96:145.56.*")) {
                        //                        for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                        //                           if (member.getEpc() != null) {
                        //                              // WarehouseManagement.setInvoiceIDTextField(member.getTag().getValue().split(":")[4]);
                        //                           }
                        //                        }
                        //                     }
                        //                     // Medium Packets
                        //                     if (group.getGroupName().equals("urn:epc:pat:gid-96:145.87.*")) {
                        //                        for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                        //                           if (member.getEpc() != null) {
                        //                              // WarehouseManagement.setInvoiceIDTextField(member.getTag().getValue().split(":")[4]);
                        //                           }
                        //                        }
                        //                     }

                        for (int i = 0; i < nOFmerchandise; i++) {

                            if (group.getGroupName().equals(packetsGroupName[i])) {
                                BigInteger quantity = new BigInteger(packetsQuantity[i]);
                                BigInteger expectedQuantity = new BigInteger(packetsExpectedQuantity[i]);
                                BigInteger quantityDelivered = new BigInteger(
                                        (group.getGroupCount().getCount()) + "");
                                BigInteger quantityRemain = quantity.add(quantityDelivered.negate());

                                for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                                    if (member.getEpc() != null) {
                                        deliveredItem = new DeliveredItem();
                                        deliveredItem.setCompany(packetsCompany[i]);
                                        deliveredItem.setDeliveryDate(
                                                now.getDay() + "/" + now.getMonth() + "/" + now.getYear());
                                        deliveredItem.setDescription(packetsDescription[i]);
                                        deliveredItem.setExpectedQuantity(expectedQuantity);
                                        deliveredItem.setMeasurementID(packetsMeasurementID[i]);
                                        deliveredItem.setQuantity(quantity);
                                        deliveredItem.setQuantityDelivered(quantityDelivered);
                                        deliveredItem.setQuantityRemain(quantityRemain);
                                        deliveredItem.setItemCode(member.getTag().getValue().split(":")[4]);
                                        WarehouseManagement.updateDeliveryTableModel(deliveredItem);
                                        deliveredItem = null;
                                    }
                                }
                            }
                        }

                        // Print All
                        for (ECReportGroupListMember member : group.getGroupList().getMember()) {
                            if (member.getEpc() != null) {
                                log.debug("***Recieved Group Values***");
                                log.debug("RawDecimal Value: " + member.getRawDecimal().getValue());
                                {
                                    if (!(member.getEpc() == null))
                                        epcs.add(member.getEpc());
                                    log.debug("Epc Value: " + member.getEpc().getValue());
                                    if ((member.getEpc() == null))
                                        log.debug("Epc Value: null");
                                }
                                log.debug("RawHex Value: " + member.getRawHex().getValue());
                                log.debug("Tag Value: " + member.getTag().getValue());
                                // log.debug("Group
                                // Value:"+member.getExtension().getFieldList().toString());

                            }
                        }

                    }
                }
            }
        }
    }
    if (epcs.size() == 0) {
        log.debug("no epc received - generating no event");
        return;
    }
}

From source file:org.ow2.aspirerfid.ide.masterdata.tools.MasterDataCaptureClient.java

private XMLGregorianCalendar getCurrentTime() {
    // get the current time and set the eventTime
    XMLGregorianCalendar now = null;
    try {//from  ww  w  . j a  va  2 s  . c  o  m
        DatatypeFactory dataFactory = DatatypeFactory.newInstance();
        now = dataFactory.newXMLGregorianCalendar(new GregorianCalendar());
        log.debug("Event Time:" + now.getHour() + ":" + now.getMinute() + ":" + ":" + now.getSecond() + "\n");
    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    }

    return now;

}

From source file:org.ow2.aspirerfid.programmableengine.epcisclient.MasterDataCaptureClient.java

public XMLGregorianCalendar getCurrentTime() {
    // get the current time and set the eventTime
    XMLGregorianCalendar now = null;
    try {//from w ww . ja  v a  2  s. c o m
        DatatypeFactory dataFactory = DatatypeFactory.newInstance();
        now = dataFactory.newXMLGregorianCalendar(new GregorianCalendar());
        log.debug("Event Time:" + now.getHour() + ":" + now.getMinute() + ":" + ":" + now.getSecond() + "\n");
    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    }

    return now;

}

From source file:org.techytax.util.DateHelper.java

public static XMLGregorianCalendar getDateForXml(Date date) {
    XMLGregorianCalendar calendar = null;
    try {/*from   w w w.ja  v  a2 s. c  o  m*/
        calendar = DatatypeFactory.newInstance().newXMLGregorianCalendar();
    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    }
    calendar.setDay(getDay(date));
    calendar.setMonth(getMonth(date) + 1);
    calendar.setYear(getYear(date));
    calendar.setHour(0);
    calendar.setMinute(0);
    calendar.setSecond(0);
    return calendar;
}

From source file:org.wattdepot.server.measurement.pruning.MeasurementPruner.java

/**
 * @return The end of the collection window.
 *//*www . j a  v  a 2  s  .c  o  m*/
private Date getEndDate() {
    XMLGregorianCalendar now;
    Date ret = null;
    try {
        now = DateConvert.convertDate(new Date());
        XMLGregorianCalendar endCal = Tstamp.incrementDays(now, -1 * definition.getIgnoreWindowDays());
        ret = DateConvert.convertXMLCal(endCal);
    } catch (DatatypeConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return ret;
}

From source file:org.wattdepot.server.measurement.pruning.MeasurementPruner.java

/**
 * @return The start of the collection window.
 */// w ww.j  a v  a  2  s.  c o m
private Date getStartDate() {
    XMLGregorianCalendar now;
    Date ret = null;
    try {
        now = DateConvert.convertDate(new Date());
        XMLGregorianCalendar startCal = Tstamp.incrementDays(now, -1 * definition.getIgnoreWindowDays());
        startCal = Tstamp.incrementDays(startCal, -1 * definition.getCollectWindowDays());
        ret = DateConvert.convertXMLCal(startCal);
    } catch (DatatypeConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return ret;
}

From source file:org.wattdepot.server.measurement.pruning.MeasurementPruner.java

@Override
public void run() {
    try {/*  w ww  . j  av  a  2  s  . co m*/
        pruneMeasurements();
    } catch (DatatypeConfigurationException e) {
        e.printStackTrace();
    } catch (IdNotFoundException e) {
        e.printStackTrace();
    }
}