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

Package com.sas.services.events.broker

# Class SecurityContext

java.lang.Object
com.sas.services.events.broker.SecurityContext

All Implemented Interfaces:
  `com.sas.PublicClonable`, `Serializable`, `Cloneable`

@SASScope("ALL") @BinaryCompatibilityOnly public class SecurityContext extends Object implements com.sas.PublicClonable, Serializable
Security context associated with a particular `Event Broker service` `message`.

## Usage

A processing node or dynamic listener can aquire this information from the `message` it is processing.

Since:
  1.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `RUN_AS_IDENTITY_BROKER`
  Run as identity: broker
  `static final int`
  `RUN_AS_IDENTITY_CLIENT`
  Run as identity: client
  `static final int`
  `RUN_AS_IDENTITY_NONE`
  Run as identity: none
  `static final int`
  `RUN_AS_IDENTITY_SPECIFIED`
  Run as identity: specified

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SecurityContext()`
  Default constructor.
  `SecurityContext(String userName, String userPW, String domain)`
  SecurityContext constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final Object`
  `clone()`
  Clone a copy of this security context.
  `final String`
  `getDomain()`
  Get authentication domain.
  `final int`
  `getRunAsIdentity()`
  Get RunAs identity context.
  `final SessionContextInterface`
  `getSessionContext()`
  Get session context.
  `final Object`
  `getSessionContextLock()`
  Get session context lock object.
  `final UserContextInterface`
  `getUserContext()`
  Get user context.
  `final String`
  `getUserName()`
  Get user name.
  `final String`
  `getUserPW()`
  Get user password.
  `final void`
  `setDomain(String domain)`
  Set authentication domain.
  `final void`
  `setRunAsIdentity(int runAsIdentity)`
  Set RunAs identity context.
  `final void`
  `setSessionContext(SessionContextInterface sc)`
  Set session context.
  `final void`
  `setSessionContextLock(Object lock)`
  Set session context lock object.
  `final void`
  `setUserContext(UserContextInterface uc)`
  Set user context.
  `final void`
  `setUserName(String userName)`
  Set user name.
  `final void`
  `setUserPW(String userPW)`
  Set user password.

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

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

- ## Field Details

  - ### RUN_AS_IDENTITY_NONE

    public static final int RUN_AS_IDENTITY_NONE
    Run as identity: none
    See Also:
      - Constant Field Values

  - ### RUN_AS_IDENTITY_CLIENT

    public static final int RUN_AS_IDENTITY_CLIENT
    Run as identity: client
    See Also:
      - Constant Field Values

  - ### RUN_AS_IDENTITY_BROKER

    public static final int RUN_AS_IDENTITY_BROKER
    Run as identity: broker
    See Also:
      - Constant Field Values

  - ### RUN_AS_IDENTITY_SPECIFIED

    public static final int RUN_AS_IDENTITY_SPECIFIED
    Run as identity: specified
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### SecurityContext

    public SecurityContext()
    Default constructor.

  - ### SecurityContext

    public SecurityContext(String userName, String userPW, String domain)
    SecurityContext constructor.
    Parameters:
      `userName` - user name.
      `userPW` - password of user.
      `domain` - security domain

- ## Method Details

  - ### clone

    public final Object clone()
    Clone a copy of this security context.

    Perform a shallow copy only.

    The session context attribute must be the same object for all instances of a cloned security context so that tracking session management usage works appropriately.

    Specified by:
      `clone` in interface `com.sas.PublicClonable`
    Overrides:
      `clone` in class `Object`
    Returns:
      clone of this message.

  - ### setUserName

    public final void setUserName(String userName)
    Set user name.
    Parameters:
      `userName` - user name.

  - ### getUserName

    public final String getUserName()
    Get user name.
    Returns:
      user name.

  - ### setUserPW

    public final void setUserPW(String userPW)
    Set user password.
    Parameters:
      `userPW` - user password.

  - ### getUserPW

    public final String getUserPW()
    Get user password.
    Returns:
      user password.

  - ### setDomain

    public final void setDomain(String domain)
    Set authentication domain.
    Parameters:
      `domain` - authentication domain.

  - ### getDomain

    public final String getDomain()
    Get authentication domain.
    Returns:
      authentication domain.

  - ### setSessionContext

    public final void setSessionContext(SessionContextInterface sc)
    Set session context.
    Parameters:
      `sc` - session context.

  - ### getSessionContext

    public final SessionContextInterface getSessionContext()
    Get session context.
    Returns:
      session context or `null if not available.`

  - ### setSessionContextLock

    public final void setSessionContextLock(Object lock)
    Set session context lock object.
    Parameters:
      `lock` - session context lock object.

  - ### getSessionContextLock

    public final Object getSessionContextLock()
    Get session context lock object.
    Returns:
      session context lock object or `null if not available.`

  - ### setUserContext

    public final void setUserContext(UserContextInterface uc)
    Set user context.
    Parameters:
      `uc` - user context.

  - ### getUserContext

    public final UserContextInterface getUserContext()
    Get user context.
    Returns:
      user context or `null if Run As context was not authenticated.`

  - ### setRunAsIdentity

    public final void setRunAsIdentity(int runAsIdentity)
    Set RunAs identity context.
    Parameters:
      `runAsIdentity` - RunAs identity context.

  - ### getRunAsIdentity

    public final int getRunAsIdentity()
    Get RunAs identity context.

    Valid RunAs identity types are as follows:

    - `none`
    - `client`
    - `broker`
    - `specified`
    Returns:
      RunAs identity context.