Compare commits
4 Commits
renovate/o
...
main
Author | SHA1 | Date |
---|---|---|
|
353ae353b7 | |
|
1bda103622 | |
|
34ac2a850a | |
|
444777c386 |
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
# Files
|
||||||
|
.classpath
|
||||||
|
.externalToolBuilders
|
||||||
|
.gradle
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
.settings
|
||||||
|
.sonar
|
||||||
|
*~
|
||||||
|
*.ipr
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
*.swp
|
||||||
|
*.DS_Store
|
||||||
|
*.snap.debug
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
|
||||||
|
# Directories
|
||||||
|
.idea/
|
||||||
|
.run/
|
||||||
|
.venv/
|
||||||
|
_site/
|
||||||
|
build/
|
||||||
|
dist/
|
||||||
|
docs/_build/
|
||||||
|
gen-java/
|
||||||
|
gen-javabean/
|
||||||
|
gen-py/
|
||||||
|
node_modules/
|
||||||
|
target/
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Overview
|
||||||
|
This project can serve as starting point for Maven and Java based projects.
|
||||||
|
|
||||||
|
# Links
|
|
@ -0,0 +1,5 @@
|
||||||
|
database.host = db.acme.com
|
||||||
|
database.port = 8199
|
||||||
|
database.user = admin
|
||||||
|
database.password = ???
|
||||||
|
database.timeout = 60000
|
|
@ -0,0 +1,100 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<name>mvn_base</name>
|
||||||
|
<description>description</description>
|
||||||
|
<url>https://swingbe.de</url>
|
||||||
|
<groupId>de.swingbe</groupId>
|
||||||
|
<artifactId>mvn_base</artifactId>
|
||||||
|
<version>0.0.1</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>GNU General Public License</name>
|
||||||
|
<url>https://www.gnu.org/licenses/gpl-3.0.txt</url>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<url>https://github.com/Software-Ingenieur-Begerad/sandbox-java</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<!-- Other properties -->
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.10.1</version>
|
||||||
|
<configuration>
|
||||||
|
<!-- Target Java versions -->
|
||||||
|
<release>11</release>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.2.4</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<filters>
|
||||||
|
<filter>
|
||||||
|
<!-- exclude signatures from merged JAR to avoid invalid signature messages -->
|
||||||
|
<artifact>*:*</artifact>
|
||||||
|
<excludes>
|
||||||
|
<exclude>META-INF/*.SF</exclude>
|
||||||
|
<exclude>META-INF/*.DSA</exclude>
|
||||||
|
<exclude>META-INF/*.RSA</exclude>
|
||||||
|
</excludes>
|
||||||
|
</filter>
|
||||||
|
</filters>
|
||||||
|
<!-- The shaded JAR will not be the main artifact for the project, it will be attached
|
||||||
|
for deployment in the way source and docs are. -->
|
||||||
|
<shadedArtifactAttached>true
|
||||||
|
</shadedArtifactAttached>
|
||||||
|
<shadedClassifierName>shaded</shadedClassifierName>
|
||||||
|
<transformers>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||||
|
<transformer
|
||||||
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
|
<manifestEntries>
|
||||||
|
<Main-Class>de.swingbe.mvn_base.Main
|
||||||
|
</Main-Class>
|
||||||
|
</manifestEntries>
|
||||||
|
</transformer>
|
||||||
|
</transformers>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
<dependencies>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-configuration2 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-configuration2</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-beanutils</groupId>
|
||||||
|
<artifactId>commons-beanutils</artifactId>
|
||||||
|
<version>1.9.4</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,42 @@
|
||||||
|
package de.swingbe.mvn_base;
|
||||||
|
|
||||||
|
import org.apache.commons.configuration2.Configuration;
|
||||||
|
import org.apache.commons.configuration2.builder.fluent.Configurations;
|
||||||
|
import org.apache.commons.configuration2.ex.ConfigurationException;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello world!");
|
||||||
|
Configurations configs = new Configurations();
|
||||||
|
try {
|
||||||
|
Configuration config = configs.properties(new File("database.properties"));
|
||||||
|
|
||||||
|
// access configuration properties
|
||||||
|
System.out.println("Access configuration properties!");
|
||||||
|
|
||||||
|
String dbHost = config.getString("database.host", "host");
|
||||||
|
System.out.println("dbHost: " + dbHost);
|
||||||
|
|
||||||
|
String falsePositive = config.getString("falsePositive", "falsePositive");
|
||||||
|
System.out.println("falsePositive: " + falsePositive);
|
||||||
|
|
||||||
|
int dbPort = config.getInt("database.port", 65535);
|
||||||
|
System.out.println("dbPort: " + dbPort);
|
||||||
|
|
||||||
|
String dbUser = config.getString("database.user", "user");
|
||||||
|
System.out.println("dbUser: " + dbUser);
|
||||||
|
|
||||||
|
String dbPassword = config.getString("database.password", "secret"); // provide a default
|
||||||
|
System.out.println("dbPassword: " + dbPassword);
|
||||||
|
|
||||||
|
long dbTimeout = config.getLong("database.timeout");
|
||||||
|
System.out.println("dbTimeout: " + dbTimeout);
|
||||||
|
} catch (ConfigurationException cex) {
|
||||||
|
System.err.println("Something went wrong!");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,13 @@
|
||||||
</license>
|
</license>
|
||||||
</licenses>
|
</licenses>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>public.onebusaway.org</id>
|
||||||
|
<url>http://nexus.onebusaway.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<url>https://github.com/Software-Ingenieur-Begerad/sandbox-java</url>
|
<url>https://github.com/Software-Ingenieur-Begerad/sandbox-java</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
@ -28,16 +35,24 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.onebusaway</groupId>
|
||||||
|
<artifactId>onebusaway-gtfs-realtime-exporter</artifactId>
|
||||||
|
<version>1.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mobilitydata</groupId>
|
||||||
|
<artifactId>gtfs-realtime-bindings</artifactId>
|
||||||
|
<version>0.0.8</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.10.1</version>
|
<version>3.10.1</version>
|
||||||
<configuration>
|
|
||||||
<!-- Target Java versions -->
|
|
||||||
<release>11</release>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
@ -1,9 +1,73 @@
|
||||||
package de.swingbe.grb_use;
|
package de.swingbe.grb_use;
|
||||||
|
|
||||||
|
import org.onebusway.gtfs_realtime.exporter.GtfsRealtimeLibrary;
|
||||||
|
import org.onebusway.gtfs_realtime.exporter.GtfsRealtimeMutableProvider;
|
||||||
|
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.FeedEntity;
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.FeedMessage;
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.Position;
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.VehiclePosition;
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.TripDescriptor;
|
||||||
|
import com.google.transit.realtime.GtfsRealtime.VehicleDescriptor;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
|
private static GtfsRealtimeMutableProvider gtfsRealtimeMutableProvider;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Hello world!");
|
System.out.println("main() started...");
|
||||||
|
//GtfsRealtime.FeedMessage msg;
|
||||||
|
FeedMessage.Builder vehiclePositions = GtfsRealtimeLibrary.createFeedMessageBuilder();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We construct a TripDescriptor and VehicleDescriptor, which will be used
|
||||||
|
* in both trip updates and vehicle positions to identify the trip and
|
||||||
|
* vehicle. Ideally, we would have a trip id to use for the trip
|
||||||
|
* descriptor, but the SEPTA api doesn't include it, so we settle for a
|
||||||
|
* route id instead.
|
||||||
|
*/
|
||||||
|
TripDescriptor.Builder tripDescriptor = TripDescriptor.newBuilder();
|
||||||
|
tripDescriptor.setRouteId("tripDescriptor:RouteId");
|
||||||
|
|
||||||
|
VehicleDescriptor.Builder vehicleDescriptor = VehicleDescriptor.newBuilder();
|
||||||
|
vehicleDescriptor.setId("vehicleDescriptor:Id");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To construct our VehiclePosition, we create a position for the vehicle.
|
||||||
|
* We add the position to a VehiclePosition builder, along with the trip
|
||||||
|
* and vehicle descriptors.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Brunswick
|
||||||
|
*/
|
||||||
|
double lat = 52.268875;
|
||||||
|
double lon = 10.526770;
|
||||||
|
|
||||||
|
Position.Builder position = Position.newBuilder();
|
||||||
|
position.setLatitude((float) lat);
|
||||||
|
position.setLongitude((float) lon);
|
||||||
|
|
||||||
|
VehiclePosition.Builder vehiclePosition = VehiclePosition.newBuilder();
|
||||||
|
vehiclePosition.setPosition(position);
|
||||||
|
vehiclePosition.setTrip(tripDescriptor);
|
||||||
|
vehiclePosition.setVehicle(vehicleDescriptor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new feed entity to wrap the vehicle position and add it to the
|
||||||
|
* GTFS-realtime vehicle positions feed.
|
||||||
|
*/
|
||||||
|
FeedEntity.Builder vehiclePositionEntity = FeedEntity.newBuilder();
|
||||||
|
vehiclePositionEntity.setId("vehiclePositionEntity:Id");
|
||||||
|
vehiclePositionEntity.setVehicle(vehiclePosition);
|
||||||
|
vehiclePositions.addEntity(vehiclePositionEntity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build out the final GTFS-realtime feed messagse and save them.
|
||||||
|
*/
|
||||||
|
gtfsRealtimeMutableProvider.setVehiclePositions(vehiclePositions.build());
|
||||||
|
|
||||||
|
System.out.println("main() done.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.swingbe.ifleet</groupId>
|
<groupId>de.swingbe.ifleet</groupId>
|
||||||
<artifactId>pg-lct-msg-api</artifactId>
|
<artifactId>pg-lct-msg-api</artifactId>
|
||||||
<version>0.0.4</version>
|
<version>0.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -4,6 +4,8 @@ import de.swingbe.ifleet.controller.PgConnection;
|
||||||
import de.swingbe.ifleet.controller.PgPrepStatement;
|
import de.swingbe.ifleet.controller.PgPrepStatement;
|
||||||
import de.swingbe.ifleet.model.LctMsg;
|
import de.swingbe.ifleet.model.LctMsg;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
private static final String TABLE = "lct_msg";
|
private static final String TABLE = "lct_msg";
|
||||||
|
@ -67,6 +69,12 @@ public class Main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<ArrayList<String>> aryLctMsgs = pgPrepStatement.get("%","%GER%", "12:00:1%","%");
|
||||||
|
if( aryLctMsgs != null) {
|
||||||
|
System.out.println("main() aryLctMsgs size: " + aryLctMsgs.size());
|
||||||
|
System.out.println("main() aryLctMsgs: " + aryLctMsgs);
|
||||||
|
}
|
||||||
|
|
||||||
System.out.println("main() done.");
|
System.out.println("main() done.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>exec-maven-plugin</artifactId>
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.0.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<mainClass>de.swingbe.postgres_java.JavaPostgreSqlVersion
|
<mainClass>de.swingbe.postgres_java.JavaPostgreSqlVersion
|
||||||
</mainClass>
|
</mainClass>
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{
|
|
||||||
"extends":
|
|
||||||
[
|
|
||||||
"config:base"
|
|
||||||
],
|
|
||||||
"timezone": "Europe/Berlin",
|
|
||||||
"schedule":
|
|
||||||
[
|
|
||||||
"after 4pm every weekday",
|
|
||||||
"before 8am every weekday",
|
|
||||||
"every weekend"
|
|
||||||
],
|
|
||||||
"packageRules":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"matchUpdateTypes": ["minor","patch"],
|
|
||||||
"matchCurrentVersion": "!/^0/",
|
|
||||||
"automerge": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Reference in New Issue