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
public class Rame { | |
private String direction; | |
private String attente; | |
public Rame() { | |
} | |
public Rame(String direction, String attente) { | |
this.direction = direction; |
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
public class IOExceptionMapper implements ExceptionMapper<IOException> { | |
public Response toResponse(IOException exception) { | |
return Response.serverError().entity("{ \"message\": \"" + exception.toString() + "\"}").build(); | |
} | |
} |
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
// Imports | |
@Path("/trafic-ratp") | |
@Produces(MediaType.APPLICATION_JSON) | |
public class TraficRatpResource { | |
private final String urlRatp; | |
public TraficRatpResource(String urlRatp) { | |
this.urlRatp = urlRatp; | |
} |
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
public class TraficRatpConfiguration extends Configuration { | |
@NotEmpty | |
private String urlRatp; | |
@JsonProperty | |
public String getUrlRatp() { | |
return urlRatp; | |
} | |
@JsonProperty |
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
public class TraficRatpApplication extends Application<TraficRatpConfiguration> { | |
public static void main(String[] args) throws Exception { | |
new TraficRatpApplication().run(args); | |
} | |
@Override | |
public String getName() { | |
return "trafic-ratp"; | |
} |
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
public class RatpHealthCheck extends HealthCheck { | |
private String urlRatp; | |
public RatpHealthCheck(String urlRatp) { | |
this.urlRatp = urlRatp; | |
} | |
@Override | |
protected Result check() throws Exception { | |
URL url = new URL(urlRatp); |
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
urlRatp: http://www.ratp.fr/horaires/fr/ratp/metro/prochains_passages/PP | |
# Logging settings. | |
logging: | |
level: INFO | |
loggers: | |
fr.inovia.blog: DEBUG | |
appenders: | |
- type: console |
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
git clone https://github.com/ksahnine/trafic-ratp-dropwizard.git | |
cd trafic-ratp-dropwizard | |
mvn package | |
docker build -t ksahnine/trafic-ratp-dropwizard . |
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
# Build: | |
# docker build -t ksahnine:trafic-ratp-dropwizard . | |
# | |
# Run: | |
# docker run -t -p 8080:8080 -v ~/conf/dev:/conf ksahnine:trafic-ratp-dropwizard | |
# | |
# DOCKER_VERSION 1.4 | |
FROM dockerfile/java:openjdk-7-jdk | |
MAINTAINER Kadda SAHNINE <kadda.sahnine@inovia-conseil.fr> |
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
- hosts: pegase.local | |
name: "** Frontend **" | |
gather_facts: True | |
sudo: yes | |
tasks: | |
- name: Installation nginx | |
pacman: name=nginx state=present | |
- name: Configuration loadbalancer | |
template: src=conf/loadbalancer-nginx-{{env}}.conf dest=/etc/nginx/nginx.conf | |
- name: Redemarrage nginx |
OlderNewer