Class SecurityUtils


  • public class SecurityUtils
    extends Object
    SecurityUtils for Generic JDBC Connector.
    Version:
    1.0, 02/07/22
    Author:
    Evani Sai Surya Kiran
    • Constructor Detail

      • SecurityUtils

        public SecurityUtils()
    • Method Detail

      • getPasswordCredential

        public static jakarta.resource.spi.security.PasswordCredential getPasswordCredential​(jakarta.resource.spi.ManagedConnectionFactory mcf,
                                                                                             Subject subject,
                                                                                             jakarta.resource.spi.ConnectionRequestInfo info)
                                                                                      throws jakarta.resource.ResourceException
        This method returns the PasswordCredential object, given the ManagedConnectionFactory, subject and the ConnectionRequestInfo. It first checks if the ConnectionRequestInfo is null or not. If it is not null, it constructs a PasswordCredential object with the user and password fields from the ConnectionRequestInfo and returns this PasswordCredential object. If the ConnectionRequestInfo is null, it retrieves the PasswordCredential objects from the Subject parameter and returns the first PasswordCredential object which contains a ManagedConnectionFactory, instance equivalent to the ManagedConnectionFactory, parameter.
        Parameters:
        mcf - ManagedConnectionFactory
        subject - Subject
        info - ConnectionRequestInfo
        Returns:
        PasswordCredential
        Throws:
        jakarta.resource.ResourceException
      • isPasswordCredentialEqual

        public static boolean isPasswordCredentialEqual​(jakarta.resource.spi.security.PasswordCredential pC1,
                                                        jakarta.resource.spi.security.PasswordCredential pC2)
        Returns true if two PasswordCredential objects are equal; false otherwise
        Parameters:
        pC1 - PasswordCredential
        pC2 - PasswordCredential
        Returns:
        true if the two PasswordCredentials are equal false otherwise