0001: /*
0002: * BEGIN_HEADER - DO NOT EDIT
0003: *
0004: * The contents of this file are subject to the terms
0005: * of the Common Development and Distribution License
0006: * (the "License"). You may not use this file except
0007: * in compliance with the License.
0008: *
0009: * You can obtain a copy of the license at
0010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
0011: * See the License for the specific language governing
0012: * permissions and limitations under the License.
0013: *
0014: * When distributing Covered Code, include this CDDL
0015: * HEADER in each file and include the License file at
0016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
0017: * If applicable add the following below this CDDL HEADER,
0018: * with the fields enclosed by brackets "[]" replaced with
0019: * your own identifying information: Portions Copyright
0020: * [year] [name of copyright owner]
0021: */
0022:
0023: /*
0024: * @(#)InstallationServiceImpl.java
0025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
0026: *
0027: * END_HEADER - DO NOT EDIT
0028: */
0029: package com.sun.esb.management.impl.installation;
0030:
0031: import java.io.Serializable;
0032: import java.util.Map;
0033: import java.util.Properties;
0034:
0035: import javax.management.MBeanServerConnection;
0036: import javax.management.ObjectName;
0037:
0038: import com.sun.esb.management.api.installation.InstallationService;
0039: import com.sun.esb.management.base.services.BaseServiceImpl;
0040: import com.sun.esb.management.common.ManagementRemoteException;
0041:
0042: /**
0043: * Defines client operations for common installation services for the client.
0044: *
0045: * @author graj
0046: */
0047: public class InstallationServiceImpl extends BaseServiceImpl implements
0048: Serializable, InstallationService {
0049:
0050: static final long serialVersionUID = -1L;
0051:
0052: /** Constructor - Constructs a new instance of InstallationServiceImpl */
0053: public InstallationServiceImpl() {
0054: super (null, false);
0055: }
0056:
0057: /**
0058: * Constructor - Constructs a new instance of InstallationServiceImpl
0059: *
0060: * @param serverConnection
0061: */
0062: public InstallationServiceImpl(
0063: MBeanServerConnection serverConnection) {
0064: super (serverConnection, false);
0065: }
0066:
0067: /**
0068: * Constructor - Constructs a new instance of InstallationServiceImpl
0069: *
0070: * @param serverConnection
0071: * @param isRemoteConnection
0072: */
0073: public InstallationServiceImpl(
0074: MBeanServerConnection serverConnection,
0075: boolean isRemoteConnection) {
0076: super (serverConnection, isRemoteConnection);
0077: }
0078:
0079: /**
0080: * installs component (service engine, binding component)
0081: *
0082: * @param paramProps
0083: * Properties object contains name/value pair.
0084: * @param zipFilePath
0085: * archive file in a zip format
0086: * @param targetName
0087: * name of the target for this operation
0088: * @return The name of the component if successful
0089: * @throws ManagementRemoteException
0090: * on error
0091: *
0092: * @see com.sun.esb.management.api.installation.InstallationService#installComponent(java.lang.String, java.util.Properties, java.lang.String)
0093: */
0094: public String installComponent(String zipFilePath,
0095: Properties paramProps, String targetName)
0096: throws ManagementRemoteException {
0097: ObjectName mbeanName = this
0098: .getInstallationServiceMBeanObjectName();
0099: Object resultObject = null;
0100:
0101: if (this .isRemoteConnection() == true) {
0102: zipFilePath = uploadFile(zipFilePath);
0103: }
0104:
0105: Object[] params = new Object[3];
0106: params[0] = zipFilePath;
0107: params[1] = paramProps;
0108: params[2] = targetName;
0109:
0110: String[] signature = new String[3];
0111: signature[0] = "java.lang.String";
0112: signature[1] = "java.util.Properties";
0113: signature[2] = "java.lang.String";
0114:
0115: resultObject = this .invokeMBeanOperation(mbeanName,
0116: "installComponent", params, signature);
0117:
0118: this .removeUploadedFile(); // if uploaded
0119:
0120: return resultObject.toString();
0121: }
0122:
0123: /**
0124: * installs component (service engine, binding component)
0125: *
0126: * @param zipFilePath
0127: * archive file in a zip format
0128: * @param targetName
0129: * name of the target for this operation
0130: * @return The name of the component if successful
0131: * @throws ManagementRemoteException
0132: * on error
0133: *
0134: * @see com.sun.esb.management.api.installation.InstallationService#installComponent(java.lang.String, java.lang.String)
0135: */
0136: public String installComponent(String zipFilePath, String targetName)
0137: throws ManagementRemoteException {
0138: return this .installComponent(zipFilePath, new Properties(),
0139: targetName);
0140: }
0141:
0142: /**
0143: * installs component ( service engine, binding component)
0144: *
0145: * @param paramProps
0146: * Properties object contains name/value pair.
0147: * @param zipFilePath
0148: * archive file in a zip format
0149: * @param targetNames
0150: * @return name of the component as map of [targetName,string].
0151: * @throws ManagementRemoteException
0152: * on error *
0153: * @see com.sun.esb.management.api.installation.InstallationService#installComponent(java.lang.String, java.util.Properties, java.lang.String[])
0154: */
0155: @SuppressWarnings("unchecked")
0156: public Map<String, String> installComponent(String zipFilePath,
0157: Properties paramProps, String[] targetNames)
0158: throws ManagementRemoteException {
0159: Map<String, String> resultObject = null;
0160: ObjectName mbeanName = this
0161: .getInstallationServiceMBeanObjectName();
0162:
0163: Object[] params = new Object[3];
0164: params[0] = zipFilePath;
0165: params[1] = paramProps;
0166: params[2] = targetNames;
0167:
0168: String[] signature = new String[3];
0169: signature[0] = "java.lang.String";
0170: signature[1] = "java.util.Properties";
0171: signature[2] = targetNames.getClass().getName();
0172:
0173: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0174: mbeanName, "installComponent", params, signature);
0175: return resultObject;
0176: }
0177:
0178: /**
0179: * installs shared library
0180: *
0181: * @param zipFilePath
0182: * archive file in a zip format
0183: * @param targetNames
0184: * @return shared library name as map of [targetName,string].
0185: * @throws ManagementRemoteException
0186: * on error
0187: *
0188: * @see com.sun.esb.management.api.installation.InstallationService#installComponent(java.lang.String, java.lang.String[])
0189: */
0190: public Map<String, String> installComponent(String zipFilePath,
0191: String[] targetNames) throws ManagementRemoteException {
0192: return installComponent(zipFilePath, new Properties(),
0193: targetNames);
0194: }
0195:
0196: /**
0197: * installs component (service engine, binding component) from the domain
0198: * target
0199: *
0200: * @param componentName
0201: * name of the component.
0202: * @param component
0203: * configuration properties
0204: * @param targetName
0205: * name of the target for this operation
0206: * @return The name of the component if successful
0207: * @throws ManagementRemoteException
0208: * on error
0209: *
0210: * @see com.sun.esb.management.api.installation.InstallationService#installComponentFromDomain(java.lang.String, java.util.Properties, java.lang.String)
0211: */
0212: public String installComponentFromDomain(String componentName,
0213: Properties properties, String targetName)
0214: throws ManagementRemoteException {
0215: ObjectName mbeanName = this
0216: .getInstallationServiceMBeanObjectName();
0217: Object resultObject = null;
0218:
0219: Object[] params = new Object[3];
0220: params[0] = componentName;
0221: params[1] = properties;
0222: params[2] = targetName;
0223:
0224: String[] signature = new String[3];
0225: signature[0] = "java.lang.String";
0226: signature[1] = "java.util.Properties";
0227: signature[2] = "java.lang.String";
0228:
0229: resultObject = this .invokeMBeanOperation(mbeanName,
0230: "installComponentFromDomain", params, signature);
0231:
0232: return resultObject.toString();
0233: }
0234:
0235: /**
0236: * installs component (service engine, binding component) from the domain
0237: * target
0238: *
0239: * @param componentName
0240: * name of the component.
0241: * @param targetName
0242: * name of the target for this operation
0243: * @return The name of the component if successful
0244: * @throws ManagementRemoteException
0245: * on error
0246: *
0247: * @see com.sun.esb.management.api.installation.InstallationService#installComponentFromDomain(java.lang.String, java.lang.String)
0248: */
0249: public String installComponentFromDomain(String componentName,
0250: String targetName) throws ManagementRemoteException {
0251: ObjectName mbeanName = this
0252: .getInstallationServiceMBeanObjectName();
0253: Object resultObject = null;
0254:
0255: Object[] params = new Object[2];
0256: params[0] = componentName;
0257: params[1] = targetName;
0258:
0259: String[] signature = new String[2];
0260: signature[0] = "java.lang.String";
0261: signature[1] = "java.lang.String";
0262:
0263: resultObject = this .invokeMBeanOperation(mbeanName,
0264: "installComponentFromDomain", params, signature);
0265:
0266: return resultObject.toString();
0267: }
0268:
0269: /**
0270: * installs component from Domain( service engine, binding component)
0271: *
0272: * @param componentName
0273: * name of the component
0274: * @param targetNames
0275: * array of targets for this operation
0276: * @return Map of targetName and component name strings.
0277: * @throws ManagementRemoteException
0278: * on error
0279: *
0280: * @see com.sun.esb.management.api.installation.InstallationService#installComponentFromDomain(java.lang.String, java.lang.String[])
0281: */
0282: @SuppressWarnings("unchecked")
0283: public Map<String, String> installComponentFromDomain(
0284: String componentName, String[] targetNames)
0285: throws ManagementRemoteException {
0286: ObjectName mbeanName = this
0287: .getInstallationServiceMBeanObjectName();
0288: Map<String, String> resultObject = null;
0289:
0290: Object[] params = new Object[2];
0291: params[0] = componentName;
0292: params[1] = targetNames;
0293:
0294: String[] signature = new String[2];
0295: signature[0] = "java.lang.String";
0296: signature[1] = targetNames.getClass().getName();
0297:
0298: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0299: mbeanName, "installComponentFromDomain", params,
0300: signature);
0301: return resultObject;
0302: }
0303:
0304: /**
0305: * installs component from Domain( service engine, binding component)
0306: *
0307: * @param componentName
0308: * name of the component
0309: * @param properties
0310: * configuration properties
0311: * @param targetNames
0312: * array of targets for this operation
0313: * @return Map of targetName and component name strings.
0314: * @throws ManagementRemoteException
0315: * on error
0316: *
0317: * @see com.sun.esb.management.api.installation.InstallationService#installComponentFromDomain(java.lang.String, java.util.Properties, java.lang.String[])
0318: */
0319: @SuppressWarnings("unchecked")
0320: public Map<String, String> installComponentFromDomain(
0321: String componentName, Properties properties,
0322: String[] targetNames) throws ManagementRemoteException {
0323: ObjectName mbeanName = this
0324: .getInstallationServiceMBeanObjectName();
0325: Map<String, String> resultObject = null;
0326:
0327: Object[] params = new Object[3];
0328: params[0] = componentName;
0329: params[1] = properties;
0330: params[2] = targetNames;
0331:
0332: String[] signature = new String[3];
0333: signature[0] = "java.lang.String";
0334: signature[1] = "java.util.Properties";
0335: signature[2] = targetNames.getClass().getName();
0336:
0337: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0338: mbeanName, "installComponentFromDomain", params,
0339: signature);
0340: return resultObject;
0341: }
0342:
0343: /**
0344: * installs shared library
0345: *
0346: * @param zipFilePath
0347: * archive file in a zip format
0348: * @param targetName
0349: * name of the target for this operation
0350: * @return shared library name string.
0351: * @throws ManagementRemoteException
0352: * on error
0353: *
0354: * @see com.sun.esb.management.api.installation.InstallationService#installSharedLibrary(java.lang.String, java.lang.String)
0355: */
0356: public String installSharedLibrary(String zipFilePath,
0357: String targetName) throws ManagementRemoteException {
0358: ObjectName mbeanName = this
0359: .getInstallationServiceMBeanObjectName();
0360: Object resultObject = null;
0361:
0362: if (this .isRemoteConnection() == true) {
0363: zipFilePath = uploadFile(zipFilePath);
0364: }
0365:
0366: Object[] params = new Object[2];
0367: params[0] = zipFilePath;
0368: params[1] = targetName;
0369:
0370: String[] signature = new String[2];
0371: signature[0] = "java.lang.String";
0372: signature[1] = "java.lang.String";
0373:
0374: resultObject = this .invokeMBeanOperation(mbeanName,
0375: "installSharedLibrary", params, signature);
0376:
0377: this .removeUploadedFile(); // if uploaded
0378:
0379: return resultObject.toString();
0380: }
0381:
0382: /**
0383: * installs shared library
0384: *
0385: * @param zipFilePath
0386: * archive file in a zip format
0387: * @param targetNames
0388: * @return shared library name as map of [targetName,string].
0389: * @throws ManagementRemoteException
0390: * on error
0391: *
0392: * @see com.sun.esb.management.api.installation.InstallationService#installSharedLibrary(java.lang.String, java.lang.String[])
0393: */
0394: @SuppressWarnings("unchecked")
0395: public Map<String, String> installSharedLibrary(String zipFilePath,
0396: String[] targetNames) throws ManagementRemoteException {
0397: ObjectName mbeanName = this
0398: .getInstallationServiceMBeanObjectName();
0399: Map<String, String> resultObject = null;
0400: Object[] params = new Object[2];
0401: params[0] = zipFilePath;
0402: params[1] = targetNames;
0403:
0404: String[] signature = new String[2];
0405: signature[0] = "java.lang.String";
0406: signature[1] = targetNames.getClass().getName();
0407:
0408: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0409: mbeanName, "installSharedLibrary", params, signature);
0410:
0411: return resultObject;
0412: }
0413:
0414: /**
0415: * installs shared library from domain target
0416: *
0417: * @param libraryName
0418: * Shared Library Name
0419: * @param targetName
0420: * name of the target for this operation
0421: * @return shared library name string.
0422: * @throws ManagementRemoteException
0423: * on error
0424: *
0425: * @see com.sun.esb.management.api.installation.InstallationService#installSharedLibraryFromDomain(java.lang.String, java.lang.String)
0426: */
0427: public String installSharedLibraryFromDomain(String libraryName,
0428: String targetName) throws ManagementRemoteException {
0429: ObjectName mbeanName = this
0430: .getInstallationServiceMBeanObjectName();
0431: Object resultObject = null;
0432:
0433: Object[] params = new Object[2];
0434: params[0] = libraryName;
0435: params[1] = targetName;
0436:
0437: String[] signature = new String[2];
0438: signature[0] = "java.lang.String";
0439: signature[1] = "java.lang.String";
0440:
0441: resultObject = this .invokeMBeanOperation(mbeanName,
0442: "installSharedLibraryFromDomain", params, signature);
0443:
0444: return resultObject.toString();
0445: }
0446:
0447: /**
0448: * installs shared library
0449: *
0450: * @param libraryName
0451: * name of the library
0452: * @param targetName
0453: * name of the target for this operation
0454: * @return Map of targetName and shared library name strings.
0455: * @throws ManagementRemoteException
0456: * on error
0457: *
0458: * @see com.sun.esb.management.api.installation.InstallationService#installSharedLibraryFromDomain(java.lang.String, java.lang.String[])
0459: */
0460: @SuppressWarnings("unchecked")
0461: public Map<String, String> installSharedLibraryFromDomain(
0462: String libraryName, String[] targetNames)
0463: throws ManagementRemoteException {
0464: ObjectName mbeanName = this
0465: .getInstallationServiceMBeanObjectName();
0466: Map<String, String> resultObject = null;
0467:
0468: Object[] params = new Object[2];
0469: params[0] = libraryName;
0470: params[1] = targetNames;
0471:
0472: String[] signature = new String[2];
0473: signature[0] = "java.lang.String";
0474: signature[1] = targetNames.getClass().getName();
0475:
0476: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0477: mbeanName, "installSharedLibraryFromDomain", params,
0478: signature);
0479: return resultObject;
0480: }
0481:
0482: /**
0483: * uninstalls component (service engine, binding component) with option to
0484: * retain in domain target and option to forcibly remove from specified
0485: * target
0486: *
0487: * @param componentName
0488: * name of the component
0489: * @param forceDelete
0490: * true to delete, false to not
0491: * @param retainInDomain
0492: * true to not delete it from the domain target, false to also
0493: * delete it from the domain target.
0494: * @param targetName
0495: * name of the target for this operation
0496: * @return The name of the component if successful
0497: * @throws ManagementRemoteException
0498: * on error
0499: *
0500: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, boolean, boolean, java.lang.String)
0501: */
0502: public String uninstallComponent(String componentName,
0503: boolean forceDelete, boolean retainInDomain,
0504: String targetName) throws ManagementRemoteException {
0505: ObjectName mbeanName = this
0506: .getInstallationServiceMBeanObjectName();
0507: Object resultObject = null;
0508:
0509: Object[] params = new Object[4];
0510: params[0] = componentName;
0511: params[1] = Boolean.valueOf(forceDelete);
0512: params[2] = Boolean.valueOf(retainInDomain);
0513: params[3] = targetName;
0514:
0515: String[] signature = new String[4];
0516: signature[0] = "java.lang.String";
0517: signature[1] = "boolean";
0518: signature[2] = "boolean";
0519: signature[3] = "java.lang.String";
0520:
0521: resultObject = this .invokeMBeanOperation(mbeanName,
0522: "uninstallComponent", params, signature);
0523:
0524: return resultObject.toString();
0525: }
0526:
0527: /**
0528: * uninstalls component (service engine, binding component) with forcibly
0529: * remove option
0530: *
0531: * @param componentName
0532: * name of the component
0533: * @param forceDelete
0534: * true to delete, false to not
0535: * @param targetName
0536: * name of the target for this operation
0537: * @return The name of the component if successful
0538: * @throws ManagementRemoteException
0539: * on error
0540: *
0541: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, boolean, java.lang.String)
0542: */
0543: public String uninstallComponent(String componentName,
0544: boolean forceDelete, String targetName)
0545: throws ManagementRemoteException {
0546: ObjectName mbeanName = this
0547: .getInstallationServiceMBeanObjectName();
0548: Object resultObject = null;
0549:
0550: Object[] params = new Object[3];
0551: params[0] = componentName;
0552: params[1] = Boolean.valueOf(forceDelete);
0553: params[2] = targetName;
0554:
0555: String[] signature = new String[3];
0556: signature[0] = "java.lang.String";
0557: signature[1] = "boolean";
0558: signature[2] = "java.lang.String";
0559:
0560: resultObject = this .invokeMBeanOperation(mbeanName,
0561: "uninstallComponent", params, signature);
0562:
0563: return resultObject.toString();
0564: }
0565:
0566: /**
0567: * uninstalls component (service engine, binding component)
0568: *
0569: * @param componentName
0570: * name of the component
0571: * @param targetName
0572: * name of the target for this operation
0573: * @return The name of the component if successful
0574: * @throws ManagementRemoteException
0575: * on error
0576: *
0577: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, java.lang.String)
0578: */
0579: public String uninstallComponent(String componentName,
0580: String targetName) throws ManagementRemoteException {
0581: ObjectName mbeanName = this
0582: .getInstallationServiceMBeanObjectName();
0583: Object resultObject = null;
0584:
0585: Object[] params = new Object[2];
0586: params[0] = componentName;
0587: params[1] = targetName;
0588:
0589: String[] signature = new String[2];
0590: signature[0] = "java.lang.String";
0591: signature[1] = "java.lang.String";
0592:
0593: resultObject = this .invokeMBeanOperation(mbeanName,
0594: "uninstallComponent", params, signature);
0595:
0596: return resultObject.toString();
0597: }
0598:
0599: /**
0600: * uninstalls component ( service engine, binding component)
0601: *
0602: * @param componentName
0603: * name of the component
0604: * @param targetNames
0605: * @return name of the component as [targetName, String] map.
0606: * @throws ManagementRemoteException
0607: * on error
0608: *
0609: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, java.lang.String[])
0610: */
0611: @SuppressWarnings("unchecked")
0612: public Map<String, String> uninstallComponent(String componentName,
0613: String[] targetNames) throws ManagementRemoteException {
0614: ObjectName mbeanName = this
0615: .getInstallationServiceMBeanObjectName();
0616: Map<String, String> resultObject = null;
0617:
0618: Object[] params = new Object[2];
0619: params[0] = componentName;
0620: params[1] = targetNames;
0621:
0622: String[] signature = new String[2];
0623: signature[0] = "java.lang.String";
0624: signature[1] = targetNames.getClass().getName();
0625:
0626: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0627: mbeanName, "uninstallComponent", params, signature);
0628:
0629: return resultObject;
0630: }
0631:
0632: /**
0633: * uninstalls component ( service engine, binding component)
0634: *
0635: * @param componentName
0636: * name of the component
0637: * @param forceDelete
0638: * true to delete, false to not
0639: * @param targetName
0640: * name of the target for this operation
0641: * @return Map of targetName and component name strings.
0642: * @throws ManagementRemoteException
0643: * on error
0644: *
0645: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, boolean, java.lang.String[])
0646: */
0647: @SuppressWarnings("unchecked")
0648: public Map<String, String> uninstallComponent(String componentName,
0649: boolean forceDelete, String[] targetNames)
0650: throws ManagementRemoteException {
0651: ObjectName mbeanName = this
0652: .getInstallationServiceMBeanObjectName();
0653: Map<String, String> resultObject = null;
0654:
0655: Object[] params = new Object[3];
0656: params[0] = componentName;
0657: params[1] = forceDelete;
0658: params[2] = targetNames;
0659:
0660: String[] signature = new String[3];
0661: signature[0] = "java.lang.String";
0662: signature[1] = "boolean";
0663: signature[2] = targetNames.getClass().getName();
0664:
0665: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0666: mbeanName, "uninstallComponent", params, signature);
0667: return resultObject;
0668: }
0669:
0670: /**
0671: * uninstalls component ( service engine, binding component)
0672: *
0673: * @param componentName
0674: * name of the component
0675: * @param forceDelete
0676: * true to delete, false to not
0677: * @param retainInDomain
0678: * true to not delete it from the domain target, false to also
0679: * delete it from the domain target.
0680: * @param targetNames
0681: * array of targets for this operation
0682: * @return Map of targetName and component name strings.
0683: * @throws ManagementRemoteException
0684: * on error
0685: *
0686: * @see com.sun.esb.management.api.installation.InstallationService#uninstallComponent(java.lang.String, boolean, boolean, java.lang.String[])
0687: */
0688: @SuppressWarnings("unchecked")
0689: public Map<String, String> uninstallComponent(String componentName,
0690: boolean forceDelete, boolean retainInDomain,
0691: String[] targetNames) throws ManagementRemoteException {
0692: ObjectName mbeanName = this
0693: .getInstallationServiceMBeanObjectName();
0694: Map<String, String> resultObject = null;
0695:
0696: Object[] params = new Object[4];
0697: params[0] = componentName;
0698: params[1] = forceDelete;
0699: params[2] = retainInDomain;
0700: params[3] = targetNames;
0701:
0702: String[] signature = new String[4];
0703: signature[0] = "java.lang.String";
0704: signature[1] = "boolean";
0705: signature[2] = "boolean";
0706: signature[3] = targetNames.getClass().getName();
0707:
0708: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0709: mbeanName, "uninstallComponent", params, signature);
0710: return resultObject;
0711: }
0712:
0713: /**
0714: * uninstalls shared library with option to retain in domain target and
0715: * option to forcibly remove from specified target
0716: *
0717: * @param sharedLibraryName
0718: * name of the shared library
0719: * @param forceDelete
0720: * true to delete, false to not
0721: * @param retainInDomain
0722: * true to not delete it from the domain target, false to also
0723: * delete it from the domain target.
0724: * @param targetName
0725: * name of the target for this operation
0726: * @return shared library name string.
0727: * @throws ManagementRemoteException
0728: * on error
0729: *
0730: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, boolean, boolean, java.lang.String)
0731: */
0732: public String uninstallSharedLibrary(String sharedLibraryName,
0733: boolean forceDelete, boolean retainInDomain,
0734: String targetName) throws ManagementRemoteException {
0735: ObjectName mbeanName = this
0736: .getInstallationServiceMBeanObjectName();
0737: Object resultObject = null;
0738:
0739: Object[] params = new Object[4];
0740: params[0] = sharedLibraryName;
0741: params[1] = Boolean.valueOf(forceDelete);
0742: params[2] = Boolean.valueOf(retainInDomain);
0743: params[3] = targetName;
0744:
0745: String[] signature = new String[4];
0746: signature[0] = "java.lang.String";
0747: signature[1] = "boolean";
0748: signature[2] = "boolean";
0749: signature[3] = "java.lang.String";
0750:
0751: resultObject = this .invokeMBeanOperation(mbeanName,
0752: "uninstallSharedLibrary", params, signature);
0753:
0754: return resultObject.toString();
0755: }
0756:
0757: /**
0758: * uninstalls shared library with option to forcibly remove
0759: *
0760: * @param sharedLibraryName
0761: * name of the shared library
0762: * @param forceDelete
0763: * true to delete, false to not
0764: * @param targetName
0765: * name of the target for this operation
0766: * @return shared library name string.
0767: * @throws ManagementRemoteException
0768: * on error
0769: *
0770: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, boolean, java.lang.String)
0771: */
0772: public String uninstallSharedLibrary(String sharedLibraryName,
0773: boolean forceDelete, String targetName)
0774: throws ManagementRemoteException {
0775: ObjectName mbeanName = this
0776: .getInstallationServiceMBeanObjectName();
0777: Object resultObject = null;
0778:
0779: Object[] params = new Object[3];
0780: params[0] = sharedLibraryName;
0781: params[1] = Boolean.valueOf(forceDelete);
0782: params[2] = targetName;
0783:
0784: String[] signature = new String[3];
0785: signature[0] = "java.lang.String";
0786: signature[1] = "boolean";
0787: signature[2] = "java.lang.String";
0788:
0789: resultObject = this .invokeMBeanOperation(mbeanName,
0790: "uninstallSharedLibrary", params, signature);
0791:
0792: return resultObject.toString();
0793: }
0794:
0795: /**
0796: * uninstalls shared library
0797: *
0798: * @param sharedLibraryName
0799: * name of the shared library
0800: * @param targetName
0801: * name of the target for this operation
0802: * @return shared library name string.
0803: * @throws ManagementRemoteException
0804: * on error
0805: *
0806: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, java.lang.String)
0807: */
0808: public String uninstallSharedLibrary(String sharedLibraryName,
0809: String targetName) throws ManagementRemoteException {
0810: ObjectName mbeanName = this
0811: .getInstallationServiceMBeanObjectName();
0812: Object resultObject = null;
0813:
0814: Object[] params = new Object[2];
0815: params[0] = sharedLibraryName;
0816: params[1] = targetName;
0817:
0818: String[] signature = new String[2];
0819: signature[0] = "java.lang.String";
0820: signature[1] = "java.lang.String";
0821:
0822: resultObject = this .invokeMBeanOperation(mbeanName,
0823: "uninstallSharedLibrary", params, signature);
0824:
0825: return resultObject.toString();
0826: }
0827:
0828: /**
0829: * uninstalls shared library
0830: *
0831: * @param sharedLibraryName
0832: * name of the shared library
0833: * @param targetNames
0834: * @return shared library name as [targetName, string] map.
0835: * @throws ManagementRemoteException
0836: * on error
0837: *
0838: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, java.lang.String[])
0839: */
0840: @SuppressWarnings("unchecked")
0841: public Map<String, String> uninstallSharedLibrary(
0842: String sharedLibraryName, String[] targetNames)
0843: throws ManagementRemoteException {
0844: ObjectName mbeanName = this
0845: .getInstallationServiceMBeanObjectName();
0846: Map<String, String> resultObject = null;
0847:
0848: Object[] params = new Object[2];
0849: params[0] = sharedLibraryName;
0850: params[1] = targetNames;
0851:
0852: String[] signature = new String[2];
0853: signature[0] = "java.lang.String";
0854: signature[1] = targetNames.getClass().getName();
0855:
0856: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0857: mbeanName, "uninstallSharedLibrary", params, signature);
0858:
0859: return resultObject;
0860: }
0861:
0862: /**
0863: * uninstalls shared library
0864: *
0865: * @param sharedLibraryName
0866: * name of the shared library
0867: * @param forceDelete
0868: * true to delete, false to not
0869: * @param targetNames
0870: * list of names of targets for this operation
0871: * @return Map of targetName and shared library name strings.
0872: * @throws ManagementRemoteException
0873: * on error
0874: *
0875: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, boolean, java.lang.String[])
0876: */
0877: @SuppressWarnings("unchecked")
0878: public Map<String, String> uninstallSharedLibrary(
0879: String sharedLibraryName, boolean forceDelete,
0880: String[] targetNames) throws ManagementRemoteException {
0881: ObjectName mbeanName = this
0882: .getInstallationServiceMBeanObjectName();
0883: Map<String, String> resultObject = null;
0884:
0885: Object[] params = new Object[3];
0886: params[0] = sharedLibraryName;
0887: params[1] = forceDelete;
0888: params[2] = targetNames;
0889:
0890: String[] signature = new String[3];
0891: signature[0] = "java.lang.String";
0892: signature[1] = "boolean";
0893: signature[2] = targetNames.getClass().getName();
0894:
0895: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0896: mbeanName, "uninstallSharedLibrary", params, signature);
0897: return resultObject;
0898: }
0899:
0900: /**
0901: * uninstalls shared library
0902: *
0903: * @param sharedLibraryName
0904: * name of the shared library
0905: * @param forceDelete
0906: * true to delete, false to not
0907: * @param retainInDomain
0908: * true to not delete it from the domain target, false to also
0909: * delete it from the domain target.
0910: * @param targetNames
0911: * array of targets for this operation
0912: * @return Map of targetName and shared library name strings.
0913: * @throws ManagementRemoteException
0914: * on error
0915: *
0916: * @see com.sun.esb.management.api.installation.InstallationService#uninstallSharedLibrary(java.lang.String, boolean, boolean, java.lang.String[])
0917: */
0918: @SuppressWarnings("unchecked")
0919: public Map<String, String> uninstallSharedLibrary(
0920: String sharedLibraryName, boolean forceDelete,
0921: boolean retainInDomain, String[] targetNames)
0922: throws ManagementRemoteException {
0923: ObjectName mbeanName = this
0924: .getInstallationServiceMBeanObjectName();
0925: Map<String, String> resultObject = null;
0926:
0927: Object[] params = new Object[4];
0928: params[0] = sharedLibraryName;
0929: params[1] = forceDelete;
0930: params[2] = retainInDomain;
0931: params[3] = targetNames;
0932:
0933: String[] signature = new String[4];
0934: signature[0] = "java.lang.String";
0935: signature[1] = "boolean";
0936: signature[2] = "boolean";
0937: signature[3] = targetNames.getClass().getName();
0938:
0939: resultObject = (Map<String, String>) this .invokeMBeanOperation(
0940: mbeanName, "uninstallSharedLibrary", params, signature);
0941: return resultObject;
0942: }
0943:
0944: /**
0945: * upgrades component (service engine, binding component) Upgrades a
0946: * component in a way that actually involves the component. During the
0947: * upgrade processing, the component's implementation of the new upgrade SPI
0948: * will be invoked to give the component the opportunity to perform any
0949: * special processing necessary to complete the upgrade. Components which do
0950: * not provide an implementation of the upgrade SPI can still be updated
0951: * using the updateComponent API.
0952: *
0953: * Also, in the upgrade implementation, changes in the component's
0954: * installation descriptor will be allowed, with the exception of the
0955: * component name (for obvious reasons). This allows new shared library
0956: * dependencies, changes to the class names of the component's SPI
0957: * implementations, and changes to the component's class loading preferences
0958: * (class path and class loading order). These changes are allowed
0959: * regardless of whether or not the component provides an implementation of
0960: * the new upgrade SPI.
0961: *
0962: * @param componentName
0963: * Name of the component to update.
0964: * @param zipFilePath
0965: * archive file in a zip format
0966: * @return The name of the component if successful
0967: * @throws ManagementRemoteException
0968: * on error
0969: *
0970: * @see com.sun.esb.management.api.installation.InstallationService#upgradeComponent(java.lang.String, java.lang.String)
0971: */
0972: public String upgradeComponent(String componentName,
0973: String zipFilePath) throws ManagementRemoteException {
0974: ObjectName mbeanName = this
0975: .getInstallationServiceMBeanObjectName();
0976: Object resultObject = null;
0977:
0978: if (this .isRemoteConnection() == true) {
0979: zipFilePath = uploadFile(zipFilePath);
0980: }
0981:
0982: Object[] params = new Object[2];
0983: params[0] = componentName;
0984: params[1] = zipFilePath;
0985:
0986: String[] signature = new String[2];
0987: signature[0] = "java.lang.String";
0988: signature[1] = "java.lang.String";
0989:
0990: resultObject = this .invokeMBeanOperation(mbeanName,
0991: "upgradeComponent", params, signature);
0992:
0993: this .removeUploadedFile(); // if uploaded
0994:
0995: return resultObject.toString();
0996: }
0997:
0998: /**
0999: * @param args
1000: */
1001: public static void main(String[] args) {
1002: // TODO Auto-generated method stub
1003:
1004: }
1005:
1006: }
|