Class ConnectorConfigurationParserServiceImpl

  • All Implemented Interfaces:
    ConnectorConstants, ResourceConstants

    public class ConnectorConfigurationParserServiceImpl
    extends ConnectorService
    This is configuration parser service. Retrieves various configuration information from ra.xml
    Author:
    Srikanth P
    • Constructor Detail

      • ConnectorConfigurationParserServiceImpl

        public ConnectorConfigurationParserServiceImpl()
        Default constructor
    • Method Detail

      • getSecurityPermissionSpec

        public String getSecurityPermissionSpec​(String moduleName)
                                         throws ConnectorRuntimeException
        Obtains the Permission string that needs to be added to the to the security policy files. These are the security permissions needed by the resource adapter implementation classes. These strings are obtained by parsing the ra.xml
        Parameters:
        moduleName - rar module Name
        Returns:
        Required policy permissions in server.policy file
        Throws:
        ConnectorRuntimeException - If rar.xml parsing fails.
      • getFileContent

        public String getFileContent​(File file)
        Obtain the content of server.policy file
        Parameters:
        file - File server.policy file
        Returns:
        String content of server.policy file
      • getResourceAdapterConfigProps

        public Properties getResourceAdapterConfigProps​(String rarName)
                                                 throws ConnectorRuntimeException
        Retrieves the Resource adapter javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.
        Parameters:
        rarName - rar module name
        Returns:
        Resource adapter javabean properties with default values.
        Throws:
        ConnectorRuntimeException - if property retrieval fails.
      • getMCFConfigProps

        public Properties getMCFConfigProps​(String rarName,
                                            String connectionDefName)
                                     throws ConnectorRuntimeException
        Retrieves the MCF javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.
        Parameters:
        rarName - rar module name
        Returns:
        managed connection factory javabean properties with default values.
        Throws:
        ConnectorRuntimeException - if property retrieval fails.
      • getAdminObjectConfigProps

        public Properties getAdminObjectConfigProps​(String rarName,
                                                    String adminObjectIntf)
                                             throws ConnectorRuntimeException
        Retrieves the admin object javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.
        Parameters:
        rarName - rar module name
        Returns:
        admin object javabean properties with default values.
        Throws:
        ConnectorRuntimeException - if property retrieval fails.
      • getAdminObjectConfigProps

        public Properties getAdminObjectConfigProps​(String rarName,
                                                    String adminObjectIntf,
                                                    String adminObjectClass)
                                             throws ConnectorRuntimeException
        Retrieves the admin object javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.
        Parameters:
        rarName - rar module name
        adminObjectIntf - admin object interface
        adminObjectClass - admin object class
        Returns:
        admin object javabean properties with default values.
        Throws:
        ConnectorRuntimeException - if property retrieval fails.
      • getConnectorConfigJavaBeans

        public Properties getConnectorConfigJavaBeans​(String rarName,
                                                      String connectionDefName,
                                                      String type)
                                               throws ConnectorRuntimeException
        Retrieves the XXX javabean properties with default values. The javabean to introspect/retrieve is specified by the type. The default values will be the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.
        Parameters:
        rarName - rar module name
        Returns:
        admin object javabean properties with default values.
        Throws:
        ConnectorRuntimeException - if property retrieval fails.
      • getActivationSpecClass

        public String getActivationSpecClass​(String rarName,
                                             String messageListenerType)
                                      throws ConnectorRuntimeException
        Return the ActivationSpecClass name for given rar and messageListenerType
        Parameters:
        moduleDir - The directory where rar is exploded.
        messageListenerType - MessageListener type
        Throws:
        ConnectorRuntimeException - If moduleDir is null. If corresponding rar is not deployed.
      • getMessageListenerConfigProps

        public Properties getMessageListenerConfigProps​(String rarName,
                                                        String messageListenerType)
                                                 throws ConnectorRuntimeException
        Parses the ra.xml for the ActivationSpec javabean properties. The ActivationSpec to be parsed is identified by the moduleDir where ra.xml is present and the message listener type. message listener type will be unique in a given ra.xml. It throws ConnectorRuntimeException if either or both the parameters are null, if corresponding rar is not deployed, if message listener type mentioned as parameter is not found in ra.xml. If rar is deployed and message listener (type mentioned) is present but no properties are present for the corresponding message listener, null is returned.
        Parameters:
        rarName - name of the rar module.
        messageListenerType - message listener type.It is uniqie across all sub-elements in element in a given rar.
        Returns:
        Javabean properties with the property names and values of properties. The property values will be the values mentioned in ra.xml if present. Otherwise it will be the default values obtained by introspecting the javabean. In both the case if no value is present, empty String is returned as the value.
        Throws:
        ConnectorRuntimeException - if either of the parameters are null. If corresponding rar is not deployed i.e moduleDir is invalid. If messagelistener type is not found in ra.xml
      • getMessageListenerConfigPropTypes

        public Properties getMessageListenerConfigPropTypes​(String rarName,
                                                            String messageListenerType)
                                                     throws ConnectorRuntimeException
        Returns the Properties object consisting of propertyname as the key and datatype as the value.
        Parameters:
        rarName - name of the rar module.
        messageListenerType - message listener type.It is uniqie across all sub-elements in element in a given rar.
        Returns:
        Properties object with the property names(key) and datatype of property(as value).
        Throws:
        ConnectorRuntimeException - if either of the parameters are null. If corresponding rar is not deployed i.e moduleDir is invalid. If messagelistener type is not found in ra.xml
      • getAdminObjectClassNames

        public String[] getAdminObjectClassNames​(String rarName,
                                                 String intfName)
                                          throws ConnectorRuntimeException
        gets the adminObjectClassNames pertaining to a rar & a specific adminObjectInterfaceName
        Parameters:
        rarName - resource-adapter name
        intfName - admin-object-interface name
        Returns:
        Array of AdminObjectInterface names as Strings
        Throws:
        ConnectorRuntimeException - if parsing fails
      • hasAdminObject

        public boolean hasAdminObject​(String rarName,
                                      String intfName,
                                      String className)
                               throws ConnectorRuntimeException
        checks whether the specified intfName, className has presence in admin objects of the RAR
        Parameters:
        rarName - resource-adapter name
        intfName - admin object interface name
        className - admin object class name
        Returns:
        boolean indicating the presence of admin object
        Throws:
        ConnectorRuntimeException - when unable to determine the presence