[teiid-commits] teiid SVN: r1366 - in branches/6.2.x: client/src/main/java/org/teiid/adminapi and 3 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Sep 17 17:13:18 EDT 2009


Author: rareddy
Date: 2009-09-17 17:13:18 -0400 (Thu, 17 Sep 2009)
New Revision: 1366

Modified:
   branches/6.2.x/adminshell/src/main/resources/scripts/adminapi.bsh
   branches/6.2.x/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java
   branches/6.2.x/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
   branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
   branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
   branches/6.2.x/test-integration/common/src/test/java/com/metamatrix/server/integration/TestAdminApi.java
Log:
TEIID-837: The VDB identifier is supplied supported with server admin api before. Removed the notion of VDB identifier and used the vdb name and version, which is similar to all the other vdb related admin api methods in current admin api.

Modified: branches/6.2.x/adminshell/src/main/resources/scripts/adminapi.bsh
===================================================================
--- branches/6.2.x/adminshell/src/main/resources/scripts/adminapi.bsh	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/adminshell/src/main/resources/scripts/adminapi.bsh	2009-09-17 21:13:18 UTC (rev 1366)
@@ -677,19 +677,15 @@
 
 /**
  * Get all the Connector Bindings for the given VDB identifier pattern
- * @param identifier - the unique identifier for a {@link VDB}
- * <ul>
- *      <li> <code>"*"</code> - for all Connector Bindings in the system
- *      <li> <code>"name or name*"</code> - for all the bindings in the VDBs that begin with given name
- *      <li><code>"name<{@link AdminObject#DELIMITER_CHAR}>version"</code> - for all the bindings in a given single VDB
- * </ul>
+ * @param vdbName - Name of the VDB
+ * @param vdbVersion - version of the VDB
  * @return Collection of {@link ConnectorBinding}
  * @throws AdminException if there's a system error.
  * @since 4.3
  */
-Collection getConnectorBindingsInVDB(String identifier) {
+Collection getConnectorBindingsInVDB(String vdbName, String vdbVersion) {
     checkAdmin();
-    result = currentContext().internalAdmin.getConnectorBindingsInVDB(identifier);
+    result = currentContext().internalAdmin.getConnectorBindingsInVDB(vdbName, vdbVersion);
     debug(result);
     return result;
 }
@@ -1014,7 +1010,7 @@
 void deleteVDBAndConnectorBindings(String name, String version) {
     checkAdmin();
     
-    Collection connectorBindings = currentContext().internalAdmin.getConnectorBindingsInVDB(name + AdminObject.DELIMITER + version);
+    Collection connectorBindings = currentContext().internalAdmin.getConnectorBindingsInVDB(name, version);
     
     currentContext().internalAdmin.changeVDBStatus(name, version, VDB.DELETED);
     for ( Iterator itr = connectorBindings.iterator(); itr.hasNext();) {

Modified: branches/6.2.x/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java
===================================================================
--- branches/6.2.x/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/client/src/main/java/org/teiid/adminapi/MonitoringAdmin.java	2009-09-17 21:13:18 UTC (rev 1366)
@@ -87,17 +87,13 @@
 
     /**
      * Get all the Connector Bindings for the given VDB identifier pattern
-     * @param identifier - the unique identifier for a {@link VDB}
-     * <ul>
-     *      <li> <code>"*"</code> - for all Connector Bindings in the system
-     *      <li> <code>"name or name*"</code> - for all the bindings in the VDBs that begin with given name
-     *      <li><code>"name<{@link AdminObject#DELIMITER_CHAR}>version"</code> - for all the bindings in a given single VDB
-     * </ul>
+	 * @param vdbName - Name of the VDB
+	 * @param vdbVersion - version of the VDB
      * @return Collection of {@link ConnectorBinding}
      * @throws AdminException if there's a system error.
      * @since 4.3
      */
-    Collection<ConnectorBinding> getConnectorBindingsInVDB(String identifier) throws AdminException;
+    Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, String vdbVersion) throws AdminException;
 
     /**
      * Get the Extension Modules that correspond to the specified identifier pattern

Modified: branches/6.2.x/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
===================================================================
--- branches/6.2.x/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/runtime/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java	2009-09-17 21:13:18 UTC (rev 1366)
@@ -126,37 +126,18 @@
     }
     
 
-    /** 
-     * @see org.teiid.adminapi.MonitoringAdmin#getConnectorBindingsInVDB(java.lang.String)
-     * @since 4.3
-     */
-    public Collection<ConnectorBinding> getConnectorBindingsInVDB(String identifier)  throws AdminException{
-        Collection<VDBArchive> vdbs = null;
-        HashMap bindings = new HashMap();
-
-        if (identifier == null || !identifier.matches(VDB_REGEX)) {
-            throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.Invalid_identifier")); //$NON-NLS-1$                
-        }
-        
-        // if . and * not specified, add a STAR at the end to compensate for the
-        // version number matching.
-        if (identifier.indexOf(DOT) == -1 && identifier.indexOf(STAR) == -1) {
-            identifier = identifier + STAR;
-        }
-                
+    @Override
+    public Collection<ConnectorBinding> getConnectorBindingsInVDB(String vdbName, String vdbVersion)  throws AdminException{
         try {
-            // first get all the VDBS in the system and loop though each of them
-            vdbs = getVDBService().getAvailableVDBs();                    
-            for (VDBArchive vdb:vdbs) {
-                if (matches(identifier, vdb.getName()+"."+vdb.getVersion())) { //$NON-NLS-1$
-                    Map connectorBindings = vdb.getConfigurationDef().getConnectorBindings();
-                    bindings.putAll(connectorBindings);
-                }
+            VDBArchive vdb = getConfigurationService().getVDB(vdbName, vdbVersion); 
+            if (vdb != null) {
+            	return (List)convertToAdminObjects(vdb.getConfigurationDef().getConnectorBindings().values());
             }
+            throw new AdminProcessingException(DQPEmbeddedPlugin.Util.getString("Admin.vdb_does_not_exists", vdbVersion, vdbVersion)); //$NON-NLS-1$
+            
         } catch (MetaMatrixComponentException e) {
         	throw new AdminComponentException(e);
         }      
-        return (List)convertToAdminObjects(bindings.values());
     }    
     
     /** 

Modified: branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
===================================================================
--- branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java	2009-09-17 21:13:18 UTC (rev 1366)
@@ -1041,4 +1041,10 @@
 			String propertyName, String propertyValue) throws AdminException {
 	}
 
+	@Override
+	public Collection<ConnectorBinding> getConnectorBindingsInVDB(
+			String vdbName, String vdbVersion) throws AdminException {
+		return null;
+	}
+
 }
\ No newline at end of file

Modified: branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java	2009-09-17 21:13:18 UTC (rev 1366)
@@ -1412,5 +1412,11 @@
 			String connectorTypeIdentifier) throws AdminException {
 		return null;
 	}
+
+	@Override
+	public Collection<org.teiid.adminapi.ConnectorBinding> getConnectorBindingsInVDB(
+			String vdbName, String vdbVersion) throws AdminException {
+		return null;
+	}
     
 }
\ No newline at end of file

Modified: branches/6.2.x/test-integration/common/src/test/java/com/metamatrix/server/integration/TestAdminApi.java
===================================================================
--- branches/6.2.x/test-integration/common/src/test/java/com/metamatrix/server/integration/TestAdminApi.java	2009-09-17 16:45:48 UTC (rev 1365)
+++ branches/6.2.x/test-integration/common/src/test/java/com/metamatrix/server/integration/TestAdminApi.java	2009-09-17 21:13:18 UTC (rev 1366)
@@ -172,7 +172,7 @@
 	    bindings = getAdmin().getConnectorBindings(STAR);
 	    assertEquals("Two bindings should exist", 2+size, bindings.size()); //$NON-NLS-1$
 	    
-	    bindings = getAdmin().getConnectorBindingsInVDB("BQT*"); //$NON-NLS-1$
+	    bindings = getAdmin().getConnectorBindingsInVDB("BQT", "1"); //$NON-NLS-1$
 	    assertEquals("Two bindings should exist", 2+size, bindings.size()); //$NON-NLS-1$
 	    
 	    assertTrue("Binding must be available", hasBinding("BQT_1.BQT1 Oracle 9i Simple Cap"));  //$NON-NLS-1$ //$NON-NLS-2$



More information about the teiid-commits mailing list