Package com.collabnet.ce.soap60.integratedapps.util

# Class IntegratedAppSupport

java.lang.Object
com.collabnet.ce.soap60.integratedapps.util.IntegratedAppSupport

public class IntegratedAppSupport extends Object
Support class that processes all the required information for an integrated application to work with CTF.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IntegratedAppSupport(String ctfBaseUrl, String iaBaseUrl, String iaName)`
  Constructor that requires a CTF base URL as an argument.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `createCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)`
  Set up the cookie.
  `List`
  `getCachedPermissions(String projId)`
  Get the cached permissions for the given project
  `List`
  `getCachedRoles(String projId)`
  Get the cached roles for the given project
  `ICollabNetSoap`
  `getCollabNetSoap()`
  Get CollabNetSoap interface.
  `String`
  `getCtfBaseUrl()`
  Get the CTF base URL
  `String`
  `getExtSysId()`
  `String`
  `getIntegratedAppBaseUrl()`
  Get the integrated apps base URL
  `String`
  `getIntegratedAppId()`
  Get the integrated application Id
  `String`
  `getIntegratedAppName()`
  Returns the IntegratedAppName
  `String`
  `getIntegratedAppObjectId()`
  Get the id of an object in the integrated application
  `String`
  `getIntegratedAppPrefix()`
  Get the Integrated Application prefix.
  `IIntegrationDataAppSoap`
  `getIntegrationDataAppSoap()`
  Get IntegrationDataAppSoap interface.
  `String`
  `getOneTimeToken()`
  `IPluggableAppSoap`
  `getPluggableAppSoap()`
  Get PluggableAppSoap interface.
  `String`
  `getPlugIdByBaseUrl(String plugId)`
  This method returns the PlugId by passing the BaseUrl
  `String`
  `getPlugUrlByLinkId(String linkId)`
  This method returns Pluggable application base Url by passing Link Id
  `String`
  `getProjectId()`
  get the project Id
  `String`
  `getProjectId(String projectPath)`
  Get the project id for a given soap session id and project path
  `String`
  `getProjectPath()`
  Get the project path
  `String`
  `getProjectPathByIntAppId(String integratedAppId)`
  Get the project path for the given integrated application id
  `IRbacAppSoap`
  `getRbacAppSoap()`
  `String`
  `getRepoPath()`
  `jakarta.servlet.http.HttpServletRequest`
  `getRequestObject()`
  Get the Request Object
  `IScmAppSoap`
  `getScmAppSoap()`
  `String`
  `getSoapSessionId()`
  Get the user's soap session id
  `String`
  `getUserId()`
  Get the userId for a given soap session id
  `String`
  `getWebSessionId()`
  Get the web session id.
  `String`
  `getWebSessionId(String soapSessionId)`
  Get the web session id for the given soap session id.
  `boolean`
  `isAdminPage()`
  Whether the current request is for an admin page or not.
  `boolean`
  `isGoUrl()`
  Identify if the current request is a gourl or not.
  `String`
  `isLoggedIn()`
  check if the user is logged in to the CTF system
  `boolean`
  `isSuperUser()`
  Whether the current logged in user is a super user or not.
  `void`
  `processRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)`
  Process the request to initialize the session and project information.
  `void`
  `processSoapRequest()`
  Process the request to initialize the session and project information.
  `void`
  `putCachedPermissions(String projId, List permissions)`
  Adds the permissions to the cache for the given project
  `void`
  `putCachedRoles(String projId, List roles)`
  Adds the roles to the cache for the given project
  `void`
  `redirectToCTF(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)`
  Redirect to CTF when the session is invalid/expired
  `void`
  `setAdminPage(boolean isAdminPage)`
  Set true if the current request is for an admin page, otherwise false.
  `void`
  `setCtfBaseUrl(String ctfBaseUrl)`
  Set the CTF base URL.
  `void`
  `setExtSysId(String mExtSysId)`
  `void`
  `setIntegratedAppBaseUrl(String iaBaseUrl)`
  Set the integrated apps base URL.
  `void`
  `setIntegratedAppId(String integratedAppId)`
  Set the integrated application Id.
  `void`
  `setIntegratedAppName(String integratedAppName)`
  Sets the IntegratedAppName
  `void`
  `setIntegratedAppObjectId(String iaObjectId)`
  Set the id of an object in the integrated application.
  `void`
  `setIntegratedAppPrefix(String prefix)`
  Set the Integrated Application prefix.
  `void`
  `setIsLoggedIn(String mIsLoggedIn)`
  set if the user is logged into the CTf systen
  `void`
  `setOneTimeToken(String mOneTimeToken)`
  `void`
  `setProjectId(String mProjectId)`
  Sets the ProjectId
  `void`
  `setProjectPath(String projectPath)`
  Set the project path
  `void`
  `setRepoPath(String mRepoPath)`
  `void`
  `setRequestObject(jakarta.servlet.http.HttpServletRequest requestObject)`
  Sets the httpServletRequest object
  `void`
  `setSoapSessionId(String soapSessionId)`
  Set the user's soap session id
  `void`
  `setWebSessionId(String webSessionId)`
  Set the web session id.
  `void`
  `updateRecentRead(jakarta.servlet.http.HttpServletRequest request, String objectId, String title)`
  Update the recently read/viewed objects
  `void`
  `updateRecentWrite(jakarta.servlet.http.HttpServletRequest request, String objectId, String title)`
  Update the recently edited or newly created objects

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

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

- ## Constructor Details

  - ### IntegratedAppSupport

    public IntegratedAppSupport(String ctfBaseUrl, String iaBaseUrl, String iaName)
    Constructor that requires a CTF base URL as an argument.
    Parameters:
      `ctfBaseUrl` - a CTF base URL
      `iaBaseUrl` - an integrated application's base URL
      `iaName` - integrated application's name

- ## Method Details

  - ### isLoggedIn

    public String isLoggedIn()
    check if the user is logged in to the CTF system
    Returns:
      String true if user is logged in to the System false if the user is a guest user who have not logged in to the system

  - ### setIsLoggedIn

    public void setIsLoggedIn(String mIsLoggedIn)
    set if the user is logged into the CTf systen
    Parameters:
      `mIsLoggedIn` - true if the user is logged into the CTF system, else false

  - ### getCachedPermissions

    public List getCachedPermissions(String projId)
    Get the cached permissions for the given project
    Parameters:
      `projId` - CTF project ID
    Returns:
      return the cached permissions for the given project

  - ### putCachedPermissions

    public void putCachedPermissions(String projId, List permissions)
    Adds the permissions to the cache for the given project
    Parameters:
      `projId` - CTF project ID
      `permissions` - a list of permissions

  - ### getCachedRoles

    public List getCachedRoles(String projId)
    Get the cached roles for the given project
    Parameters:
      `projId` - CTF project ID
    Returns:
      return the cached roles for the given project

  - ### putCachedRoles

    public void putCachedRoles(String projId, List roles)
    Adds the roles to the cache for the given project
    Parameters:
      `projId` - CTF project ID
      `roles` - a list of roles in the project

  - ### getProjectId

    public String getProjectId()
    get the project Id
    Returns:
      Project Id

  - ### setProjectId

    public void setProjectId(String mProjectId)
    Sets the ProjectId
    Parameters:
      `mProjectId` -

  - ### getRequestObject

    public jakarta.servlet.http.HttpServletRequest getRequestObject()
    Get the Request Object
    Returns:
      the http request object

  - ### setRequestObject

    public void setRequestObject(jakarta.servlet.http.HttpServletRequest requestObject)
    Sets the httpServletRequest object

  - ### getIntegratedAppName

    public String getIntegratedAppName()
    Returns the IntegratedAppName
    Returns:
      the integratedAppName

  - ### setIntegratedAppName

    public void setIntegratedAppName(String integratedAppName)
    Sets the IntegratedAppName
    Parameters:
      `integratedAppName` - the integratedApp Name

  - ### getIntegratedAppId

    public String getIntegratedAppId()
    Get the integrated application Id
    Returns:
      the integrated application id.

  - ### setIntegratedAppId

    public void setIntegratedAppId(String integratedAppId)
    Set the integrated application Id.
    Parameters:
      `integratedAppId` - the integrated application Id.

  - ### getProjectPath

    public String getProjectPath()
    Get the project path
    Returns:
      project path to which the integrated app. belongs

  - ### setProjectPath

    public void setProjectPath(String projectPath)
    Set the project path
    Parameters:
      `projectPath` - the project path to which the integrated app. belongs

  - ### getCtfBaseUrl

    public String getCtfBaseUrl()
    Get the CTF base URL
    Returns:
      String

  - ### setCtfBaseUrl

    public void setCtfBaseUrl(String ctfBaseUrl)
    Set the CTF base URL.
    Parameters:
      `ctfBaseUrl` -

  - ### getIntegratedAppBaseUrl

    public String getIntegratedAppBaseUrl()
    Get the integrated apps base URL
    Returns:
      the integrated apps base URL

  - ### setIntegratedAppBaseUrl

    public void setIntegratedAppBaseUrl(String iaBaseUrl)
    Set the integrated apps base URL.
    Parameters:
      `iaBaseUrl` - integrated apps base URL

  - ### getWebSessionId

    public String getWebSessionId()
    Get the web session id.
    Returns:
      the web session id

  - ### setWebSessionId

    public void setWebSessionId(String webSessionId)
    Set the web session id.
    Parameters:
      `webSessionId` - users web session id

  - ### getSoapSessionId

    public String getSoapSessionId()
    Get the user's soap session id
    Returns:
      soap session id

  - ### setSoapSessionId

    public void setSoapSessionId(String soapSessionId)
    Set the user's soap session id
    Parameters:
      `soapSessionId` -

  - ### getIntegratedAppObjectId

    public String getIntegratedAppObjectId()
    Get the id of an object in the integrated application
    Returns:
      id of an object in the integrated application.

  - ### setIntegratedAppObjectId

    public void setIntegratedAppObjectId(String iaObjectId)
    Set the id of an object in the integrated application.
    Parameters:
      `iaObjectId` - object id

  - ### getPluggableAppSoap

    public IPluggableAppSoap getPluggableAppSoap()
    Get PluggableAppSoap interface.
    Returns:
      PluggableAppSoap interface

  - ### getCollabNetSoap

    public ICollabNetSoap getCollabNetSoap()
    Get CollabNetSoap interface.
    Returns:
      CollabNetSoap interface

  - ### getRbacAppSoap

    public IRbacAppSoap getRbacAppSoap()

  - ### getScmAppSoap

    public IScmAppSoap getScmAppSoap()

  - ### getIntegrationDataAppSoap

    public IIntegrationDataAppSoap getIntegrationDataAppSoap()
    Get IntegrationDataAppSoap interface.
    Returns:
      IntegrationDataAppSoap interface

  - ### createCookie

    public void createCookie(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws RemoteException
    Set up the cookie.
    Parameters:
      `request` - HttpServletRequest
      `response` - HttpServletResponse
    Throws:
      `RemoteException`

  - ### getWebSessionId

    public String getWebSessionId(String soapSessionId) throws RemoteException
    Get the web session id for the given soap session id.
    Parameters:
      `soapSessionId` - soap session id
    Returns:
      web session id for the given soap session id.
    Throws:
      `RemoteException` - thrown when the session is invalid

  - ### getPlugUrlByLinkId

    public String getPlugUrlByLinkId(String linkId) throws RemoteException
    This method returns Pluggable application base Url by passing Link Id
    Parameters:
      `linkId` -
    Returns:
    Throws:
      `RemoteException`

  - ### getProjectPathByIntAppId

    public String getProjectPathByIntAppId(String integratedAppId) throws RemoteException
    Get the project path for the given integrated application id
    Parameters:
      `integratedAppId` - integrated application id
    Returns:
      project path for the given integrated application
    Throws:
      `RemoteException` - thrown something goes wrong

  - ### getPlugIdByBaseUrl

    public String getPlugIdByBaseUrl(String plugId) throws RemoteException
    This method returns the PlugId by passing the BaseUrl
    Parameters:
      `plugId` -
    Returns:
    Throws:
      `RemoteException`

  - ### processRequest

    public void processRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws RemoteException
    Process the request to initialize the session and project information.
    Parameters:
      `request` - HttpServletRequest
      `response` - HttpServletResponse
    Throws:
      `RemoteException` - thrown when the session is invalid

  - ### getUserId

    public String getUserId() throws RemoteException
    Get the userId for a given soap session id
    Returns:
      the user id for a given session id
    Throws:
      `RemoteException`

  - ### getProjectId

    public String getProjectId(String projectPath) throws RemoteException
    Get the project id for a given soap session id and project path
    Parameters:
      `projectPath` - the project path
    Returns:
      project id for a given project path
    Throws:
      `RemoteException`

  - ### isGoUrl

    public boolean isGoUrl()
    Identify if the current request is a gourl or not.
    Returns:
      true if the request is a gourl, otherwise false.

  - ### isSuperUser

    public boolean isSuperUser() throws RemoteException
    Whether the current logged in user is a super user or not.
    Returns:
      true if the user is a super user, otherwise false.
    Throws:
      `RemoteException`

  - ### processSoapRequest

    public void processSoapRequest() throws RemoteException
    Process the request to initialize the session and project information.
    Throws:
      `RemoteException` - thrown when the session is invalid

  - ### getOneTimeToken

    public String getOneTimeToken()

  - ### setOneTimeToken

    public void setOneTimeToken(String mOneTimeToken)

  - ### getExtSysId

    public String getExtSysId()

  - ### setExtSysId

    public void setExtSysId(String mExtSysId)

  - ### getRepoPath

    public String getRepoPath()

  - ### setRepoPath

    public void setRepoPath(String mRepoPath)

  - ### isAdminPage

    public boolean isAdminPage()
    Whether the current request is for an admin page or not.
    Returns:
      true if the requested page is for an admin page, otherwise false.

  - ### setAdminPage

    public void setAdminPage(boolean isAdminPage)
    Set true if the current request is for an admin page, otherwise false.
    Parameters:
      `isAdminPage` - true if the current request is for an admin page, otherwise false

  - ### redirectToCTF

    public void redirectToCTF(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws RemoteException
    Redirect to CTF when the session is invalid/expired
    Parameters:
      `request` - HttpServletResponse
      `response` - HttpServletResponse
    Throws:
      `RemoteException` - thrown when there is problem during redirect.

  - ### getIntegratedAppPrefix

    public String getIntegratedAppPrefix()
    Get the Integrated Application prefix.
    Returns:
      the Integrated Application prefix.

  - ### setIntegratedAppPrefix

    public void setIntegratedAppPrefix(String prefix)
    Set the Integrated Application prefix.
    Parameters:
      `prefix` - the integrated application prefix.

  - ### updateRecentRead

    public void updateRecentRead(jakarta.servlet.http.HttpServletRequest request, String objectId, String title)
    Update the recently read/viewed objects
    Parameters:
      `request` - HttpServletRequest
      `objectId` - object that was viewed
      `title` - object title

  - ### updateRecentWrite

    public void updateRecentWrite(jakarta.servlet.http.HttpServletRequest request, String objectId, String title)
    Update the recently edited or newly created objects
    Parameters:
      `request` - HttpServletRequest
      `objectId` - object that was recently edited/created
      `title` - object title