[Yanel-commits] rev 56690 - public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator

michi at wyona.com michi at wyona.com
Thu Feb 10 09:37:31 CET 2011


Author: michi
Date: 2011-02-10 09:37:30 +0100 (Thu, 10 Feb 2011)
New Revision: 56690

Modified:
   public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java
Log:
log error if resource type name and namespace not match

Modified: public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java	2011-02-10 08:19:39 UTC (rev 56689)
+++ public/yanel/trunk/src/contributions/resources/resource-creator/src/java/org/wyona/yanel/impl/resources/rescreator/ResourceCreatorResource.java	2011-02-10 08:37:30 UTC (rev 56690)
@@ -528,17 +528,26 @@
         org.wyona.yanel.core.map.Realm realm = newResource.getRealm();
         String rcPath = org.wyona.yanel.core.ResourceConfigurationMap.getRCPath(realm, newResource.getPath());
         if (rcPath != null) {
+            log.debug("Resource configuration path: " + rcPath);
             if (realm.getRTIRepository().existsNode(rcPath)) {
                 ResourceConfiguration rc = new ResourceConfiguration(realm.getRTIRepository().getNode(rcPath));  
                 if (rc != null && newResource.getRTD().getResourceTypeLocalName().equals(rc.getName()) && newResource.getRTD().getResourceTypeNamespace().equals(rc.getNamespace())) {
                     log.warn("Path of new resource '" + newResource.getPath() + "' matches within resource configuration map and hence no resource config will be created!");
                     return;
+                } else {
+                    if (rc != null) {
+                        log.warn("Resource configuration '" + rcPath + "' exists, but either name ('" + rc.getName() + "', '" + newResource.getRTD().getResourceTypeLocalName() + "') or namespace ('" + rc.getNamespace() + "', '" + newResource.getRTD().getResourceTypeNamespace() + "') do not match!");
+                    } 
                 }
             } else {
                 throw new Exception("Request did match within resource configuration map of realm '" + realm.getName() + "', but no such resource type configuration node exist: " + rcPath);
             }
+        } else {
+            log.error("No such resource configuration path: " + rcPath);
         }
 
+        log.debug("Path of new resource '" + newResource.getPath() + "' does not match within resource configuration map and hence resource config will be created!");
+
         // Create resource config XML
         StringBuilder rcContent = new StringBuilder("<?xml version=\"1.0\"?>\n\n");
         rcContent.append("<yanel:resource-config xmlns:yanel=\"http://www.wyona.org/yanel/rti/1.0\">\n");



More information about the Yanel-commits mailing list