Index: modules/cnr-enabling-inspector/trunk/src/main/java/eu/dnetlib/enabling/inspector/SubscriptionController.java
===================================================================
--- modules/cnr-enabling-inspector/trunk/src/main/java/eu/dnetlib/enabling/inspector/SubscriptionController.java	(revision 43289)
+++ modules/cnr-enabling-inspector/trunk/src/main/java/eu/dnetlib/enabling/inspector/SubscriptionController.java	(revision 43290)
@@ -10,6 +10,7 @@
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import eu.dnetlib.enabling.is.sn.SubscriptionRegistry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.stereotype.Controller;
@@ -38,8 +39,8 @@
 	/**
 	 * is sn subscription registries.
 	 */
-	@Resource(name = "issResourceStateNotificationRegistries")
-	private transient List<ResourceStateSubscriptionRegistry> registries;
+	@Resource(name = "issResourceStateNotificationRegistry")
+	private transient SubscriptionRegistry registry;
 
 	/**
 	 * allows to control the global enable of issn.
@@ -65,23 +66,22 @@
 	@RequestMapping("/inspector/sn.do")
 	String listSubscriptions(final Model model) throws XPathExpressionException {
 
-		log.debug("registries: " + registries);
+		log.debug("registries: " + registry);
 
 		final List<Map<String, String>> subscriptions = new ArrayList<Map<String, String>>();
-		for (ResourceStateSubscriptionRegistry registry : registries) {
-			for (ResourceStateSubscription sub : registry.getSubscriptionDao().listSubscriptions()) {
-				final Map<String, String> attrs = new HashMap<String, String>(); // NOPMD
-				attrs.put("prefix", sub.getPrefix());
-				attrs.put("type", sub.getType());
-				attrs.put("resourceId", sub.getResourceId());
-				attrs.put("xpath", sub.getXpath());
-				attrs.put("id", sub.getSubscriptionId());
 
-				final DOMResult result = new DOMResult(); // NOPMD
-				sub.getSubscriberAsEpr().writeTo(result);
-				attrs.put("address", XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode()));
-				subscriptions.add(attrs);
-			}
+		for (ResourceStateSubscription sub : registry.listSubscriptions()) {
+			final Map<String, String> attrs = new HashMap<String, String>(); // NOPMD
+			attrs.put("prefix", sub.getPrefix());
+			attrs.put("type", sub.getType());
+			attrs.put("resourceId", sub.getResourceId());
+			attrs.put("xpath", sub.getXpath());
+			attrs.put("id", sub.getSubscriptionId());
+
+			final DOMResult result = new DOMResult(); // NOPMD
+			sub.getSubscriberAsEpr().writeTo(result);
+			attrs.put("address", XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode()));
+			subscriptions.add(attrs);
 		}
 
 		model.addAttribute("subscriptions", subscriptions);
@@ -103,7 +103,7 @@
 	@RequestMapping("/inspector/snByAddress.do")
 	String listSubscriptionsByAddress(final Model model, @RequestParam(value="address", required=false) final String address) throws XPathExpressionException {
 
-		log.debug("registries: " + registries);
+		log.debug("registries: " + registry);
 
 		final List<Map<String, String>> subscriptions = new ArrayList<Map<String, String>>();
 		log.debug("Address is "+address);
@@ -110,25 +110,23 @@
 		
 			model.addAttribute("address", address);
 			
-			for (ResourceStateSubscriptionRegistry registry : registries) {
-				for (ResourceStateSubscription sub : registry.getSubscriptionDao().listSubscriptions()) {
-					final DOMResult result = new DOMResult(); // NOPMD
-					sub.getSubscriberAsEpr().writeTo(result);
-					final String addr = XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode());
-					
-					if ( address==null || (addr != null && addr.startsWith(address)) ) {
-						final Map<String, String> attrs = new HashMap<String, String>(); // NOPMD
-						attrs.put("prefix", sub.getPrefix());
-						attrs.put("type", sub.getType());
-						attrs.put("resourceId", sub.getResourceId());
-						attrs.put("xpath", sub.getXpath());
-						attrs.put("id", sub.getSubscriptionId());
-     					attrs.put("address", addr);
-						subscriptions.add(attrs);
-					}
+			for (ResourceStateSubscription sub : registry.listSubscriptions()) {
+				final DOMResult result = new DOMResult(); // NOPMD
+				sub.getSubscriberAsEpr().writeTo(result);
+				final String addr = XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode());
+
+				if ( address==null || (addr != null && addr.startsWith(address)) ) {
+					final Map<String, String> attrs = new HashMap<String, String>(); // NOPMD
+					attrs.put("prefix", sub.getPrefix());
+					attrs.put("type", sub.getType());
+					attrs.put("resourceId", sub.getResourceId());
+					attrs.put("xpath", sub.getXpath());
+					attrs.put("id", sub.getSubscriptionId());
+                    attrs.put("address", addr);
+					subscriptions.add(attrs);
 				}
 			}
-		
+
 		model.addAttribute("subscriptions", subscriptions);
 		model.addAttribute("enabled", !inhibitionCondition.isTrue());
 		return "inspector/subscriptionsByAddress";
@@ -153,10 +151,7 @@
 	 */
 	@RequestMapping("/inspector/deleteSubscription.do")
 	String deleteSubscription(@RequestParam("id") final String subscriptionId) {
-		for (ResourceStateSubscriptionRegistry registry : registries) {
-			if (registry.getSubscriptionDao().removeSubscription(subscriptionId))
-				break;
-		}
+		registry.removeSubscription(subscriptionId);
 		return "redirect:sn.do";
 	}
 	
@@ -175,17 +170,16 @@
 		final List<String> deleted = new ArrayList<String>();
 		
 		if (address != null && address.length() > "http://".length()) {
-			for (ResourceStateSubscriptionRegistry registry : registries) {
-				for (ResourceStateSubscription sub : registry.getSubscriptionDao().listSubscriptions()) {
-					final DOMResult result = new DOMResult(); // NOPMD
-					sub.getSubscriberAsEpr().writeTo(result);
-					final String addr = XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode());
-					
-					if (addr != null && addr.startsWith(address)) {
-						String id = sub.getSubscriptionId();
-						registry.getSubscriptionDao().removeSubscription(id);
-						deleted.add(id + " ("+ addr +")");
-					}
+
+			for (ResourceStateSubscription sub : registry.listSubscriptions()) {
+				final DOMResult result = new DOMResult(); // NOPMD
+				sub.getSubscriberAsEpr().writeTo(result);
+				final String addr = XPathFactory.newInstance().newXPath().evaluate("//*[local-name() = 'Address']", result.getNode());
+
+				if (addr != null && addr.startsWith(address)) {
+					String id = sub.getSubscriptionId();
+					registry.removeSubscription(id);
+					deleted.add(id + " ("+ addr +")");
 				}
 			}
 		}
Index: modules/cnr-enabling-inspector/trunk
===================================================================
--- modules/cnr-enabling-inspector/trunk	(revision 43289)
+++ modules/cnr-enabling-inspector/trunk	(revision 43290)

Property changes on: modules/cnr-enabling-inspector/trunk
___________________________________________________________________
Modified: svn:ignore
## -2,3 +2,4 ##
 .settings
 .classpath
 target
+*.iml
