1 /**************************************************************************** 2 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Imola Informatica. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the LGPL License v2.1 5 * which accompanies this distribution, and is available at 6 * http://www.gnu.org/licenses/lgpl.html 7 ****************************************************************************/ 8 package it.imolinfo.jbi4corba.jbi.component.runtime; 9 10 import java.util.Map; 11 import javax.management.InvalidAttributeValueException; 12 import javax.management.MBeanException; 13 import javax.management.openmbean.CompositeData; 14 import javax.management.openmbean.CompositeType; 15 import javax.management.openmbean.TabularData; 16 17 18 /** 19 * MBean interface for run-time configuration 20 */ 21 @SuppressWarnings("unchecked") 22 public interface RuntimeConfigurationMBean { 23 24 25 // Attribute names 26 public static final String CONFIG_THREADS = "OutboundThreads"; 27 28 // Application configurations and application variables 29 public static final String CONFIG_APPLICATION_CONFIGURATIONS = "ApplicationConfigurations"; 30 31 public Integer getOutboundThreads(); 32 33 public void setOutboundThreads(Integer val) 34 throws InvalidAttributeValueException, MBeanException; 35 /** 36 * Get the CompositeType definition for the components application configuration 37 * 38 * @return the CompositeType for the components application configuration. 39 */ 40 public CompositeType queryApplicationConfigurationType(); 41 42 /** 43 * Add an application configuration. The configuration name is a part of the CompositeData. 44 * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING 45 * 46 * @param name - configuration name, must match the value of the field "name" in the namedConfig 47 * @param appConfig - application configuration composite 48 * @throws MBeanException if the application configuration cannot be added. 49 */ 50 public void addApplicationConfiguration(String name, CompositeData appConfig) throws InvalidAttributeValueException, MBeanException; 51 52 /** 53 * Delete an application configuration. 54 * 55 * @param name - identification of the application configuration to be deleted 56 * @throws MBeanException if the configuration cannot be deleted. 57 */ 58 public void deleteApplicationConfiguration(String name) throws MBeanException; 59 60 /** 61 * Update a application configuration. The configuration name is a part of the CompositeData. 62 * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING 63 * 64 * @param name - configuration name, must match the value of the field "configurationName" in the appConfig 65 * @param appConfig - application configuration composite 66 * @throws MBeanException if there are errors encountered when updating the configuration. 67 */ 68 public void setApplicationConfiguration(String name, CompositeData appConfig) throws InvalidAttributeValueException, MBeanException; 69 70 /** 71 * Get a Map of all application configurations for the component. 72 * 73 * @return a TabularData of all the application configurations for a 74 * component keyed by the configuration name. 75 */ 76 public TabularData getApplicationConfigurations(); 77 /** Retrieves the application configuration map. The map key is the 78 * configuration name, the value is a String representing a HTTP URL. 79 * This method is used to communicate application configuration data 80 * within the component and is not intended for MBean clients. 81 * 82 * @return a Map containing application configuration information 83 */ 84 public Map retrieveApplicationConfigurationsMap(); 85 86 /** Updates the application configuration map. 87 * This method is used to communicate application configuration data within the 88 * component, and not intended for MBean clients 89 * 90 * @param a Map containing application variable information 91 */ 92 public void updateApplicationConfigurationsMap(Map val) throws MBeanException; 93 94 /** Retrieves the component specific configuration schema. 95 * 96 * @return a String containing the configuration schema. 97 */ 98 //public String retrieveConfigurationDisplaySchema(); 99 100 /** Retrieves the component configuration metadata. 101 * The XML data conforms to the component 102 * configuration schema. 103 * 104 * @return a String containing the configuration metadata. 105 */ 106 //public String retrieveConfigurationDisplayData(); 107 108 /** 109 * Retrieves the application variables map. The map key is the application variable name, the 110 * value is a String[] containing detailed information about the application variable. This 111 * method is used to communicate application variable data with in the component and is not 112 * intended for MBean clients 113 * 114 * @return a Map containing application variable information 115 */ 116 public Map<String, String[]> retrieveApplicationVariablesMap(); 117 118 /** 119 * Updates the application variable map. This method is used to communicate application 120 * configuration data within the component, and not intended for MBean clients 121 * 122 * @param a Map containing application variable information 123 */ 124 125 public void updateApplicationVariablesMap(Map<String, String[]> map) throws MBeanException; 126 127 public int countVariables(); 128 129 /*---------------------------------------------------------------------------------*\ 130 * Operations for Application Variables Management * 131 \*---------------------------------------------------------------------------------*/ 132 133 /** 134 * This operation adds a new applicationvariable. If a variable already exists with the same 135 * name as that specified then the operation fails. 136 * 137 * @param name - name of the application variable 138 * @param appVar - this is the application variable compoiste 139 * @throws MBeanException if an error occurs in adding the application variables to the 140 * component. 141 */ 142 public void addApplicationVariable(String name, CompositeData appVar) throws MBeanException; 143 144 /** 145 * This operation sets an application variable. If a variable does not exist with the same name, 146 * its an error. 147 * 148 * @param name - name of the application variable 149 * @param appVar - this is the application variable compoiste to be updated. 150 * @throws MBeanException if one or more application variables cannot be deleted 151 */ 152 public void setApplicationVariable(String name, CompositeData appVar) throws MBeanException; 153 154 /** 155 * This operation deletes an application variable, if a variable with the specified name does 156 * not exist, it's an error. 157 * 158 * @param name - name of the application variable 159 * @throws MBeanException on errors. 160 */ 161 public void deleteApplicationVariable(String name) throws MBeanException; 162 163 /** 164 * Get the Application Variable set for a component. 165 * 166 * @return a TabularData which has all the applicationvariables set on the component. 167 */ 168 public TabularData getApplicationVariables(); 169 170 /** 171 * Retrieves the Configuration Display Schema 172 */ 173 public String retrieveConfigurationDisplaySchema(); 174 175 /** 176 * Retrieves the Configuration Display Data 177 */ 178 public String retrieveConfigurationDisplayData(); 179 180 }