1- // Copyright 2015-2019 SWIM.AI inc.
1+ // Copyright 2015-2022 Swim. inc
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
2121import java .util .Iterator ;
2222import java .util .List ;
2323import java .util .zip .GZIPInputStream ;
24- import swim .api .ref .SwimRef ;
24+ import swim .api .ref .WarpRef ;
2525import swim .codec .Utf8 ;
2626import swim .structure .Form ;
2727import swim .structure .Item ;
@@ -37,25 +37,25 @@ public class NextBusHttpAPI {
3737
3838 private NextBusHttpAPI () { }
3939
40- public static void sendRoutes (List <Agency > agencies , SwimRef swim ) {
40+ public static void sendRoutes (List <Agency > agencies , WarpRef warp ) {
4141 for (Agency agency : agencies ) {
42- sendRoutes (agency , swim );
42+ sendRoutes (agency , warp );
4343 }
4444 }
4545
46- public static void sendVehicleInfo (String pollUrl , Agency ag , SwimRef swim ) {
46+ public static void sendVehicleInfo (String pollUrl , Agency ag , WarpRef warp ) {
4747 final Vehicles vehicles = getVehicleLocations (pollUrl , ag );
4848 if (vehicles != null && vehicles .getVehicles ().size () > 0 ) {
4949 final Value value = Form .forClass (Vehicles .class ).mold (vehicles ).toValue ();
50- swim .command (ag .getUri (), "addVehicles" , value );
50+ warp .command (ag .getUri (), "addVehicles" , value );
5151 }
5252 }
5353
54- private static void sendRoutes (Agency agency , SwimRef swim ) {
54+ private static void sendRoutes (Agency agency , WarpRef warp ) {
5555 final Routes routes = getRoutes (agency );
5656 if (routes != null && !routes .getRoutes ().isEmpty ()) {
5757 final Value value = Form .forClass (Routes .class ).mold (routes ).toValue ();
58- swim .command (agency .getUri (), "addRoutes" , value );
58+ warp .command (agency .getUri (), "addRoutes" , value );
5959 }
6060 }
6161
@@ -157,7 +157,7 @@ private static Value parse(URL url) {
157157 urlConnection = (HttpURLConnection ) url .openConnection ();
158158 urlConnection .setRequestProperty ("Accept-Encoding" , "gzip, deflate" );
159159 final InputStream stream = new GZIPInputStream (urlConnection .getInputStream ());
160- final Value configValue = Utf8 .read (Xml .structureParser ().documentParser (), stream );
160+ final Value configValue = Utf8 .read (stream , Xml .structureParser ().documentParser ());
161161 return configValue ;
162162 } catch (Throwable e ) {
163163 e .printStackTrace ();
0 commit comments