001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ComponentConfiguration.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.management;
030:
031: import java.util.Map;
032: import java.util.Properties;
033: import javax.management.openmbean.CompositeData;
034: import javax.management.openmbean.CompositeType;
035: import javax.management.openmbean.TabularData;
036: import javax.management.MBeanException;
037:
038: /**
039: * The ComponentConfiguration is a dynamic facade MBean for component configuration.
040: * This MBean provides a facade for managing component static, variable and
041: * named configuration.
042: *
043: * This ComponentExtension MBean is registered for each installation of the component
044: * on a target i.e it is target specific.
045: *
046: * @author Sun Microsystems, Inc.
047: */
048: public interface ComponentConfiguration extends
049: javax.management.DynamicMBean {
050: /**
051: * Detect the components support for component configuration. This method
052: * returns true if the component has a configuration MBean with
053: * configuration attributes.
054: *
055: * @return true if the components configuration MBean has configuration
056: * attributes.
057: * @throws MBeanException if the component is not installed or is not
058: * in the Started state.
059: *
060: */
061: public boolean isComponentConfigSupported() throws MBeanException;
062:
063: /*---------------------------------------------------------------------------------*\
064: * Operations for Application Variables Management *
065: \*---------------------------------------------------------------------------------*/
066:
067: /**
068: * Detect the components support for application variables. This method
069: * returns true if the component has a configuration MBean and implements
070: * all the operations for application variable management.
071: *
072: * @return true if the components configuration MBean implements all the
073: * operations for application variables.
074: * @throws MBeanException if the component is not installed or is not
075: * in the Started state.
076: *
077: */
078: public boolean isAppVarsSupported() throws MBeanException;
079:
080: /**
081: * This operation adds a new application variable. If a variable already exists with
082: * the same name as that specified then the operation fails.
083: *
084: * @param name - name of the application variable
085: * @param appVar - this is the application variable compoiste
086: * @throws MBeanException if an error occurs in adding the application variables to the
087: * component.
088: * @return management message string which gives the status of the operation. For
089: * target=cluster, instance specific details are included.
090: */
091: String addApplicationVariable(String name, CompositeData appVar)
092: throws MBeanException;
093:
094: /**
095: * This operation sets an application variable. If a variable does not exist with
096: * the same name, its an error.
097: *
098: * @param name - name of the application variable
099: * @param appVar - this is the application variable compoiste to be updated.
100: * @throws MBeanException if one or more application variables cannot be deleted
101: * @return management message string which gives the status of the operation. For
102: * target=cluster, instance specific details are included.
103: */
104: String setApplicationVariable(String name, CompositeData appVar)
105: throws MBeanException;
106:
107: /**
108: * This operation deletes an application variable, if a variable with the specified name does
109: * not exist, it's an error.
110: *
111: * @param name - name of the application variable
112: * @throws MBeanException on errors.
113: * @return management message string which gives the status of the operation. For
114: * target=cluster, instance specific details are included.
115: */
116: String deleteApplicationVariable(String name) throws MBeanException;
117:
118: /**
119: * Get the Application Variable set for a component.
120: *
121: * @return a TabularData which has all the applicationvariables set on the component.
122: */
123: TabularData getApplicationVariables();
124:
125: /*---------------------------------------------------------------------------------*\
126: * Operations for Application Configuration Management *
127: \*---------------------------------------------------------------------------------*/
128:
129: /**
130: * Detect the components support for application configuration. This method
131: * returns true if the component has a configuration MBean and implements
132: * all the operations for application configuration management.
133: *
134: * @return true if the components configuration MBean implements all the
135: * operations for application configuration.
136: * @throws MBeanException if the component is not installed or is not
137: * in the Started state.
138: *
139: */
140: public boolean isAppConfigSupported() throws MBeanException;
141:
142: /**
143: * Get the CompositeType definition for the components application configuration
144: *
145: * @return the CompositeType for the components application configuration.
146: */
147: CompositeType queryApplicationConfigurationType();
148:
149: /**
150: * Add an application configuration. The configuration name is a part of the CompositeData.
151: * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING
152: *
153: * @param name - configuration name, must match the value of the field "name" in the namedConfig
154: * @param appCfgProps - application configuration properties
155: * @throws MBeanException if the application configuration cannot be added.
156: * @return management message string which gives the status of the operation. For
157: * target=cluster, instance specific details are included.
158: */
159: String addApplicationConfiguration(String name,
160: Properties appCfgProps) throws MBeanException;
161:
162: /**
163: * Add an application configuration. The configuration name is a part of the CompositeData.
164: * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING
165: *
166: * @param name - configuration name, must match the value of the field "name" in the namedConfig
167: * @param appConfig - application configuration composite
168: * @throws MBeanException if the application configuration cannot be added.
169: * @return management message string which gives the status of the operation. For
170: * target=cluster, instance specific details are included.
171: */
172: String addApplicationConfiguration(String name,
173: CompositeData appConfig) throws MBeanException;
174:
175: /**
176: * Delete an application configuration.
177: *
178: * @param name - identification of the application configuration to be deleted
179: * @throws MBeanException if the configuration cannot be deleted.
180: * @return management message string which gives the status of the operation. For
181: * target=cluster, instance specific details are included.
182: */
183: String deleteApplicationConfiguration(String name)
184: throws MBeanException;
185:
186: /**
187: * Update a application configuration. The configuration name is a part of the CompositeData.
188: * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING
189: *
190: * @param name - configuration name, must match the value of the field "configurationName" in the appConfig
191: * @param appCfgProps - application configuration properties.
192: * @throws MBeanException if there are errors encountered when updating the configuration.
193: * @return management message string which gives the status of the operation. For
194: * target=cluster, instance specific details are included.
195: */
196: String setApplicationConfiguration(String name,
197: Properties appCfgProps) throws MBeanException;
198:
199: /**
200: * Update a application configuration. The configuration name is a part of the CompositeData.
201: * The itemName for the configuration name is "configurationName" and the type is SimpleType.STRING
202: *
203: * @param name - configuration name, must match the value of the field "configurationName" in the appConfig
204: * @param appConfig - application configuration composite
205: * @throws MBeanException if there are errors encountered when updating the configuration.
206: * @return management message string which gives the status of the operation. For
207: * target=cluster, instance specific details are included.
208: */
209: String setApplicationConfiguration(String name,
210: CompositeData appConfig) throws MBeanException;
211:
212: /**
213: * Get a Map of all application configurations for the component.
214: *
215: * @return a TabularData of all the application configurations for a
216: * component keyed by the configuration name.
217: */
218: TabularData getApplicationConfigurations();
219:
220: /*---------------------------------------------------------------------------------*\
221: * Operations Component Configuration meta-data Management *
222: \*---------------------------------------------------------------------------------*/
223:
224: /**
225: * Retrieves the component specific configuration schema.
226: *
227: * @return a String containing the configuration schema.
228: * @throws MBeanException on errors.
229: */
230: public String retrieveConfigurationDisplaySchema()
231: throws MBeanException;
232:
233: /**
234: * Retrieves the component configuration metadata.
235: * The XML data conforms to the component
236: * configuration schema.
237: *
238: * @return a String containing the configuration metadata.
239: * @throws MBeanException on errors
240: */
241: public String retrieveConfigurationDisplayData()
242: throws MBeanException;
243: }
|