Skip to content

Commit

Permalink
Merge pull request #41 from TheTransitClock/tc_issue_37
Browse files Browse the repository at this point in the history
Tc issue 37
  • Loading branch information
scrudden committed Feb 1, 2018
2 parents cb369a9 + d769af9 commit 98a5d91
Show file tree
Hide file tree
Showing 153 changed files with 473 additions and 1,284 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>transitclock</name>
<url>http://www.transitime.org//</url>
<url>http://www.transitclock.org//</url>
<modules>
<module>transitclock</module>
<module>transitclockApi</module>
Expand All @@ -26,8 +26,8 @@
<module>transitclockIntegration</module>
<module>transitclock</module>
<module>transitclockApi</module>
<module>transitclockWebapp</module>
<module>transitclockQuickStart</module>
<module>transitclockWebapp</module>
<module>transitclockQuickStart</module>
</modules>
</profile>
</profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ private static List<String> getGtfsRealtimeURIs() {
return gtfsRealtimeURIs.getValue();
}
private static StringListConfigValue gtfsRealtimeURIs =
new StringListConfigValue("transitime.avl.gtfsRealtimeFeedURIs",
new StringListConfigValue("transitclock.avl.gtfsRealtimeFeedURIs",
null,
"Semicolon separated list of URIs of the GTFS-realtime data to read in");

private static String getCsvFileOutputDir() {
return csvFileOutputDir.getValue();
}
private static StringConfigValue csvFileOutputDir =
new StringConfigValue("transitime.avl.csvFileOutputDir",
new StringConfigValue("transitclock.avl.csvFileOutputDir",
"/Users/Mike/gtfsRealtimeData/csv",
"Name of directory where output will be written");

Expand All @@ -69,7 +69,7 @@ private static String getTimeZoneStr() {
return timeZoneStr.getValue();
}
private static StringConfigValue timeZoneStr =
new StringConfigValue("transitime.avl.timeZoneStr",
new StringConfigValue("transitclock.avl.timeZoneStr",
"",
"The timezone for the agency. In the form " +
"\"America/New_York\"");
Expand All @@ -78,7 +78,7 @@ private static boolean shouldOffsetForMapOfChina() {
return offsetForMapOfChina.getValue();
}
private static BooleanConfigValue offsetForMapOfChina =
new BooleanConfigValue("transitime.avl.offsetForMapOfChina",
new BooleanConfigValue("transitclock.avl.offsetForMapOfChina",
false,
"If set to true then the latitudes/longitudes stored " +
"will be adjusted for the China map offset so that the " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ public class Core {
// Read in configuration files. This should be done statically before
// the logback LoggerFactory.getLogger() is called so that logback can
// also be configured using a transitime config file. The files are
// specified using the java system property -Dtransitime.configFiles .
// specified using the java system property -Dtransitclock.configFiles .
static {
ConfigFileReader.processConfig();
}
private static StringConfigValue cacheReloadStartTimeStr =
new StringConfigValue("transitime.core.cacheReloadStartTimeStr",
new StringConfigValue("transitclock.core.cacheReloadStartTimeStr",
"",
"Date and time of when to start reading arrivaldepartures to inform caches.");

private static StringConfigValue cacheReloadEndTimeStr =
new StringConfigValue("transitime.core.cacheReloadEndTimeStr",
new StringConfigValue("transitclock.core.cacheReloadEndTimeStr",
"",
"Date and time of when to end reading arrivaldepartures to inform caches.");
private static final Logger logger =
Expand Down Expand Up @@ -192,7 +192,7 @@ public Core(String agencyId) {
* Creates the Core object for the application. There can only be one Core
* object per application. Uses CoreConfig.getAgencyId() to determine the
* agencyId. This means it typically uses the agency ID specified by the
* Java property -Dtransitime.core.agencyId .
* Java property -Dtransitclock.core.agencyId .
* <p>
* Usually doesn't need to be called directly because can simply use
* Core.getInstance().
Expand Down Expand Up @@ -373,7 +373,7 @@ private static void processCommandLineOptions(String[] args)
// Handle help option
if (cmd.hasOption("h")) {
// Display help
final String commandLineSyntax = "java transitime.jar";
final String commandLineSyntax = "java transitclock.jar";
final PrintWriter writer = new PrintWriter(System.out);
final HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(writer,
Expand Down Expand Up @@ -491,7 +491,7 @@ public static void main(String[] args) {
List<String> optionalModuleNames = CoreConfig.getOptionalModules();
if (optionalModuleNames.size() > 0)
logger.info("Starting up optional modules specified via " +
"transitime.modules.optionalModulesList param:");
"transitclock.modules.optionalModulesList param:");
else
logger.info("No optional modules to start up.");
for (String moduleName : optionalModuleNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public void process() throws IllegalArgumentException {
*/
private static void displayCommandLineOptions(Options options) {
// Display help
final String commandLineSyntax = "java transitime.jar";
final String commandLineSyntax = "java transitclock.jar";
final PrintWriter writer = new PrintWriter(System.out);
final HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(writer, 80, // printedRowWidth
Expand Down Expand Up @@ -661,10 +661,10 @@ public static void main(String[] args) {
// Found that when running on AWS that program never terminates,
// probably because still have db threads running. Therefore
// using exit() to definitely end the process.
String integrationTest = System.getProperty("transitime.core.integrationTest");
String integrationTest = System.getProperty("transitclock.core.integrationTest");
if(integrationTest != null){
logger.info("GTFS import complete for integration test");
System.setProperty("transitime.core.gtfsImported","true");
System.setProperty("transitclock.core.gtfsImported","true");
}else{
System.exit(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ else if ("resetVehicle".equals(commandStr))
*/
private static void displayCommandLineOptionsAndExit(Options options) {
// Display help
final String commandLineSyntax = "java transitime.jar";
final String commandLineSyntax = "java transitclock.jar";
final PrintWriter writer = new PrintWriter(System.out);
writer.append(
"A command line application that allows user to request data\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ScheduleGenerator {
// Read in configuration files. This should be done statically before
// the logback LoggerFactory.getLogger() is called so that logback can
// also be configured using a transitime config file. The files are
// specified using the java system property -Dtransitime.configFiles .
// specified using the java system property -Dtransitclock.configFiles .
static {
ConfigFileReader.processConfig();
}
Expand All @@ -78,7 +78,7 @@ public class ScheduleGenerator {
*/
private static void displayCommandLineOptions(Options options) {
// Display help
final String commandLineSyntax = "java transitime.jar";
final String commandLineSyntax = "java transitclock.jar";
final PrintWriter writer = new PrintWriter(System.out);
final HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp(writer,
Expand All @@ -91,7 +91,7 @@ private static void displayCommandLineOptions(Options options) {
null, // footer
true); // displayUsage
writer.write("Also need to set VM parameters: \n" +
" -Dtransitime.core.agencyId=<agencyId>\n");
" -Dtransitclock.core.agencyId=<agencyId>\n");
writer.close();
}

Expand Down Expand Up @@ -211,7 +211,7 @@ private static CommandLine processCommandLineOptions(String[] args) {
System.exit(0);
}

// Get project ID from VM param transitime.core.agencyId
// Get project ID from VM param transitclock.core.agencyId
agencyId = AgencyConfig.getAgencyId();
if (agencyId == null) {
displayCommandLineOptions(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public String getDialectClass() {
* <p>
* The resulting files have the name "ddl_" plus dialect name such as mysql
* or oracle plus the first two components of the package name such as
* org_transitime.
* org_transitclock.
*/
public static void main(String[] args) throws Exception {
// Handle the command line options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class UpdateTravelTimes {
// Read in configuration files. This should be done statically before
// the logback LoggerFactory.getLogger() is called so that logback can
// also be configured using a transitime config file. The files are
// specified using the java system property -Dtransitime.configFiles .
// specified using the java system property -Dtransitclock.configFiles .
static {
ConfigFileReader.processConfig();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@
*/
public class AmigoCloudAvlModule extends AvlModule {
private static StringConfigValue feedUrl = new StringConfigValue(
"transitime.avl.amigocloud.apiToken",
"transitclock.avl.amigocloud.apiToken",
"R:0pKSjytdXHfGMfWdRjY5xGGUU3FgaamySwDK0u",
"The API token obtained from AmigoCloud via "
+ "https://www.amigocloud.com/accounts/tokens that allows "
+ "access to their feed.");

private static LongConfigValue userId =
new LongConfigValue(
"transitime.avl.amigocloud.userId",
"transitclock.avl.amigocloud.userId",
1194L,
"The ID of the client. Obtained using the amigocloud api "
+ "token via \"curl https://www.amigocloud.com/api/v1/me?token=API_TOKEN\"");

private static LongConfigValue projectId = new LongConfigValue(
"transitime.avl.amigocloud.projectId", 661L,
"transitclock.avl.amigocloud.projectId", 661L,
"The amigocloud ID of the agency that getting AVL data " + "from.");

private static LongConfigValue datasetId = new LongConfigValue(
"transitime.avl.amigocloud.datasetId", 12556L,
"transitclock.avl.amigocloud.datasetId", 12556L,
"The amigocloud ID of the dataset for the agency that "
+ "getting AVL data from.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void run() {
logger.debug("Not processing AVL report because the new "
+ "report is too close in time to the previous AVL "
+ "report for the vehicle. "
+ "transitime.avl.minTimeBetweenAvlReportsSecs={} "
+ "transitclock.avl.minTimeBetweenAvlReportsSecs={} "
+ "secs. New AVL report is {}. Previous valid AVL "
+ "report is {}",
AvlConfig.getMinTimeBetweenAvlReportsSecs(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* A singleton thread executor for executing AVL reports. For when not using JMS
* to handle queue of AVL reports. One can dump AVL reports into this executor
* and then have them be executed, possibly using multiple threads. The number
* of threads is specified using the Java property transitime.avl.numThreads .
* The queue size is set using the Java property transitime.avl.queueSize .
* of threads is specified using the Java property transitclock.avl.numThreads .
* The queue size is set using the Java property transitclock.avl.queueSize .
* <p>
* Causes AvlClient.run() to be called on each AvlReport, unless using test
* executor, in which case the AvlClientTester() is called.
Expand All @@ -58,7 +58,7 @@ public class AvlExecutor {
private final static int MAX_THREADS = 25;

private static IntegerConfigValue avlQueueSize =
new IntegerConfigValue("transitime.avl.queueSize", 2000,
new IntegerConfigValue("transitclock.avl.queueSize", 2000,
"How many items to go into the blocking AVL queue "
+ "before need to wait for queue to have space. Should "
+ "be approximately 50% more than the number of reports "
Expand All @@ -67,7 +67,7 @@ public class AvlExecutor {
+ "data will be rejected by the ThreadPoolExecutor. ");

private static IntegerConfigValue numAvlThreads =
new IntegerConfigValue("transitime.avl.numThreads", 1,
new IntegerConfigValue("transitclock.avl.numThreads", 1,
"How many threads to be used for processing the AVL " +
"data. For most applications just using a single thread " +
"is probably sufficient and it makes the logging simpler " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ public class AvlJmsClientModule extends Module {
private final static int MAX_THREADS = 100;

private static IntegerConfigValue avlQueueSize =
new IntegerConfigValue("transitime.avl.jmsQueueSize", 350,
new IntegerConfigValue("transitclock.avl.jmsQueueSize", 350,
"How many items to go into the blocking AVL queue "
+ "before need to wait for queue to have space. "
+ "Only for when JMS is used.");

private static IntegerConfigValue numAvlThreads =
new IntegerConfigValue("transitime.avl.jmsNumThreads", 1,
new IntegerConfigValue("transitclock.avl.jmsNumThreads", 1,
"How many threads to be used for processing the AVL " +
"data. For most applications just using a single thread " +
"is probably sufficient and it makes the logging simpler " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ private static String getCsvAvlFeedFileName() {
return csvAvlFeedFileName.getValue();
}
private static StringConfigValue csvAvlFeedFileName =
new StringConfigValue("transitime.avl.csvAvlFeedFileName",
new StringConfigValue("transitclock.avl.csvAvlFeedFileName",
"/Users/Mike/cvsAvlData/testAvlData.csv",
"The name of the CSV file containing AVL data to process.");


private static BooleanConfigValue processInRealTime =
new BooleanConfigValue("transitime.avl.processInRealTime",
new BooleanConfigValue("transitclock.avl.processInRealTime",
false,
"For when getting batch of AVL data from a CSV file. "
+ "When true then when reading in do at the same speed as "
Expand Down Expand Up @@ -134,9 +134,9 @@ public void run() {
}

// Kill off the whole program because done processing the AVL data
String integrationTest = System.getProperty("transitime.core.integrationTest");
String integrationTest = System.getProperty("transitclock.core.integrationTest");
if(integrationTest != null){
System.setProperty("transitime.core.csvImported","true");
System.setProperty("transitclock.core.csvImported","true");
}else{
System.exit(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static List<String> getGtfsRealtimeURIs() {
return gtfsRealtimeURIs.getValue();
}
private static StringListConfigValue gtfsRealtimeURIs =
new StringListConfigValue("transitime.avl.gtfsRealtimeFeedURIs",
new StringListConfigValue("transitclock.avl.gtfsRealtimeFeedURIs",
null,
"Semicolon separated list of URIs of the GTFS-realtime data to read in");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static String getGtfsRealtimeURI() {
return gtfsRealtimeURI.getValue();
}
private static StringConfigValue gtfsRealtimeURI =
new StringConfigValue("transitime.avl.gtfsRealtimeFeedURI",
new StringConfigValue("transitclock.avl.gtfsRealtimeFeedURI",
"file:///C:/Users/Mike/gtfsRealtimeData",
"The URI of the GTFS-realtime feed to use.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class NextBusAvlModule extends XmlPollingAvlModule {

// Parameter that specifies URL of the NextBus feed.
private static StringConfigValue nextBusFeedUrl =
new StringConfigValue("transitime.avl.nextbus.url",
new StringConfigValue("transitclock.avl.nextbus.url",
"http://webservices.nextbus.com/service/publicXMLFeed",
"The URL of the NextBus feed to use.");
private static String getNextBusFeedUrl() {
Expand All @@ -54,17 +54,17 @@ private static String getNextBusFeedUrl() {
// Config param that specifies the agency name to use as part
// of the NextBus feed URL.
private static StringConfigValue agencyNameForFeed =
new StringConfigValue("transitime.avl.nextbus.agencyNameForFeed",
new StringConfigValue("transitclock.avl.nextbus.agencyNameForFeed",
"If set then specifies the agency name to use for the "
+ "feed. If not set then the transitime.core.agencyId "
+ "feed. If not set then the transitclock.core.agencyId "
+ "is used.");
protected String getAgencyNameForFeed() {
return agencyNameForFeed.getValue();
}

private static BooleanConfigValue useTripShortNameForAssignment =
new BooleanConfigValue(
"transitime.avl.nextbus.useTripShortNameForAssignment",
"transitclock.avl.nextbus.useTripShortNameForAssignment",
false,
"For some agencies the block info in the feed doesn't "
+ "match the GTFS data. For these can sometimes use the "
Expand All @@ -78,7 +78,7 @@ protected String getAgencyNameForFeed() {
// decreased.
private static IntegerConfigValue apiClockSkewMsecs =
new IntegerConfigValue(
"transitime.avl.nextbus.apiClockSkewMsecs",
"transitclock.avl.nextbus.apiClockSkewMsecs",
0,
"Determining GPS time from API is kludgey. Only have "
+ "secsSinceReport attribute in API. Sometimes, probably "
Expand Down
Loading

0 comments on commit 98a5d91

Please sign in to comment.