Grega Bremec 3 lat temu
commit
3a13ce9085

+ 5 - 0
.gitignore

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

+ 23 - 0
pom.xml

@@ -0,0 +1,23 @@
+<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>shared-data-model</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>jar</packaging>
+  <dependencies>
+	  	<dependency>
+		    <groupId>javax.ws.rs</groupId>
+		    <artifactId>javax.ws.rs-api</artifactId>
+		    <version>2.0</version>
+	  	</dependency>
+	  	<dependency>
+		    <groupId>javax.xml.bind</groupId>
+		    <artifactId>jaxb-api</artifactId>
+		    <version>2.3.0</version>
+	  	</dependency>
+  </dependencies>
+</project>

+ 38 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/shared_dom/Award.java

@@ -0,0 +1,38 @@
+package net.p0f.samples.rhpam_fuse_integration.shared_dom;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Award implements java.io.Serializable {
+	private static final long serialVersionUID = 1L;
+	private Customer carrier;
+	private String reason;
+
+	public Award() {
+		super();
+	}
+
+	public Award(String reason) {
+		this.setReason(reason);
+	}
+
+	public String getReason() {
+		return reason;
+	}
+
+	public void setReason(String reason) {
+		this.reason = reason;
+	}
+
+	public Customer getCarrier() {
+		return carrier;
+	}
+
+	public void setCarrier(Customer carrier) {
+		this.carrier = carrier;
+	}
+	
+	public String toString() {
+		return "[Award: \"" + this.reason + "\" to: " + this.carrier + "]";
+	}
+}

+ 53 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/shared_dom/Customer.java

@@ -0,0 +1,53 @@
+package net.p0f.samples.rhpam_fuse_integration.shared_dom;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Customer implements java.io.Serializable {
+	private static final long serialVersionUID = 1L;
+	public static final int NONE = 0;
+	public static final int PLATINUM = 4;
+	public static final int GOLD = 3;
+	public static final int SILVER = 2;
+	public static final int BRONZE = 1;
+	
+	private String name;
+	private int age;
+	private int loyaltyLevel;
+	private int loyaltyAge;
+	private long milesFlown;
+
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public int getAge() {
+		return age;
+	}
+	public void setAge(int age) {
+		this.age = age;
+	}
+	public int getLoyaltyLevel() {
+		return loyaltyLevel;
+	}
+	public void setLoyaltyLevel(int loyaltyLevel) {
+		this.loyaltyLevel = loyaltyLevel;
+	}
+	public int getLoyaltyAge() {
+		return loyaltyAge;
+	}
+	public void setLoyaltyAge(int loyaltyAge) {
+		this.loyaltyAge = loyaltyAge;
+	}
+	public long getMilesFlown() {
+		return milesFlown;
+	}
+	public void setMilesFlown(long milesFlown) {
+		this.milesFlown = milesFlown;
+	}
+	public String toString() {
+		return "[" + this.name + "/" + this.age + "y/" + this.milesFlown + "mi/" + this.loyaltyLevel + "lvl/" + this.loyaltyAge + "y]";
+	}
+}

+ 19 - 0
src/main/java/net/p0f/samples/rhpam_fuse_integration/ws_rs/spec/CustomerService.java

@@ -0,0 +1,19 @@
+package net.p0f.samples.rhpam_fuse_integration.ws_rs.spec;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import net.p0f.samples.rhpam_fuse_integration.shared_dom.Customer;
+
+@Path("/customers")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public interface CustomerService {
+	@GET
+	@Path("/{id}")
+	public Customer getCustomer(@PathParam("id") Integer customerId);
+}