felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1775001 - /felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java
Date Mon, 19 Dec 2016 08:11:23 GMT
Author: cziegeler
Date: Mon Dec 19 08:11:23 2016
New Revision: 1775001

URL: http://svn.apache.org/viewvc?rev=1775001&view=rev
Log:
FELIX-5288 : Implement RFC 227 (R7 Update). Update to latest API changes

Modified:
    felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java

Modified: felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java
URL: http://svn.apache.org/viewvc/felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java?rev=1775001&r1=1775000&r2=1775001&view=diff
==============================================================================
--- felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java
(original)
+++ felix/trunk/configadmin/src/main/java/org/osgi/service/cm/ConfigurationPermission.java
Mon Dec 19 08:11:23 2016
@@ -36,9 +36,10 @@ import org.osgi.framework.Filter;
 /**
  * Indicates a bundle's authority to configure bundles or be updated by
  * Configuration Admin.
- *
+ * 
  * @ThreadSafe
- * @author $Id$
+ * @author $Id: ConfigurationPermission.java 1750478 2016-06-28 11:34:40Z
+ *         cziegeler $
  * @since 1.2
  */
 
@@ -68,7 +69,8 @@ public final class ConfigurationPermissi
 
     private final static int		ACTION_CONFIGURE	= 0x00000001;
 	private final static int		ACTION_TARGET		= 0x00000002;
-	private final static int		ACTION_ALL			= ACTION_CONFIGURE | ACTION_TARGET;
+	private final static int		ACTION_ATTRIBUTE    = 0x00000004;
+	private final static int		ACTION_ALL			= ACTION_CONFIGURE | ACTION_TARGET | ACTION_ATTRIBUTE;
 	final static int				ACTION_NONE			= 0;
 
 	/**
@@ -180,10 +182,23 @@ public final class ConfigurationPermissi
 					matchlen = 9;
 					mask |= ACTION_CONFIGURE;
 
-				} else {
-					// parse error
-					throw new IllegalArgumentException("invalid actions: " + actions);
-				}
+    			} else
+	    			if (i >= 8 && (a[i - 8] == 'a' || a[i - 8] == 'A')
+		    				&& (a[i - 7] == 't' || a[i - 7] == 'T')
+			    			&& (a[i - 6] == 't' || a[i - 6] == 'T')
+				    		&& (a[i - 5] == 'r' || a[i - 5] == 'R')
+					    	&& (a[i - 4] == 'i' || a[i - 4] == 'I')
+						    && (a[i - 3] == 'b' || a[i - 3] == 'B')
+						    && (a[i - 2] == 'u' || a[i - 2] == 'U')
+    						&& (a[i - 1] == 't' || a[i - 1] == 'T')
+	     					&& (a[i] == 'e' || a[i] == 'E')) {
+		    			matchlen = 9;
+			    		mask |= ACTION_ATTRIBUTE;
+				    } else {
+					   // parse error
+    					throw new IllegalArgumentException("invalid actions: " + actions);
+	    			}
+	    		
 
 			// make sure we didn't just match the tail of a word
 			// like "ackbarftarget". Also, skip to the comma.
@@ -425,6 +440,13 @@ public final class ConfigurationPermissi
 				if (comma)
 					sb.append(',');
 				sb.append(TARGET);
+				comma = true;
+			}
+
+			if ((mask & ACTION_ATTRIBUTE) == ACTION_ATTRIBUTE) {
+				if (comma)
+					sb.append(',');
+				sb.append(ATTRIBUTE);
 			}
 
 			actions = result = sb.toString();



Mime
View raw message