Grega Bremec 3 éve
commit
34b4fcbcf9

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.project
+.classpath
+.settings
+.*.swp
+target

+ 51 - 0
pom.xml

@@ -0,0 +1,51 @@
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>net.p0f.samples.rhpam-fuse-integration</groupId>
+  <artifactId>ws-customer-data</artifactId>
+  <version>1.0.0</version>
+  <properties>
+  	<maven.compiler.source>1.8</maven.compiler.source>
+  	<maven.compiler.target>1.8</maven.compiler.target>
+  </properties>
+  <packaging>war</packaging>
+    <dependencyManagement>
+  	<dependencies>
+		<dependency>
+		    <groupId>org.jboss.bom</groupId>
+		    <artifactId>jboss-eap-javaee7-with-tools</artifactId>
+		    <version>7.1.6.GA</version>
+		    <type>pom</type>
+		    <scope>import</scope>
+		</dependency>
+	</dependencies>
+  </dependencyManagement>
+  <dependencies>
+	  	<dependency>
+		    <groupId>javax.enterprise</groupId>
+		    <artifactId>cdi-api</artifactId>
+		    <scope>provided</scope>
+	  	</dependency>
+	  	<dependency>
+		    <groupId>org.jboss.resteasy</groupId>
+		    <artifactId>resteasy-jaxrs</artifactId>
+		    <scope>provided</scope>
+	  	</dependency>
+	  	<dependency>
+		    <groupId>net.p0f.samples.rhpam-fuse-integration</groupId>
+		    <artifactId>shared-data-model</artifactId>
+		    <version>1.0.0</version>
+	  	</dependency>
+  </dependencies>
+  <build>
+    <plugins>
+        <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-war-plugin</artifactId>
+            <version>2.6</version>
+            <configuration>
+                <failOnMissingWebXml>false</failOnMissingWebXml>
+            </configuration>
+        </plugin>
+    </plugins>
+  </build>
+</project>

+ 21 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_rs/customer/CustomerServiceImpl.java

@@ -0,0 +1,21 @@
+package net.p0f.samples.rhpam_fuse_integration.ws_rs.customer;
+
+import java.util.Random;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+import net.p0f.samples.rhpam_fuse_integration.ws_rs.spec.CustomerService;
+
+public class CustomerServiceImpl implements CustomerService {
+	public Customer getCustomer(Integer customerId) {
+		Customer c = new Customer();
+		
+		c.setName("John Doe");
+		c.setAge(new Random().nextInt(100));
+		c.setMilesFlown(new Random().nextInt(100000));
+		c.setLoyaltyAge(new Random().nextInt(15));
+
+		System.out.println("Returning id " + customerId.intValue() + " as " + c.toString());
+
+		return c;
+	}
+}

+ 8 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_rs/customer/JaxRsApplication.java

@@ -0,0 +1,8 @@
+package net.p0f.samples.rhpam_fuse_integration.ws_rs.customer;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+@ApplicationPath("/api")
+public class JaxRsApplication extends Application {
+}