Skip to Content.
Sympa Menu

perfsonar-dev - r2063 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security

Subject: perfsonar development work

List archive

r2063 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security


Chronological Thread 
  • From:
  • To:
  • Subject: r2063 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security
  • Date: Tue, 13 Feb 2007 12:49:04 -0500

Author: uros
Date: 2007-02-13 12:49:03 -0500 (Tue, 13 Feb 2007)
New Revision: 2063

Added:

trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java

trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/AuthorizationException.java
Modified:

trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Credentials.java
Log:
Almost finished implementation of Anonymization

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Authorization.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/AuthorizationException.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/AuthorizationException.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Credentials.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Credentials.java
2007-02-13 13:14:57 UTC (rev 2062)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security/Credentials.java
2007-02-13 17:49:03 UTC (rev 2063)
@@ -14,9 +14,6 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.ArrayList;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.PrintStream;
@@ -31,762 +28,6 @@
public class Credentials {


-
- /**
- * Authorization type declaration.
- */
- public enum AuthorizationType {
-
- UNUSED(null),
- ANONYMIZATION("anonymization"),
- HEADER_FILTER("header_filter"),
- PAYLOAD_FILTER("payload_filter"),
- SAMPLING("sampling");
-
- /**
- * Constructor with authorization type name argument.
- *
- * @param type authorization type name
- */
- private AuthorizationType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Authorization type name getter.
- *
- * @return authorization type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return authorization type identified by authorization type name.
- *
- * @return authorization type or null if not found
- */
- public static AuthorizationType getTypeByName(String type) {
-
- for (AuthorizationType at :
EnumSet.allOf(AuthorizationType.class)) {
-
- if (at.getType().equals(type)) return at;
-
- }
-
- return null;
-
- }
-
- /**
- * Sampling type name holder.
- */
- private final String type;
- }
-
- /**
- * Sampling type declaration.
- */
- public enum SamplingType {
-
- DETERMINISTIC("deterministic"),
- PROBABILISTIC("probabilistic");
-
- /**
- * Constructor with sampling type name argument.
- *
- * @param type sampling type name
- */
- private SamplingType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Sampling type name getter.
- *
- * @return sampling type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return sampling type identified by sampling type name.
- *
- * @return sampling type or null if not found
- */
- public static SamplingType getTypeByName(String type) {
-
- for (SamplingType st : EnumSet.allOf(SamplingType.class)) {
-
- if (st.getType().equals(type)) return st;
-
- }
-
- return null;
-
- }
-
- /**
- * Sampling type name holder.
- */
- private final String type;
- }
-
- /**
- * Anonymization protocol types.
- */
- public enum AnonymizationProtocolType {
-
- IP("ip"),
- TCP("tcp"),
- UDP("udp"),
- ICMP("icmp"),
- HTTP("http"),
- FTP("ftp");
-
-
- /**
- * Constructor with anonymization protocol type name.
- *
- * @param type anonymization protocol type name
- */
- private AnonymizationProtocolType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Anonymization protocol type name getter.
- *
- * @return anonymization protocol type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return anonymization protocol type identified by anon type name.
- *
- * @return anonymization protocol type or null if not found
- */
- public static AnonymizationProtocolType getTypeByName(String type) {
-
- for (AnonymizationProtocolType st :
- EnumSet.allOf(AnonymizationProtocolType.class)) {
-
- if (st.getType().equals(type)) return st;
-
- }
-
- return null;
-
- }
-
- private final String type;
-
- }
-
- /**
- * Anonymization field types.
- */
- public enum AnonymizationFieldType {
-
- PAYLOAD("payload"),
- CHECKSUM("checksum"),
- SRC_IP("srcIp"),
- DST_IP("dstIp"),
- TTL("ttl"),
- TOS("tos"),
- ID("id"),
- IP_VERSION("fieldVersion"),
- OPTIONS("options"),
- PACKET_LENGTH("packetLength"),
- IP_PROTO("ipProto"),
- IHL("ihl"),
- FRAGMENT_OFFSET("fragmentOffset"),
- SRC_PORT("srcPort"),
- DST_PORT("dstPort"),
- SEQUENCE_NUMBER("sequenceNumber"),
- OFFSET_AND_RESERVED("offsetAndReserved"),
- ACK_NUMBER("ackNumber"),
- FLAGS("flags"),
- URGENT_POINTER("urgentPointer"),
- WINDOW("window"),
- TCP_OPTIONS("tcpOptions"),
- UDP_DATAGRAM_LENGTH("udpDatagramLength"),
- TYPE("type"),
- CODE("code"),
- HTTP_VERSION("httpVersion"),
- METHOD("method"),
- URI("uri"),
- USER_AGENT("userAgent"),
- ACCEPT("accept"),
- ACCEPT_CHARSET("acceptCharset"),
- ACCEPT_ENCODING("acceptEncoding"),
- ACCEPT_LANGUAGE("acceptLanguage"),
- ACCEPT_RANGES("acceptRanges"),
- AGE("age"),
- ALLOW("allow"),
- AUTHORIZATION("authorization"),
- CACHE_CONTROL("chacheControl"),
- CONNECTION_TYPE("connectionType"),
- CONTENT_TYPE("contentType"),
- CONTENT_LENGTH("contentLength"),
- CONTENT_LOCATION("contentLocation"),
- CONTENT_MD5("contentMd5"),
- CONTENT_RANGE("contentRange"),
- COOKIE("cookie"),
- ETAG("etag"),
- EXPECT("expect"),
- EXPIRES("expires"),
- FROM("from"),
- HOST("host"),
- IF_MATCH("ifMatch"),
- IF_MODIFIED_SINCE("ifModifiedSince"),
- IF_NONE_MATCH("ifNoneMatch"),
- IF_RANGE("ifRange"),
- IF_UNMODIFIED_SINCE("ifUnmodifiedSince"),
- LAST_MODIFIED("lastModified"),
- MAX_FORWRDS("maxForwrds"),
- PRAGMA("pragma"),
- PROXY_AUTHENTICATE("proxyAuthenticate"),
- PROXY_AUTHORIZATION("proxyAuthorization"),
- RANGE("range"),
- REFERRER("referrer"),
- RETRY_AFTER("retryAfter"),
- SET_COOKIE("setCookie"),
- SERVER("server"),
- TE("te"),
- TRAILER("trailer"),
- TRANSFER_ENCODING("transferEncoding"),
- UPGRADE("upgrade"),
- VIA("via"),
- WARNING("warning"),
- WWW_AUTHENTICATE("wwwAuthenticate"),
- X_POWERED_BY("xPoweredBy"),
- RESPONSE_CODE("responseCode"),
- RESP_CODE_DESCR("respCodeDescr"),
- VARY("vary"),
- DATE("date"),
- CONTENT_ENCODING("contentEncoding"),
- KEEP_ALIVE("keepAlive"),
- LOCATION("location"),
- CONTENT_LANGUAGE("contentLanguage"),
- DERIVED_FROM("derivedForm"),
- ALLOWED("allowed"),
- MIME_VERSION("mimeVersion"),
- TITLE("title"),
- REFRESH("refresh"),
- HTTP_PAYLOAD("httpPayload"),
- USER("user"),
- PASS("pass"),
- ACCT("acct"),
- FTP_TYPE("ftpType"),
- STRU("stru"),
- MODE("mode"),
- CWD("cwd"),
- PWD("pwd"),
- CDUP("cdup"),
- PASV("pasv"),
- RETR("retr"),
- REST("rest"),
- PORT("port"),
- LIST("list"),
- NLST("nlst"),
- QUIT("quit"),
- SYST("syst"),
- STAT("stat"),
- HELP("help"),
- NOOP("noop"),
- STOR("stor"),
- APPE("appe"),
- STOU("stou"),
- ALLO("allo"),
- MKD("mkd"),
- RMD("rmd"),
- DELE("dele"),
- RNFR("rnfr"),
- RNTO("rnto"),
- SITE("site"),
- FTP_RESPONSE_CODE("ftpResponseCode"),
- FTP_RESPONSE_ARG("ftpResponseArg");
-
-
- /**
- * Constructor with anonymization field type name.
- *
- * @param type anonymization field type name
- */
- private AnonymizationFieldType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Anonymization field type name getter.
- *
- * @return anonymization field type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return anonymization field type identified by anon type name.
- *
- * @return anonymization field type or null if not found
- */
- public static AnonymizationFieldType getTypeByName(String type) {
-
- for (AnonymizationFieldType aft :
- EnumSet.allOf(AnonymizationFieldType.class)) {
-
- if (aft.getType().equals(type)) return aft;
-
- }
-
- return null;
-
- }
-
- private final String type;
-
- }
-
- /**
- * Anonymization function types.
- */
- public enum AnonymizationFunctionType {
-
- UNCHANGED("unchanged"),
- MAP("map"),
- MAP_DISTRIBUTION("mapDistribution"),
- STRIP("strip"),
- RANDOM("random"),
- HASHED("hashed"),
- PATTERN_FILL("patternFill"),
- ZERO("zero"),
- REPLACE("replace"),
- PREFIX_PRESERVING("prefixPreserving"),
- PREFIX_PRESERVING_MAP("prefixPreservingMap"),
- CHECKSUM_ADJUST("checksumAdjust"),
- FILENAME_RANDOM("filenameRandom"),
- REGEXP("regexp");
-
-
- /**
- * Constructor with anonymization function type name.
- *
- * @param type anonymization function type name
- */
- private AnonymizationFunctionType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Anonymization function type name getter.
- *
- * @return anonymization function type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return anonymization function type identified by anon type name.
- *
- * @return anonymization function type or null if not found
- */
- public static AnonymizationFunctionType getTypeByName(String type) {
-
- for (AnonymizationFunctionType aft :
- EnumSet.allOf(AnonymizationFunctionType.class)) {
-
- if (aft.getType().equals(type)) return aft;
-
- }
-
- return null;
-
- }
-
- private final String type;
-
- }
-
- /**
- * Anonymization hash function types.
- */
- public enum AnonymizationHashFunctionType {
-
- SHA("sha"),
- MD5("md5"),
- CRC32("crc32"),
- SHA_2("sha2"),
- TRIPLEDES("trippleDes"),
- AES("aes"),
- DES("des");
-
-
- /**
- * Constructor with anonymization hash function type name.
- *
- * @param type anonymization hash function type name
- */
- private AnonymizationHashFunctionType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Anonymization hash function type name getter.
- *
- * @return anonymization hash function type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return anonymization hash function type identified by anon type
name.
- *
- * @return anonymization hash function type or null if not found
- */
- public static AnonymizationHashFunctionType getTypeByName(String
type) {
-
- for (AnonymizationHashFunctionType ahft :
- EnumSet.allOf(AnonymizationHashFunctionType.class)) {
-
- if (ahft.getType().equals(type)) return ahft;
-
- }
-
- return null;
-
- }
-
- private final String type;
-
- }
-
- /**
- * Anonymization hash function padding types.
- */
- public enum AnonymizationHashFunctionPaddingType {
-
- PAD_WITH_ZERO("padWithZero"),
- STRIP_REST("stripRest");
-
-
- /**
- * Constructor with anonymization hash function padding type name.
- *
- * @param type anonymization hash function padding type name
- */
- private AnonymizationHashFunctionPaddingType(String type) {
-
- this.type = type;
-
- }
-
- /**
- * Anonymization hash function padding type name getter.
- *
- * @return anonymization hash function padding type name
- */
- public String getType() {
-
- return type;
-
- }
-
- /**
- * Return anonymization hash function padding type
- * identified by anon type name.
- *
- * @return anonymization hash function padding type or null if not
found
- */
- public static AnonymizationHashFunctionPaddingType getTypeByName(
- String type) {
-
- for (AnonymizationHashFunctionPaddingType ahfpt :
- EnumSet.allOf(AnonymizationHashFunctionPaddingType.class)) {
-
- if (ahfpt.getType().equals(type)) return ahfpt;
-
- }
-
- return null;
-
- }
-
- private final String type;
-
- }
-
-
- /**
- * This class provides placeholder for sampling authorization data
- *
- * @author urosj
- */
- public class Sampling {
-
-
- // ---------------------------------- class fields
-
-
- private SamplingType type = null;
- private int threshold = -1;
-
-
- // ---------------------------------- constructors
-
-
- /**
- * Default constructor
- */
- public Sampling() {
-
- }
-
- /**
- * Constructor with type and threshold.
- *
- * @param type sampling type
- * @param threshold sampling threshold
- */
- public Sampling(SamplingType type, int threshold) {
-
- this.type = type;
- this.threshold = threshold;
-
- }
-
-
- // ---------------------------------- public methods
-
-
- /**
- * Sampling type setter.
- *
- * @param type sampling type
- */
- public void setType(SamplingType type) {
-
- this.type = type;
-
- }
-
- /**
- * Sampling type getter.
- *
- * @return sampling type
- */
- public SamplingType getType() {
-
- return type;
-
- }
-
- /**
- * Threshold setter.
- *
- * @param threshold sampling threshold
- */
- public void setThreshold(int threshold) {
-
- this.threshold = threshold;
-
- }
-
- /**
- * Threshold getter.
- *
- * @return sampling threshold
- */
- public int getThreshold() {
-
- return threshold;
-
- }
-
- /**
- * Helper method to print out sampling data.
- *
- * @param out
- */
- public void printOut(PrintStream out) {
-
- out.println("\t\tType: '" + type.getType() + "'");
- out.println("\t\tThreshold: " + threshold);
- }
-
- }
-
- /**
- * This class provides placeholder for anonymization authorization data
- *
- * @author urosj
- */
- public class Anonymization {
-
-
- // ---------------------------------- class fields
-
-
- private AnonymizationProtocolType protocolType = null;
- private AnonymizationFieldType fieldType = null;
- private AnonymizationFunctionType functionType = null;
- private String[] functionParams = null;
-
-
-
- // ---------------------------------- constructors
-
-
- /**
- * Default constructor
- */
- public Anonymization() {
-
- }
-
- /**
- * Constructor to fill al the variables.
- *
- * @param protocolType
- * @param fieldType
- * @param functionType
- * @param functionParams
- */
- public Anonymization(AnonymizationProtocolType protocolType,
- AnonymizationFieldType fieldType,
- AnonymizationFunctionType functionType,
- String[] functionParams) {
-
- this.protocolType = protocolType;
- this.fieldType = fieldType;
- this.functionType = functionType;
- this.functionParams = functionParams;
-
- }
-
- // ---------------------------------- public methods
-
-
- /**
- * Protocol type setter.
- *
- * @param type protocol type
- */
- public void setProtocolType(AnonymizationProtocolType protocolType) {
-
- this.protocolType = protocolType;
-
- }
-
- /**
- * Protocol type getter.
- *
- * @return protocol type
- */
- public AnonymizationProtocolType getProtocolType() {
-
- return protocolType;
-
- }
-
- /**
- * Field type setter.
- *
- * @param type field type
- */
- public void setFieldType(AnonymizationFieldType fieldType) {
-
- this.fieldType = fieldType;
-
- }
-
- /**
- * Field type getter.
- *
- * @return field type
- */
- public AnonymizationFieldType getFieldType() {
-
- return fieldType;
-
- }
-
- /**
- * Function type setter.
- *
- * @param type function type
- */
- public void setFunctionType(AnonymizationFunctionType functionType) {
-
- this.functionType = functionType;
-
- }
-
- /**
- * Function type getter.
- *
- * @return function type
- */
- public AnonymizationFunctionType getFunctionType() {
-
- return functionType;
-
- }
-
- /**
- * Function params setter.
- *
- * @param params function params
- */
- public void setFunctionParams(String[] functionParams) {
-
- this.functionParams = functionParams;
-
- }
-
- /**
- * Function params getter.
- *
- * @return function params
- */
- public String[] getFunctionParams() {
-
- return functionParams;
-
- }
-
- }
-
// ---------------------------------- class fields


@@ -806,10 +47,7 @@
private String username = null;
private String password = null;
private String role = null;
- private String[] headerFilters = null;
- private String[] payloadFilters = null;
- private Sampling[] samplings = null;
- private Anonymization[] anonymizations = null;
+ private Authorization authorization = null;



@@ -850,6 +88,50 @@


/**
+ * Getter for username
+ *
+ * @return username
+ */
+ public String getUsername() {
+
+ return username;
+
+ }
+
+ /**
+ * Getter for password
+ *
+ * @return password
+ */
+ public String getPassword() {
+
+ return password;
+
+ }
+
+ /**
+ * Getter for role
+ *
+ * @return role
+ */
+ public String getRole() {
+
+ return role;
+
+ }
+
+ /**
+ * Getter for authorization
+ *
+ * @return authorization
+ */
+ public Authorization getAuthorization() {
+
+ return authorization;
+
+ }
+
+ /**
* Verify credentials specified by username and password.
* If credentials are verified, return role the username is in
* and all authorization records associated with it.
@@ -859,9 +141,10 @@
* @return credentials for the specified username
* @throws SQLException in case of SQL error
* @throws CredentialsException in case of Credentials error
+ * @throws AuthorizationException in case of authorization error
*/
- public Credentials getCredentials(String username, String password)
- throws SQLException, CredentialsException {
+ public Credentials getFromDb(String username, String password)
+ throws SQLException, CredentialsException, AuthorizationException {

Credentials retCreds = new Credentials();

@@ -892,172 +175,8 @@
retCreds.password = password;
retCreds.role = rst.getString(1);

- // Retrieve all the header filters
- pstmt.close();
- pstmt = conn.prepareStatement(
- "SELECT hf.value FROM role_authorization AS ra,"
- + " authorization AS a, authorization_type AS at,"
- + " header_filter AS hf WHERE"
- + " at.name='" + AuthorizationType.HEADER_FILTER.getType()
- + "' AND ra.role=? AND ra.authorization_id=a.id"
- + " AND a.authorization_type_id=at.id"
- + " AND a.authorization_ref_id=hf.id");
- pstmt.setString(1, retCreds.role);
- rst.close();
- rst = pstmt.executeQuery();
-
- rst.last();
- int nRows = rst.getRow();
- retCreds.headerFilters = new String[nRows];
- rst.beforeFirst();
- int i = 0;
- while (rst.next()) retCreds.headerFilters[i++] =
rst.getString(1);
-
- // Retrieve all the payload filters
- pstmt.close();
- pstmt = conn.prepareStatement(
- "SELECT pf.value FROM role_authorization AS ra,"
- + " authorization AS a, authorization_type AS at,"
- + " payload_filter AS pf WHERE"
- + " at.name='" + AuthorizationType.PAYLOAD_FILTER.getType()
- + "' AND ra.role=? AND ra.authorization_id=a.id"
- + " AND a.authorization_type_id=at.id"
- + " AND a.authorization_ref_id=pf.id");
- pstmt.setString(1, retCreds.role);
- rst.close();
- rst = pstmt.executeQuery();
-
- rst.last();
- nRows = rst.getRow();
- retCreds.payloadFilters = new String[nRows];
- rst.beforeFirst();
- i = 0;
- while (rst.next()) retCreds.payloadFilters[i++] =
rst.getString(1);
-
- // Retrieve all the sampling params
- pstmt.close();
- pstmt = conn.prepareStatement(
- "SELECT s.id,s.type,s.threshold FROM role_authorization AS
ra,"
- + " authorization AS a, authorization_type AS at,"
- + " sampling AS s WHERE"
- + " at.name='" + AuthorizationType.SAMPLING.getType()
- + "' AND ra.role=? AND ra.authorization_id=a.id"
- + " AND a.authorization_type_id=at.id"
- + " AND a.authorization_ref_id=s.id");
- pstmt.setString(1, retCreds.role);
- rst.close();
- rst = pstmt.executeQuery();
-
- rst.last();
- nRows = rst.getRow();
- retCreds.samplings = new Sampling[nRows];
- rst.beforeFirst();
- i = 0;
- while (rst.next()) {
-
- SamplingType st =
SamplingType.getTypeByName(rst.getString(2));
- if (st == null)
- throw new CredentialsException(
- "Unknown sampling type (" + rst.getString(2)
- + ") with id " + rst.getInt(1));
-
- retCreds.samplings[i++] = new Sampling(st, rst.getInt(3));
-
- }
-
- // Retrieve all the anonymization params
- pstmt.close();
- pstmt = conn.prepareStatement(
- "SELECT an.id,an.proto,an.field,an.func,p.id,p.value"
- + " FROM role_authorization AS ra,"
- + " authorization AS a, authorization_type AS at,"
- + " anonymization AS an LEFT JOIN param AS p ON"
- + " an.id=p.authorization_ref_id LEFT JOIN"
- + " authorization_type AS at2 ON"
- + " p.authorization_type_id=at2.id WHERE"
- + " at.name='" + AuthorizationType.ANONYMIZATION.getType()
- + "' AND ra.role=? AND ra.authorization_id=a.id"
- + " AND a.authorization_type_id=at.id"
- + " AND a.authorization_ref_id=an.id"
- + " ORDER BY an.id, p.idx");
- pstmt.setString(1, retCreds.role);
- rst.close();
- rst = pstmt.executeQuery();
-
- List<Anonymization> anonsList = new ArrayList<Anonymization>();
- List<String> paramList = null;
- Anonymization curAnon = null;
- int prevAnonId = 0;
- int curAnonId;
- while (rst.next()) {
-
- curAnonId = rst.getInt(1);
- if (curAnonId != prevAnonId) {
-
- if (paramList != null && curAnon != null) {
-
- curAnon.setFunctionParams(
- paramList.toArray(new String[paramList.size()]));
- paramList.clear();
- anonsList.add(curAnon);
-
- }
-
- curAnon = new Anonymization();
-
- AnonymizationProtocolType apt =
- AnonymizationProtocolType.getTypeByName(
- rst.getString(2));
- if (apt == null)
- throw new CredentialsException(
- "Invalid protocol type ("
- + rst.getString(2)
- + ") with anonymization id "
- + curAnonId);
- curAnon.setProtocolType(apt);
-
- AnonymizationFieldType afit =
- AnonymizationFieldType.getTypeByName(
- rst.getString(3));
- if (afit == null)
- throw new CredentialsException(
- "Invalid protocol field ("
- + rst.getString(3)
- + ") with anonymization id "
- + curAnonId);
- curAnon.setFieldType(afit);
-
- AnonymizationFunctionType afut =
- AnonymizationFunctionType.getTypeByName(
- rst.getString(4));
- if (afut == null)
- throw new CredentialsException(
- "Invalid protocol function ("
- + rst.getString(4)
- + ") with anonymization id "
- + curAnonId);
- curAnon.setFunctionType(afut);
-
- }
-
- if (rst.getInt(5) != 0) paramList.add(rst.getString(6));
-
- prevAnonId = curAnonId;
-
-
- }
-
- if (paramList != null && curAnon != null) {
-
- curAnon.setFunctionParams(
- paramList.toArray(new String[paramList.size()]));
- anonsList.add(curAnon);
-
- }
-
- retCreds.anonymizations =
- anonsList.toArray(new Anonymization[anonsList.size()]);
-
+ retCreds.authorization =
+ new Authorization(conn).getFromDb(retCreds.role);
} finally {
if (rst != null) {
rst.close();
@@ -1085,28 +204,9 @@
out.println("Password: '" + password + "'");
out.println("Role: '" + role + "'");

- out.println("Header filters:");
- int i = 1;
- for (String hf : headerFilters)
- out.println("\t" + (i++) + ". '" + hf + "'");
-
- out.println("Payload filters:");
- i = 1;
- for (String pf : payloadFilters)
- out.println("\t" + (i++) + ". '" + pf + "'");
-
- out.println("Sampling:");
- i = 1;
- for (Sampling s : samplings) {
-
- out.println("\t" + (i++) + ".");
- s.printOut(out);
-
- }
-/*
-TODO
- private Anonymization[] anonymizations = null;
-*/
+ out.println("Authorization:");
+ authorization.printOut(out);
+
}


@@ -1130,7 +230,7 @@
Credentials creds = new Credentials(
sqlManager, "127.0.0.1", "3306", "gn2_jra1_tcmp",
"tcmp", "odEldxcVyk0wq5zr");
- Credentials userCreds = creds.getCredentials(username, password);
+ Credentials userCreds = creds.getFromDb(username, password);
System.out.println("\nGot the following credentials:");
userCreds.printOut(System.out);




  • r2063 - trunk/perfsonar/src/org/perfsonar/service/measurementPoint/tracefileCaptureType/security, svnlog, 02/13/2007

Archive powered by MHonArc 2.6.16.

Top of Page