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); }
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)); }
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; }