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: * @(#)Updater.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: /**
030: * Updater.java
031: *
032: * SUN PROPRIETARY/CONFIDENTIAL.
033: * This software is the proprietary information of Sun Microsystems, Inc.
034: * Use is subject to license terms.
035: *
036: * Created on August 23, 2006, 5:17 PM
037: */package com.sun.jbi.management.registry;
038:
039: import com.sun.jbi.ComponentInfo;
040: import com.sun.jbi.ComponentState;
041: import com.sun.jbi.ServiceUnitInfo;
042: import com.sun.jbi.ServiceAssemblyInfo;
043: import com.sun.jbi.ServiceUnitState;
044: import com.sun.jbi.ServiceAssemblyState;
045: import com.sun.jbi.management.ConfigurationCategory;
046:
047: import java.util.Calendar;
048: import java.util.Map;
049: import java.util.Properties;
050:
051: /**
052: * This interface defines operations which clients can use to update the registry.
053: *
054: *
055: * @author Sun Microsystems, Inc.
056: */
057: public interface Updater {
058: /*--------------------------------------------------------------------------------*\
059: * Add / Remove Entities *
060: \*--------------------------------------------------------------------------------*/
061:
062: /**
063: * Add a component to the runtime target
064: *
065: * @param componentInfo - component instance
066: * @throws RegistryException on errors
067: */
068: void addComponent(ComponentInfo componentInfo)
069: throws RegistryException;
070:
071: /**
072: * Add a component to a given target. If target = DOMAIN, then a simple component
073: * entry is created with the component name. If the target = SERVER / CLUSTER
074: * a component-ref is added.
075: *
076: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
077: * not considered when targetType = DOMAIN.
078: * @param componentInfo - component instance
079: * @throws RegistryException on errors
080: */
081: void addComponent(String targetName, ComponentInfo componentInfo)
082: throws RegistryException;
083:
084: /**
085: * Remove a component from the runtime's target
086: *
087: * @param componentName - component name
088: * @throws RegistryException on errors
089: */
090: void removeComponent(String componentName) throws RegistryException;
091:
092: /**
093: * Remove a component from a given target.
094: *
095: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
096: * @param componentName - component name
097: * @throws RegistryException on errors
098: */
099: void removeComponent(String targetName, String componentName)
100: throws RegistryException;
101:
102: /**
103: * Add a shared library to he runtime's target
104: *
105: * @param ComponentInfo - shared library info
106: * @throws RegistryException on errors
107: */
108: void addSharedLibrary(ComponentInfo sharedLibraryInfo)
109: throws RegistryException;
110:
111: /**
112: * Add a shared library to a given target. If target = DOMAIN, then a simple
113: * entry is created with the library name. If the target = SERVER / CLUSTER
114: * a shared-library-ref is added.
115: *
116: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
117: * @param ComponentInfo - shared library info
118: * @throws RegistryException on errors
119: */
120: void addSharedLibrary(String targetName,
121: ComponentInfo sharedLibraryInfo) throws RegistryException;
122:
123: /**
124: * Remove a shared library from the runtimes target
125: *
126: * @param sharedLibraryName - shared library name
127: * @throws RegistryException on errors
128: */
129: void removeSharedLibrary(String sharedLibraryName)
130: throws RegistryException;
131:
132: /**
133: * Remove a shared library from a given target.
134: *
135: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
136: * @param sharedLibraryName - shared library name
137: * @throws RegistryException on errors
138: */
139: void removeSharedLibrary(String targetName, String sharedLibraryName)
140: throws RegistryException;
141:
142: /**
143: * Add a service assembly to he runtime's target
144: *
145: * @param saName - service assembly name
146: * @throws RegistryException on errors
147: */
148: void addServiceAssembly(String saName) throws RegistryException;
149:
150: /**
151: * Add a service assembly to a given target. If target = DOMAIN, then a simple
152: * entry is created with the assembly name. If the target = SERVER / CLUSTER
153: * a service-assembly-ref is added.
154: *
155: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
156: * @param saName - service assembly name
157: * @throws RegistryException on errors
158: */
159: void addServiceAssembly(String targetName, String saName)
160: throws RegistryException;
161:
162: /**
163: * Remove a service assembly from a given target.
164: *
165: * @param serviceAssemblyName - service assembly name
166: * @throws RegistryException on errors
167: */
168: void removeServiceAssembly(String serviceAssemblyName)
169: throws RegistryException;
170:
171: /**
172: * Remove a service assembly from a given target.
173: *
174: * @param serviceAssemblyName - service assembly name
175: * @param targetName - {'domain', 'server', "instance-name", "cluster-name"}
176: * @throws RegistryException on errors
177: */
178: void removeServiceAssembly(String targetName,
179: String serviceAssemblyName) throws RegistryException;
180:
181: /**
182: * @param serverNameRef - server name to be added
183: */
184: void addServer(String serverNameRef) throws RegistryException;
185:
186: /**
187: * @param serverNameRef - server name to be removed
188: */
189: void removeServer(String serverNameRef) throws RegistryException;
190:
191: /**
192: * @param clusterNameRef - cluster name to be added
193: */
194: void addCluster(String clusterNameRef) throws RegistryException;
195:
196: /**
197: * @param clusterNameRef - cluster name to be removed
198: */
199: void removeCluster(String clusterNameRef) throws RegistryException;
200:
201: /**
202: * Add a domain shared library
203: *
204: * @param slName - name of the shared library
205: * @param fileName - component file name
206: */
207: void addSharedLibrary(String slName, String fileName,
208: Calendar timestamp) throws RegistryException;
209:
210: /**
211: * Add a domain component
212: *
213: * @param componentName - name of the component
214: * @param fileName - component file name
215: */
216: void addComponent(String componentName, String fileName,
217: Calendar timestamp) throws RegistryException;
218:
219: /**
220: * Add a service assembly to the domain.
221: *
222: * @param saName - service assembly name
223: * @param fileName - service assembly archive name
224: * @throws RegistryException on errors
225: */
226: public void addServiceAssembly(String saName, String fileName,
227: Calendar timestamp) throws RegistryException;
228:
229: /*--------------------------------------------------------------------------------*\
230: * Operations to update entries *
231: \*--------------------------------------------------------------------------------*/
232:
233: /**
234: * Set the state of a component for the target at runtime.
235: *
236: * @param componentName - component name
237: * @param state - the state to set.
238: * @throws RegistryException on errors
239: */
240: void setComponentState(ComponentState state, String componentName)
241: throws RegistryException;
242:
243: /**
244: * Set the state of a component in a server/cluster.
245: *
246: * @param targetName - either the server-name or cluster-name
247: * @param componentName - component name
248: * @param state - the state to set.
249: * @throws RegistryException on errors
250: */
251: void setComponentState(String targetName, ComponentState state,
252: String componentName) throws RegistryException;
253:
254: /**
255: * Set the properties of a component in a server/cluster.
256: *
257: * @param targetName - either the server-name or cluster-name, this operation is
258: * a no-op when target = domain.
259: * @param componentName - component name
260: * @param props - the properties to set.
261: * @throws RegistryException on errors
262: */
263: void setComponentProperties(String targetName,
264: Map<String, String> state, String componentName)
265: throws RegistryException;
266:
267: /**
268: * Set the state of a ServiceUnit for the runtime target.
269: *
270: * @param componentName - component name
271: * @param suName - service unit name
272: * @param state - the state to set.
273: * @throws RegistryException on errors
274: */
275: void setServiceUnitState(ServiceUnitState state,
276: String componentName, String suName)
277: throws RegistryException;
278:
279: /**
280: * Set the state of a ServiceUnit in a server / cluster.
281: *
282: * @param targetName - either the value 'domain', 'server' or the
283: * server-name or cluster-name.
284: * @param componentName - component name
285: * @param suName - service unit name
286: * @param state - the state to set.
287: * @throws RegistryException on errors
288: */
289: void setServiceUnitState(String targetName, ServiceUnitState state,
290: String componentName, String suName)
291: throws RegistryException;
292:
293: /**
294: * Set the state of a ServiceAssembly for the runtime target.
295: *
296: * @param state - the state to set.
297: * @param saName - the service assembly name
298: * @throws RegistryException on errors
299: */
300: void setServiceAssemblyState(ServiceAssemblyState state,
301: String saName) throws RegistryException;
302:
303: /**
304: * Set the state of a ServiceAssembly in a server / cluster.
305: *
306: * @param targetName - either the value 'domain', 'server' or the
307: * server-name or cluster-name.
308: * @param saName - service assembly name
309: * @param state - the state to set.
310: * @throws RegistryException on errors
311: */
312: void setServiceAssemblyState(String targetName,
313: ServiceAssemblyState state, String saName)
314: throws RegistryException;
315:
316: /**
317: * Add a ServiceUnit to a Component for the runtime target
318: *
319: * @param suInfo - ServiceUnitInfo
320: * @param componentName - component name
321: * @throws RegistryException on errors
322: */
323: void addServiceUnitToComponent(String componentName,
324: ServiceUnitInfo suInfo) throws RegistryException;
325:
326: /**
327: * Add a ServiceUnit to a Component
328: *
329: * @param suInfo - ServiceUnitInfo
330: * @param targetName - either the value 'domain', 'server' or the
331: * server-name or cluster-name.
332: * @param componentName - component name
333: * @throws RegistryException on errors
334: */
335: void addServiceUnitToComponent(String targetName,
336: String componentName, ServiceUnitInfo suInfo)
337: throws RegistryException;
338:
339: /**
340: * Remove a ServiceUnit from a Component for the runtime target
341: *
342: * @param suName - ServiceUnitInfo name
343: * @param componentName - component name
344: * @throws RegistryException on errors
345: */
346: void removeServiceUnitFromComponent(String componentName,
347: String suName) throws RegistryException;
348:
349: /**
350: * Remove a ServiceUnit from a Component
351: *
352: * @param suName - ServiceUnitInfo name
353: * @param targetName - the server-name or cluster-name.
354: * @param componentName - component name
355: * @throws RegistryException on errors
356: */
357: void removeServiceUnitFromComponent(String targetName,
358: String componentName, String suName)
359: throws RegistryException;
360:
361: /**
362: * Set the file name for the domain component.
363: *
364: * @param fileName - name of the component archive
365: * @param componentName - component name
366: */
367: void setComponentFileName(String fileName, String componentName)
368: throws RegistryException;
369:
370: /**
371: * Set the file name for the domain shared library.
372: *
373: * @param fileName - name of the shared library archive
374: * @param slName - shared library name
375: */
376: void setSharedLibraryFileName(String fileName, String slName)
377: throws RegistryException;
378:
379: /**
380: * Set the file name for the domain service assembly.
381: *
382: * @param fileName - name of the service assembly archive
383: * @param saName - service assembly name
384: */
385: void setServiceAssemblyFileName(String fileName, String saName)
386: throws RegistryException;
387:
388: /*--------------------------------------------------------------------------------*\
389: * Set runtime configuration attributes *
390: \*--------------------------------------------------------------------------------*/
391:
392: /**
393: * Set the value of a configuration attribute belonging to the
394: * specified category, for the runtime target.
395: *
396: * @param type - configuration category
397: * @param name - identification for the attribute
398: * @param value - string representation of the attribute value
399: * @exception RegistryException on errors in getting the attribute value
400: */
401: void setAttribute(ConfigurationCategory type, String name,
402: String value) throws RegistryException;
403:
404: /**
405: * Get the value of a configuration attribute belonging to the
406: * specified category, for the runtime target.
407: *
408: * @param targetName - target instance/cluster name.
409: * @param type - configuration category
410: * @param name - identification for the attribute
411: * @param value - string representation of the attribute value
412: * @exception RegistryException on errors in getting the attribute value
413: */
414: void setAttribute(String targetName, ConfigurationCategory type,
415: String name, String value) throws RegistryException;
416:
417: /**
418: * Delete the named attribute from the category if it exists, for the implicit target.
419: * The attribute is deleted only if it is overriden for the target, if target is "domain"
420: * the attribute is not deleted.
421: *
422: * @param type - configuration category
423: * @param name - identification for the attribute
424: * @exception RegistryException on errors in getting the attribute value
425: */
426: void deleteAttribute(ConfigurationCategory type, String name)
427: throws RegistryException;
428:
429: /**
430: * Delete the named attribute from the category if it exists.
431: * The attribute is deleted only if it is overriden for the target, if target is "domain"
432: * the attribute is not deleted.
433: *
434: * @param targetName - target instance/cluster name.
435: * @param type - configuration category
436: * @param name - identification for the attribute
437: * @exception RegistryException on errors in getting the attribute value
438: */
439: void deleteAttribute(String targetName, ConfigurationCategory type,
440: String name) throws RegistryException;
441:
442: /**
443: * This method is used to set the upgrade-number attribute in the domain
444: * level entry for a component
445: * @param componentName the component name
446: * @param upgradeNumber the upgrade number
447: * @throws RegistryException if the upgrade number could not be set
448: */
449: void setComponentUpgradeNumber(String componentName,
450: java.math.BigInteger upgradeNumber)
451: throws RegistryException;
452:
453: /*--------------------------------------------------------------------------------*\
454: * Component configuration ops *
455: \*--------------------------------------------------------------------------------*/
456:
457: /*--------------------------------------------------------------------------------*\
458: * Set static component configuration *
459: \*--------------------------------------------------------------------------------*/
460: /**
461: * Set the value of a configuration attribute for a component installed on a target
462: * for the runtime target.
463: * @param name - identification for the attribute
464: * @param value - string representation of the attribute value
465: * @param componentName - identification for the component
466: * @exception RegistryException on errors in setting the attribute value
467: */
468: void setComponentAttribute(String componentName, String name,
469: String value) throws RegistryException;
470:
471: /**
472: * Set the value of a configuration attribute for a component installed on a target,
473: *
474: * @param targetName - target instance/cluster name.
475: * @param name - identification for the attribute
476: * @param value - string representation of the attribute value
477: * @param componentName - identification for the component
478: * @exception RegistryException on errors in setting the attribute value
479: */
480: void setComponentAttribute(String componentName, String targetName,
481: String name, String value) throws RegistryException;
482:
483: /**
484: * Set the value of a configuration attribute for a component installed on a target
485: * for the runtime target.
486: * @param props - properties to set
487: * @param componentName - identification for the component
488: * @exception RegistryException on errors in setting the attribute value
489: */
490: void setComponentAttributes(String componentName, Properties props)
491: throws RegistryException;
492:
493: /**
494: * Set the value of a configuration attribute for a component installed on a target,
495: *
496: * @param targetName - target instance/cluster name.
497: * @param props - properties to set
498: * @param componentName - identification for the component
499: * @exception RegistryException on errors in setting the attribute value
500: */
501: void setComponentAttributes(String componentName,
502: String targetName, Properties props)
503: throws RegistryException;
504:
505: /*--------------------------------------------------------------------------------*\
506: * Set/Add/Delete application variables *
507: \*--------------------------------------------------------------------------------*/
508: /**
509: * Add a set of application variables to the registry for the runtime target.
510: *
511: * @param appVars - list of application variables to be added to the registry
512: * @exception RegistryException on errors in adding the application variables.
513: */
514: void addComponentApplicationVariables(String componentName,
515: com.sun.jbi.management.ComponentInfo.Variable[] appVars)
516: throws RegistryException;
517:
518: /**
519: * Add a set of application variables to the registry for the specified target.
520: *
521: * @param appVars - list of application variables to be added to the registry
522: * @param targetName - target to be updated
523: * @exception RegistryException on errors in adding the application variables.
524: */
525: void addComponentApplicationVariables(String componentName,
526: String targetName,
527: com.sun.jbi.management.ComponentInfo.Variable[] appVars)
528: throws RegistryException;
529:
530: /**
531: * Update a set of application variables to the registry for the runtime target.
532: *
533: * @param appVars - list of application variables to be updated
534: * @exception RegistryException on errors in updating the application variables.
535: */
536: void updateComponentApplicationVariables(String componentName,
537: com.sun.jbi.management.ComponentInfo.Variable[] appVars)
538: throws RegistryException;
539:
540: /**
541: * Updated a set of application variables to the registry for the specified target.
542: *
543: * @param appVars - list of application variables to be updated
544: * @param targetName - target to be updated
545: * @exception RegistryException on errors in updating the application variables.
546: */
547: void updateComponentApplicationVariables(String componentName,
548: String targetName,
549: com.sun.jbi.management.ComponentInfo.Variable[] appVars)
550: throws RegistryException;
551:
552: /**
553: * Delete a set of application variables from the registry for the runtime target.
554: *
555: * @param appVars - list of application variables to be deleted from the registry
556: * @param names - the names of the variables to be deleted.
557: * @exception RegistryException on errors in deleting the application variables.
558: */
559: void deleteComponentApplicationVariables(String componentName,
560: String[] names) throws RegistryException;
561:
562: /**
563: * Add a set of application variables to the registry for the specified target.
564: *
565: * @param appVars - list of application variables to be deleted from the registry
566: * @param targetName - target to be updated
567: * @param names - the names of the variables to be deleted.
568: * @exception RegistryException on errors in deleting the application variables.
569: */
570: void deleteComponentApplicationVariables(String componentName,
571: String targetName, String[] names) throws RegistryException;
572:
573: /*--------------------------------------------------------------------------------*\
574: * Set/Add/Delete Named Configurations *
575: \*--------------------------------------------------------------------------------*/
576: /**
577: * Add a named application configuration to the registry for the component for the
578: * implicit runtime target.
579: *
580: * @param componentName
581: * component identification
582: * @param appConfig
583: * named application configuration represented as properties
584: * @exception RegistryException on errors in adding the application configuration.
585: */
586: void addComponentApplicationConfiguration(String componentName,
587: Properties appConfig) throws RegistryException;
588:
589: /**
590: * Add a named application configuration to the registry for the component for the
591: * specified runtime target.
592: *
593: * @param componentName
594: * component identification
595: * @param appConfig
596: * named application configuration represented as properties
597: * @param targetName
598: * target name
599: * @exception RegistryException on errors in adding the application configuration.
600: */
601: void addComponentApplicationConfiguration(String componentName,
602: String targetName, Properties appConfig)
603: throws RegistryException;
604:
605: /**
606: * Update a named application configuration set on a component
607: * for the implicit runtime target.
608: *
609: * @param componentName
610: * component identification
611: * @param appConfig
612: * named application configuration represented as properties
613: * @exception RegistryException on errors in updating the application configuration.
614: */
615: void updateComponentApplicationConfiguration(String componentName,
616: Properties appConfig) throws RegistryException;
617:
618: /**
619: * Update a named application configuration set on a component
620: * for the specified runtime target.
621: *
622: * @param componentName
623: * component identification
624: * @param appConfig
625: * named application configuration represented as properties
626: * @param targetName
627: * target name
628: * @exception RegistryException on errors in updating the application configuration.
629: */
630: void updateComponentApplicationConfiguration(String componentName,
631: String targetName, Properties appConfig)
632: throws RegistryException;
633:
634: /**
635: * Delete a named application configuration
636: *
637: * @param appConfigName
638: * name of the application configuration to delete.
639: * @param componentName
640: * component identification
641: * @exception RegistryException on errors in deleting the application configuration.
642: */
643: void deleteComponentApplicationConfiguration(String componentName,
644: String appConfigName) throws RegistryException;
645:
646: /**
647: * Delete a named application configuration
648: *
649: * @param componentName
650: * component identification
651: * @param targetName
652: * target name
653: * @param appConfigName
654: * the name of the configuration to be deleted.
655: * @exception RegistryException on errors in deleting the application configuration.
656: */
657: void deleteComponentApplicationConfiguration(String componentName,
658: String targetName, String appConfigName)
659: throws RegistryException;
660: }
|