ServiceAlertBean.getReason
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.onebusaway.transit_data.model.service_alerts.ServiceAlertBean.getReason(Showing top 4 results out of 315)

origin: OneBusAway/onebusaway-application-modules

public String submit() throws IOException, JSONException, ParseException {
  
 _model.setReason(string(_model.getReason()));
 
 if(isNewServiceAlert() || isFromFavorite()){
   _model.setId(null);
 }
 
 try { 
  if (_model.getId() == null || _model.getId().trim().isEmpty() ) {
        _model = _transitDataService.createServiceAlert(_agencyId, _model);
  }
  else {
   //ServiceAlertBean existing = _transitDataService.getServiceAlertForId(_model.getId());
   //if (existing != null) {
    // The updated service alert constructed from the POST won't include affects clauses.
   //  _model.setAllAffects(existing.getAllAffects());
   //}
   _transitDataService.updateServiceAlert(_model);
  }
 } catch (RuntimeException e) {
  _log.error("Error creating or updating Service Alert", e);
  throw e;
 }
 return "submitSuccess";
}

origin: OneBusAway/onebusaway-application-modules

private void setServiceAlerts(AgencyWithCoverageBean agency, List<ServiceAlertRssBean> beans, String baseUrl) {
  ListBean<ServiceAlertBean> allServiceAlertsForAgencyId
      = _transitDataService.getAllServiceAlertsForAgencyId(agency.getAgency().getId());
  if (allServiceAlertsForAgencyId == null) {
    _log.info("no service alerts returned for agency " + agency.getAgency().getId());
    return;
  }
  
  long time = System.currentTimeMillis();
  for (ServiceAlertBean sab : allServiceAlertsForAgencyId.getList()) {
    
    if(!containsActiveAlert(sab, time)){
      continue;
    }
    
    ServiceAlertRssBean bean = new ServiceAlertRssBean();
    bean.setId(sab.getId());
    bean.setReason(sab.getReason());
    if (sab.getSeverity() != null) {
      bean.setSeverity(sab.getSeverity().getTpegCodes()[0]);
    }
    bean.setSummary(ServiceAlertRssBean.getLocalString(sab.getSummaries()));
    bean.setDescription(ServiceAlertRssBean.getLocalString(sab.getDescriptions()));
    bean.setPublicationWindows(toTimeRange(sab.getPublicationWindows()));
    bean.setAffectsClauses(toAffectClause(sab.getAllAffects()));
    beans.add(bean);
  }
}

origin: OneBusAway/onebusaway-application-modules

bean.setReason(situation.getReason());
origin: OneBusAway/onebusaway-application-modules

serviceAlertRecord.setCause(getReasonAsCause(bean.getReason()));
org.onebusaway.transit_data.model.service_alertsServiceAlertBeangetReason

Popular methods of ServiceAlertBean

  • getAllAffects
  • getDescriptions
  • getId
  • getPublicationWindows
  • getSummaries
  • getActiveWindows
  • getCreationTime
  • getConsequences
  • getSeverity
  • <init>
  • getSource
  • getUrls
  • getSource,
  • getUrls,
  • setAllAffects,
  • setDescriptions,
  • setId,
  • setSummaries,
  • setConsequences,
  • setCreationTime,
  • setPublicationWindows

Popular classes and methods

  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java virtua
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • HashSet (java.util)
    This class implements the Set interface, backed by a java.util.HashMap.
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Option (scala)

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)