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.PasswordCredential
getPasswordCredential(jakarta.resource.spi.ManagedConnectionFactory mcf, Subject subject, jakarta.resource.spi.ConnectionRequestInfo info)
This method returns thePasswordCredential
object, given theManagedConnectionFactory
, subject and theConnectionRequestInfo
.static boolean
isPasswordCredentialEqual(jakarta.resource.spi.security.PasswordCredential pC1, jakarta.resource.spi.security.PasswordCredential pC2)
Returns true if twoPasswordCredential
objects 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.ResourceException
This method returns thePasswordCredential
object, given theManagedConnectionFactory
, subject and theConnectionRequestInfo
. It first checks if theConnectionRequestInfo
is null or not. If it is not null, it constructs aPasswordCredential
object with the user and password fields from theConnectionRequestInfo
and returns thisPasswordCredential
object. If theConnectionRequestInfo
is null, it retrieves thePasswordCredential
objects from theSubject
parameter and returns the firstPasswordCredential
object which contains aManagedConnectionFactory
, instance equivalent to theManagedConnectionFactory
, 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 twoPasswordCredential
objects are equal; false otherwise- Parameters:
pC1
-PasswordCredential
pC2
-PasswordCredential
- Returns:
- true if the two PasswordCredentials are equal false otherwise
-
-