[teiid-commits] teiid SVN: r1847 - trunk/console/src/main/java/org/teiid/rhq/comm.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Feb 19 11:28:06 EST 2010


Author: tejones
Date: 2010-02-19 11:28:05 -0500 (Fri, 19 Feb 2010)
New Revision: 1847

Removed:
   trunk/console/src/main/java/org/teiid/rhq/comm/Component.java
   trunk/console/src/main/java/org/teiid/rhq/comm/Connection.java
   trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionFactory.java
   trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionPool.java
   trunk/console/src/main/java/org/teiid/rhq/comm/VMComponent.java
Modified:
   trunk/console/src/main/java/org/teiid/rhq/comm/ExecutedResult.java
Log:
TEIID-807: Cleaned up legacy code and added VDB deployment/un-deployment. Also added operation execution framework.

Deleted: trunk/console/src/main/java/org/teiid/rhq/comm/Component.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/Component.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/Component.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * 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.teiid.rhq.comm;
-
-import java.util.Map;
-
-
-/** 
- * @since 4.3
- */
-public interface Component extends Comparable<Object> {
-    
-    public static final String SYSTEM_KEY = "teiid.system.key"; //$NON-NLS-1$
-    public static final String NAME = "teiid.name"; //$NON-NLS-1$
-    public static final String IDENTIFIER = "teiid.identifier"; //$NON-NLS-1$
-    public static final String DESCRIPTION = "teiid.description"; //$NON-NLS-1$
-    public static final String VERSION = "teiid.version"; //$NON-NLS-1$
-    
-    /**
-     * Return the system key that this component identifies with.
-     * @return String system key
-     */
-    String getSystemKey();
-    
-    /**
-     * Return the name for this component
-     * @return String name
-     */
-    String getName();
-    
-    /**
-     * return the unique identifier for this component
-     * @return String unique identifier
-     */
-    String getIdentifier();
-    
-    /**
-     * Return the description
-     * @return String description
-     */
-    String getDescription();
-    
-    /**
-     * Return the version
-     * @return String version
-     */
-    String getVersion();
-    
-    /**
-     * Return a value for the request property key
-     * @param key is the identifier to look for
-     * @return String value
-     */
-    String getProperty(String key);
-    
-    
-    /**
-     * Return the map of properties.
-     * @return Map of properties
-     */
-    Map getProperties();
-
-    
-    
-
-}

Deleted: trunk/console/src/main/java/org/teiid/rhq/comm/Connection.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/Connection.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/Connection.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -1,140 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * 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.teiid.rhq.comm;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Properties;
-
-import org.teiid.rhq.admin.utils.SingletonConnectionManager;
-
-
-
-public interface Connection {
-    
-    /**
-     * Called to find out if the connection represents a valid connection to the
-     * JBEDSP system.   This call should be used only after obtaining a connection
-     * from the {@link SingletonConnectionManager#getConnection(String)}.
-     * The connection can become invalid if the JBEDSP system goes down.
-     */
-    boolean isValid();
-    
-    /**
-     * Called by the {@link ConnectionPool} to check if the connection is still open. 
-     * @return true is the connection is alive.
-
-     */
-    boolean isAlive();
-	
-    /**
-     * Call to indicate the connection is no longer needed and that
-     * resources can be released. 
-     */
-    public void close() ;
-     
-	
-	/**
-	 * This method is called by a component of the JBEDSP RHQ plugin. The
-	 * component identifier, type and metric operation are used to execute the correlating logic.
-	 * The valueMap is a map of values (0-n) that are required by
-	 * the logic to determine the metric.
-	 * @param componentType @see ConnectionConstants.ComponentType
-	 * @param identifier 
-	 * @param metric
-	 * @param valueMap
-	 * @return Object
-     * @throws ConnectionException
-	 */
-	public Object getMetric(final String componentType, String identifier, final String metric, final Map valueMap) throws ConnectionException;
-
-	/**
-	 * This method is called by a component of the JBEDSP RHQ plugin. The
-	 * component type and operation are used to execute the correlating logic.
-	 * The valueMap is a collection of values (0-n) that are required by
-	 * the operation.
-	 * {@link ConnectionConstants.ComponentType} for <code>componentType</code> values
-	 * @param result
-	 * @param componentType
-	 * @param operationName
-	 * @param valueMap
-     * @throws ConnectionException
-	 */
-	public void executeOperation(final ExecutedResult result, final Map valueMap) throws ConnectionException;
-	
-	/**
-	 * This method is called by a component to determine if that particular component is con. The
-	 * component type and identifier are used to execute the correlating logic.
-	 * 
-     * {@link ConnectionConstants.ComponentType} for <code>componentType</code> values
-     * 
-	 * The return value is true if UP else false if DOWN
-	 * 
-	 * @param componentType
-	 * @param identifier
-	 * @return Boolean 
-     * @throws ConnectionException
-	 */
-	public Boolean isAvailable(final String componentType, final String identifier) throws ConnectionException;
-	
-   
-    /**
-     *  Return the properties for component of a specified resource type {@link ConnectionConstants.ComponentType}  
-     * @param componentType {@link ConnectionConstants.ComponentType}
-     * @param identifier
-     * @return
-     * @throws ConnectionException
-     * @since 4.3
-     */
-    
-    public Properties getProperties(String componenType, String identifier) throws ConnectionException; 
-    
-	/**
-	 * Returns a property for a given identifier
-	 * 
-	 * @param identifier
-	 * @param property
-     * @throws ConnectionException
-	 */
-	public String getProperty(String identifier, String property) throws ConnectionException;
-	
-	/**
-	 * Returns the unique key that maps this connection to the system that is being connected to.
-	 * This key used during the enterprise monitoring to keep track of which connection belongs to
-	 * what's being monitored.
-	 * 
-	 * @return key JBEDSP represented by this connection
-     * @throws Exception
-	 */
-	public String getKey() throws Exception;
-    
-    /**
-     * Returns a <code>Collection</code> of {@link Component Component}s for the given identifier for the
-     * given name of the {@link ConnectionConstants.ComponentType}
-     * @param componentType
-     * @param identifier
-     * @return
-     * @throws ConnectionException
-     */
-    public Collection<Component> discoverComponents(String componentType, String identifier) throws ConnectionException;
-   
-}

Deleted: trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionFactory.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionFactory.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionFactory.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * 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.teiid.rhq.comm;
-
-import java.util.Properties;
-
-
-/**
- * The primary interface to be implemented by the pool user.  The ConnectionFactory
- * is called by the {@link ConnectionPool} to create and close the connection. 
- * 
- * 
- * This
- */
-public interface ConnectionFactory {
-	
-    public static final String CONNECTION_FACTORY_DEFAULT="org.teiid.rhq.comm.impl.TeiidConnectionFactory";  //$NON-NLS-1$
-
-
-
-    /**
-     * Set the environment that this factory is being run in - typically used 
-     * to obtain properties when creating connections and to log messages as 
-     * necessary.
-     * @param env The environment properties needed to create a connection by the connector manager
-     *     {@link ConnectionConstants} 
-     * @param connectionPool is passed so the factory can set the pool on the connection.
-     */
-    void initialize(Properties env, ConnectionPool connectionPool) throws ConnectionException;
-    
-    /**
-     * Return the url used to connect to the server.
-     * @return String url
-     */
-    String getURL();
-
-    /**
-     * Create the connection. This connection is to an existing MetaMatrix server.
-     * @return The Connection form of source-specific connection
-     * @throws ConnectorException If an error occurs while creating the connection
-     */
-    Connection createConnection() throws ConnectionException;
-    
-    
-    /**
-     * Called by the {@link ConnectionPool} when a connection is being cleaned up from the pool.
-     * This will allow the creator of the connection to do any last cleanup steps necessary in order
-     * to release all resources.   
-     * 
-     * In cases where the {@link Connection}, when the {@link Connection#close()} method only returns
-     * the connection to the pool and does not actually close the connection, this close will be 
-     * responsible for actually closing the connection to the source.
-     * @param connection
-
-     */
-    void closeConnection(Connection connection) ;
-
-}

Deleted: trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionPool.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionPool.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/ConnectionPool.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -1,103 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * 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.teiid.rhq.comm;
-
-import java.util.Properties;
-
-
-
-
-/**
- * The primary interface for the ConnectionPool used by the connection manager
- * responsible for handing out connections to the discovery and resource JON objects.
- *
- * After the instantiation of the ConnectionPool, the @link #initialize(String, Properties) method
- * will be called so the pool can be initialized.  
- * @since 1.0
- *  
- */
-public interface ConnectionPool extends ConnectionPoolConstants {
-    
-
-    /**
-     * Set the connection factory responsible for creating a connection
-     * when the pool needs a new one.   @see ConnectionPoolConstants for the
-     * avalable settings to configure the pool.
-      * @param env are the environment variables needed to iniatilize the connection pool.
-     * @since 1.0
-     */
-    void initialize(Properties env, ClassLoader cl) throws ConnectionException ;
-    
-    /**
-     * Return a unique key that identifies this connection pool
-     * 
-     * @return
-     */
-    String getKey();
-    
-    
-    /**
-     * Returns a {@link Connection} from the pool.
-     * @return Connction
-     */
-    Connection getConnection() throws ConnectionException;
-    
-    
-    /**
-     * Return the connection to the pool.   It's up to the 
-     * implementation of the pool if the connection is reused or not
-     * @param connection returned to the pool
-     */
-    void close(Connection connection)  throws ConnectionException;
-    
-    
-    /** 
-     * Called to shutdown the pool. 
-     * 
-     */
-    void shutdown()  throws ConnectionException;
-    
-    
-    /**
-     * Return the <code>ClassLoader</code> used to instantiate the {@link ConnectionFactory} and
-     * will be used on all calls in the {@link Connection} 
-     * @return
-     */
-    ClassLoader getClassLoader();
-    
-    /**
-     * Return the number of connection that are currently in use.
-     * @return int is the number of connections in use
-     *
-     * @since
-     */
-    int getConnectionsInUseCount();
-    
-    /**
-     * Return the number of connections that are currently available in the pool.
-     * @return int is the number of connections currently available in the pool.
-     *
-     * @since 6.2
-     */
-    int getAvailableConnectionCount();
-    
-}

Modified: trunk/console/src/main/java/org/teiid/rhq/comm/ExecutedResult.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/ExecutedResult.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/ExecutedResult.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -21,6 +21,7 @@
  */
 package org.teiid.rhq.comm;
 
+import java.util.Collection;
 import java.util.List;
 
 public interface ExecutedResult {
@@ -33,7 +34,7 @@
 	
 	List<String> getFieldNameList();
 	
-	void setContent(List content);
+	void setContent(Collection content);
 	
 	void setContent(String content);
 	

Deleted: trunk/console/src/main/java/org/teiid/rhq/comm/VMComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/comm/VMComponent.java	2010-02-19 16:27:35 UTC (rev 1846)
+++ trunk/console/src/main/java/org/teiid/rhq/comm/VMComponent.java	2010-02-19 16:28:05 UTC (rev 1847)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * 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.teiid.rhq.comm;
-
-
-/** 
- * @since 4.3
- */
-public interface VMComponent extends Component {
-    public static final String PORT = "mm.port"; //$NON-NLS-1$
-
-    String getPort();
-}



More information about the teiid-commits mailing list