-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7db977
commit 383dbc3
Showing
26 changed files
with
623 additions
and
2 deletions.
There are no files selected for viewing
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,13 @@ | ||
# DWOnAzure | ||
|
||
How to start the DWOnAzure application | ||
--- | ||
|
||
1. Run `mvn clean install` to build your application | ||
1. Start application with `java -jar target/DWOnAzure-1.0-SNAPSHOT.jar server config.yml` | ||
1. To check that your application is running enter url `http://localhost:8080` | ||
|
||
Health Check | ||
--- | ||
|
||
To see your applications health enter url `http://localhost:8081/healthcheck` |
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,9 @@ | ||
logging: | ||
level: INFO | ||
loggers: | ||
com.dwonazure: DEBUG | ||
|
||
server: | ||
applicationConnectors: | ||
- type: http | ||
port: !!int ${HTTP_PLATFORM_PORT} |
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,124 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.dwonazure</groupId> | ||
<artifactId>DWOnAzure</artifactId> | ||
<name>DWOnAzure</name> | ||
<version>1.0-SNAPSHOT</version> | ||
<prerequisites> | ||
<maven>3.0.0</maven> | ||
</prerequisites> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>2.4.1</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<createDependencyReducedPom>true</createDependencyReducedPom> | ||
<transformers> | ||
<transformer /> | ||
<transformer> | ||
<mainClass>${mainClass}</mainClass> | ||
</transformer> | ||
</transformers> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.6</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.3</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.10.3</version> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.8.1</version> | ||
<configuration> | ||
<dependencyLocationsEnabled>false</dependencyLocationsEnabled> | ||
<dependencyDetailsEnabled>false</dependencyDetailsEnabled> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.10.3</version> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.dropwizard</groupId> | ||
<artifactId>dropwizard-bom</artifactId> | ||
<version>${dropwizard.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<properties> | ||
<dropwizard.version>1.0.3</dropwizard.version> | ||
<mainClass>com.dwonazure.DWOnAzureApplication</mainClass> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
</project> | ||
|
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,142 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<prerequisites> | ||
<maven>3.0.0</maven> | ||
</prerequisites> | ||
|
||
<groupId>com.dwonazure</groupId> | ||
<artifactId>DWOnAzure</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>DWOnAzure</name> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<dropwizard.version>1.0.3</dropwizard.version> | ||
<mainClass>com.dwonazure.DWOnAzureApplication</mainClass> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.dropwizard</groupId> | ||
<artifactId>dropwizard-bom</artifactId> | ||
<version>${dropwizard.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.dropwizard</groupId> | ||
<artifactId>dropwizard-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>2.4.1</version> | ||
<configuration> | ||
<createDependencyReducedPom>true</createDependencyReducedPom> | ||
<transformers> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | ||
<mainClass>${mainClass}</mainClass> | ||
</transformer> | ||
</transformers> | ||
<!-- exclude signed Manifests --> | ||
<filters> | ||
<filter> | ||
<artifact>*:*</artifact> | ||
<excludes> | ||
<exclude>META-INF/*.SF</exclude> | ||
<exclude>META-INF/*.DSA</exclude> | ||
<exclude>META-INF/*.RSA</exclude> | ||
</excludes> | ||
</filter> | ||
</filters> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.6</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.3</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.10.3</version> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.8.1</version> | ||
<configuration> | ||
<dependencyLocationsEnabled>false</dependencyLocationsEnabled> | ||
<dependencyDetailsEnabled>false</dependencyDetailsEnabled> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.10.3</version> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
</project> |
39 changes: 39 additions & 0 deletions
39
DWOnAzure/src/main/java/com/dwonazure/DWOnAzureApplication.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,39 @@ | ||
package com.dwonazure; | ||
|
||
import io.dropwizard.Application; | ||
import io.dropwizard.setup.Bootstrap; | ||
import io.dropwizard.setup.Environment; | ||
import com.dwonazure.resources.HelloResource; | ||
import io.dropwizard.configuration.EnvironmentVariableSubstitutor; | ||
import io.dropwizard.configuration.SubstitutingSourceProvider; | ||
|
||
|
||
public class DWOnAzureApplication extends Application<DWOnAzureConfiguration> { | ||
|
||
public static void main(final String[] args) throws Exception { | ||
new DWOnAzureApplication().run(args); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "DWOnAzure"; | ||
} | ||
|
||
@Override | ||
public void initialize(final Bootstrap<DWOnAzureConfiguration> bootstrap) { | ||
// TODO: application initialization | ||
bootstrap.setConfigurationSourceProvider( | ||
new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), | ||
new EnvironmentVariableSubstitutor(false) | ||
) | ||
); | ||
} | ||
|
||
@Override | ||
public void run(final DWOnAzureConfiguration configuration, | ||
final Environment environment) { | ||
// TODO: implement application | ||
environment.jersey().register(new HelloResource()); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
DWOnAzure/src/main/java/com/dwonazure/DWOnAzureConfiguration.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,10 @@ | ||
package com.dwonazure; | ||
|
||
import io.dropwizard.Configuration; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import org.hibernate.validator.constraints.*; | ||
import javax.validation.constraints.*; | ||
|
||
public class DWOnAzureConfiguration extends Configuration { | ||
// TODO: implement service configuration | ||
} |
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,26 @@ | ||
package com.dwonazure.core; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class Greeting { | ||
|
||
@JsonProperty | ||
private String greeting; | ||
|
||
public Greeting() { | ||
} | ||
|
||
public Greeting(String greeting) { | ||
this.greeting = greeting; | ||
} | ||
|
||
public String getGreeting() { | ||
return greeting; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Greeting{" + "greeting=" + greeting + '}'; | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
DWOnAzure/src/main/java/com/dwonazure/resources/HelloResource.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,29 @@ | ||
package com.dwonazure.resources; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import com.dwonazure.core.Greeting; | ||
|
||
@Path("/hello") | ||
public class HelloResource { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String getGreeting() { | ||
return "Hello world!"; | ||
} | ||
|
||
/** | ||
* Resource method producing greeting in JSON format. | ||
* | ||
* @return a Greeting object | ||
*/ | ||
@Path("/hello_json") | ||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public Greeting getJSONGreeting() { | ||
return new Greeting("Hello world!"); | ||
} | ||
} |
Oops, something went wrong.