public class Facade extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONFIG_SCHEMA_PATH |
protected static String |
DOMAIN |
protected static String |
MASKED_FIELD_VALUE |
protected static String |
mComponentConfigSchema |
protected EnvironmentContext |
mEnvCtx |
protected Logger |
mLog |
protected MBeanNames |
mMBeanNames |
protected MBeanServer |
mMBeanSvr |
protected ManagementContext |
mMgtCtx |
protected MessageBuilder |
mMsgBuilder |
protected PlatformContext |
mPlatform |
protected String |
mTarget |
protected StringTranslator |
mTranslator |
protected static String |
PASSWORD |
protected static String |
SERVER |
protected static HashMap |
sTypeMap |
protected static String |
WORKSPACE_ROOT |
| Constructor and Description |
|---|
Facade(EnvironmentContext ctx,
String target) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
archiveEqualityCheck(File f1,
File f2,
ArchiveType type,
String entityName)
Check if two files are identical.If the archives are not identical a
Management exception is thrown indicating a different archive exists in the
domain.
|
boolean |
areAllInstancesUp(String clusterName) |
protected void |
componentInstallationCheck(String componentName,
boolean throwExWhenInstalled)
Check if a Component is installed on a target.
|
protected String |
convertToString(Collection colxn)
Convert the objects in the collection to string.
|
protected File |
fromFileURL(String urlStr)
Parses an installation zip url, strips file protocol details
(if necessary) and returns a File reference.
|
protected List<String> |
getAllTargets() |
protected String |
getComponentConfigurationData(String compName)
Get the the "Configuration" element in the jbi.xml.
|
protected String |
getComponentConfigurationNS(String compName)
Get the namespace of the "Configuration" element in the jbi.xml, if one
exists.
|
protected String |
getComponentConfigurationSchema()
Get the the "Configuration" element in the jbi.xml.
|
protected ObjectName |
getComponentLifeCycleMBeanName(String componentName,
ComponentType compType,
String instanceName)
Get the Component Lifecycle MBean name on an instance.
|
protected ComponentQuery |
getComponentQuery()
Get a reference to ComponentQuery.
|
protected ComponentQuery |
getComponentQuery(String target)
Get a reference to ComponentQuery.
|
protected ComponentState |
getComponentState(String compName,
String instanceName) |
protected String |
getComponentStateOnInstance(String compName,
String instanceName)
This operation invokes the getCurentState() operation on the ComponentLifeCycle
MBean for a component on the instance, if the instance is running, if the instance
is down the state of the Component is SHUTDOWN.
|
protected ComponentType |
getComponentType(String componentName) |
protected ObjectName |
getFacadeInstallerMBeanName(String componentName)
Get the Facade Installer MBean object name for a component.
|
protected ObjectName |
getFacadeInstallerMBeanName(String componentName,
ComponentType compType)
Get the Facade Installer MBean object name for a component.
|
protected GenericQuery |
getGenericQuery()
Get a reference to GenericQuery.
|
protected MBeanServerConnection |
getMBeanServerConnection(String serverName)
Get an MBeanServer connection for the target
|
protected Registry |
getRegistry()
Get a reference to the JBI registry.
|
protected ObjectName |
getRemoteAdminServiceObjectName(String instanceName) |
protected Object |
getRemoteAttribute(ObjectName mbeanName,
String attribute,
String serverName)
Get attribute on the remote object with a return value.
|
protected Object |
getRemoteAttributes(ObjectName mbeanName,
String[] attributes,
String serverName)
Get attributes on the remote object with a return value.
|
protected ServiceAssemblyQuery |
getServiceAssemblyQuery()
Get a reference to registry Updater.
|
protected Updater |
getUpdater()
Get a reference to registry Updater.
|
protected void |
handleClusteredInstanceFailures(String taskId,
Map<String,Throwable> exceptionMap,
int numInstances,
String locStrKey)
Handle Cluster installation failures.
|
protected static void |
initPrimitiveTypeMap()
Initialize the data structure which maps primitive types to their wrapper classes
|
protected void |
instanceRunningCheck(String instanceName) |
protected Object |
invokeLocalOperation(ObjectName mbeanName,
String op,
Object[] params,
String[] sign)
Invoke a operation on a local MBean
|
protected Object |
invokeRemoteOperation(ObjectName mbeanName,
String op,
Object[] params,
String[] sign,
String serverName)
Invoke a operation on the remote object with a return value.
|
protected void |
invokeRemoteVoidOperation(ObjectName mbeanName,
String op,
Object[] params,
String[] sign,
String serverName)
Invoke a operation on the remote object w/o a return value.
|
protected boolean |
isComponentInstalled(String compName) |
protected boolean |
isInstanceRunning(String instanceName) |
protected boolean |
isMBeanRegisteredOnInstance(ObjectName mbeanName,
String serverName) |
protected boolean |
isSharedLibraryInstalled(String slName) |
boolean |
isTargetUp(String targetName)
Checks to see if the Target (server, cluster) is up or down.
|
protected void |
mbeanRegistrationCheck(String op,
ObjectName mbeanName,
String serverName)
MBean registration check.
|
protected void |
setRemoteAttribute(ObjectName mbeanName,
Attribute attribute,
String serverName)
Set an attribute on the remote object with a return value.
|
protected Object |
setRemoteAttributes(ObjectName mbeanName,
AttributeList attributes,
String serverName)
Set an attribute on the remote object with a return value.
|
protected void |
sharedLibraryInstallationCheck(String slName,
boolean throwExWhenInstalled)
Check if a SharedLibrary is installed on a target.
|
protected void |
throwNotSupportedManagementException(String taskId) |
protected String |
toFileURL(String urlStr)
Always returns a 208-compliant file URL based on the supplied urlStr.
|
protected void |
unregisterComponentConfigurationMBean(String target,
String compName)
Unregister the Component Configuration MBean for the component.
|
protected void |
unregisterComponentConfigurationMBean(String target,
String compName,
ComponentType compType)
Unregister the Component Configuration MBean for the component.
|
protected void |
unregisterComponentExtensionMBean(String target,
String compName)
Unregister the ComponentExtension MBean for the component.
|
protected void |
unregisterComponentExtensionMBean(String target,
String compName,
ComponentType compType)
Unregister the ComponentLifeCycle MBean for the component.
|
protected void |
unregisterComponentLifeCycleMBean(String target,
String compName)
Unregister the ComponentLifeCycle MBean for the component.
|
protected void |
unregisterComponentLifeCycleMBean(String target,
String compName,
ComponentType compType)
Unregister the ComponentLifeCycle MBean for the component.
|
protected String |
uploadFile(String serverName,
String localFile)
Upload a file to the specified target and return the absolute path to the
file on the remote target
|
protected Archive |
validateArchive(String archiveZipUrl,
ArchiveType expectedType,
String taskId)
Validate the Archive
|
protected String mTarget
protected EnvironmentContext mEnvCtx
protected MBeanServer mMBeanSvr
protected MBeanNames mMBeanNames
protected MessageBuilder mMsgBuilder
protected PlatformContext mPlatform
protected StringTranslator mTranslator
protected ManagementContext mMgtCtx
protected Logger mLog
protected static String mComponentConfigSchema
protected static HashMap sTypeMap
protected static final String DOMAIN
protected static final String SERVER
protected static final String WORKSPACE_ROOT
protected static final String MASKED_FIELD_VALUE
protected static final String PASSWORD
protected static final String CONFIG_SCHEMA_PATH
public Facade(EnvironmentContext ctx, String target) throws ManagementException
ManagementExceptionprotected ComponentQuery getComponentQuery() throws ManagementException
ManagementExceptionprotected ComponentQuery getComponentQuery(String target) throws ManagementException
ManagementExceptionprotected GenericQuery getGenericQuery() throws ManagementException
ManagementExceptionprotected Updater getUpdater() throws ManagementException
ManagementExceptionprotected ServiceAssemblyQuery getServiceAssemblyQuery() throws ManagementException
ManagementExceptionprotected Registry getRegistry()
protected MBeanServerConnection getMBeanServerConnection(String serverName) throws ManagementException
ManagementExceptionprotected void invokeRemoteVoidOperation(ObjectName mbeanName, String op, Object[] params, String[] sign, String serverName) throws ManagementException
ManagementExceptionprotected Object invokeRemoteOperation(ObjectName mbeanName, String op, Object[] params, String[] sign, String serverName) throws ManagementException
ManagementExceptionprotected void setRemoteAttribute(ObjectName mbeanName, Attribute attribute, String serverName) throws ManagementException
ManagementExceptionprotected Object setRemoteAttributes(ObjectName mbeanName, AttributeList attributes, String serverName) throws ManagementException
ManagementExceptionprotected Object getRemoteAttributes(ObjectName mbeanName, String[] attributes, String serverName) throws ManagementException
ManagementExceptionprotected Object getRemoteAttribute(ObjectName mbeanName, String attribute, String serverName) throws ManagementException
ManagementExceptionprotected Object invokeLocalOperation(ObjectName mbeanName, String op, Object[] params, String[] sign) throws ManagementException
ManagementExceptionprotected ComponentType getComponentType(String componentName) throws ManagementException
ManagementExceptionprotected String getComponentStateOnInstance(String compName, String instanceName) throws ManagementException
ManagementExceptionprotected ComponentState getComponentState(String compName, String instanceName) throws ManagementException
ManagementExceptionprotected boolean isComponentInstalled(String compName) throws ManagementException
ManagementExceptionprotected ObjectName getFacadeInstallerMBeanName(String componentName) throws ManagementException
ManagementExceptionprotected ObjectName getFacadeInstallerMBeanName(String componentName, ComponentType compType) throws ManagementException
ManagementExceptionprotected File fromFileURL(String urlStr)
protected String toFileURL(String urlStr)
protected Archive validateArchive(String archiveZipUrl, ArchiveType expectedType, String taskId) throws ManagementException
ManagementException - if the archive is not valid or does not exist.protected void mbeanRegistrationCheck(String op, ObjectName mbeanName, String serverName) throws ManagementException
ManagementExceptionprotected boolean isMBeanRegisteredOnInstance(ObjectName mbeanName, String serverName) throws ManagementException
ManagementExceptionpublic boolean isTargetUp(String targetName)
targetName - name of the target (e.g., cluster1, server, etc.)public boolean areAllInstancesUp(String clusterName)
clusterName - - cluster nameprotected boolean isInstanceRunning(String instanceName) throws ManagementException
ManagementExceptionprotected void instanceRunningCheck(String instanceName) throws JBIException
JBIException - if the instance is not running.protected String uploadFile(String serverName, String localFile) throws ManagementException
ManagementExceptionprotected void sharedLibraryInstallationCheck(String slName, boolean throwExWhenInstalled) throws ManagementException
ManagementExceptionprotected boolean isSharedLibraryInstalled(String slName) throws ManagementException
ManagementExceptionprotected void componentInstallationCheck(String componentName, boolean throwExWhenInstalled) throws ManagementException
ManagementExceptionprotected void handleClusteredInstanceFailures(String taskId, Map<String,Throwable> exceptionMap, int numInstances, String locStrKey) throws ManagementException
ManagementExceptionprotected ObjectName getRemoteAdminServiceObjectName(String instanceName)
protected ObjectName getComponentLifeCycleMBeanName(String componentName, ComponentType compType, String instanceName) throws ManagementException
JBIException - when
the component is not installed on the target
the instance is not up
AdminService MBean is not registered on the remote instance.ManagementExceptionprotected void unregisterComponentLifeCycleMBean(String target, String compName) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void unregisterComponentLifeCycleMBean(String target, String compName, ComponentType compType) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void unregisterComponentExtensionMBean(String target, String compName) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void unregisterComponentExtensionMBean(String target, String compName, ComponentType compType) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void unregisterComponentConfigurationMBean(String target, String compName) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void unregisterComponentConfigurationMBean(String target, String compName, ComponentType compType) throws JBIException
target - - the target value of the facade MBeanJBIExceptionprotected void throwNotSupportedManagementException(String taskId) throws ManagementException
ManagementExceptionprotected static void initPrimitiveTypeMap()
protected String convertToString(Collection colxn)
set - a non-empty setprotected List<String> getAllTargets() throws ManagementException
ManagementExceptionprotected void archiveEqualityCheck(File f1, File f2, ArchiveType type, String entityName) throws ManagementException
f1 - - file to comparef2 - - file to comparetype - - type of archivesentityName - - component / shared library / service assembly nameManagementException - if the two archives are not identical.protected String getComponentConfigurationNS(String compName)
compName - - component nameprotected String getComponentConfigurationData(String compName)
compName - - component nameprotected String getComponentConfigurationSchema() throws ManagementException
compName - - component nameManagementExceptionCopyright © 2011-2016 OpenESB Community. All Rights Reserved.