initial commit
This commit is contained in:
16
.classpath
16
.classpath
@ -2,15 +2,9 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="src" path="src/main/resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
<classpathentry kind="src" path="src/test/java"/>
|
||||
<classpathentry kind="src" path="src/test/resources"/>
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/build/
|
||||
/bin/
|
1
.gradle/2.2.1/taskArtifacts/cache.properties
Normal file
1
.gradle/2.2.1/taskArtifacts/cache.properties
Normal file
@ -0,0 +1 @@
|
||||
#Tue May 26 17:53:04 CEST 2015
|
BIN
.gradle/2.2.1/taskArtifacts/cache.properties.lock
Normal file
BIN
.gradle/2.2.1/taskArtifacts/cache.properties.lock
Normal file
Binary file not shown.
BIN
.gradle/2.2.1/taskArtifacts/fileHashes.bin
Normal file
BIN
.gradle/2.2.1/taskArtifacts/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/2.2.1/taskArtifacts/fileSnapshots.bin
Normal file
BIN
.gradle/2.2.1/taskArtifacts/fileSnapshots.bin
Normal file
Binary file not shown.
BIN
.gradle/2.2.1/taskArtifacts/outputFileStates.bin
Normal file
BIN
.gradle/2.2.1/taskArtifacts/outputFileStates.bin
Normal file
Binary file not shown.
BIN
.gradle/2.2.1/taskArtifacts/taskArtifacts.bin
Normal file
BIN
.gradle/2.2.1/taskArtifacts/taskArtifacts.bin
Normal file
Binary file not shown.
1
.gradle/2.3/taskArtifacts/cache.properties
Normal file
1
.gradle/2.3/taskArtifacts/cache.properties
Normal file
@ -0,0 +1 @@
|
||||
#Wed May 27 09:37:38 CEST 2015
|
BIN
.gradle/2.3/taskArtifacts/cache.properties.lock
Normal file
BIN
.gradle/2.3/taskArtifacts/cache.properties.lock
Normal file
Binary file not shown.
BIN
.gradle/2.3/taskArtifacts/fileHashes.bin
Normal file
BIN
.gradle/2.3/taskArtifacts/fileHashes.bin
Normal file
Binary file not shown.
BIN
.gradle/2.3/taskArtifacts/fileSnapshots.bin
Normal file
BIN
.gradle/2.3/taskArtifacts/fileSnapshots.bin
Normal file
Binary file not shown.
BIN
.gradle/2.3/taskArtifacts/outputFileStates.bin
Normal file
BIN
.gradle/2.3/taskArtifacts/outputFileStates.bin
Normal file
Binary file not shown.
BIN
.gradle/2.3/taskArtifacts/taskArtifacts.bin
Normal file
BIN
.gradle/2.3/taskArtifacts/taskArtifacts.bin
Normal file
Binary file not shown.
10
.project
10
.project
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ch.psi.daq.rest</name>
|
||||
<name>rest</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
@ -9,14 +10,9 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.springsource.ide.eclipse.gradle.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
@ -0,0 +1,5 @@
|
||||
#org.springsource.ide.eclipse.gradle.core.preferences.GradleProjectPreferences
|
||||
#Tue May 26 17:48:59 CEST 2015
|
||||
build.family.org.gradle.tooling.model.eclipse.HierarchicalEclipseProject=;
|
||||
org.springsource.ide.eclipse.gradle.linkedresources=
|
||||
org.springsource.ide.eclipse.gradle.rootprojectloc=
|
13
.settings/org.eclipse.jdt.core.prefs
Normal file
13
.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
#Wed May 27 10:41:51 CEST 2015
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
49
build.gradle
Normal file
49
build.gradle
Normal file
@ -0,0 +1,49 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
version = '1.0.0'
|
||||
group = 'ch.psi.daq'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven { url "http://slsyoke4.psi.ch:8081/artifactory/libs-releases" }
|
||||
maven { url "http://slsyoke4.psi.ch:8081/artifactory/libs-snapshots" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile 'ch.psi.daq:cassandra:1.0.0'
|
||||
compile 'org.springframework.boot:spring-boot-starter-web:1.2.3.RELEASE'
|
||||
compile 'org.apache.commons:commons-lang3:3.4'
|
||||
testCompile group: 'junit', name: 'junit', version: '4.+'
|
||||
}
|
||||
|
||||
apply plugin: 'maven'
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
repository(url: "http://slsyoke4.psi.ch:8081/artifactory/libs-snapshots-local"){
|
||||
authentication(userName: "upload", password: "{DESede}eWKHxAtQ2Dc=")
|
||||
}
|
||||
pom.groupId = 'ch.psi.daq'
|
||||
pom.artifactId = 'rest'
|
||||
}
|
||||
}
|
||||
}
|
1
settings.gradle
Normal file
1
settings.gradle
Normal file
@ -0,0 +1 @@
|
||||
rootProject.name = 'rest'
|
13
src/main/java/ch/psi/daq/rest/DaqController.java
Normal file
13
src/main/java/ch/psi/daq/rest/DaqController.java
Normal file
@ -0,0 +1,13 @@
|
||||
package ch.psi.daq.rest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import ch.psi.daq.cassandra.writer.CassandraWriter;
|
||||
|
||||
@RestController
|
||||
public class DaqController {
|
||||
|
||||
@Autowired
|
||||
private CassandraWriter writer;
|
||||
}
|
45
src/main/java/ch/psi/daq/rest/DaqRestApplication.java
Normal file
45
src/main/java/ch/psi/daq/rest/DaqRestApplication.java
Normal file
@ -0,0 +1,45 @@
|
||||
package ch.psi.daq.rest;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.context.web.SpringBootServletInitializer;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* Entry point to our rest-frontend of the Swissfel application which most importantly wires all the @RestController annotated classes.
|
||||
* <p>
|
||||
*
|
||||
* This acts as a @Configuration class for Spring. As such it has @ComponentScan
|
||||
* annotation that enables scanning for another Spring components in current
|
||||
* package and its subpackages.
|
||||
* <p>
|
||||
* Another annotation is @EnableAutoConfiguration which tells Spring Boot to run
|
||||
* autoconfiguration.
|
||||
* <p>
|
||||
* It also extends SpringBootServletInitializer which will configure Spring
|
||||
* servlet for us, and overrides the configure() method to point to itself, so
|
||||
* Spring can find the main configuration.
|
||||
* <p>
|
||||
* Finally, the main() method consists of single static call to
|
||||
* SpringApplication.run().
|
||||
* <p>
|
||||
* Methods annotated with {@link @Bean} are Java beans that are
|
||||
* container-managed, i.e. managed by Spring. Whenever there are @Autowire, @Inject
|
||||
* or similar annotations found in the code (which is being scanned through the @ComponentScan
|
||||
* annotation), the container then knows how to create those beans and inject
|
||||
* them accordingly.
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan(basePackages = { "ch.psi.daq" })
|
||||
public class DaqRestApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(DaqRestApplication.class, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
|
||||
return application.sources(DaqRestApplication.class);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user