Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixs

  • Loading branch information...
commit 0f8b5675ee69d855ebdc2fa8ecb5ace1b5c03e5e 1 parent 11b7716
Christophe Hamerling chamerling authored
6 governance-api/src/main/java/org/ow2/play/governance/api/SubscriptionManagement.java
View
@@ -36,7 +36,9 @@
public interface SubscriptionManagement {
/**
- * Subscribe to producers on behalf of the consumers
+ * Subscribe to producers on behalf of the consumers. This will send the
+ * subscribe to the right place and add entries to the subscription
+ * registry.
*
* @param subscription
* @return
@@ -45,7 +47,7 @@
@WebMethod
List<Subscription> subscribe(List<Subscription> subscriptions)
throws GovernanceExeption;
-
+
/**
* Unsubscribe. Call unsubscribe on services and remove from the
* subscription registry.
48 governance-dsb/pom.xml
View
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>play-governance</artifactId>
+ <groupId>org.ow2.play</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.ow2.play</groupId>
+ <artifactId>governance-dsb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>governance-dsb</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>13.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ow2.petals.dsb</groupId>
+ <artifactId>dsb-cxfutils</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ow2.play</groupId>
+ <artifactId>governance-api</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ow2.petals.dsb</groupId>
+ <artifactId>dsb-wsn-jbise-wsapi</artifactId>
+ <version>1.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
53 governance-dsb/src/main/java/org/ow2/play/governance/dsb/DSBSubscriptionService.java
View
@@ -0,0 +1,53 @@
+/**
+ *
+ * Copyright (c) 2012, PetalsLink
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+package org.ow2.play.governance.dsb;
+
+import javax.jws.WebMethod;
+
+import org.ow2.play.governance.api.GovernanceExeption;
+import org.ow2.play.governance.api.SubscriptionService;
+import org.ow2.play.governance.api.bean.Subscription;
+
+/**
+ * @author chamerling
+ *
+ */
+public class DSBSubscriptionService implements SubscriptionService {
+
+ /* (non-Javadoc)
+ * @see org.ow2.play.governance.api.SubscriptionService#subscribe(org.ow2.play.governance.api.bean.Subscription)
+ */
+ @Override
+ @WebMethod
+ public Subscription subscribe(Subscription subscription) throws GovernanceExeption {
+ throw new GovernanceExeption("Not implemented");
+ }
+
+ /* (non-Javadoc)
+ * @see org.ow2.play.governance.api.SubscriptionService#unsubscribe(org.ow2.play.governance.api.bean.Subscription, java.lang.String)
+ */
+ @Override
+ @WebMethod
+ public boolean unsubscribe(Subscription subscription,
+ String subscriptionManagementEndpoint) throws GovernanceExeption {
+ throw new GovernanceExeption("Not implemented");
+ }
+
+}
79 governance-dsb/src/test/java/org/ow2/play/governance/dsb/APITEst.java
View
@@ -0,0 +1,79 @@
+/**
+ *
+ * Copyright (c) 2012, PetalsLink
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+package org.ow2.play.governance.dsb;
+
+import junit.framework.TestCase;
+
+import org.petalslink.dsb.cxf.CXFHelper;
+import org.petalslink.dsb.jbi.se.wsn.api.ManagementService;
+import org.petalslink.dsb.jbi.se.wsn.api.Subscription;
+import org.petalslink.dsb.jbi.se.wsn.api.SubscriptionManagementService;
+import org.petalslink.dsb.jbi.se.wsn.api.Topic;
+
+/**
+ * @author chamerling
+ *
+ */
+public class APITEst extends TestCase {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testGetTopics() throws Exception {
+ SubscriptionManagementService client = CXFHelper
+ .getClientFromFinalURL(
+ "http://localhost:8079/play-dsb-wsn-package/SubscriptionManagementService",
+ SubscriptionManagementService.class);
+
+ //System.out.println(client.getSubscriptions());
+ Topic topic = new Topic();
+ topic.name = "TaxiUCGeoLocation";
+ topic.ns = "http://streams.event-processing.org/ids/";
+ topic.prefix = "s";
+ System.out.println(client.getSubscriptionsForTopic(topic));
+ for (Subscription s : client.getSubscriptionsForTopic(topic)) {
+ System.out.println(s.subscriber);
+ System.out.println(s.uuid);
+ System.out.println(s.topic);
+ }
+
+ ManagementService ms = CXFHelper.getClientFromFinalURL(
+ "http://localhost:8079/play-dsb-wsn-package/ManagementService",
+ ManagementService.class);
+ System.out.println(ms.getTopics());
+
+ //System.out.println(client.getSubscriptions());
+ }
+}
2  governance-wsn/src/main/java/org/ow2/play/governance/wsn/SubscriptionServiceClient.java
View
@@ -27,6 +27,7 @@
/**
* WSN client for pubsub. Can also be exposed as web service.
+ * Does not retreive any endpoint; All must be available in the beans.
*
* @author chamerling
*
@@ -131,5 +132,4 @@ public boolean unsubscribe(Subscription subscription, String subscriptionManagem
}
return result;
}
-
}
1  pom.xml
View
@@ -28,6 +28,7 @@
<!--<module>governance-monitoring-api</module>-->
<module>governance-dcep</module>
<module>governance-ec</module>
+ <module>governance-dsb</module>
</modules>
<build>
<defaultGoal>install</defaultGoal>
Please sign in to comment.
Something went wrong with that request. Please try again.