[Join-cvs] join1/src/main/org/figure8/join/services/remoting/services ProcessControlServiceImpl.ja
Brought to you by:
lbroudoux
|
From: Laurent B. <lbr...@us...> - 2008-07-25 00:00:46
|
Update of /cvsroot/join/join1/src/main/org/figure8/join/services/remoting/services In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv9181/services/remoting/services Modified Files: ProcessControlServiceImpl.java Log Message: Fix for issue #1995255 : review interface, implementations and clients Index: ProcessControlServiceImpl.java =================================================================== RCS file: /cvsroot/join/join1/src/main/org/figure8/join/services/remoting/services/ProcessControlServiceImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProcessControlServiceImpl.java 9 Oct 2006 20:27:22 -0000 1.2 --- ProcessControlServiceImpl.java 25 Jul 2008 00:00:43 -0000 1.3 *************** *** 15,19 **** package org.figure8.join.services.remoting.services; - import org.figure8.join.core.DuplicateEntityException; import org.figure8.join.services.remoting.ProcessControlService; import org.figure8.join.services.remoting.InvalidSessionException; --- 15,18 ---- *************** *** 121,125 **** * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setBuildStatus(String token, String statusKey, String buildKey) throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); --- 120,125 ---- * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setBuildStatus(String token, String statusKey, String buildKey) ! throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); *************** *** 127,136 **** if (user.hasPermission(joinRole)){ ! Status status = processManager.getStatus(statusKey); ! Build build = assemblyManager.getBuild(buildKey); ! ! if (status != null && build != null){ ! build.setStatus(status); ! //assemblyManager.saveBuild(build, build.getComponents()); } } --- 127,144 ---- if (user.hasPermission(joinRole)){ ! try{ ! Status status = processManager.getStatus(statusKey); ! Build build = assemblyManager.getBuild(buildKey); ! ! if (status != null && build != null){ ! build.setStatus(status); ! assemblyManager.saveBuild(build, null, null); ! } ! } ! catch (Exception e){ ! // Log and wrap exception into Remote one. ! log.warn("Caught an Exception while updating the status of build: " + buildKey); ! log.warn("Here's the detailed message: " + e.getMessage()); ! throw new RemoteException("Exception while invoking status update on build"); } } *************** *** 146,150 **** * @throws RemoteException if an exception occurs during the remote conversation */ ! public RemoteStatus getAssemblyStatus(String token, String key) throws InvalidSessionException, RemoteException{ // Ensure token is still valid. getAuthenticatedUser(token); --- 154,159 ---- * @throws RemoteException if an exception occurs during the remote conversation */ ! public RemoteStatus getAssemblyStatus(String token, String key) ! throws InvalidSessionException, RemoteException{ // Ensure token is still valid. getAuthenticatedUser(token); *************** *** 164,168 **** * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setAssemblyStatus(String token, String statusKey, String assemblyKey) throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); --- 173,178 ---- * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setAssemblyStatus(String token, String statusKey, String assemblyKey) ! throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); *************** *** 170,190 **** if (user.hasPermission(joinRole)){ ! Status status = processManager.getStatus(statusKey); ! Assembly assembly = assemblyManager.getAssembly(assemblyKey); ! ! if (status != null && assembly != null){ ! assembly.setStatus(status); ! try {assemblyManager.saveAssembly(assembly, null);} ! catch (Exception e){ ! // Log and wrap exception into Remote one. ! log.warn("Caught an Exception while updating the status of assembly: " + assemblyKey); ! log.warn("Here's the detailed message: " + e.getMessage()); ! throw new RemoteException("Exception while invoking status update on assembly"); } } } else throw new InvalidSessionException("Integrator security role is required !"); } ! /** * Retrieve the status of a specified {@link Deployment}. --- 180,202 ---- if (user.hasPermission(joinRole)){ ! try{ ! Status status = processManager.getStatus(statusKey); ! Assembly assembly = assemblyManager.getAssembly(assemblyKey); ! ! if (status != null && assembly != null){ ! assembly.setStatus(status); ! assemblyManager.saveAssembly(assembly, null); } } + catch (Exception e){ + // Log and wrap exception into Remote one. + log.warn("Caught an Exception while updating the status of assembly: " + assemblyKey); + log.warn("Here's the detailed message: " + e.getMessage()); + throw new RemoteException("Exception while invoking status update on assembly"); + } } else throw new InvalidSessionException("Integrator security role is required !"); } ! /** * Retrieve the status of a specified {@link Deployment}. *************** *** 195,207 **** * @throws RemoteException if an exception occurs during the remote conversation */ ! public RemoteStatus getDeploymentStatus(String token, long deploymentId) throws InvalidSessionException, RemoteException{ // Ensure token is still valid. getAuthenticatedUser(token); ! Deployment deployment = environmentManager.getDeployment(deploymentId); ! /* if (deployment != null) ! return BeansHelper.getRemoteObject(deployment); ! */ return null; } --- 207,218 ---- * @throws RemoteException if an exception occurs during the remote conversation */ ! public RemoteStatus getDeploymentStatus(String token, Long deploymentId) ! throws InvalidSessionException, RemoteException{ // Ensure token is still valid. getAuthenticatedUser(token); ! Deployment deployment = environmentManager.getDeployment(deploymentId.longValue()); if (deployment != null) ! return BeansHelper.getRemoteObject(deployment.getStatus()); return null; } *************** *** 215,233 **** * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setDeploymentStatus(String token, String statusKey, long deploymentId) throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); Role joinRole = permissionManager.getRole(Role.DEFAULT_JOINER_ROLE); ! if (user.hasPermission(joinRole)){ ! Status status = processManager.getStatus(statusKey); ! Deployment deployment = environmentManager.getDeployment(deploymentId); ! if (status != null && deployment != null){ ! deployment.setStatus(status); ! environmentManager.saveDeployment(deployment); } } ! throw new InvalidSessionException("Integrator security role is required !"); } } --- 226,253 ---- * @throws RemoteException if an exception occurs during the remote conversation */ ! public void setDeploymentStatus(String token, String statusKey, Long deploymentId) ! throws InvalidSessionException, RemoteException{ // Ensure token is still valid and get user view. UserView user = getAuthenticatedUser(token); Role joinRole = permissionManager.getRole(Role.DEFAULT_JOINER_ROLE); ! if (user.hasPermission(joinRole)){ ! try{ ! Status status = processManager.getStatus(statusKey); ! Deployment deployment = environmentManager.getDeployment(deploymentId.longValue()); ! if (status != null && deployment != null){ ! deployment.setStatus(status); ! environmentManager.saveDeployment(deployment); ! } ! } ! catch (Exception e){ ! // Log and wrap exception into Remote one. ! log.warn("Caught an Exception while updating the status of deployment: " + deploymentId); ! log.warn("Here's the detailed message: " + e.getMessage()); ! throw new RemoteException("Exception while invoking status update on deployment"); } } ! else throw new InvalidSessionException("Integrator security role is required !"); } } |