forked from goeuropa/transitime-1
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR #22: Endpoints: command/serviceIds, command/vehiclesToBlock & Trac…
…car module
- Loading branch information
Showing
21 changed files
with
2,792 additions
and
118 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
app/src/main/java/org/transitclock/api/data/ApiServiceId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* (C)2023 */ | ||
package org.transitclock.api.data; | ||
|
||
import jakarta.xml.bind.annotation.XmlAttribute; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* A short description of a serviceId. For when outputting list of block IDs for service. | ||
* | ||
* @author SkiBu Smith | ||
*/ | ||
public class ApiServiceId { | ||
|
||
@XmlAttribute | ||
private String id; | ||
|
||
@XmlAttribute | ||
private List<String> blockIds; | ||
|
||
/********************** Member Functions **************************/ | ||
|
||
/** | ||
* Need a no-arg constructor for Jersey. Otherwise get really obtuse "MessageBodyWriter not | ||
* found for media type=application/json" exception. | ||
*/ | ||
protected ApiServiceId() { | ||
} | ||
|
||
public ApiServiceId(String serviceId, List<String> blockIds) { | ||
this.id = serviceId; | ||
this.blockIds = blockIds; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/org/transitclock/api/data/ApiServiceIds.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* (C)2023 */ | ||
package org.transitclock.api.data; | ||
|
||
import jakarta.xml.bind.annotation.XmlElement; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* For outputting simple list of unsorted service IDs with lists of sorted block IDs | ||
* | ||
* @author SkiBu Smith | ||
*/ | ||
@XmlRootElement | ||
public class ApiServiceIds { | ||
|
||
@XmlElement(name= "serviceIds") | ||
private List<ApiServiceId> apiServiceIds; | ||
|
||
/********************** Member Functions **************************/ | ||
|
||
/** | ||
* Need a no-arg constructor for Jersey. Otherwise get really obtuse "MessageBodyWriter not | ||
* found for media type=application/json" exception. | ||
*/ | ||
protected ApiServiceIds() { | ||
} | ||
|
||
/** | ||
* Creates the API unsorted version of list of IDs. | ||
* | ||
* @param serviceIds | ||
*/ | ||
public ApiServiceIds(Map<String, List<String>> serviceIds) { | ||
apiServiceIds = new ArrayList<>(); | ||
serviceIds.forEach((key, list) -> apiServiceIds | ||
.add(new ApiServiceId(key,list))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
core/src/main/java/org/transitclock/config/data/TraccarConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* (C)2023 */ | ||
package org.transitclock.config.data; | ||
|
||
import org.transitclock.config.StringConfigValue; | ||
|
||
|
||
public class TraccarConfig { | ||
/** | ||
* Traccar properties for log in by "TraccarAVLModule" | ||
* | ||
* @return | ||
*/ | ||
public static final StringConfigValue TRACCAREMAIL = new StringConfigValue("transitclock.avl.traccar.email", null, | ||
"This is the username for the traccar server api."); | ||
|
||
public static final StringConfigValue TRACCARPASSWORD = new StringConfigValue("transitclock.avl.traccar.password", | ||
null, "This is the password for the traccar server api"); | ||
|
||
public static final StringConfigValue TRACCARBASEURL = new StringConfigValue("transitclock.avl.traccar.baseurl", | ||
null, "This is the url for the traccar server api."); | ||
|
||
public static final StringConfigValue TRACCARSOURCE = new StringConfigValue("transitclock.avl.traccar.source", | ||
"TRACCAR", "This is the value recorded in the source for the AVL Report."); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.