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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Set up the cookie.ListgetCachedPermissions(String projId)Get the cached permissions for the given projectListgetCachedRoles(String projId)Get the cached roles for the given projectICollabNetSoapgetCollabNetSoap()Get CollabNetSoap interface.StringgetCtfBaseUrl()Get the CTF base URLStringgetExtSysId()StringgetIntegratedAppBaseUrl()Get the integrated apps base URLStringgetIntegratedAppId()Get the integrated application IdStringgetIntegratedAppName()Returns the IntegratedAppNameStringgetIntegratedAppObjectId()Get the id of an object in the integrated applicationStringgetIntegratedAppPrefix()Get the Integrated Application prefix.IIntegrationDataAppSoapgetIntegrationDataAppSoap()Get IntegrationDataAppSoap interface.StringgetOneTimeToken()IPluggableAppSoapgetPluggableAppSoap()Get PluggableAppSoap interface.StringgetPlugIdByBaseUrl(String plugId)This method returns the PlugId by passing the BaseUrlStringgetPlugUrlByLinkId(String linkId)This method returns Pluggable application base Url by passing Link IdStringgetProjectId()get the project IdStringgetProjectId(String projectPath)Get the project id for a given soap session id and project pathStringgetProjectPath()Get the project pathStringgetProjectPathByIntAppId(String integratedAppId)Get the project path for the given integrated application idIRbacAppSoapgetRbacAppSoap()StringgetRepoPath()javax.servlet.http.HttpServletRequestgetRequestObject()Get the Request ObjectIScmAppSoapgetScmAppSoap()StringgetSoapSessionId()Get the user's soap session idStringgetUserId()Get the userId for a given soap session idStringgetWebSessionId()Get the web session id.StringgetWebSessionId(String soapSessionId)Get the web session id for the given soap session id.booleanisAdminPage()Whether the current request is for an admin page or not.booleanisGoUrl()Identify if the current request is a gourl or not.StringisLoggedIn()check if the user is logged in to the CTF systembooleanisSuperUser()Whether the current logged in user is a super user or not.voidprocessRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Process the request to initialize the session and project information.voidprocessSoapRequest()Process the request to initialize the session and project information.voidputCachedPermissions(String projId, List permissions)Adds the permissions to the cache for the given projectvoidputCachedRoles(String projId, List roles)Adds the roles to the cache for the given projectvoidredirectToCTF(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Redirect to CTF when the session is invalid/expiredvoidsetAdminPage(boolean isAdminPage)Set true if the current request is for an admin page, otherwise false.voidsetCtfBaseUrl(String ctfBaseUrl)Set the CTF base URL.voidsetExtSysId(String mExtSysId)voidsetIntegratedAppBaseUrl(String iaBaseUrl)Set the integrated apps base URL.voidsetIntegratedAppId(String integratedAppId)Set the integrated application Id.voidsetIntegratedAppName(String integratedAppName)Sets the IntegratedAppNamevoidsetIntegratedAppObjectId(String iaObjectId)Set the id of an object in the integrated application.voidsetIntegratedAppPrefix(String prefix)Set the Integrated Application prefix.voidsetIsLoggedIn(String mIsLoggedIn)set if the user is logged into the CTf systenvoidsetOneTimeToken(String mOneTimeToken)voidsetProjectId(String mProjectId)Sets the ProjectIdvoidsetProjectPath(String projectPath)Set the project pathvoidsetRepoPath(String mRepoPath)voidsetRequestObject(javax.servlet.http.HttpServletRequest requestObject)Sets the httpServletRequest objectvoidsetSoapSessionId(String soapSessionId)Set the user's soap session idvoidsetWebSessionId(String webSessionId)Set the web session id.voidupdateRecentRead(javax.servlet.http.HttpServletRequest request, String objectId, String title)Update the recently read/viewed objectsvoidupdateRecentWrite(javax.servlet.http.HttpServletRequest request, String objectId, String title)Update the recently edited or newly created objects
-
-
-
Method Detail
-
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 IDpermissions- 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 IDroles- 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 javax.servlet.http.HttpServletRequest getRequestObject()
Get the Request Object- Returns:
- the http request object
-
setRequestObject
public void setRequestObject(javax.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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws RemoteExceptionSet up the cookie.- Parameters:
request- HttpServletRequestresponse- 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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws RemoteExceptionProcess the request to initialize the session and project information.- Parameters:
request- HttpServletRequestresponse- 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 RemoteExceptionWhether 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 RemoteExceptionProcess 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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws RemoteExceptionRedirect to CTF when the session is invalid/expired- Parameters:
request- HttpServletResponseresponse- 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(javax.servlet.http.HttpServletRequest request, String objectId, String title)Update the recently read/viewed objects- Parameters:
request- HttpServletRequestobjectId- object that was viewedtitle- object title
-
-