ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1165632 - /incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java
Date Tue, 06 Sep 2011 12:17:47 GMT
Author: marrs
Date: Tue Sep  6 12:17:46 2011
New Revision: 1165632

URL: http://svn.apache.org/viewvc?rev=1165632&view=rev
Log:
Small refactoring, and added a note to the implementation that refers to ACE-179.

Modified:
    incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java

Modified: incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java?rev=1165632&r1=1165631&r2=1165632&view=diff
==============================================================================
--- incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java
(original)
+++ incubator/ace/trunk/ace-client-repository-impl/src/main/java/org/apache/ace/client/repository/stateful/impl/StatefulGatewayObjectImpl.java
Tue Sep  6 12:17:46 2011
@@ -298,15 +298,19 @@ public class StatefulGatewayObjectImpl i
 
             List<LogEvent> newEvents = m_repository.getAuditEvents(newDescriptors);
             for (int position = newEvents.size() - 1; position >= 0; position--) {
-                String currentVersion = (String) newEvents.get(position).getProperties().get(AuditEvent.KEY_VERSION);
-                if (newEvents.get(position).getType() == AuditEvent.DEPLOYMENTCONTROL_INSTALL)
{
+                LogEvent event = newEvents.get(position);
+                
+                // TODO we need to check here if the deployment package is actually the right
one
+                
+                String currentVersion = (String) event.getProperties().get(AuditEvent.KEY_VERSION);
+                if (event.getType() == AuditEvent.DEPLOYMENTCONTROL_INSTALL) {
                     addStatusAttribute(KEY_LAST_INSTALL_VERSION, currentVersion);
                     setProvisioningState(ProvisioningState.InProgress);
                     sendNewAuditlog(newDescriptors);
                     m_processedAuditEvents = allDescriptors;
                     return;
                 }
-                else if (newEvents.get(position).getType() == AuditEvent.DEPLOYMENTADMIN_COMPLETE)
{
+                else if (event.getType() == AuditEvent.DEPLOYMENTADMIN_COMPLETE) {
                     addStatusAttribute(KEY_LAST_INSTALL_VERSION, currentVersion);
                     if ((currentVersion != null) && currentVersion.equals(getStatusAttribute(KEY_ACKNOWLEDGED_INSTALL_VERSION)))
{
                         setProvisioningState(ProvisioningState.Idle);
@@ -315,7 +319,7 @@ public class StatefulGatewayObjectImpl i
                         return;
                     }
                     else {
-                        String value = (String) newEvents.get(position).getProperties().get(AuditEvent.KEY_SUCCESS);
+                        String value = (String) event.getProperties().get(AuditEvent.KEY_SUCCESS);
                         addStatusAttribute(KEY_LAST_INSTALL_SUCCESS, value);
                         if (Boolean.parseBoolean(value)) {
                             setProvisioningState(ProvisioningState.OK);



Mime
View raw message