Package com.sun.gjc.util
Class SecurityUtils
- java.lang.Object
-
- com.sun.gjc.util.SecurityUtils
-
public class SecurityUtils extends Object
SecurityUtils for Generic JDBC Connector.- Version:
- 1.0, 02/07/22
- Author:
- Evani Sai Surya Kiran
-
-
Constructor Summary
Constructors Constructor Description SecurityUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static jakarta.resource.spi.security.PasswordCredentialgetPasswordCredential(jakarta.resource.spi.ManagedConnectionFactory mcf, Subject subject, jakarta.resource.spi.ConnectionRequestInfo info)This method returns thePasswordCredentialobject, given theManagedConnectionFactory, subject and theConnectionRequestInfo.static booleanisPasswordCredentialEqual(jakarta.resource.spi.security.PasswordCredential pC1, jakarta.resource.spi.security.PasswordCredential pC2)Returns true if twoPasswordCredentialobjects are equal; false otherwise
-
-
-
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.ResourceExceptionThis method returns thePasswordCredentialobject, given theManagedConnectionFactory, subject and theConnectionRequestInfo. It first checks if theConnectionRequestInfois null or not. If it is not null, it constructs aPasswordCredentialobject with the user and password fields from theConnectionRequestInfoand returns thisPasswordCredentialobject. If theConnectionRequestInfois null, it retrieves thePasswordCredentialobjects from theSubjectparameter and returns the firstPasswordCredentialobject which contains aManagedConnectionFactory, instance equivalent to theManagedConnectionFactory, parameter.- Parameters:
mcf-ManagedConnectionFactorysubject-Subjectinfo-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 twoPasswordCredentialobjects are equal; false otherwise- Parameters:
pC1-PasswordCredentialpC2-PasswordCredential- Returns:
- true if the two PasswordCredentials are equal false otherwise
-
-