atg.svc.repository.service
Class SolutionStatusService

java.lang.Object
  extended by atg.nucleus.GenericService
      extended by atg.svc.repository.service.BaseService
          extended by atg.svc.repository.service.SharedService
              extended by atg.svc.repository.service.SolutionStatusService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class SolutionStatusService
extends SharedService

Author:
rshinde

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.svc.repository.service.BaseService
mBeanHomes, mBeanHomesName, mRepositoryHomes, mRepositoryHomesName
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
SolutionStatusService()
           
 
Method Summary
 boolean addStatusForTaskElementId(java.lang.String pWorkflowName, java.lang.String pTaskElementId, SolutionStatus pSolutionStatus)
          Adds a solution status task definition for workflow name and task element id.
 SolutionSolutionStatus changeSolutionVersion(atg.versionmanager.VersionManagerURI pSolutionURI, atg.versionmanager.VersionManagerURI pTargetURI, boolean pForceDeleteOld, boolean pMigrateOldValues)
           
 SolutionSolutionStatus createSolutionStatus(java.lang.String pSolutionId, int pVersion, SolutionStatus pSolutionStatus)
          Creates solution's status
 SolutionSolutionStatus createSolutionStatus(java.lang.String pSolutionId, int pVersion, SolutionStatus pSolutionStatus, boolean pDeployed)
          Creates solution's status
 SolutionSolutionStatus findDeployedSolutionStatus(java.lang.String pSolutionId)
          Finds the deployed solution's status
 SolutionSolutionStatus findSolutionStatus(java.lang.String pSolutionId, int pVersion)
          Finds the solution's status
 SolutionStatusTaskDefn findStatusForTaskElementId(java.lang.String pWorkflowName, java.lang.String pTaskElementId)
          Finds a solution status task object by workflow name and task element id.
 atg.svc.agent.events.EventTools getEventTools()
           
 SolutionService getSolutionService()
           
 boolean isSolutionDeployed(java.lang.String pSolutionId)
          Returns true if the given solution has been deployed.
 SolutionSolutionStatus markSolutionStatusAsDeployed(java.lang.String pSolutionId, int pVersion)
          Marks the solution as deployed for the version specified if not already deployed.
 void markSolutionStatusAsUndeployed(java.lang.String pSolutionId)
          Finds the deployed solution status (if the solution is currently deployed) and marks that status as undeployed.
 SolutionSolutionStatus markSolutionStatusAsUnDeployed(java.lang.String pSolutionId, int pVersion)
          Marks the solution as undeployed for the version specified.
 void removeSolutionStatusTaskDefn(java.lang.String pWorkflowName, java.lang.String pTaskElementId)
          Finds a solution status task object by workflow name and task element id.
 void saveSolutionStatus(SolutionSolutionStatus pSolutionSolutionStatus)
          Saves the SolutionSolutionStatus.
 void saveSolutionStatusTaskDefn(SolutionStatusTaskDefn pSolutionStatusTaskDefn)
          Saves the SolutionStatusTaskDefn.
 void setEventTools(atg.svc.agent.events.EventTools pEventTools)
           
 void setSolutionService(SolutionService pSolutionService)
           
 SolutionSolutionStatus updateSolutionStatus(java.lang.String pSolutionId, int pVersion, SolutionStatus pSolutionStatus, boolean pDeployed)
          Updates a solution's status
 
Methods inherited from class atg.svc.repository.service.SharedService
getBeanHomes, getRepositoryHomes
 
Methods inherited from class atg.svc.repository.service.BaseService
getBaseBeanHomes, getBaseRepositoryHomes, getBeanHomesName, getRepositoryHomesName, getRepositoryService, getToday, setBeanHomesName, setRepositoryHomesName, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning, setServiceInfo, startService, stopService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

SolutionStatusService

public SolutionStatusService()
Method Detail

getEventTools

public atg.svc.agent.events.EventTools getEventTools()

setEventTools

public void setEventTools(atg.svc.agent.events.EventTools pEventTools)

getSolutionService

public SolutionService getSolutionService()

setSolutionService

public void setSolutionService(SolutionService pSolutionService)

findStatusForTaskElementId

public SolutionStatusTaskDefn findStatusForTaskElementId(java.lang.String pWorkflowName,
                                                         java.lang.String pTaskElementId)
                                                  throws ObjectNotFoundException
Finds a solution status task object by workflow name and task element id.

Parameters:
pWorkflowName - The workflow process name
pTaskElementId - The task element id of the task in the workflow.
Returns:
The SolutionStatusTask ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

addStatusForTaskElementId

public boolean addStatusForTaskElementId(java.lang.String pWorkflowName,
                                         java.lang.String pTaskElementId,
                                         SolutionStatus pSolutionStatus)
                                  throws javax.ejb.CreateException,
                                         PersistenceException
Adds a solution status task definition for workflow name and task element id. If it does not exist it will create a new one. If it does exist it will update the status.

Parameters:
pWorkflowName - The workflow process name
pTaskElementId - The task element id of the task in the workflow.
pSolutionStatus - The solution status
Returns:
true if SolutionStatusTaskDefn was created, if updated or already existed return false.
Throws:
javax.ejb.CreateException
PersistenceException

removeSolutionStatusTaskDefn

public void removeSolutionStatusTaskDefn(java.lang.String pWorkflowName,
                                         java.lang.String pTaskElementId)
                                  throws ObjectNotFoundException,
                                         PersistenceException
Finds a solution status task object by workflow name and task element id.

Parameters:
pWorkflowName - The workflow process name
pTaskElementId - The task element id of the task in the workflow.
Throws:
ObjectNotFoundException - If the id is not found.
PersistenceException

createSolutionStatus

public SolutionSolutionStatus createSolutionStatus(java.lang.String pSolutionId,
                                                   int pVersion,
                                                   SolutionStatus pSolutionStatus)
                                            throws javax.ejb.CreateException,
                                                   PersistenceException,
                                                   ObjectNotFoundException
Creates solution's status

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
pSolutionStatus - The solution status
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
javax.ejb.CreateException
PersistenceException
ObjectNotFoundException

createSolutionStatus

public SolutionSolutionStatus createSolutionStatus(java.lang.String pSolutionId,
                                                   int pVersion,
                                                   SolutionStatus pSolutionStatus,
                                                   boolean pDeployed)
                                            throws javax.ejb.CreateException,
                                                   PersistenceException,
                                                   ObjectNotFoundException
Creates solution's status

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
pSolutionStatus - The solution status
pDeployed - The deployed status
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
javax.ejb.CreateException
PersistenceException
ObjectNotFoundException

updateSolutionStatus

public SolutionSolutionStatus updateSolutionStatus(java.lang.String pSolutionId,
                                                   int pVersion,
                                                   SolutionStatus pSolutionStatus,
                                                   boolean pDeployed)
                                            throws javax.ejb.CreateException,
                                                   PersistenceException,
                                                   ObjectNotFoundException
Updates a solution's status

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
pSolutionStatus - The solution status
pDeployed - Flag to mark this as deployed status
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
javax.ejb.CreateException
PersistenceException
ObjectNotFoundException

findSolutionStatus

public SolutionSolutionStatus findSolutionStatus(java.lang.String pSolutionId,
                                                 int pVersion)
                                          throws ObjectNotFoundException
Finds the solution's status

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
ObjectNotFoundException - If the id is not found.

findDeployedSolutionStatus

public SolutionSolutionStatus findDeployedSolutionStatus(java.lang.String pSolutionId)
Finds the deployed solution's status

Parameters:
pSolutionId - The solution rep id
Returns:
The SolutionSolutionStatus ReposImpl or null if the solutoin has no deployed solution status because it was created via repository import rather than thru deployment.

isSolutionDeployed

public boolean isSolutionDeployed(java.lang.String pSolutionId)
Returns true if the given solution has been deployed.

Parameters:
pSolutionId - The repository id of the solution to check.
Returns:
true if the solution has been deployed else false.

markSolutionStatusAsDeployed

public SolutionSolutionStatus markSolutionStatusAsDeployed(java.lang.String pSolutionId,
                                                           int pVersion)
                                                    throws ObjectNotFoundException,
                                                           PersistenceException
Marks the solution as deployed for the version specified if not already deployed. Also mark the previously deployed solutions as not deployed. Only one solution version can be deployed at any given time.

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
ObjectNotFoundException - when the solution status is not found
PersistenceException - When unable to save the solution status

markSolutionStatusAsUnDeployed

public SolutionSolutionStatus markSolutionStatusAsUnDeployed(java.lang.String pSolutionId,
                                                             int pVersion)
                                                      throws ObjectNotFoundException,
                                                             PersistenceException
Marks the solution as undeployed for the version specified. Only modifies the status' published flag if it was deployed.

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
Returns:
The SolutionSolutionStatus ReposImpl
Throws:
ObjectNotFoundException - when the solution status is not found
PersistenceException - When unable to save the solution status

markSolutionStatusAsUndeployed

public void markSolutionStatusAsUndeployed(java.lang.String pSolutionId)
                                    throws PersistenceException
Finds the deployed solution status (if the solution is currently deployed) and marks that status as undeployed. If the solution has never been deployed, this is a no-op.

Parameters:
pSolutionId - The solution rep id
pVersion - The solution version
Throws:
PersistenceException - When unable to save the solution status

changeSolutionVersion

public SolutionSolutionStatus changeSolutionVersion(atg.versionmanager.VersionManagerURI pSolutionURI,
                                                    atg.versionmanager.VersionManagerURI pTargetURI,
                                                    boolean pForceDeleteOld,
                                                    boolean pMigrateOldValues)
                                             throws ObjectNotFoundException,
                                                    PersistenceException,
                                                    javax.ejb.RemoveException
Parameters:
pSolutionURI - the original version of the solution
pTargetURI - the target version of the solution.
pForceDeleteOld - if set to true, delete the old SolutionSolutionStatus if the SolutionSolutionStatus already exists for target version and also migrate the old statusId and lastModifyDate.
pMigrateOldValues - if set to true, copy the statusId and lastModifyDate from old version to target version. This is valid only if SolutionSolutionStatus exits for the target version.
Returns:
The SolutionSolutionStatus for target.
Throws:
ObjectNotFoundException
PersistenceException
javax.ejb.RemoveException - Unable to delete the existing SolutionSolutionStatus for older version

saveSolutionStatus

public void saveSolutionStatus(SolutionSolutionStatus pSolutionSolutionStatus)
                        throws PersistenceException
Saves the SolutionSolutionStatus.

Parameters:
pSolutionSolutionStatus - the status to be saved
Throws:
PersistenceException

saveSolutionStatusTaskDefn

public void saveSolutionStatusTaskDefn(SolutionStatusTaskDefn pSolutionStatusTaskDefn)
                                throws PersistenceException
Saves the SolutionStatusTaskDefn.

Parameters:
pSolutionStatusTaskDefn - the status to be saved
Throws:
PersistenceException