Class JKAbstractContext

java.lang.Object
com.jk.core.context.JKAbstractContext
All Implemented Interfaces:
JKContext
Direct Known Subclasses:
JKDesktopContext, JKMobileContext, JKServletContext, JKWebContext

public abstract class JKAbstractContext extends Object implements JKContext
This class implements the JKContext interface.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKAbstractContext

      public JKAbstractContext()
  • Method Details

    • getRemotPort

      public int getRemotPort()
      This method gets the remote machine port number.
      Specified by:
      getRemotPort in interface JKContext
      Returns:
      the remote machine port number.
    • getPort

      public int getPort()
      This method gets the server port number.
      Specified by:
      getPort in interface JKContext
      Returns:
      the server port number.
    • getRemoteMachineName

      public String getRemoteMachineName()
      This method gets the remote machine name.
      Specified by:
      getRemoteMachineName in interface JKContext
      Returns:
      a string representing the remote machine name.
    • getRemoteIP

      public String getRemoteIP()
      This method gets the remote machine IP Address.
      Specified by:
      getRemoteIP in interface JKContext
      Returns:
      the remote machine IP address.
    • getSessionID

      public String getSessionID()
      This method gets the current session identifier (ID)
      Specified by:
      getSessionID in interface JKContext
      Returns:
      the current session identifier (ID)
    • getConfigPath

      public String getConfigPath()
      This method gets the configuration file path for this object.
      Specified by:
      getConfigPath in interface JKContext
      Returns:
      the configuration file path for this JKContext object.
    • getCurrentToken

      public String getCurrentToken()
      This method gets the current security token.
      Specified by:
      getCurrentToken in interface JKContext
      Returns:
      the current security token.
    • getRemoteAppName

      public String getRemoteAppName()
      This method gets the remote application name.
      Specified by:
      getRemoteAppName in interface JKContext
      Returns:
      the remote application name.
    • getProgram

      public String getProgram()
      This method gets the program.
      Specified by:
      getProgram in interface JKContext
      Returns:
      a string representing the program.
    • getUserName

      public String getUserName()
      This method gets the user name.
      Specified by:
      getUserName in interface JKContext
      Returns:
      string representing the user name.
    • getClientId

      public String getClientId()
      This method gets the client identifier (ID).
      Specified by:
      getClientId in interface JKContext
      Returns:
      the client identifier (ID).
    • getModule

      public String getModule()
      This method gets the module.
      Specified by:
      getModule in interface JKContext
      Returns:
      string representing the module.
    • getAction

      public String getAction()
      This method gets the action.
      Specified by:
      getAction in interface JKContext
      Returns:
      string representing the action.
    • getAppName

      public String getAppName()
      This method gets the application name.
      Specified by:
      getAppName in interface JKContext
      Returns:
      the application name
    • getHost

      public String getHost()
      This method gets the host name.
      Specified by:
      getHost in interface JKContext
      Returns:
      the host name.
    • getRealIP

      public String getRealIP()
      This method gets the real IP address.
      Specified by:
      getRealIP in interface JKContext
      Returns:
      a string representing the real IP address.
    • getForwardPort

      public String getForwardPort()
      This method gets the forward host server port.
      Specified by:
      getForwardPort in interface JKContext
      Returns:
      a string representing the forward host server port.
    • getForwardHost

      public String getForwardHost()
      This method gets the forward host name.
      Specified by:
      getForwardHost in interface JKContext
      Returns:
      the forward host name.
    • getRole

      public String getRole()
      This method gets the context role.
      Specified by:
      getRole in interface JKContext
      Returns:
      a string representing the context role.
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • getRemoteUser

      public String getRemoteUser()
      This method gets the remote machine user.
      Specified by:
      getRemoteUser in interface JKContext
      Returns:
      the remote machine user.
    • getRemoteRole

      public String getRemoteRole()
      This method gets the remote machine user context role.
      Specified by:
      getRemoteRole in interface JKContext
      Returns:
      the remote machine user context role.
    • getTenantId

      public String getTenantId()
      This method gets the tenant identifier (ID).
      Specified by:
      getTenantId in interface JKContext
      Returns:
      the tenant identifier (ID).
    • getApplicationMap

      public HashMap<String,Object> getApplicationMap()
      This method gets the application map as a HashMap.
      Specified by:
      getApplicationMap in interface JKContext
      Returns:
      a HashMap view of the application map.
    • getRequestMap

      public HashMap<String,Object> getRequestMap()
      This method gets the request map as a HashMap
      Specified by:
      getRequestMap in interface JKContext
      Returns:
      a HashMap view of the request map.
    • getSessionMap

      public HashMap<String,Object> getSessionMap()
      This method gets the current session map as a HashMap.
      Specified by:
      getSessionMap in interface JKContext
      Returns:
      a HashMap view of the current session map.
    • getHeadersMap

      public Map<String,String> getHeadersMap()
      This method gets the headers map.
      Specified by:
      getHeadersMap in interface JKContext
      Returns:
      a Map view of the headers map.
    • getAttribute

      public Object getAttribute(String attribute)
      This method gets the specified context attribute.
      Specified by:
      getAttribute in interface JKContext
      Parameters:
      attribute - Specifies the attribute name.
      Returns:
      an object that represents the specified attribute.
    • getUser

      public Object getUser()
      This method gets the current user.
      Specified by:
      getUser in interface JKContext
      Returns:
      an object representing the current user.
    • getResourceLoader

      public JKResourceLoader getResourceLoader()
      This method gets the resource loader for this context object.
      Specified by:
      getResourceLoader in interface JKContext
      Returns:
      the resource loader for this JKContext object.
    • setApplicationMap

      public void setApplicationMap(Map<String,Object> applicationMap)
      This method replaces the application map with the specified map.
      Parameters:
      applicationMap - Specifies the new application map.
    • setRemoteMachineName

      public void setRemoteMachineName(String machineName)
      This method sets the machine name to the specified value.
      Parameters:
      machineName - Specifies the new machine name.
    • setRemoteIP

      public void setRemoteIP(String remoteIP)
      This method sets the remote IP address to the specified value.
      Parameters:
      remoteIP - Specifies the new remote IP address.
    • setRemotPort

      public void setRemotPort(int remotPort)
      This method sets the remote server port number to the specifies value.
      Parameters:
      remotPort - Specifies the new remote server port number.
    • setRequestMap

      public void setRequestMap(Map<String,Object> requestMap)
      This method replaces the request map with the specified map.
      Parameters:
      requestMap - Specifies the new request map.
    • setSessionID

      public void setSessionID(String sessionID)
      This method sets the current session identifier (ID) to the specified value.
      Parameters:
      sessionID - Specifies the new current session identifier (ID).
    • setSessionMap

      public void setSessionMap(Map<String,Object> sessionMap)
      This method replaces the session map with the specified map.
      Parameters:
      sessionMap - Specifies the new session map.
    • setUser

      public void setUser(Object user)
      This method replaces the user object with the specified object.
      Parameters:
      user - Specifies the new user object.
    • setConfigPath

      public void setConfigPath(String configPath)
      This method sets the configuration file path to the specified value.
      Parameters:
      configPath - Specifies the new configuration file path.
    • setCurrentToken

      public void setCurrentToken(String token)
      This method sets the current security token to the specified value.
      Parameters:
      token - Specifies the new current security token.
    • setUserName

      public void setUserName(String userName)
      This method sets the user name to the specified value.
      Parameters:
      userName - Specifies the new user name.
    • setProgram

      public void setProgram(String program)
      This method sets the program to the specifies value.
      Parameters:
      program - Specifies the new program.
    • setClientId

      public void setClientId(String clientId)
      This method sets the client identifier (ID) to the specified value.
      Parameters:
      clientId - Specifies the new client identifier (ID).
    • setModule

      public void setModule(String module)
      This method sets the module to the specified value.
      Parameters:
      module - Specifies the new module.
    • setAction

      public void setAction(String action)
      This method sets the action to the specified value.
      Parameters:
      action - Specifies the new action.
    • setAppName

      public void setAppName(String appName)
      This method sets the application name to the specified value.
      Parameters:
      appName - Specifies the new application name.
    • setRemoteUser

      public void setRemoteUser(String userName)
      This method sets the user name to the specified value.
      Parameters:
      userName - Specifies the new user name.
    • setRole

      public void setRole(String role)
      This method sets the context role to the specified value.
      Parameters:
      role - Specifies the new context role.
    • setRemoteRole

      public void setRemoteRole(String role)
      This method sets the remote context role to the specified value.
      Parameters:
      role - Specifies the new remote context role.
    • setAttribute

      public void setAttribute(String key, Object value)
      This method sets the specified value to the entry that is associated with the specified key in the map.
      Specified by:
      setAttribute in interface JKContext
      Parameters:
      key - Specifies the key associated with the value to be added.
      value - Specifies the new value to the entry associated with the specified key.
    • setRemoteAppName

      public void setRemoteAppName(String appName)
      This method sets the remote application name to the specified value.
      Specified by:
      setRemoteAppName in interface JKContext
      Parameters:
      appName - Specifies the new remote application name.
    • setPort

      public void setPort(int serverPort)
      This method sets the server port number to the specified value.
      Specified by:
      setPort in interface JKContext
      Parameters:
      serverPort - Specifies the new server port number.
    • setHost

      public void setHost(String name)
      This sets the host name to the specified value.
      Specified by:
      setHost in interface JKContext
      Parameters:
      name - Specifies the new host name.
    • setHeadersMap

      public void setHeadersMap(Map<String,String> headersMap)
      This method replaces the headers map to the specified map.
      Specified by:
      setHeadersMap in interface JKContext
      Parameters:
      headersMap - Specifies the new headers map.
    • setTenantId

      public void setTenantId(String tenantId)
      This method sets the tenant identifier (ID) to the specified value.
      Specified by:
      setTenantId in interface JKContext
      Parameters:
      tenantId - Specifies the new tenant identifier (ID).
    • toSimpleMap

      public Map<String,Object> toSimpleMap()
      This method puts all this object attributes in a map.
      Specified by:
      toSimpleMap in interface JKContext
      Returns:
      a Map view of the object attributes.