summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/profile
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2013-08-28 00:49:05 -0400
committerAde Lee <alee@redhat.com>2013-09-02 22:40:10 -0400
commit9c7e89d813b640619d02f9076eaa90829f4395ef (patch)
treea8f1f8e4addf031ebcb6baa891bbe54f789759e0 /base/common/src/com/netscape/certsrv/profile
parenta90518e49247453d63d7054fc45fdc13926b4149 (diff)
downloadpki-9c7e89d813b640619d02f9076eaa90829f4395ef.tar.gz
pki-9c7e89d813b640619d02f9076eaa90829f4395ef.tar.xz
pki-9c7e89d813b640619d02f9076eaa90829f4395ef.zip
Add audit logging to profile interface
This patch adds initial audit logging to the Profile interface. A more complete review of audit logging will probably be done for Common Criteria testing.
Diffstat (limited to 'base/common/src/com/netscape/certsrv/profile')
-rw-r--r--base/common/src/com/netscape/certsrv/profile/PolicyConstraint.java42
-rw-r--r--base/common/src/com/netscape/certsrv/profile/PolicyConstraintValue.java37
-rw-r--r--base/common/src/com/netscape/certsrv/profile/PolicyDefault.java48
-rw-r--r--base/common/src/com/netscape/certsrv/profile/ProfileAttribute.java37
-rw-r--r--base/common/src/com/netscape/certsrv/profile/ProfileInput.java55
-rw-r--r--base/common/src/com/netscape/certsrv/profile/ProfileOutput.java49
-rw-r--r--base/common/src/com/netscape/certsrv/profile/ProfilePolicy.java37
7 files changed, 305 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/profile/PolicyConstraint.java b/base/common/src/com/netscape/certsrv/profile/PolicyConstraint.java
index a0f4e9def..ab46ecd14 100644
--- a/base/common/src/com/netscape/certsrv/profile/PolicyConstraint.java
+++ b/base/common/src/com/netscape/certsrv/profile/PolicyConstraint.java
@@ -81,4 +81,46 @@ public class PolicyConstraint {
this.constraints = constraints;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((classId == null) ? 0 : classId.hashCode());
+ result = prime * result + ((constraints == null) ? 0 : constraints.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((text == null) ? 0 : text.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PolicyConstraint other = (PolicyConstraint) obj;
+ if (classId == null) {
+ if (other.classId != null)
+ return false;
+ } else if (!classId.equals(other.classId))
+ return false;
+ if (constraints == null) {
+ if (other.constraints != null)
+ return false;
+ } else if (!constraints.equals(other.constraints))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (text == null) {
+ if (other.text != null)
+ return false;
+ } else if (!text.equals(other.text))
+ return false;
+ return true;
+ }
}
diff --git a/base/common/src/com/netscape/certsrv/profile/PolicyConstraintValue.java b/base/common/src/com/netscape/certsrv/profile/PolicyConstraintValue.java
index a16b4c59d..162b706bb 100644
--- a/base/common/src/com/netscape/certsrv/profile/PolicyConstraintValue.java
+++ b/base/common/src/com/netscape/certsrv/profile/PolicyConstraintValue.java
@@ -70,4 +70,41 @@ public class PolicyConstraintValue {
public void setValue(String value) {
this.value = value;
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((descriptor == null) ? 0 : descriptor.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PolicyConstraintValue other = (PolicyConstraintValue) obj;
+ if (descriptor == null) {
+ if (other.descriptor != null)
+ return false;
+ } else if (!descriptor.equals(other.descriptor))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
}
diff --git a/base/common/src/com/netscape/certsrv/profile/PolicyDefault.java b/base/common/src/com/netscape/certsrv/profile/PolicyDefault.java
index f92242cc1..5b1943147 100644
--- a/base/common/src/com/netscape/certsrv/profile/PolicyDefault.java
+++ b/base/common/src/com/netscape/certsrv/profile/PolicyDefault.java
@@ -92,4 +92,52 @@ public class PolicyDefault {
this.params = params;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((attributes == null) ? 0 : attributes.hashCode());
+ result = prime * result + ((classId == null) ? 0 : classId.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((params == null) ? 0 : params.hashCode());
+ result = prime * result + ((text == null) ? 0 : text.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PolicyDefault other = (PolicyDefault) obj;
+ if (attributes == null) {
+ if (other.attributes != null)
+ return false;
+ } else if (!attributes.equals(other.attributes))
+ return false;
+ if (classId == null) {
+ if (other.classId != null)
+ return false;
+ } else if (!classId.equals(other.classId))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (params == null) {
+ if (other.params != null)
+ return false;
+ } else if (!params.equals(other.params))
+ return false;
+ if (text == null) {
+ if (other.text != null)
+ return false;
+ } else if (!text.equals(other.text))
+ return false;
+ return true;
+ }
}
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileAttribute.java b/base/common/src/com/netscape/certsrv/profile/ProfileAttribute.java
index 9c889bb8a..c3549424c 100644
--- a/base/common/src/com/netscape/certsrv/profile/ProfileAttribute.java
+++ b/base/common/src/com/netscape/certsrv/profile/ProfileAttribute.java
@@ -77,4 +77,41 @@ public class ProfileAttribute {
return "PolicyAttribute [name=" + name + ", value=" + value + ", descriptor=" + descriptor + "]";
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((descriptor == null) ? 0 : descriptor.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProfileAttribute other = (ProfileAttribute) obj;
+ if (descriptor == null) {
+ if (other.descriptor != null)
+ return false;
+ } else if (!descriptor.equals(other.descriptor))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
+
}
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileInput.java b/base/common/src/com/netscape/certsrv/profile/ProfileInput.java
index a9b9507cb..2826f50d8 100644
--- a/base/common/src/com/netscape/certsrv/profile/ProfileInput.java
+++ b/base/common/src/com/netscape/certsrv/profile/ProfileInput.java
@@ -129,4 +129,59 @@ public class ProfileInput {
configAttrs.clear();
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((attrs == null) ? 0 : attrs.hashCode());
+ result = prime * result + ((classId == null) ? 0 : classId.hashCode());
+ result = prime * result + ((configAttrs == null) ? 0 : configAttrs.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((text == null) ? 0 : text.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProfileInput other = (ProfileInput) obj;
+ if (attrs == null) {
+ if (other.attrs != null)
+ return false;
+ } else if (!attrs.equals(other.attrs))
+ return false;
+ if (classId == null) {
+ if (other.classId != null)
+ return false;
+ } else if (!classId.equals(other.classId))
+ return false;
+ if (configAttrs == null) {
+ if (other.configAttrs != null)
+ return false;
+ } else if (!configAttrs.equals(other.configAttrs))
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (text == null) {
+ if (other.text != null)
+ return false;
+ } else if (!text.equals(other.text))
+ return false;
+ return true;
+ }
+
}
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileOutput.java b/base/common/src/com/netscape/certsrv/profile/ProfileOutput.java
index 759b65ce7..f12b64787 100644
--- a/base/common/src/com/netscape/certsrv/profile/ProfileOutput.java
+++ b/base/common/src/com/netscape/certsrv/profile/ProfileOutput.java
@@ -118,4 +118,53 @@ public class ProfileOutput {
attrs.clear();
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((attrs == null) ? 0 : attrs.hashCode());
+ result = prime * result + ((classId == null) ? 0 : classId.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((text == null) ? 0 : text.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProfileOutput other = (ProfileOutput) obj;
+ if (attrs == null) {
+ if (other.attrs != null)
+ return false;
+ } else if (!attrs.equals(other.attrs))
+ return false;
+ if (classId == null) {
+ if (other.classId != null)
+ return false;
+ } else if (!classId.equals(other.classId))
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ if (text == null) {
+ if (other.text != null)
+ return false;
+ } else if (!text.equals(other.text))
+ return false;
+ return true;
+ }
+
}
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfilePolicy.java b/base/common/src/com/netscape/certsrv/profile/ProfilePolicy.java
index d5f84f188..4ea0f1abb 100644
--- a/base/common/src/com/netscape/certsrv/profile/ProfilePolicy.java
+++ b/base/common/src/com/netscape/certsrv/profile/ProfilePolicy.java
@@ -79,4 +79,41 @@ public class ProfilePolicy {
return null;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((constraint == null) ? 0 : constraint.hashCode());
+ result = prime * result + ((def == null) ? 0 : def.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProfilePolicy other = (ProfilePolicy) obj;
+ if (constraint == null) {
+ if (other.constraint != null)
+ return false;
+ } else if (!constraint.equals(other.constraint))
+ return false;
+ if (def == null) {
+ if (other.def != null)
+ return false;
+ } else if (!def.equals(other.def))
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ return true;
+ }
+
}