perfsonar-dev - r2080 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security
Subject: perfsonar development work
List archive
r2080 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security
Chronological Thread
- From:
- To:
- Subject: r2080 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security
- Date: Thu, 15 Feb 2007 11:03:50 -0500
Author: uros
Date: 2007-02-15 11:03:49 -0500 (Thu, 15 Feb 2007)
New Revision: 2080
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java
Log:
Special case of anonymization parameter (REGEXP). General implementation
still missing.
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java
2007-02-15 15:28:48 UTC (rev 2079)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java
2007-02-15 16:03:49 UTC (rev 2080)
@@ -890,6 +890,16 @@
}
+ /**
+ * Value getter.
+ *
+ * @return value
+ */
+ public String getValue() {
+
+ return value;
+
+ }
}
@@ -949,6 +959,16 @@
}
+ /**
+ * Value getter.
+ *
+ * @return value
+ */
+ public Integer getValue() {
+
+ return value;
+
+ }
}
@@ -1011,6 +1031,16 @@
}
+ /**
+ * Value getter.
+ *
+ * @return value
+ */
+ public AnonymizationMapDistributionType getValue() {
+
+ return value;
+
+ }
}
@@ -1072,6 +1102,16 @@
}
+ /**
+ * Value getter.
+ *
+ * @return value
+ */
+ public AnonymizationHashFunctionType getValue() {
+
+ return value;
+
+ }
}
@@ -1134,6 +1174,16 @@
}
+ /**
+ * Value getter.
+ *
+ * @return value
+ */
+ public AnonymizationHashFunctionPaddingType getValue() {
+
+ return value;
+
+ }
}
@@ -1194,7 +1244,6 @@
}
-
/**
* Value getter.
*
@@ -1205,6 +1254,7 @@
return value;
}
+
}
/**
@@ -1368,8 +1418,8 @@
functionType.getParamTypes();
AnonymizationPatternTypeParameter param0 =
(AnonymizationPatternTypeParameter)paramTypes[0].getCls()
- .getConstructor(parentCls.getClass(),
String.class)
- .newInstance(parentCls, functionParams.get(0));
+ .getConstructor(parentCls.getClass(), String.class)
+ .newInstance(parentCls, functionParams.get(0));
if (param0.getValue() == null)
throw new Exception("Unknown pattern type '"
+ functionParams.get(0) + "'");
@@ -1391,14 +1441,46 @@
(AnonymizationParameter)param1Cls
.getConstructor(parentCls.getClass(),
String.class)
.newInstance(parentCls, functionParams.get(1));
+ if (param1.getValueAsObject() == null)
+ throw new Exception("Empty pattern value '"
+ + functionParams.get(0) + "'");
convParams.add(param0);
convParams.add(param1);
} else if (functionType == AnonymizationFunctionType.REGEXP)
{
- //TODO
+ if (functionParams.size() < 1)
+ throw new Exception("Invalid number of parameters
for"
+ + " anonymization function '"
+ + functionType.getType() + "'");
+ AnonymizationParameterType paramTypes[] =
+ functionType.getParamTypes();
+ AnonymizationStringParameter regex =
+ (AnonymizationStringParameter)paramTypes[0].getCls()
+ .getConstructor(parentCls.getClass(), String.class)
+ .newInstance(parentCls, functionParams.get(0));
+ if (regex.getValue() == null)
+ throw new Exception("Empty regular expression '"
+ + functionParams.get(0) + "'");
+
+ convParams.add(regex);
+
+ String saved = functionParams.remove(0);
+
+ for (String s : functionParams) {
+
+ AnonymizationStringParameter param =
+
(AnonymizationStringParameter)paramTypes[0].getCls()
+ .getConstructor(parentCls.getClass(),
String.class)
+ .newInstance(parentCls, s);
+ convParams.add(param);
+
+ }
+
+ functionParams.add(0, saved);
+
} else {
//TODO
- r2080 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security, svnlog, 02/15/2007
Archive powered by MHonArc 2.6.16.