You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/08/18 17:50:45 UTC

svn commit: r686793 - /webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java

Author: nandana
Date: Mon Aug 18 08:50:45 2008
New Revision: 686793

URL: http://svn.apache.org/viewvc?rev=686793&view=rev
Log:
Policies are not updated correctly, fixing an issue found during testing

Modified:
    webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java

Modified: webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java?rev=686793&r1=686792&r2=686793&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java (original)
+++ webservices/axis2/branches/java/1_4/modules/kernel/src/org/apache/axis2/description/PolicySubject.java Mon Aug 18 08:50:45 2008
@@ -20,6 +20,7 @@
 package org.apache.axis2.description;
 
 import java.util.Collection;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -32,6 +33,8 @@
 public class PolicySubject {
 
 	private boolean updated = false;
+	
+	private Date lastUpdatedTime = new Date();
 
 	private HashMap attachedPolicyComponents = new HashMap();
 
@@ -49,6 +52,7 @@
 
 	public void attachPolicyReference(PolicyReference reference) {
 		attachedPolicyComponents.put(reference.getURI(), reference);
+		setLastUpdatedTime(new Date());
 	}
 
 	public void attachPolicyComponents(List policyComponents) {
@@ -73,6 +77,8 @@
 	public void attachPolicyComponent(String key,
 			PolicyComponent policyComponent) {
 		attachedPolicyComponents.put(key, policyComponent);
+		setLastUpdatedTime(new Date());
+		
 		if (!isUpdated()) {
 			setUpdated(true);
 		}
@@ -103,6 +109,7 @@
 					"policy doesn't have a name or an id ");
 		}
 		attachedPolicyComponents.put(key, policy);
+		setLastUpdatedTime(new Date());		
 		if (!isUpdated()) {
 			setUpdated(true);
 		}
@@ -110,6 +117,7 @@
 
 	public void detachPolicyComponent(String key) {
 		attachedPolicyComponents.remove(key);
+		setLastUpdatedTime(new Date());
 		if (!isUpdated()) {
 			setUpdated(true);
 		}
@@ -117,8 +125,17 @@
 
 	public void clear() {
 		attachedPolicyComponents.clear();
+		setLastUpdatedTime(new Date());
 		if (!isUpdated()) {
 			setUpdated(true);
 		}
 	}
+	
+        public Date getLastUpdatedTime() {
+                return lastUpdatedTime;
+        }
+
+        public void setLastUpdatedTime(Date lastUpdatedTime) {
+                this.lastUpdatedTime = lastUpdatedTime;
+        }
 }