### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.security

# Class GetSubject

java.lang.Object
com.sas.services.security.GetSubject

@SASScope("ALL") @BinaryCompatibilityOnly public class GetSubject extends Object
This class has only one purpose: To copy a user's Subject across a remote interface. Since the JAAS Subject class is neither Remote nor Serializable, there needs to be a mechanism for getting it across a remote interface, so it can be used for a doAs() or doAsPrivileged() code section.

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GetSubject()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Subject`
  `getSubject(UserContextInterface user)`
  Get a security Subject from a UserContext.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GetSubject

    public GetSubject()

- ## Method Details

  - ### getSubject

    public static Subject getSubject(UserContextInterface user) throws ServiceException
    Get a security Subject from a UserContext. A Subject is defined by its collections of principals, public credentials and private credentials. Get those items from the UserContext (hopefully, they'return all PFS versions of those objects), and create a new Subject in the current JVM.

    Parameters:
      `user` - The UserContext to create the new Subject from.
    Returns:
      The new Subject, created in the local JVM.
    Throws:
      `ServiceException` - in the event of service object failure.