Ejemplo n.º 1
0
        public void WritePlannedRoute(
            VmPlannedRouteConfiguration configuration,
            String plannedRouteData,
            String plannedRouteCloseOutData)
        {
            String localName = configuration.GetDirectoryName();

            JwUtility.WriteToFile(
                GetPlannedRouteDataPath(localName),
                plannedRouteData);

            JwUtility.WriteToFile(
                GetPlannedRouteCloseOutDataPath(localName),
                plannedRouteCloseOutData);

            JwUtility.WriteToFile(
                GetPlannedRouteLastUpdateCookiePath(localName),
                JwTimestampPolicy.GetIsoTimestampPolicy().Format( configuration.LastUpdateTs));
        }
Ejemplo n.º 2
0
        public bool HasConfiguration(VmPlannedRouteConfiguration configuration)
        {
            String path = GetPlannedRouteLocalPath(configuration.GetDirectoryName());

            if ( ! Directory.Exists(path) ) return false;

            JwTimestamp ts = GetLastUpdatedTimestamp(configuration);

            return JwUtility.IsEqual(ts, configuration.LastUpdateTs);
        }
Ejemplo n.º 3
0
        public void GetPlannedRouteConfiguration(VmPlannedRouteConfiguration configuration)
        {
            if( ! AirportInputData.PlannedRoutes.HasConfiguration(configuration) )
            {

                MonitorBeginFile(AirportInputData.AirportCode, "...Get " + configuration.GetDisplayString());

                String plannedRoutesData = GetPlannedRoutesData(configuration);
                String plannedRoutesCloseOutData = GetPlannedRouteCloseOutData(configuration);

                AirportInputData.PlannedRoutes.WritePlannedRoute(
                    configuration,
                    plannedRoutesData,
                    plannedRoutesCloseOutData);
            }
        }
Ejemplo n.º 4
0
 public JwTimestamp GetLastUpdatedTimestamp(VmPlannedRouteConfiguration configuration)
 {
     String filePath = GetPlannedRouteLastUpdateCookiePath(configuration.GetDirectoryName());
     String s = JwUtility.ReadString(filePath);
     if( s == null ) return null;
     s = s.Trim();
     if( JwUtility.IsEmpty(s) ) return null;
     JwTimestamp ts = JwTimestampPolicy.GetIsoTimestampPolicy().Parse(s);
     return ts;
 }
Ejemplo n.º 5
0
 /**
  * Get Planned Route Close Out Times
  *
  * Purpose:
  *      Get the close out times of the domestic planned routes for the specified dates.
  *
  * Expected parameters:
  *      accountCode     the account code must must reference an active account
  *      login           the login must be an active user with the cargoWorker role
  *      password        the password must match the user'
  s password
  *      deviceName      the name of a registered device.
  *      airportCode     must be active
  *      startDate       formatted as ISO
  *      endDate         formatted as ISO
  *
  * Returned values:
  *      {response header}
  *      data: list planned routes and close out time, separated by a carriage
  *      return, line feed. The data will be concatenated together into a fixed length
  *      string of length 9. The control number will be padded with spaces to 4
  *      characters. The time will be formated in 24 hour clock (military) without
  *      seconds.
  *      The data is as follows:
  *          planned route control number (route index number)
  *          close out time
  */
 public String GetPlannedRouteCloseOutData(VmPlannedRouteConfiguration configuration)
 {
     VmMessageHttpRequest req2 = new VmMessageHttpRequest();
     req2.Mappings["command"] = "getPlannedRouteCloseOutTimes";
     req2.Mappings["airportCode"] = AirportInputData.AirportCode;
     req2.Mappings["startDate"] = JwDatePolicyIso.FormatAsIsoDate( configuration.EffectiveStartDate);
     req2.Mappings["endDate"] = JwDatePolicyIso.FormatAsIsoDate( configuration.EffectiveEndDate);
     VmMessageHttpResponse res2  = req2.Send();
     return res2.GetData();
 }