Class ConnectorDDTransformUtils


  • public class ConnectorDDTransformUtils
    extends Object
    This is an util class pertaining to the connector deployment descriptor i.e ra.xml and sun-ra.xml. This consist of methods to obtain the deployment descriptor and perform various transformations on that to obtain/constructs classes/objects pertaining to the Connector modules like ConnectorDescriptorInfo.
    Author:
    Srikanth P
    • Constructor Detail

      • ConnectorDDTransformUtils

        public ConnectorDDTransformUtils()
    • Method Detail

      • getConnectorDescriptorInfo

        public static ConnectorDescriptorInfo getConnectorDescriptorInfo​(ConnectionDefDescriptor connectionDefDescriptor)
        Constructs ConnectorDescriptorInfo object from the ConnectionDefDescriptor object (deployment descriptor of connector module)
        Parameters:
        connectionDefDescriptor - ConnectionDefDescriptor object which represents the ra.xml and sun-ra.xml
        Returns:
        Transformed ConnectorDescriptorInfo object
      • mergeProps

        public static Set mergeProps​(List<Property> props,
                                     Set defaultMCFProps,
                                     Properties propertiesToSkip)
        merges the properties mentioned in first parameter with the Set of properties mentioned in second parameter. Values of first parameter takes precedence over second. First parameter represents properties present in domain.xml Second parameter contains values mentioned in deployment descriptors.
        Parameters:
        props - Array of properties that needs to be merged with properties mentioned in deployment descriptor. These values takes precedence over values present in deployment descriptors.
        propertiesToSkip - properties to be skipped while merging. They will be skipped only when both its name as well as its value match.
        Returns:
        Set of merged properties.
      • mergeProps

        public static Set mergeProps​(List<Property> props,
                                     Set defaultMCFProps)
        merges the properties mentioned in first parameter with the Set of properties mentioned in second parameter. Values of first parameter takes precedence over second. First parameter represents properties present in domain.xml Second parameter contains values mentioned in deployment descriptors.
        Parameters:
        props - Array of properties that needs to be merged with properties mentioned in deployement descriptor. These values takes precedence over values present in deployment descriptors.
        Returns:
        Set of merged properties.
      • getConnectorDescriptor

        public static ConnectorDescriptor getConnectorDescriptor​(String moduleDir,
                                                                 String rarModuleName)
                                                          throws ConnectorRuntimeException
        Get the ConnectorDescriptor object which represents the ra.xml and sun-ra.xml from an exploded rar module.
        Parameters:
        moduleDir - Directory where rar is exploded.
        Returns:
        ConnectorDescriptor object which represents the ra.xml and sun-ra.xml
        Throws:
        ConnectorRuntimeException - if ra.xml could not be located or invalid. For 1.0 type rar if sun-ra.xml is not present or invalid this exception is thrown. For 1.5 type rar sun-ra.xml should not be present.
      • getConnectionDefs

        public static ConnectionDefDescriptor[] getConnectionDefs​(ConnectorDescriptor connectorDesc)
        Obtain all the ConnectionDefDescriptor(abstracts the element in ra.xml) objects that are present in given ra.xml file.
        Parameters:
        connectorDesc - ConnectorDescriptor object which represents the ra.xml and sun-ra.xml
        Returns:
        Array of ConnectionDefDescriptor objects which represent the element.
      • getResourceAdapterClassName

        public static String getResourceAdapterClassName​(String rarLocation)
      • getMessageListeners

        public MessageListener[] getMessageListeners​(ConnectorDescriptor desc)
        Returns all the message listeners present in the connectorDescriptor which abstracts the ra.xml
        Parameters:
        desc - connectorDescriptor which abstracts the ra.xml
        Returns:
        Array of MessageListener objects