Class ClientSecurityContext
java.lang.Object
com.sun.enterprise.security.common.AbstractSecurityContext
com.sun.enterprise.security.common.ClientSecurityContext
- All Implemented Interfaces:
com.sun.enterprise.security.integration.AppServSecurityContext
,Serializable
This class represents the security context on the client side. For usage of the IIOP_CLIENT_PER_THREAD_FLAG flag, see
UsernamePasswordStore. When set to false, the volatile field sharedCsc is used to store the context.
- Author:
- Harpreet Singh
- See Also:
-
Field Summary
Fields inherited from class com.sun.enterprise.security.common.AbstractSecurityContext
initiator, subject
-
Constructor Summary
ConstructorDescriptionClientSecurityContext
(String userName, Subject s) This creates a new ClientSecurityContext object. -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the caller principal.static ClientSecurityContext
This method gets the SecurityContext stored here.com.sun.enterprise.security.integration.AppServSecurityContext
This method should be implemented by the subclasses to return the Credentials of the caller principal.static boolean
com.sun.enterprise.security.integration.AppServSecurityContext
newInstance
(String userName, Subject subject) com.sun.enterprise.security.integration.AppServSecurityContext
newInstance
(String userName, Subject subject, String realm) static void
This method sets the SecurityContext to be stored here.void
setCurrentSecurityContext
(com.sun.enterprise.security.integration.AppServSecurityContext context) void
setSecurityContextWithPrincipal
(Principal principal) void
toString()
-
Field Details
-
IIOP_CLIENT_PER_THREAD_FLAG
- See Also:
-
-
Constructor Details
-
ClientSecurityContext
This creates a new ClientSecurityContext object.- Parameters:
The
- name of the user.The
- Credentials of the user.
-
-
Method Details
-
getCurrent
This method gets the SecurityContext stored here. If using a per-thread authentication model, it gets the context from Thread Local Store (TLS) of the current thread. If not using a per-thread authentication model, it gets the singleton context.- Returns:
- The current Security Context stored here. It returns null if SecurityContext could not be found.
-
setCurrent
This method sets the SecurityContext to be stored here.- Parameters:
The
- Security Context that should be stored.
-
getCallerPrincipal
This method returns the caller principal. This information may be redundant since the same information can be inferred by inspecting the Credentials of the caller.- Specified by:
getCallerPrincipal
in interfacecom.sun.enterprise.security.integration.AppServSecurityContext
- Specified by:
getCallerPrincipal
in classAbstractSecurityContext
- Returns:
- The caller Principal.
-
getSubject
Description copied from class:AbstractSecurityContext
This method should be implemented by the subclasses to return the Credentials of the caller principal.- Specified by:
getSubject
in interfacecom.sun.enterprise.security.integration.AppServSecurityContext
- Specified by:
getSubject
in classAbstractSecurityContext
- Returns:
- A credentials object associated with the current client invocation.
-
toString
-
hasEmtpyCredentials
-
newInstance
-
newInstance
-
setCurrentSecurityContext
public void setCurrentSecurityContext(com.sun.enterprise.security.integration.AppServSecurityContext context) -
getCurrentSecurityContext
public com.sun.enterprise.security.integration.AppServSecurityContext getCurrentSecurityContext() -
setUnauthenticatedSecurityContext
public void setUnauthenticatedSecurityContext() -
setSecurityContextWithPrincipal
-