Examples of InstanceState


Examples of io.fathom.cloud.protobuf.CloudModel.InstanceState

            if (peer.getId() == instance.getId()) {
                continue;
            }

            // TODO: Return a typed object
            InstanceState state = peer.getInstanceState();
            if (state != null) {
                switch (state) {
                case TERMINATED:
                case STOPPED:
                case STOPPING:
View Full Code Here

Examples of org.glassfish.api.admin.InstanceState

            name = getNodeValue(attrs.getNamedItem("name"));
            state = getNodeValue(attrs.getNamedItem("state"));
        }
        if(name == null)
            return;
        InstanceState newInstanceState = null;
        if(state == null)
            newInstanceState = new InstanceState(InstanceState.StateType.NO_RESPONSE);
        else
            newInstanceState = new InstanceState(InstanceState.StateType.makeStateType(state));
        NodeList list = n.getChildNodes();
        if(list == null)
            return;
        for(int i=0; i<list.getLength(); i++) {
            //TODO : Why we need this ? check
            String t = list.item(i).getTextContent();
            if("\n".equals(t))
                continue;
            newInstanceState.addFailedCommands(t);
        }
        instanceStates.put(name, newInstanceState);
    }
View Full Code Here

Examples of org.glassfish.api.admin.InstanceState

            name = getNodeValue(attrs.getNamedItem("name"));
            state = getNodeValue(attrs.getNamedItem("state"));
        }
        if(name == null)
            return;
        InstanceState newInstanceState = null;
        if(state == null)
            newInstanceState = new InstanceState(InstanceState.StateType.NO_RESPONSE);
        else
            newInstanceState = new InstanceState(InstanceState.StateType.makeStateType(state));
        NodeList list = n.getChildNodes();
        if(list == null)
            return;
        for(int i=0; i<list.getLength(); i++) {
            //TODO : Why we need this ? check
            String t = list.item(i).getTextContent();
            if("\n".equals(t))
                continue;
            newInstanceState.addFailedCommands(t);
        }
        instanceStates.put(name, newInstanceState);
    }
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

    int index = stopTime.getBlockSequence() - 1;
    if (index < 0)
      return null;

    BlockStopTimeEntry prevStopTime = stopTimes.get(index);
    InstanceState state = instance.getStopTimeInstance().getState();
    ArrivalAndDepartureTime scheduledTime = ArrivalAndDepartureTime.getScheduledTime(
        state, prevStopTime);

    if (instance.getFrequency() != null) {
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

    int index = stopTime.getBlockSequence() + 1;
    if (index >= stopTimes.size())
      return null;

    BlockStopTimeEntry nextStopTime = stopTimes.get(index);
    InstanceState state = instance.getStopTimeInstance().getState();

    ArrivalAndDepartureTime scheduledTime = ArrivalAndDepartureTime.getScheduledTime(
        state, nextStopTime);

    if (state.getFrequency() != null) {

      StopTimeEntry nStopTime = nextStopTime.getStopTime();

      int betweenStopDelta = nStopTime.getArrivalTime()
          - stopTime.getStopTime().getDepartureTime();
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

      StopEntry nextStop = nextStopTime.getStop();

      List<StopTransfer> transfers = _stopTransferService.getTransfersFromStop(nextStop);

      if (!transfers.isEmpty()) {
        InstanceState state = instance.getStopTimeInstance().getState();
        StopTimeInstance nextStopTimeInstance = new StopTimeInstance(
            nextBlockStopTime, state);
        ArrivalAndDepartureTime nextScheduledTime = ArrivalAndDepartureTime.getScheduledTime(
            state, nextBlockStopTime);

        ArrivalAndDepartureInstance nextInstance = new ArrivalAndDepartureInstance(
            nextStopTimeInstance, nextScheduledTime);

        if (state.getFrequency() != null) {

          int betweenStopDelta = nextStopTime.getArrivalTime()
              - blockStopTime.getStopTime().getDepartureTime();
          int atStopDelta = nextStopTime.getDepartureTime()
              - nextStopTime.getArrivalTime();
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

    /**
     * Why don't we use the ArrivalAndDepartureTime scheduled arrival and
     * departures here? Because they may have been artificially shifted for a
     * frequency-based method
     */
    InstanceState state = instance.getStopTimeInstance().getState();
    ArrivalAndDepartureTime schedule = ArrivalAndDepartureTime.getScheduledTime(
        state, instance.getBlockStopTime());

    long arrivalTime = schedule.getArrivalTime() + arrivalDeviation * 1000;
    setPredictedArrivalTimeForInstance(instance, arrivalTime);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

    BlockEntryImpl block = block("block");
    BlockConfigurationEntry blockConfig = blockConfiguration(block,
        serviceIds(lsids("a"), lsids()), trip);

    BlockTripInstance blockTripInstance = new BlockTripInstance(
        blockConfig.getTrips().get(0), new InstanceState(
            System.currentTimeMillis()));

    List<ServiceAlert> alerts = _service.getServiceAlertsForVehicleJourney(
        System.currentTimeMillis(), blockTripInstance, new AgencyAndId("1",
            "1111"));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

        int fromIndex = GenericBinarySearch.search(index, index.size(),
            relativeFrom, IndexAdapters.BLOCK_STOP_TIME_DEPARTURE_INSTANCE);

        if (fromIndex < index.size()) {
          BlockStopTimeEntry blockStopTime = index.getBlockStopTimeForIndex(fromIndex);
          InstanceState state = new InstanceState(serviceDate.getTime());
          StopTimeInstance sti = new StopTimeInstance(blockStopTime, state);
          stopTimeInstances.add(sti);
        }
      }
    }

    List<FrequencyBlockStopTimeIndex> frequencyIndices = _blockIndexService.getFrequencyStopTimeIndicesForStop(stopEntry);

    for (FrequencyBlockStopTimeIndex index : frequencyIndices) {

      List<Date> serviceDates = _calendarService.getNextServiceDatesForDepartureInterval(
          index.getServiceIds(), index.getServiceInterval(), time);

      for (Date serviceDate : serviceDates) {

        int relativeFrom = effectiveTime(serviceDate.getTime(), time);

        int fromIndex = GenericBinarySearch.search(index, index.size(),
            relativeFrom, IndexAdapters.FREQUENCY_END_TIME_INSTANCE);

        List<FrequencyBlockStopTimeEntry> frequencyStopTimes = index.getFrequencyStopTimes();
        if (fromIndex < index.size()) {
          FrequencyBlockStopTimeEntry entry = frequencyStopTimes.get(fromIndex);
          BlockStopTimeEntry bst = entry.getStopTime();
          FrequencyEntry frequency = entry.getFrequency();
          InstanceState state = new InstanceState(serviceDate.getTime(),
              frequency);
          int stopTimeOffset = entry.getStopTimeOffset();
          int frequencyOffset = computeFrequencyOffset(relativeFrom, bst,
              frequency, stopTimeOffset, true);
          StopTimeInstance sti = new StopTimeInstance(bst, state,
View Full Code Here

Examples of org.onebusaway.transit_data_federation.services.blocks.InstanceState

         * have to decrement to find the first good stop index
         */
        if (!findDepartures)
          sourceIndex--;

        InstanceState state = new InstanceState(serviceDate.getTime());

        while (0 <= sourceIndex && sourceIndex < sourceStopIndexSize) {

          BlockStopTimeEntry stopTimeSource = sourceStopIndex.getBlockStopTimeForIndex(sourceIndex);
          StopTimeInstance stiSource = new StopTimeInstance(stopTimeSource,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.