当前位置: 首页>>代码示例>>Java>>正文


Java D2LogicalModel类代码示例

本文整理汇总了Java中com.thales.ntis.subscriber.datex.D2LogicalModel的典型用法代码示例。如果您正苦于以下问题:Java D2LogicalModel类的具体用法?Java D2LogicalModel怎么用?Java D2LogicalModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


D2LogicalModel类属于com.thales.ntis.subscriber.datex包,在下文中一共展示了D2LogicalModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleFullEventRefresh

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
private void handleFullEventRefresh(D2LogicalModel request) {
    synchronized (LOCK_EVENT_UPDATES) {
        try {
            LOG.info("Processing Event Data Full Refresh.");
            HashMap<String, SituationRecord> tempEventCache = new HashMap<>(EVENT_CACHE);
            EVENT_CACHE.clear();
            processEventsInFullRefresh(request, tempEventCache);
            processEventsUpdatedAfterFullRefreshPublicationTime(request, tempEventCache);
            processRefreshedEventData();
            tempEventCache.clear();
            LOG.info("Finished processing Event Data Full Refresh.");
        } catch (Exception e) {
            LOG.error(e.getMessage());
        }
    }
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:17,代码来源:EventDataServiceImpl.java

示例2: handleEventUpdate

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
private void handleEventUpdate(D2LogicalModel d2LogicalModel) {
    synchronized (LOCK_EVENT_UPDATES) {
        try {
            SituationPublication situationPublication = (SituationPublication) d2LogicalModel.getPayloadPublication();
            if (situationPublication != null) {
                List<Situation> situations = situationPublication.getSituation();

                LOG.info(NUMBER_OF_EVENTS_IN_PAYLOAD, situations.size());

                for (Situation situation : situations) {
                    // Only have 1 situationRecord per situation (index=0)
                    SituationRecord situationRecord = situation.getSituationRecord().get(0);
                    EVENT_CACHE.put(situationRecord.getId(), situationRecord);
                    processEventData(situationRecord);
                }
            }
        } catch (Exception e) {
            LOG.error(e.getMessage());
        }
    }
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:22,代码来源:EventDataServiceImpl.java

示例3: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {
    LOG.info("handling Ntis Model Notification Request !");

    if (d2LogicalModel.getPayloadPublication() != null) {
        GenericPublication genericPublication = ((GenericPublication) d2LogicalModel.getPayloadPublication());
        XMLGregorianCalendar publicationTime = genericPublication.getPublicationTime();
        LOG.info("Ntis model publication time: " + publicationTime);
        String genericPublicationName = genericPublication.getGenericPublicationName();
        LOG.info("Generic publication name: " + genericPublicationName);
        GenericPublicationExtensionType genericPublicationExtension = genericPublication.getGenericPublicationExtension();
        NtisModelVersionInformation ntisModelVersionInformation = genericPublicationExtension
                .getNtisModelVersionInformation();
        LOG.info("Network model - file name " + ntisModelVersionInformation.getModelFilename());
        LOG.info("Network model - version " + ntisModelVersionInformation.getModelVersion());
        LOG.info("Network model - publication time " + ntisModelVersionInformation.getModelPublicationTime());
    }

    LOG.info("Ntis Model Notification Data Request: Processing Completed Successfuly");
}
 
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:21,代码来源:NtisModelNotificationDataServiceImpl.java

示例4: newInstance

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
public static TrafficDataService newInstance(D2LogicalModel request) {

        String feedType = request.getPayloadPublication().getFeedType();

        LOG.info("FeedType is : " + feedType);

        if (feedType.toLowerCase().contains(FeedType.ANPR.lowerCase())) {
            return new ANPRTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.MIDAS.lowerCase())) {
            return new MIDASTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.TMU.lowerCase())) {
            return new TMUTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.FUSED_SENSOR_ONLY.lowerCase())) {
            return new FusedSensorOnlyTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.FUSED_FVD_AND_SENSOR_PTD.lowerCase())) {
            return new FusedFvdAndSensorTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.VMS.lowerCase())) {
            return new VMSTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.NTIS_MODEL_UPDATE_NOTIFICATION.lowerCase())) {
            return new NtisModelNotificationDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.EVENT_DATA.lowerCase())) {
            return new EventDataServiceImpl();

        } else {
            LOG.error("Unrecognised Feed Type: " + feedType);
            return null;
        }
    }
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:36,代码来源:TrafficDataServiceFactory.java

示例5: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {
    LOG.info("{}: received...", PUBLICATION_TYPE);
    LOG.info(NUMBER_OF_EVENTS_IN_CACHE, EVENT_CACHE.size());
    if (isEventFullRefresh(d2LogicalModel)) {
        handleFullEventRefresh(d2LogicalModel);
    } else {
        handleEventUpdate(d2LogicalModel);
    }

    LOG.info("{}: processed successfully.", PUBLICATION_TYPE);
    LOG.info(NUMBER_OF_EVENTS_IN_CACHE, EVENT_CACHE.size());
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:14,代码来源:EventDataServiceImpl.java

示例6: processEventsInFullRefresh

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
private void processEventsInFullRefresh(D2LogicalModel request, HashMap<String, SituationRecord> tempEventCache) {
    SituationPublication situationPublication = (SituationPublication) request.getPayloadPublication();
    if (situationPublication != null) {
        List<Situation> situations = situationPublication.getSituation();
        LOG.info(NUMBER_OF_EVENTS_IN_PAYLOAD, situations.size());
        for (Situation situation : situations) {
            refreshEvent(situation.getSituationRecord().get(0), tempEventCache);
        }
    }
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:11,代码来源:EventDataServiceImpl.java

示例7: processEventsUpdatedAfterFullRefreshPublicationTime

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
private void processEventsUpdatedAfterFullRefreshPublicationTime(D2LogicalModel request,
        HashMap<String, SituationRecord> tempEventCache) {
    DateTime fullRefreshPublicationTime = xmlGregoriaCalanderToDateTime(request.getPayloadPublication().getPublicationTime());
    LOG.info("Full Refresh Publication Time: {}", fullRefreshPublicationTime);
    for (SituationRecord record : tempEventCache.values()) {
        if (isEventUpdatedAfterFullRefreshPublicationTime(record, fullRefreshPublicationTime)) {
            EVENT_CACHE.put(record.getId(), record);
            LOG.info("Keeping cached version of event: {} as it has been updated after the Full Refresh Publication Time.",
                    record.getId());
        } else {
            LOG.info("Discarding cached version of event: {} as it is older than the Full Refresh Publication Time.",
                    record.getId());
        }
    }
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:16,代码来源:EventDataServiceImpl.java

示例8: validate

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
public boolean validate(D2LogicalModel request) {

        // D2LogicalModel is at the base element of the request so must not be
        // null.
        if (request != null) {

            if (LOG.isDebugEnabled()) {
                LOG.debug("D2LogicalModel is " + request);
            }

        } else {
            LOG.error("D2LogicalModel is null! Incoming request does not appear to be valid!");
            return false;
        }

        // Exchange must not be null.
        if (request.getExchange() != null) {
            LOG.info("Country is "
                    + request.getExchange().getSupplierIdentification()
                            .getCountry().value());
            LOG.info("National Identifier is "
                    + request.getExchange().getSupplierIdentification()
                            .getNationalIdentifier());
        } else {
            LOG.error("Exchange is null! Incoming request does not appear to be valid!");
            return false;
        }
        return true;
    }
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:30,代码来源:AbstractDatexService.java

示例9: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {

    LOG.info(PUBLICATION_TYPE + ": received...");

    SituationPublication situationPublication = null;

    try {
        situationPublication = (SituationPublication) d2LogicalModel.getPayloadPublication();
        if (situationPublication != null) {
            List<Situation> situations = situationPublication.getSituation();

            LOG.info("Number of Events in payload: " + situations.size());

            for (Situation situation : situations) {
                // Only have 1 situationRecord per situation (index=0)
                SituationRecord situationRecord = situation.getSituationRecord().get(0);

                // Different types of event/situation record contain some common information and 
                // some type-specific data items and should be handled accordingly
                processCommonEventData(situationRecord);

                if (MaintenanceWorks.class.equals(situationRecord.getClass())) {
                    processMaintenanceWorksEvent((MaintenanceWorks) situationRecord);
                }

            }
            LOG.info(PUBLICATION_TYPE + ": processed successfully.");
        }
    } catch (Exception e) {
        LOG.error(e.getMessage());
    }
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release2.5,代码行数:34,代码来源:EventDataServiceImpl.java

示例10: newInstance

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
public static TrafficDataService newInstance(D2LogicalModel request) {

        String feedType = request.getPayloadPublication().getFeedType();

        LOG.info("FeedType is : " + feedType);

        if (feedType.toLowerCase().contains(FeedType.ANPR.lowerCase())) {
            return new ANPRTrafficDataServiceImpl();
        } else if (feedType.toLowerCase().contains(FeedType.MIDAS.lowerCase())) {
            return new MIDASTrafficDataServiceImpl();
        } else if (feedType.toLowerCase().contains(FeedType.TMU.lowerCase())) {
            return new TMUTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.FUSED_SENSOR_ONLY.lowerCase())) {
            return new SensorTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.FUSED_FVD_AND_SENSOR_PTD.lowerCase())) {
            return new FVDTrafficDataServiceImpl();
        } else if (feedType.toLowerCase().contains(FeedType.VMS.lowerCase())) {
            return new VMSTrafficDataServiceImpl();

        } else if (feedType.toLowerCase().contains(FeedType.NTIS_MODEL_UPDATE_NOTIFICATION.lowerCase())) {
            return new NtisModelNotificationDataServiceImpl();
        }

        return null;
    }
 
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:28,代码来源:TrafficDataServiceFactory.java

示例11: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {
    LOG.info("handling TMU Request !");

    try {
        if (d2LogicalModel.getPayloadPublication() != null) {
            List<SiteMeasurements> siteMeasurementsList = ((MeasuredDataPublication) d2LogicalModel.getPayloadPublication())
                    .getSiteMeasurements();
            for (SiteMeasurements siteMeasurements : siteMeasurementsList) {
                List<SiteMeasurementsIndexMeasuredValue> measuredValueList = siteMeasurements.getMeasuredValue();
                for (SiteMeasurementsIndexMeasuredValue siteMeasurementsIndexMeasuredValue : measuredValueList) {
                    MeasuredValue measuredValue = siteMeasurementsIndexMeasuredValue.getMeasuredValue();
                    BasicData basicData = measuredValue.getBasicData();
                    if (basicData instanceof TrafficFlow) {
                        VehicleFlowValue value = ((TrafficFlow) basicData).getVehicleFlow();
                        LOG.info("Vehicle flow rate : " + value.getVehicleFlowRate().intValue());
                    } else if (basicData instanceof TrafficSpeed) {
                        float speed = ((TrafficSpeed) basicData).getAverageVehicleSpeed().getSpeed();
                        LOG.info("Traffic speed : " + speed);
                    } else if (basicData instanceof TrafficHeadway) {
                        float headWay = ((TrafficHeadway) basicData).getAverageTimeHeadway().getDuration();
                        LOG.info("Traffic Headway : " + headWay);
                    } else if (basicData instanceof TrafficConcentration) {
                        float percentage = ((TrafficConcentration) basicData).getOccupancy().getPercentage();
                        LOG.info("Traffic concentration percentage : " + percentage);
                    }
                }
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
        LOG.error(e.getMessage());
    }
    LOG.info("TMU Request: Processing Completed Successfuly");
}
 
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:36,代码来源:TMUTrafficDataServiceImpl.java

示例12: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@PayloadRoot(namespace = "http://datex2.eu/schema/2/2_0", localPart = "d2LogicalModel")
public void handle(@RequestPayload D2LogicalModel request) {
    log.info("Received request for subscription");
    datexIIService.handle(request);
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:6,代码来源:SubscriberServiceEndpoint.java

示例13: isEventFullRefresh

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
private boolean isEventFullRefresh(D2LogicalModel d2LogicalModel) {
    return d2LogicalModel.getPayloadPublication().getFeedType().toLowerCase().contains(FeedType.FULL_REFRESH.lowerCase());
}
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:4,代码来源:EventDataServiceImpl.java

示例14: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
public void handle(
D2LogicalModel request);
 
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:3,代码来源:TrafficDataService.java

示例15: handle

import com.thales.ntis.subscriber.datex.D2LogicalModel; //导入依赖的package包/类
@Override
public void handle(D2LogicalModel d2LogicalModel) {

    LOG.info("handling VMS Request !");

    try {
        VmsPublication payloadPublication = (VmsPublication)
                d2LogicalModel.getPayloadPublication();
        if (payloadPublication != null) {
            VmsUnit vmsUnit =
                    payloadPublication.getVmsUnit().get(0);
            if (vmsUnit != null) {
                LOG.info("Vmsunit GUID: " + vmsUnit.getVmsUnitReference().getId());

                List<VmsUnitVmsIndexVms> vmsIndexList = vmsUnit.getVms();
                if (vmsIndexList.size() > 0) {
                    VmsUnitVmsIndexVms vmsUnitVmsIndexVms =
                            vmsIndexList.get(0);
                    List<VmsMessageIndexVmsMessage> vmsMessageList =
                            vmsUnitVmsIndexVms.getVms().getVmsMessage();
                    if (vmsMessageList.size() > 0) {
                        VmsMessage vmsMessage =
                                vmsMessageList.get(0).getVmsMessage();
                        List<TextPage> textPageList =
                                vmsMessage.getTextPage();
                        if (textPageList.size() > 0) {
                            TextPage textPage = textPageList.get(0);
                            VmsText vmsText =
                                    textPage.getVmsText();
                            List<VmsTextLineIndexVmsTextLine> vmsTextLineList = vmsText.getVmsTextLine();
                            if (vmsTextLineList.size() > 0) {
                                VmsTextLineIndexVmsTextLine vmsTextLineIndexVmsTextLine = vmsTextLineList.get(0);
                                LOG.info(" vms text line " +
                                        vmsTextLineIndexVmsTextLine.getVmsTextLine().getVmsTextLine());
                            }
                        }
                    }
                }
            }
        }

    } catch (Exception e) {
        LOG.error(e.getMessage());
    }

    LOG.info("VMSTraffic Data Request: Processing Completed Successfuly");
}
 
开发者ID:ntisservices,项目名称:OBSOLETE-ntis-java-web-services-Release2.4,代码行数:48,代码来源:VMSTrafficDataServiceImpl.java


注:本文中的com.thales.ntis.subscriber.datex.D2LogicalModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。