From ed73dbf357aff41edcbab401a94e5fbc266d9391 Mon Sep 17 00:00:00 2001 From: Mufaddal Makati Date: Fri, 7 Aug 2015 13:09:49 -0700 Subject: First Commit --- cos/cosbase/pom.xml | 23 ++++ .../vcpe/cos/cosbase/client/CoSClient.java | 151 +++++++++++++++++++++ .../vcpe/cos/cosbase/model/BandwidthProfile.java | 27 ++++ .../com/cablelabs/vcpe/cos/cosbase/model/CoS.java | 86 ++++++++++++ .../cos/cosbase/repository/CoSRespository.java | 22 +++ .../cosbase/repository/CoSRespositoryInMem.java | 74 ++++++++++ .../vcpe/cos/cosbase/client/CoSClientTest.java | 105 ++++++++++++++ .../cos/cosbase/repository/CoSRepositoryTest.java | 63 +++++++++ .../vcpe/cos/cosbase/client/CoSClient$1.class | Bin 0 -> 748 bytes .../vcpe/cos/cosbase/client/CoSClient.class | Bin 0 -> 4135 bytes .../vcpe/cos/cosbase/model/BandwidthProfile.class | Bin 0 -> 1338 bytes .../com/cablelabs/vcpe/cos/cosbase/model/CoS.class | Bin 0 -> 3647 bytes .../cos/cosbase/repository/CoSRespository.class | Bin 0 -> 534 bytes .../cosbase/repository/CoSRespositoryInMem.class | Bin 0 -> 3649 bytes cos/cosbase/target/cosbase.jar | Bin 0 -> 9554 bytes cos/cosbase/target/maven-archiver/pom.properties | 5 + .../vcpe/cos/cosbase/client/CoSClientTest.class | Bin 0 -> 2944 bytes .../cos/cosbase/repository/CoSRepositoryTest.class | Bin 0 -> 2308 bytes cos/cosmgr/pom.xml | 29 ++++ .../vcpe/cos/cosmgr/CORSResponseFilter.java | 25 ++++ .../vcpe/cos/cosmgr/CoSJaxRsApplication.java | 18 +++ .../com/cablelabs/vcpe/cos/cosmgr/CoSService.java | 130 ++++++++++++++++++ cos/cosmgr/src/main/webapp/WEB-INF/web.xml | 24 ++++ cos/cosmgr/src/main/webapp/index.jsp | 8 ++ .../vcpe/cos/cosmgr/CORSResponseFilter.class | Bin 0 -> 1384 bytes .../vcpe/cos/cosmgr/CoSJaxRsApplication.class | Bin 0 -> 689 bytes .../cablelabs/vcpe/cos/cosmgr/CoSService$1.class | Bin 0 -> 905 bytes .../com/cablelabs/vcpe/cos/cosmgr/CoSService.class | Bin 0 -> 3955 bytes cos/cosmgr/target/cosmgr.war | Bin 0 -> 9806641 bytes .../vcpe/cos/cosmgr/CORSResponseFilter.class | Bin 0 -> 1384 bytes .../vcpe/cos/cosmgr/CoSJaxRsApplication.class | Bin 0 -> 689 bytes .../cablelabs/vcpe/cos/cosmgr/CoSService$1.class | Bin 0 -> 905 bytes .../com/cablelabs/vcpe/cos/cosmgr/CoSService.class | Bin 0 -> 3955 bytes .../WEB-INF/lib/asm-all-repackaged-2.2.0-b14.jar | Bin 0 -> 320127 bytes .../target/cosmgr/WEB-INF/lib/cglib-2.2.0-b14.jar | Bin 0 -> 282815 bytes .../cosmgr/WEB-INF/lib/common-1.0-SNAPSHOT.jar | Bin 0 -> 2690 bytes .../cosmgr/WEB-INF/lib/cosbase-1.0-SNAPSHOT.jar | Bin 0 -> 9554 bytes .../target/cosmgr/WEB-INF/lib/guava-14.0.1.jar | Bin 0 -> 2189117 bytes .../cosmgr/WEB-INF/lib/hk2-api-2.2.0-b14.jar | Bin 0 -> 126233 bytes .../cosmgr/WEB-INF/lib/hk2-locator-2.2.0-b14.jar | Bin 0 -> 133345 bytes .../cosmgr/WEB-INF/lib/hk2-utils-2.2.0-b14.jar | Bin 0 -> 53381 bytes .../WEB-INF/lib/javax.annotation-api-1.2.jar | Bin 0 -> 26366 bytes .../cosmgr/WEB-INF/lib/javax.inject-2.2.0-b14.jar | Bin 0 -> 5987 bytes .../cosmgr/WEB-INF/lib/javax.ws.rs-api-2.0.jar | Bin 0 -> 112758 bytes .../cosmgr/WEB-INF/lib/jersey-client-2.2.jar | Bin 0 -> 117090 bytes .../cosmgr/WEB-INF/lib/jersey-common-2.2.jar | Bin 0 -> 600514 bytes .../lib/jersey-container-servlet-core-2.2.jar | Bin 0 -> 52819 bytes .../cosmgr/WEB-INF/lib/jersey-media-moxy-2.2.jar | Bin 0 -> 15591 bytes .../cosmgr/WEB-INF/lib/jersey-server-2.2.jar | Bin 0 -> 801094 bytes .../lib/org.eclipse.persistence.antlr-2.5.0.jar | Bin 0 -> 189645 bytes .../lib/org.eclipse.persistence.asm-2.5.0.jar | Bin 0 -> 271208 bytes .../lib/org.eclipse.persistence.core-2.5.0.jar | Bin 0 -> 4977121 bytes .../lib/org.eclipse.persistence.moxy-2.5.0.jar | Bin 0 -> 488045 bytes .../WEB-INF/lib/osgi-resource-locator-1.0.1.jar | Bin 0 -> 20235 bytes .../WEB-INF/lib/validation-api-1.1.0.Final.jar | Bin 0 -> 63777 bytes cos/cosmgr/target/cosmgr/WEB-INF/web.xml | 24 ++++ cos/cosmgr/target/cosmgr/index.jsp | 8 ++ cos/cosmgr/target/maven-archiver/pom.properties | 5 + cos/pom.xml | 24 ++++ 59 files changed, 851 insertions(+) create mode 100644 cos/cosbase/pom.xml create mode 100644 cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.java create mode 100644 cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.java create mode 100644 cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/CoS.java create mode 100644 cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.java create mode 100644 cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.java create mode 100644 cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.java create mode 100644 cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.java create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient$1.class create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.class create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.class create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/CoS.class create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.class create mode 100644 cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.class create mode 100644 cos/cosbase/target/cosbase.jar create mode 100644 cos/cosbase/target/maven-archiver/pom.properties create mode 100644 cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.class create mode 100644 cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.class create mode 100644 cos/cosmgr/pom.xml create mode 100644 cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.java create mode 100644 cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.java create mode 100644 cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSService.java create mode 100644 cos/cosmgr/src/main/webapp/WEB-INF/web.xml create mode 100644 cos/cosmgr/src/main/webapp/index.jsp create mode 100644 cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class create mode 100644 cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class create mode 100644 cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class create mode 100644 cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class create mode 100644 cos/cosmgr/target/cosmgr.war create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/asm-all-repackaged-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/cglib-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/common-1.0-SNAPSHOT.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/cosbase-1.0-SNAPSHOT.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/guava-14.0.1.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-api-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-locator-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-utils-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.annotation-api-1.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.inject-2.2.0-b14.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.ws.rs-api-2.0.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-client-2.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-common-2.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-container-servlet-core-2.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-media-moxy-2.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-server-2.2.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/osgi-resource-locator-1.0.1.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/lib/validation-api-1.1.0.Final.jar create mode 100644 cos/cosmgr/target/cosmgr/WEB-INF/web.xml create mode 100644 cos/cosmgr/target/cosmgr/index.jsp create mode 100644 cos/cosmgr/target/maven-archiver/pom.properties create mode 100644 cos/pom.xml (limited to 'cos') diff --git a/cos/cosbase/pom.xml b/cos/cosbase/pom.xml new file mode 100644 index 0000000..6574e02 --- /dev/null +++ b/cos/cosbase/pom.xml @@ -0,0 +1,23 @@ + + + + com.cablelabs.vcpe + cos + 1.0-SNAPSHOT + + + 4.0.0 + + com.cablelabs.vcpe + cosbase + jar + 1.0-SNAPSHOT + + + cosbase + + + + + diff --git a/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.java b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.java new file mode 100644 index 0000000..d47b11b --- /dev/null +++ b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.java @@ -0,0 +1,151 @@ +package com.cablelabs.vcpe.cos.cosbase.client; + +import com.cablelabs.vcpe.cos.cosbase.model.CoS; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.List; + +/** + * Created by steve on 5/28/15. + */ +public class CoSClient { + + private Client client; // provided by Jersey + + public CoSClient() { + client = ClientBuilder.newClient(); + } + + //-------------------------------------------------------- + public CoS create(CoS cos) + //-------------------------------------------------------- + { + WebTarget target =client.target("http://localhost:9090/cosmgr/webapi/"); + Response response = target.path("cos") + .request(MediaType.APPLICATION_JSON) + .post(Entity.entity(cos, MediaType.APPLICATION_JSON)); + + if (response.getStatus() != 200 ) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + return response.readEntity(CoS.class); + } + + //-------------------------------------------------------- + public CoS update(CoS cos) + //-------------------------------------------------------- + { + WebTarget target =client.target("http://localhost:9090/cosmgr/webapi/"); + Response response = target.path("cos/"+cos.getId()) + .request(MediaType.APPLICATION_JSON) + .put(Entity.entity(cos, MediaType.APPLICATION_JSON)); + + if (response.getStatus() != 200 ) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + return response.readEntity(CoS.class); + } + + + //-------------------------------------------------------- + public CoS get(String cosId) + //-------------------------------------------------------- + // get CoS of specified ID + { + WebTarget target = client.target("http://localhost:9090/cosmgr/webapi/"); + + Response response = target.path("cos/"+cosId).request(MediaType.APPLICATION_JSON).get(Response.class); + if (response.getStatus() != 200) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + + //return response; + return response.readEntity(CoS.class); + } + + //-------------------------------------------------------- + public List getAll() + //-------------------------------------------------------- + // get a list of all CoS instances + { + + WebTarget target = client.target("http://localhost:9090/cosmgr/webapi/"); + + // Can I do this with a Response, so that I can check for errors + List response = target.path("cos/list") + .request(MediaType.APPLICATION_JSON) + .get(new GenericType>() { + }); + if (response == null) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException("there was an error on the server."); + } + return response; + } + + + + //-------------------------------------------------------- + public void delete(String cosId) + //-------------------------------------------------------- + // delete CoS of specified ID + { + WebTarget target = client.target("http://localhost:9090/cosmgr/webapi/"); + Response response = target.path("cos/"+cosId).request(MediaType.APPLICATION_JSON).delete(); + if (response.getStatus() != 200) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + } + + //-------------------------------------------------------- + public CoS testGet() + //-------------------------------------------------------- + // test marshaling of CoS class from server json + { + WebTarget target = client.target("http://localhost:9090/cosmgr/webapi/"); + + Response response = target.path("cos").request(MediaType.APPLICATION_JSON).get(Response.class); + if (response.getStatus() != 200) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + + //return response; + return response.readEntity(CoS.class); + } + + //-------------------------------------------------------- + public String ping() + //-------------------------------------------------------- + // test connectivity + { + + WebTarget target = client.target("http://localhost:9090/cosmgr/webapi/"); + + Response response = target.path("cos").request(MediaType.TEXT_PLAIN).get(); + if (response.getStatus() != 200) // figure out how to use Status.OK + { + // in production you can be more specific based on reponse code, id, etc + throw new RuntimeException(response.getStatus() + ": there was an error on the server."); + } + + + return response.readEntity(String.class); + } +} diff --git a/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.java b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.java new file mode 100644 index 0000000..70f7313 --- /dev/null +++ b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.java @@ -0,0 +1,27 @@ +package com.cablelabs.vcpe.cos.cosbase.model; + +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Created by steve on 5/24/15. + */ + +@XmlRootElement +public class BandwidthProfile { + private int committedInfoRate = 0; // MBS + private int committedBurtSize = 0; // MBS + private int excessInfoRate = 0; // MBS + private int excessBurstSize = 0; // MBS + + public int getCommittedInfoRate() { return committedInfoRate; } + public void setCommittedInfoRate(int committedInfoRate) { this.committedInfoRate = committedInfoRate; } + + public int getCommittedBurtSize() { return committedBurtSize; } + public void setCommittedBurtSize(int committedBurtSize) { this.committedBurtSize = committedBurtSize; } + + public int getExcessInfoRate() { return excessInfoRate; } + public void setExcessInfoRate(int excessInfoRate) { this.excessInfoRate = excessInfoRate; } + + public int getExcessBurstSize() { return excessBurstSize; } + public void setExcessBurstSize(int excessBurstSize) { this.excessBurstSize = excessBurstSize; } +} diff --git a/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/CoS.java b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/CoS.java new file mode 100644 index 0000000..8a4d219 --- /dev/null +++ b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/model/CoS.java @@ -0,0 +1,86 @@ +package com.cablelabs.vcpe.cos.cosbase.model; + +import com.cablelabs.vcpe.common.Dbg; + +import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; + +/** + * Created by steve on 5/24/15. + */ + +@XmlRootElement +public class CoS +{ + private String id; + + // private BandwidthProfile ingressBWProfile; + // private BandwidthProfile egressBWProfile; + // Above should be integrated at some point + // ... for now we will support commitedInfoRate in Lie of BW Profiles + private int commitedInfoRate; // MBPS + + private double availbility; // percentage + private double frameDelay; // milli-seconds + private double jitter; // milli-seconds + private double frameLoss; // percentage + + // no argument constructor required for JAX-RS + public CoS() { + commitedInfoRate = 0; + availbility = 0.0; + frameDelay = 0.0; + jitter = 0.0; + frameLoss = 0.0; + } + + + public String getId() { return id; } + public void setId(String id) { this.id = id; } + + public int getCommitedInfoRate() { return commitedInfoRate; } + public void setCommitedInfoRate(int commitedInfoRate) { this.commitedInfoRate = commitedInfoRate; } + + public double getAvailbility() { return availbility; } + public void setAvailbility(double availbility) { this.availbility = availbility; } + + public double getFrameDelay() { return frameDelay; } + public void setFrameDelay(double frameDelay) { this.frameDelay = frameDelay; } + + public double getJitter() { return jitter; } + public void setJitter(double jitter) { this.jitter = jitter; } + + public double getFrameLoss() { return frameLoss; } + public void setFrameLoss(double frameLoss) { this.frameLoss = frameLoss; } + + public void setAllProps(String id, int commitedInfoRate, double availbility, double frameDelay, double jitter, double frameLoss) + { + this.id = id; + this.commitedInfoRate = commitedInfoRate; + this.availbility = availbility; + this.frameDelay = frameDelay; + this.jitter = jitter; + this.frameLoss = frameLoss; + } + + public void dump() { dump(0); } + public void dump(int tab) { + Dbg.p(tab, "id: " + this.id); + Dbg.p(tab, "commInfoRate: " + this.commitedInfoRate); + Dbg.p(tab, "availbility: " + this.availbility); + Dbg.p(tab, "frameDelay: " + this.frameDelay); + Dbg.p(tab, "jitter: " + this.jitter); + Dbg.p(tab, "frameLoss: " + this.frameLoss); + } + + public static void dumpList(List cosList) { dumpList(0, cosList); } + public static void dumpList(int tab, List cosList) { + int numCos = 0; + Dbg.p("----- CoS List : [" + cosList.size() + "] elements"); + for (CoS curCos : cosList) { + numCos++; + Dbg.p(tab+1, ""); + curCos.dump(tab+2); + } + } +} diff --git a/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.java b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.java new file mode 100644 index 0000000..3a58000 --- /dev/null +++ b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.java @@ -0,0 +1,22 @@ +package com.cablelabs.vcpe.cos.cosbase.repository; + +import com.cablelabs.vcpe.cos.cosbase.model.CoS; + +import java.util.List; + +/** + * Created by steve on 5/25/15. + */ +public interface CoSRespository +{ + // TODO add exceptions + + CoS add(CoS cos); // returns null if already exists, otherwise returns stored cos + CoS get(String cosId); // returns null if not found, otherwise stored cos + CoS update(CoS cos); // returns null if did not exit, otherwise cos as it was previous to update (put in any case) + CoS delete(String cosId); // returns null if not found, otherwise cos as it was previous to delete + int count(); // number of CoS stored in the repo + List getAll(); + + public void dump(int tab); // print out contents of the repo +} diff --git a/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.java b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.java new file mode 100644 index 0000000..2fa44c1 --- /dev/null +++ b/cos/cosbase/src/main/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.java @@ -0,0 +1,74 @@ +package com.cablelabs.vcpe.cos.cosbase.repository; + +import com.cablelabs.vcpe.common.Dbg; +import com.cablelabs.vcpe.cos.cosbase.model.CoS; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Created by steve on 5/24/15. + */ + + +/* + Singleton that contains a hashmap which holds instances of CoS objects, indexed by CiS ID + */ + +public enum CoSRespositoryInMem implements CoSRespository { + INSTANCE; // Singleton + + private Map< String, CoS> cosDB = new ConcurrentHashMap(); + + @Override + public CoS add(CoS cos) { + if ( this.get(cos.getId()) != null ) { + return null; + } + cosDB.put(cos.getId(), cos ); + return cos; + } + + @Override + public CoS get(String cosId) { + return cosDB.get(cosId); + } + + @Override + public CoS update(CoS cos) { + // put returns null if cos did not exist, other returns cos as it stood prior to put + return cosDB.put(cos.getId(), cos); + } + + @Override + public CoS delete(String cosId) { + // remove returns null if cos did not exist, other returns cos as it stood prior to remove + return cosDB.remove(cosId); + } + + @Override + public List getAll() { + List cosList = new ArrayList(cosDB.values()); + return cosList; + } + + @Override + public int count() { + return cosDB.size(); + } + + @Override + public void dump(int tab) { + + Dbg.p(tab, "CoS Repo: " + cosDB.size() + " entrie(s)"); + int numCos = 0; + for (CoS curCos : cosDB.values()) { + numCos++; + Dbg.p(tab+1, ""); + curCos.dump(tab+2); + } + } + +} diff --git a/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.java b/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.java new file mode 100644 index 0000000..cbf5516 --- /dev/null +++ b/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.java @@ -0,0 +1,105 @@ +package com.cablelabs.vcpe.cos.cosbase.client; + +import com.cablelabs.vcpe.common.Dbg; +import com.cablelabs.vcpe.cos.cosbase.model.CoS; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.*; + +/** + * Created by steve on 5/28/15. + */ + +public class CoSClientTest { + + @Test + public void testAll() throws Exception { + CoSClient coSClient = new CoSClient(); + + CoS gold = new CoS(); + gold.setAllProps("gold", 100, 0.99, 17.43, 2.43, 0.01); + Dbg.p("gold svc being created in CoS"); + gold.dump(1); + + gold = coSClient.create(gold); + assertNotNull(gold); + + CoS retrievedCos = coSClient.get(gold.getId()); + + assertNotNull(retrievedCos); + Dbg.p("gold svc just retrieved from CoS"); + retrievedCos.dump(1); + retrievedCos = null; + + gold.setCommitedInfoRate(50); + Dbg.p("gold svc modified, to be updated"); + gold.dump(1); + assertNotNull(coSClient.update(gold)); + retrievedCos = coSClient.get(gold.getId()); + assertNotNull(retrievedCos); + Dbg.p("gold svc modified, just retrieved from CoS"); + retrievedCos.dump(1); + + coSClient.delete(gold.getId()); + + CoS vid = new CoS(); + CoS game = new CoS(); + CoS dl = new CoS(); + + vid.setAllProps ("vid", 100, 0.99, 17.43, 2.43, 0.1); + game.setAllProps("game", 75, 0.99, 7.43, 1.43, 0.01); + dl.setAllProps("dl", 100, 0.99, 17.43, 2.43, 0.02); + + vid = coSClient.create(vid); + assertNotNull(vid); + + game = coSClient.create(game); + assertNotNull(game); + + dl = coSClient.create(dl); + assertNotNull(dl); + + + + List cosList = coSClient.getAll(); + assertNotNull(cosList); + assertEquals(cosList.size(), 3); + CoS.dumpList(cosList); + + coSClient.delete(game.getId()); + cosList = coSClient.getAll(); + assertNotNull(cosList); + assertEquals(cosList.size(), 2); + CoS.dumpList(cosList); + + coSClient.delete(vid.getId()); + cosList = coSClient.getAll(); + assertNotNull(cosList); + assertEquals(cosList.size(), 1); + CoS.dumpList(cosList); + + coSClient.delete(dl.getId()); + cosList = coSClient.getAll(); + assertNotNull(cosList); + assertEquals(cosList.size(), 0); + CoS.dumpList(cosList); + } + + @Test + public void testTestGet() throws Exception { + CoSClient coSClient = new CoSClient(); + CoS cos = coSClient.testGet(); + cos.dump();; + } + + @Test + public void testPing() throws Exception { + + CoSClient coSClient = new CoSClient(); + String resp = coSClient.ping(); + Dbg.p(resp); + } + +} \ No newline at end of file diff --git a/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.java b/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.java new file mode 100644 index 0000000..0c46737 --- /dev/null +++ b/cos/cosbase/src/test/java/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.java @@ -0,0 +1,63 @@ +package com.cablelabs.vcpe.cos.cosbase.repository; + +import com.cablelabs.vcpe.cos.cosbase.model.CoS; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Created by steve on 5/25/15. + */ +public class CoSRepositoryTest +{ + + @Test + public void test() { + + CoS gold = new CoS(); + CoS silver = new CoS(); + CoS bronze = new CoS(); + + // id CIR/MBS avail delay jitter frameloss + gold.setAllProps("gold", 100, 0.99, 17.43, 2.43, 0.01); + silver.setAllProps("silver", 50, 0.95, 27.43, 2.43, 0.02); + bronze.setAllProps("bronze", 25, 0.90, 37.43, 2.43, 0.03); + + CoSRespository repo = CoSRespositoryInMem.INSTANCE; + + assertNotNull(repo.add(gold)); + assertNotNull(repo.add(silver)); + assertNotNull(repo.add(bronze)); + assertNull(repo.add(bronze)); // duplicate + assertEquals(repo.count(), 3); + + assertNotNull(repo.get(gold.getId())); + assertNotNull(repo.get(silver.getId())); + assertNotNull(repo.get(bronze.getId())); + + assertNotNull(repo.delete(silver.getId())); + assertNull(repo.delete(silver.getId())); + assertNull(repo.delete("not-in-repo")); + assertEquals(repo.count(), 2); + + assertEquals(repo.get(gold.getId()).getCommitedInfoRate(), 100); + assertNotEquals(repo.get(bronze.getId()).getCommitedInfoRate(), 100); + + CoS tin = new CoS(); + tin.setAllProps("tin", 1, 0.50, 47.43, 2.43, 0.04); + + + assertNull(repo.update(tin)); // update non-existent cos + assertEquals(repo.count(), 3); + assertEquals(repo.get("tin").getCommitedInfoRate(), 1); + + tin.setCommitedInfoRate(5); + assertNotNull(repo.update(tin)); // update existing cos, same object + assertEquals(repo.get("tin").getCommitedInfoRate(), 5); + + CoS tin2 = new CoS(); + tin.setAllProps("tin", 8, 0.50, 47.43, 2.43, 0.04); + assertNotNull(repo.update(tin)); // update existing cos, new object + assertEquals(repo.get("tin").getCommitedInfoRate(), 8); + } +} diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient$1.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient$1.class new file mode 100644 index 0000000..6e5c04d Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient$1.class differ diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.class new file mode 100644 index 0000000..d20148c Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClient.class differ diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.class new file mode 100644 index 0000000..3e4a92d Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/BandwidthProfile.class differ diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/CoS.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/CoS.class new file mode 100644 index 0000000..744b89c Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/model/CoS.class differ diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.class new file mode 100644 index 0000000..d3b6054 Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespository.class differ diff --git a/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.class b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.class new file mode 100644 index 0000000..6d8f689 Binary files /dev/null and b/cos/cosbase/target/classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRespositoryInMem.class differ diff --git a/cos/cosbase/target/cosbase.jar b/cos/cosbase/target/cosbase.jar new file mode 100644 index 0000000..d991659 Binary files /dev/null and b/cos/cosbase/target/cosbase.jar differ diff --git a/cos/cosbase/target/maven-archiver/pom.properties b/cos/cosbase/target/maven-archiver/pom.properties new file mode 100644 index 0000000..0b6b211 --- /dev/null +++ b/cos/cosbase/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Aug 06 14:01:18 PDT 2015 +version=1.0-SNAPSHOT +groupId=com.cablelabs.vcpe +artifactId=cosbase diff --git a/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.class b/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.class new file mode 100644 index 0000000..a4c81fc Binary files /dev/null and b/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/client/CoSClientTest.class differ diff --git a/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.class b/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.class new file mode 100644 index 0000000..c9f508e Binary files /dev/null and b/cos/cosbase/target/test-classes/com/cablelabs/vcpe/cos/cosbase/repository/CoSRepositoryTest.class differ diff --git a/cos/cosmgr/pom.xml b/cos/cosmgr/pom.xml new file mode 100644 index 0000000..9245481 --- /dev/null +++ b/cos/cosmgr/pom.xml @@ -0,0 +1,29 @@ + + + + com.cablelabs.vcpe + cos + 1.0-SNAPSHOT + + + 4.0.0 + + com.cablelabs.vcpe + cosmgr + war + 1.0-SNAPSHOT + + + cosmgr + + + + + com.cablelabs.vcpe + cosbase + 1.0-SNAPSHOT + + + + diff --git a/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.java b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.java new file mode 100644 index 0000000..50a118a --- /dev/null +++ b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.java @@ -0,0 +1,25 @@ +package com.cablelabs.vcpe.cos.cosmgr; + +import java.io.IOException; + +import javax.ws.rs.container.ContainerRequestContext; +import javax.ws.rs.container.ContainerResponseContext; +import javax.ws.rs.container.ContainerResponseFilter; +import javax.ws.rs.core.MultivaluedMap; + +// +// enable cross origin responses, otherwise we can't send rest requests from domain different than that of the server hosting our service +// + +public class CORSResponseFilter implements ContainerResponseFilter { + + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) + throws IOException { + + MultivaluedMap headers = responseContext.getHeaders(); + headers.add("Access-Control-Allow-Origin", "*"); + headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + headers.add("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, X-Codingpedia"); + } + +} diff --git a/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.java b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.java new file mode 100644 index 0000000..8d9c889 --- /dev/null +++ b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.java @@ -0,0 +1,18 @@ +package com.cablelabs.vcpe.cos.cosmgr; + +import org.glassfish.jersey.server.ResourceConfig; + +// +// In order to avoid CORS issues, register our CORS Response filter +// + +public class CoSJaxRsApplication extends ResourceConfig { + + /** + * Register JAX-RS application components. + */ + public CoSJaxRsApplication() { + packages("com.cablelabs.vcpe.cos.cosmgr"); + register(CORSResponseFilter.class); + } +} \ No newline at end of file diff --git a/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSService.java b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSService.java new file mode 100644 index 0000000..e9390fc --- /dev/null +++ b/cos/cosmgr/src/main/java/com/cablelabs/vcpe/cos/cosmgr/CoSService.java @@ -0,0 +1,130 @@ +package com.cablelabs.vcpe.cos.cosmgr; + +import com.cablelabs.vcpe.common.Dbg; +import com.cablelabs.vcpe.cos.cosbase.model.CoS; +import com.cablelabs.vcpe.cos.cosbase.repository.CoSRespositoryInMem; + +import javax.ws.rs.*; +import javax.ws.rs.core.GenericEntity; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.List; + +/** + * Root resource (exposed at "myresource" path) + */ +@Path("cos") +public class CoSService +{ + + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + //-------------------------------------------------------- + public Response create(CoS cos) + //-------------------------------------------------------- + { + if ( cos == null) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + + Dbg.p("\nADDING [" + cos.getId() + "] to cos repo"); + CoSRespositoryInMem.INSTANCE.add(cos); + CoSRespositoryInMem.INSTANCE.dump(0); + return Response.ok().entity(cos).build(); + } + + @PUT + @Path("{cosId}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + //-------------------------------------------------------- + public Response update(CoS cos) + //-------------------------------------------------------- + { + Dbg.p("\nUPDATING [" + cos.getId()+"]"); + CoSRespositoryInMem.INSTANCE.update(cos); + CoSRespositoryInMem.INSTANCE.dump(0); + return Response.ok().entity(cos).build(); + } + + @GET + @Produces(MediaType.APPLICATION_JSON) + @Path("{cosId}") + //-------------------------------------------------------- + public Response get( @PathParam("cosId") String cosId ) + //-------------------------------------------------------- + { + if ( cosId == null) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + Dbg.p("\nRETRIEVING ["+cosId+"]"); + CoSRespositoryInMem.INSTANCE.dump(1); + CoS cos = CoSRespositoryInMem.INSTANCE.get(cosId); + if (cos == null) { + return Response.status(Response.Status.NOT_FOUND).build(); + } + cos.dump(1); + return Response.ok().entity(cos).build(); + } + + @DELETE + @Path("{cosId}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + //-------------------------------------------------------- + public Response delete(@PathParam("cosId") String cosId) + //-------------------------------------------------------- + + { + if ( cosId == null) { + return Response.status(Response.Status.BAD_REQUEST).build(); + } + Dbg.p("\nDELETE:" + cosId); + CoSRespositoryInMem.INSTANCE.delete(cosId); + CoSRespositoryInMem.INSTANCE.dump(0); + return Response.ok().build(); + } + + + @GET + @Path("list") + @Produces(MediaType.APPLICATION_JSON) + //-------------------------------------------------------- + public Response cosList() + //-------------------------------------------------------- + // get a list of all CoS objects + { + Dbg.p("\nCOS GET ALL:"); + List cosList = CoSRespositoryInMem.INSTANCE.getAll(); + if (cosList == null ) + { + return Response.status(Response.Status.NOT_FOUND).build(); + } + return Response.ok().entity(new GenericEntity>(cosList) {}).build(); + } + + @GET + @Produces(MediaType.APPLICATION_JSON) + //-------------------------------------------------------- + public CoS testGet() + //-------------------------------------------------------- + // simple get to check out json format + + { + CoS cos = new CoS(); + cos.setAllProps("testGetCoS", 100, 0.99, 17.43, 2.43, 0.01); + return cos; + } + + @GET + @Produces(MediaType.TEXT_PLAIN) + //-------------------------------------------------------- + public String ping() + //-------------------------------------------------------- + // simple ping to check connectivity + { + Dbg.p("In CoS Service simple get connection test server"); + return "... pingCos reponse"; + } +} diff --git a/cos/cosmgr/src/main/webapp/WEB-INF/web.xml b/cos/cosmgr/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..49cf6ad --- /dev/null +++ b/cos/cosmgr/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + + Jersey Web Application + org.glassfish.jersey.servlet.ServletContainer + + jersey.config.server.provider.packages + com.cablelabs.vcpe.cos + + + javax.ws.rs.Application + com.cablelabs.vcpe.cos.cosmgr.CoSJaxRsApplication + + 1 + + + Jersey Web Application + /webapi/* + + + diff --git a/cos/cosmgr/src/main/webapp/index.jsp b/cos/cosmgr/src/main/webapp/index.jsp new file mode 100644 index 0000000..a064b45 --- /dev/null +++ b/cos/cosmgr/src/main/webapp/index.jsp @@ -0,0 +1,8 @@ + + +

Jersey RESTful Web Application!

+

Jersey resource +

Visit Project Jersey website + for more information on Jersey! + + diff --git a/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class new file mode 100644 index 0000000..1bc8889 Binary files /dev/null and b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class differ diff --git a/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class new file mode 100644 index 0000000..ef46719 Binary files /dev/null and b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class differ diff --git a/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class new file mode 100644 index 0000000..cc9d6f7 Binary files /dev/null and b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class differ diff --git a/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class new file mode 100644 index 0000000..23ee3d9 Binary files /dev/null and b/cos/cosmgr/target/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class differ diff --git a/cos/cosmgr/target/cosmgr.war b/cos/cosmgr/target/cosmgr.war new file mode 100644 index 0000000..f10f3a5 Binary files /dev/null and b/cos/cosmgr/target/cosmgr.war differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class new file mode 100644 index 0000000..1bc8889 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CORSResponseFilter.class differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class new file mode 100644 index 0000000..ef46719 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSJaxRsApplication.class differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class new file mode 100644 index 0000000..cc9d6f7 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService$1.class differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class new file mode 100644 index 0000000..23ee3d9 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/classes/com/cablelabs/vcpe/cos/cosmgr/CoSService.class differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/asm-all-repackaged-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/asm-all-repackaged-2.2.0-b14.jar new file mode 100644 index 0000000..9c1f40d Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/asm-all-repackaged-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/cglib-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/cglib-2.2.0-b14.jar new file mode 100644 index 0000000..7d6963b Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/cglib-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/common-1.0-SNAPSHOT.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/common-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..267b07a Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/common-1.0-SNAPSHOT.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/cosbase-1.0-SNAPSHOT.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/cosbase-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..d991659 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/cosbase-1.0-SNAPSHOT.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/guava-14.0.1.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/guava-14.0.1.jar new file mode 100644 index 0000000..3a3d925 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/guava-14.0.1.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-api-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-api-2.2.0-b14.jar new file mode 100644 index 0000000..acec5bc Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-api-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-locator-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-locator-2.2.0-b14.jar new file mode 100644 index 0000000..fb2687f Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-locator-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-utils-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-utils-2.2.0-b14.jar new file mode 100644 index 0000000..2c8df43 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/hk2-utils-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.annotation-api-1.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.annotation-api-1.2.jar new file mode 100644 index 0000000..9ab39ff Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.annotation-api-1.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.inject-2.2.0-b14.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.inject-2.2.0-b14.jar new file mode 100644 index 0000000..21463e7 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.inject-2.2.0-b14.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.ws.rs-api-2.0.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.ws.rs-api-2.0.jar new file mode 100644 index 0000000..b7d364b Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/javax.ws.rs-api-2.0.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-client-2.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-client-2.2.jar new file mode 100644 index 0000000..cab47b0 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-client-2.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-common-2.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-common-2.2.jar new file mode 100644 index 0000000..55d27ed Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-common-2.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-container-servlet-core-2.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-container-servlet-core-2.2.jar new file mode 100644 index 0000000..e03b5f9 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-container-servlet-core-2.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-media-moxy-2.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-media-moxy-2.2.jar new file mode 100644 index 0000000..786290a Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-media-moxy-2.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-server-2.2.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-server-2.2.jar new file mode 100644 index 0000000..37b3410 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/jersey-server-2.2.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar new file mode 100644 index 0000000..cff0ef8 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar new file mode 100644 index 0000000..832e18e Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar new file mode 100644 index 0000000..01bb838 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar new file mode 100644 index 0000000..29a1057 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/osgi-resource-locator-1.0.1.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/osgi-resource-locator-1.0.1.jar new file mode 100644 index 0000000..bd6aa17 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/osgi-resource-locator-1.0.1.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/lib/validation-api-1.1.0.Final.jar b/cos/cosmgr/target/cosmgr/WEB-INF/lib/validation-api-1.1.0.Final.jar new file mode 100644 index 0000000..de85403 Binary files /dev/null and b/cos/cosmgr/target/cosmgr/WEB-INF/lib/validation-api-1.1.0.Final.jar differ diff --git a/cos/cosmgr/target/cosmgr/WEB-INF/web.xml b/cos/cosmgr/target/cosmgr/WEB-INF/web.xml new file mode 100644 index 0000000..49cf6ad --- /dev/null +++ b/cos/cosmgr/target/cosmgr/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + + Jersey Web Application + org.glassfish.jersey.servlet.ServletContainer + + jersey.config.server.provider.packages + com.cablelabs.vcpe.cos + + + javax.ws.rs.Application + com.cablelabs.vcpe.cos.cosmgr.CoSJaxRsApplication + + 1 + + + Jersey Web Application + /webapi/* + + + diff --git a/cos/cosmgr/target/cosmgr/index.jsp b/cos/cosmgr/target/cosmgr/index.jsp new file mode 100644 index 0000000..a064b45 --- /dev/null +++ b/cos/cosmgr/target/cosmgr/index.jsp @@ -0,0 +1,8 @@ + + +

Jersey RESTful Web Application!

+

Jersey resource +

Visit Project Jersey website + for more information on Jersey! + + diff --git a/cos/cosmgr/target/maven-archiver/pom.properties b/cos/cosmgr/target/maven-archiver/pom.properties new file mode 100644 index 0000000..3ea6361 --- /dev/null +++ b/cos/cosmgr/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Aug 06 14:01:18 PDT 2015 +version=1.0-SNAPSHOT +groupId=com.cablelabs.vcpe +artifactId=cosmgr diff --git a/cos/pom.xml b/cos/pom.xml new file mode 100644 index 0000000..1ad3e4b --- /dev/null +++ b/cos/pom.xml @@ -0,0 +1,24 @@ + + + + com.cablelabs.vcpe + vcpe-services + 1.0-SNAPSHOT + + + 4.0.0 + + com.cablelabs.vcpe + cos + pom + 1.0-SNAPSHOT + + + cosbase + cosmgr + + + + + -- cgit 1.2.3-korg