[teiid-commits] teiid SVN: r2530 - in branches/7.1.x/console/src/main: java/org/teiid/rhq/plugin/util and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Sep 3 12:14:36 EDT 2010


Author: tejones
Date: 2010-09-03 12:14:36 -0400 (Fri, 03 Sep 2010)
New Revision: 2530

Added:
   branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
   branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
Modified:
   branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
   branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-1228: Added Data Role resource node under VDB Resource

Added: branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
===================================================================
--- branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java	                        (rev 0)
+++ branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java	2010-09-03 16:14:36 UTC (rev 2530)
@@ -0,0 +1,287 @@
+/*
+ * 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.plugin;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.NamingException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.EnumValueSupport;
+import org.jboss.metatype.api.values.GenericValue;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.mc4j.ems.connection.EmsConnection;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
+import org.rhq.plugins.jbossas5.util.ConversionUtils;
+import org.teiid.adminapi.impl.PropertyMetadata;
+import org.teiid.rhq.admin.DQPManagementView;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+import org.teiid.rhq.plugin.util.PluginConstants.Operation;
+import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
+import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
+
+/**
+ * Component class for a Teiid VDB
+ * 
+ */
+public class DataRoleComponent extends Facet {
+	private final Log LOG = LogFactory
+			.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.teiid.rhq.plugin.Facet#start(org.rhq.core.pluginapi.inventory.
+	 * ResourceContext)
+	 */
+	@Override
+	public void start(ResourceContext context) {
+		this.resourceConfiguration = context.getPluginConfiguration();
+		this.componentType = PluginConstants.ComponentType.DATA_ROLE.NAME;
+		super.start(context);
+	}
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.teiid.rhq.plugin.Facet#getAvailability()
+	 */
+	@Override
+	public AvailabilityType getAvailability() {
+		return ((VDBComponent)this.resourceContext.getParentResourceComponent()).getAvailability();
+	}
+
+	@Override
+	String getComponentType() {
+		return PluginConstants.ComponentType.DATA_ROLE.NAME;
+	}
+
+	@Override
+	public void getValues(MeasurementReport arg0,
+			Set<MeasurementScheduleRequest> arg1) throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+	
+	/**
+	 * The plugin container will call this method when it has a new
+	 * configuration for your managed resource. Your plugin will re-configure
+	 * the managed resource in your own custom way, setting its configuration
+	 * based on the new values of the given configuration.
+	 * 
+	 * @see ConfigurationFacet#updateResourceConfiguration(ConfigurationUpdateReport)
+	 */
+	public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+
+		Configuration resourceConfig = report.getConfiguration();
+		resourceConfiguration = resourceConfig.deepCopy();
+
+		// Get the vdb and update date role anyAuthenticated and MappedRoleNames
+		ManagementView managementView = null;
+		ComponentType componentType = new ComponentType(
+				PluginConstants.ComponentType.VDB.TYPE,
+				PluginConstants.ComponentType.VDB.SUBTYPE);
+
+		ManagedComponent managedComponent = null;
+		ManagedProperty anyAuthenticatedMp = null;
+		report.setStatus(ConfigurationUpdateStatus.SUCCESS);
+		try {
+
+			managementView = getConnection().getManagementView();
+			managedComponent = managementView.getComponent(
+					((VDBComponent) this.resourceContext
+							.getParentResourceComponent()).name, componentType);
+			ManagedProperty mp = managedComponent.getProperty("dataPolicies");//$NON-NLS-1$
+			List<ManagedObject> dataRolesListMp = (List<ManagedObject>) MetaValueFactory
+					.getInstance().unwrap(mp.getValue());
+			String name = resourceConfiguration.getSimpleValue("name", null); //$NON-NLS-1$
+			String anyAuthenticated = resourceConfiguration.getSimpleValue(
+					"anyAuthenticated", null); //$NON-NLS-1$
+
+			for (ManagedObject mo : dataRolesListMp) {
+
+				String pname = ProfileServiceUtil.stringValue(mo.getProperty(
+						"name").getValue()); //$NON-NLS-1$
+				if (!pname.equals(name)) {
+					continue;
+				}
+				anyAuthenticatedMp = mo.getProperty("anyAuthenticated"); //$NON-NLS-1$
+				anyAuthenticatedMp.setValue(ProfileServiceUtil.wrap(
+						SimpleMetaType.BOOLEAN, anyAuthenticated));
+				List<Property> mappedRoleNamePropertyList = resourceConfiguration
+				.getList("mappedRoleNameList").getList(); //$NON-NLS-1$
+
+				List<String> mappedRoleNameList = new ArrayList<String>();
+				
+				for (Property mappedRoleNameProperty : mappedRoleNamePropertyList){
+					String mappedRoleNameString = ((PropertyMap)mappedRoleNameProperty).getSimpleValue("name", null); //$NON-NLS-1$
+					mappedRoleNameList.add(mappedRoleNameString);
+				}
+				ManagedProperty mappedRoleNameMp = mo.getProperty("mappedRoleNames"); //$NON-NLS-1$
+				mappedRoleNameMp.setValue(MetaValueFactory.getInstance().create(mappedRoleNameList));
+			}
+
+			try {
+				managementView.updateComponent(managedComponent);
+			} catch (Exception e) {
+				LOG.error("Unable to update component [" //$NON-NLS-1$
+						+ managedComponent.getName() + "] of type " //$NON-NLS-1$
+						+ componentType + ".", e); //$NON-NLS-1$
+				report.setStatus(ConfigurationUpdateStatus.FAILURE);
+				report.setErrorMessageFromThrowable(e);
+			}
+		} catch (Exception e) {
+			LOG.error("Unable to process update request", e); //$NON-NLS-1$
+			report.setStatus(ConfigurationUpdateStatus.FAILURE);
+			report.setErrorMessageFromThrowable(e);
+		}
+
+	}
+
+	@Override
+	public Configuration loadResourceConfiguration() {
+
+		VDBComponent parentComponent = (VDBComponent) this.resourceContext
+				.getParentResourceComponent();
+		ManagedComponent mcVdb = null;
+		Configuration configuration = resourceContext.getPluginConfiguration();
+		try {
+			mcVdb = ProfileServiceUtil.getManagedComponent(getConnection(),
+					new ComponentType(PluginConstants.ComponentType.VDB.TYPE,
+							PluginConstants.ComponentType.VDB.SUBTYPE),
+					parentComponent.name);
+		} catch (NamingException e) {
+			final String msg = "NamingException in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+			LOG.error(msg, e);
+		} catch (Exception e) {
+			final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+			LOG.error(msg, e);
+		}
+
+		// Get data roles from VDB
+		ManagedProperty property = mcVdb.getProperty("dataPolicies"); //$NON-NLS-1$
+		if (property != null) {
+			CollectionValueSupport valueSupport = (CollectionValueSupport) property
+					.getValue();
+			MetaValue[] metaValues = valueSupport.getElements();
+
+			for (MetaValue value : metaValues) {
+				GenericValueSupport genValueSupport = (GenericValueSupport) value;
+				ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+						.getValue();
+
+				String dataRoleName = ProfileServiceUtil.getSimpleValue(
+						managedObject, "name", String.class); //$NON-NLS-1$
+				Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
+						managedObject, "anyAuthenticated", Boolean.class); //$NON-NLS-1$
+				String description = ProfileServiceUtil.getSimpleValue(
+						managedObject, "description", String.class); //$NON-NLS-1$
+
+				configuration.put(new PropertySimple("name", dataRoleName)); //$NON-NLS-1$
+				configuration.put(new PropertySimple("anyAuthenticated", //$NON-NLS-1$ 
+						anyAuthenticated));
+				configuration
+						.put(new PropertySimple("description", description)); //$NON-NLS-1$
+
+				PropertyList mappedRoleNameList = new PropertyList(
+						"mappedRoleNameList"); //$NON-NLS-1$
+				configuration.put(mappedRoleNameList);
+				ManagedProperty mappedRoleNames = managedObject
+						.getProperty("mappedRoleNames"); //$NON-NLS-1$
+				if (mappedRoleNames != null) { 
+					List<String> props = (List<String>) MetaValueFactory
+							.getInstance().unwrap(mappedRoleNames.getValue());
+					for (String mappedRoleName : props) {
+						PropertyMap mappedRoleNameMap = null;
+
+						mappedRoleNameMap = new PropertyMap("map", //$NON-NLS-1$
+								new PropertySimple("name", mappedRoleName)); //$NON-NLS-1$
+						mappedRoleNameList.add(mappedRoleNameMap);
+					}
+				}
+			}
+		}
+
+		return configuration;
+
+	}
+
+	@Override
+	public CreateResourceReport createResource(
+			CreateResourceReport createResourceReport) {
+
+		createContentBasedResource(createResourceReport);
+		return createResourceReport;
+	}
+
+	@Override
+	public ProfileServiceConnection getConnection() {
+		return ((VDBComponent) this.resourceContext
+				.getParentResourceComponent()).getConnection();
+	}
+
+	@Override
+	public EmsConnection getEmsConnection() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}


Property changes on: branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
===================================================================
--- branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java	                        (rev 0)
+++ branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java	2010-09-03 16:14:36 UTC (rev 2530)
@@ -0,0 +1,139 @@
+/*
+ * 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.plugin;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
+import org.teiid.rhq.plugin.util.PluginConstants;
+import org.teiid.rhq.plugin.util.ProfileServiceUtil;
+
+/**
+ * Discovery component for Data Roles of a VDB
+ * 
+ */
+public class DataRoleDiscoveryComponent implements ResourceDiscoveryComponent {
+
+	private final Log log = LogFactory
+			.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
+
+	public Set<DiscoveredResourceDetails> discoverResources(
+			ResourceDiscoveryContext discoveryContext)
+			throws InvalidPluginConfigurationException, Exception {
+		Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
+		VDBComponent parenComponent = (VDBComponent) discoveryContext
+				.getParentResourceComponent();
+		ProfileServiceConnection connection = parenComponent.getConnection();
+
+		ManagedComponent mcVdb = ProfileServiceUtil.getManagedComponent(
+				connection, new ComponentType(
+						PluginConstants.ComponentType.VDB.TYPE,
+						PluginConstants.ComponentType.VDB.SUBTYPE),
+				parenComponent.name);
+
+		// Get data roles from VDB
+		ManagedProperty property = mcVdb.getProperty("dataPolicies");
+		if (property != null) {
+			CollectionValueSupport valueSupport = (CollectionValueSupport) property
+					.getValue();
+			MetaValue[] metaValues = valueSupport.getElements();
+
+			for (MetaValue value : metaValues) {
+				GenericValueSupport genValueSupport = (GenericValueSupport) value;
+				ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+						.getValue();
+
+				String dataRoleName = ProfileServiceUtil.getSimpleValue(
+						managedObject, "name", String.class);
+				Boolean anyAuthenticated = ProfileServiceUtil.getSimpleValue(
+						managedObject, "anyAuthenticated", Boolean.class);
+				String description = ProfileServiceUtil.getSimpleValue(
+						managedObject, "description", String.class);
+
+				/**
+				 * 
+				 * A discovered resource must have a unique key, that must stay
+				 * the same when the resource is discovered the next time
+				 */
+				DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+						discoveryContext.getResourceType(), // ResourceType
+						dataRoleName, // Resource Key
+						dataRoleName, // Resource Name
+						null, // Version
+						PluginConstants.ComponentType.DATA_ROLE.DESCRIPTION, // Description
+						discoveryContext.getDefaultPluginConfiguration(), // Plugin
+						// Config
+						null // Process info from a process scan
+				);
+
+				Configuration configuration = detail.getPluginConfiguration();
+
+				configuration.put(new PropertySimple("name", dataRoleName));
+				configuration.put(new PropertySimple("anyAuthenticated",
+						anyAuthenticated));
+				configuration
+						.put(new PropertySimple("description", description));
+
+				PropertyList mappedRoleNameList = new PropertyList(
+						"mappedRoleNameList");
+				configuration.put(mappedRoleNameList);
+				ManagedProperty mappedRoleNames = managedObject
+						.getProperty("mappedRoleNames");
+				if (mappedRoleNames != null) {
+					List<String> props = (List<String>) MetaValueFactory
+							.getInstance().unwrap(mappedRoleNames.getValue());
+					for (String mappedRoleName : props) {
+						mappedRoleNameList.add(new PropertySimple("name", mappedRoleName));
+					}
+
+				}
+				// Add to return values
+				discoveredResources.add(detail);
+				log.debug("Discovered Teiid VDB Data Role: " + dataRoleName);
+			}
+		}
+		
+		return discoveredResources;
+
+	}
+}
\ No newline at end of file


Property changes on: branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java	2010-09-03 14:43:18 UTC (rev 2529)
+++ branches/7.1.x/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java	2010-09-03 16:14:36 UTC (rev 2530)
@@ -118,7 +118,20 @@
 			}
 
 		}
+		
+		public interface DATA_ROLE {
 
+			public final static String NAME = "VDB Data Role"; //$NON-NLS-1$
+			public final static String DESCRIPTION = "Data/Security Role for a Teiid Virtual Database (VDB)"; //$NON-NLS-1$
+
+			public static interface Operations {
+			}
+			
+			public static interface Metrics {
+			}
+
+		}
+
 		public interface Translator {
 
 			public final static String TYPE = "teiid"; //$NON-NLS-1$

Modified: branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml	2010-09-03 14:43:18 UTC (rev 2529)
+++ branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml	2010-09-03 16:14:36 UTC (rev 2530)
@@ -154,20 +154,22 @@
 				</c:list-property>
 			</results>
 		</operation>
-		
+
 		<operation name="deployVdbByUrl" displayName="Deploy a VDB via URL"
 			description="Deploy a VDB using a URL">
 			<parameters>
 				<c:simple-property displayName="VDB URL" name="vdbUrl"
 					type="file" required="true" description="The URL of the VDB to deploy" />
-				<c:simple-property displayName="VDB Deploy File Name" name="vdbDeployName"
-					type="string" required="true" description="The deployment file name to use. Must match the VDB Name you are deploying." />
+				<c:simple-property displayName="VDB Deploy File Name"
+					name="vdbDeployName" type="string" required="true"
+					description="The deployment file name to use. Must match the VDB Name you are deploying." />
 				<c:simple-property displayName="VDB Version" name="vdbVersion"
-					type="integer" required="false" description="The version to use for the deployed VDB (leave blank for overwrite of version one)" />
+					type="integer" required="false"
+					description="The version to use for the deployed VDB (leave blank for overwrite of version one)" />
 			</parameters>
 		</operation>
-		
 
+
 		<operation name="terminateSession" displayName="Terminate Session"
 			description="Terminate a specified session">
 			<parameters>
@@ -269,30 +271,30 @@
 			displayType="detail" category="throughput" property="userBufferSpace"
 			description="The currently used file buffer space in MB." />
 
-        <metric displayName="Prepared Plan Cache Hit Ratio %" defaultOn="true"
-            displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.hitRatio"
-            description="Percentage of positive cache hits" />
+		<metric displayName="Prepared Plan Cache Hit Ratio %"
+			defaultOn="true" displayType="detail" category="performance"
+			property="PREPARED_PLAN_CACHE.hitRatio" description="Percentage of positive cache hits" />
 
-        <metric displayName="Prepared Plan Cache Size" defaultOn="true"
-            displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.totalEntries"
-            description="Current number of entries in cache" />
+		<metric displayName="Prepared Plan Cache Size" defaultOn="true"
+			displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.totalEntries"
+			description="Current number of entries in cache" />
 
-        <metric displayName="Prepared Plan Cache # of Requests" defaultOn="true"
-            displayType="detail" category="performance" property="PREPARED_PLAN_CACHE.requestCount"
-            description="Total number of requests made against cache" />
-            
-        <metric displayName="ResultSet Cache Hit Ratio %" defaultOn="true"
-            displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.hitRatio"
-            description="Percentage of positive cache hits" />
+		<metric displayName="Prepared Plan Cache # of Requests"
+			defaultOn="true" displayType="detail" category="performance"
+			property="PREPARED_PLAN_CACHE.requestCount" description="Total number of requests made against cache" />
 
-        <metric displayName="ResultSet Cache Size" defaultOn="true"
-            displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.totalEntries"
-            description="Current number of entries in cache" />
+		<metric displayName="ResultSet Cache Hit Ratio %" defaultOn="true"
+			displayType="detail" category="performance"
+			property="QUERY_SERVICE_RESULT_SET_CACHE.hitRatio" description="Percentage of positive cache hits" />
 
-        <metric displayName="ResultSet Cache  # of Requests" defaultOn="true"
-            displayType="detail" category="performance" property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount"
-            description="Total number of requests made against cache" />
+		<metric displayName="ResultSet Cache Size" defaultOn="true"
+			displayType="detail" category="performance"
+			property="QUERY_SERVICE_RESULT_SET_CACHE.totalEntries" description="Current number of entries in cache" />
 
+		<metric displayName="ResultSet Cache  # of Requests" defaultOn="true"
+			displayType="detail" category="performance"
+			property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount" description="Total number of requests made against cache" />
+
 		<resource-configuration>
 			<c:group name="teiidProperties" displayName="Runtime Engine Properties"
 				hiddenByDefault="false">
@@ -498,7 +500,7 @@
 							<c:option value="INACTIVE" name="DOWN" default="true" />
 						</c:property-options>
 					</c:simple-property>
-					<c:simple-property name="connectionType" type="string" 
+					<c:simple-property name="connectionType" type="string"
 						description="Allowable Connections: 1) NONE - disallow new connections 2) BY VERSION - allow connections only if the version is specified or if this is the earliest 'BY VERSION' vdb and there are no vdbs marked as 'ANY' 
 3) ANY - allow connections with or without a version specified. If multiple versions of same VDB are deployed, connect to one specified with ANY, or if there are multiple VDBs with ANY then connect to the latest version with ANY "
 						required="false">
@@ -598,6 +600,32 @@
 				</c:group>
 			</resource-configuration>
 
+			<service name="Data Roles" description="Data Roles for this VDB"
+				class="DataRoleComponent" discovery="DataRoleDiscoveryComponent">
+
+				<resource-configuration>
+					<c:simple-property name="name" displayName="Name"
+						description="Name of the data role" readOnly="true" required="false" />
+					<c:simple-property name="anyAuthenticated"
+						displayName="Any Authenticated" type="boolean"
+						description="Indicates if the role is mapped to any authenticated user"
+						readOnly="false" required="false" />
+					<c:simple-property name="description"
+						displayName="Description" type="string"
+						description="Description of this data role"
+						readOnly="true" required="false" />	
+					<c:list-property name="mappedRoleNameList"
+						readOnly="false" required="false" displayName="Mapped Role Names"
+						description="Mapped role names for this data role">
+						<c:map-property name="map" readOnly="false">
+							<c:simple-property name="name" displayName="Name"
+								description="Name of this mapped role" readOnly="true" />
+						</c:map-property>
+					</c:list-property>
+				</resource-configuration>
+
+			</service>
+
 		</service>
 
 		<service name="Translators" description="Teiid Translators"



More information about the teiid-commits mailing list