{
ReleaseResult result = releaseManager.getReleaseResult( releaseId );
if ( result != null && getContinuum().getContinuumReleaseResult( projectId, releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
{
ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
getContinuum().addContinuumReleaseResult( releaseResult );
}
}
listenerSummary.setPhases( DistributedReleaseUtil.getReleasePhases( map ) );
listenerSummary.setCompletedPhases( DistributedReleaseUtil.getCompletedReleasePhases( map ) );
listenerSummary.setInProgress( DistributedReleaseUtil.getReleaseInProgress( map ) );
listenerSummary.setError( DistributedReleaseUtil.getReleaseError( map ) );
}
else
{
throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
}
}
else
{
ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId );
if ( listener != null )
{
username = listener.getUsername();
if ( listener.getState() == ContinuumReleaseManagerListener.LISTENING )
{
status = "inProgress";
}
else if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
{
status = SUCCESS;
}
else
{
status = "initialized";
}
listenerSummary.setPhases( listener.getPhases() );
listenerSummary.setCompletedPhases( listener.getCompletedPhases() );
listenerSummary.setInProgress( listener.getInProgress() );
listenerSummary.setError( listener.getError() );
}
else
{
throw new Exception( "There is no on-going or finished release operation with id " + releaseId );
}
if ( status.equals( SUCCESS ) )
{
ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
if ( result != null && getContinuum().getContinuumReleaseResult( projectId, releaseGoal, result.getStartTime(), result.getEndTime() ) == null )
{
ContinuumReleaseResult releaseResult = createContinuumReleaseResult( result );
getContinuum().addContinuumReleaseResult( releaseResult );
}
}
}