summaryrefslogtreecommitdiffstats
path: root/base/server/cmscore
diff options
context:
space:
mode:
Diffstat (limited to 'base/server/cmscore')
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/dbs/KeyDBSchema.java1
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRecord.java16
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRepository.java8
3 files changed, 19 insertions, 6 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyDBSchema.java b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyDBSchema.java
index 743176318..12f69950a 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyDBSchema.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyDBSchema.java
@@ -48,4 +48,5 @@ public class KeyDBSchema {
public static final String LDAP_ATTR_CLIENT_ID = "clientId";
public static final String LDAP_ATTR_STATUS = "status";
public static final String LDAP_ATTR_DATA_TYPE = "dataType";
+ public static final String LDAP_ATTR_REALM = "realm";
}
diff --git a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRecord.java b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRecord.java
index 7ae546184..fbf2ee227 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRecord.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRecord.java
@@ -40,9 +40,6 @@ import com.netscape.certsrv.dbs.keydb.KeyState;
*/
public class KeyRecord implements IDBObj, IKeyRecord {
- /**
- *
- */
private static final long serialVersionUID = -3765000841161998984L;
private BigInteger mSerialNo = null;
private KeyState mState = null;
@@ -59,6 +56,7 @@ public class KeyRecord implements IDBObj, IKeyRecord {
private String mClientId = null;
private String mStatus = null;
private String mDataType = null;
+ private String mRealm = null;
protected static Vector<String> mNames = new Vector<String>();
@@ -78,6 +76,7 @@ public class KeyRecord implements IDBObj, IKeyRecord {
mNames.addElement(ATTR_CLIENT_ID);
mNames.addElement(ATTR_STATUS);
mNames.addElement(ATTR_DATA_TYPE);
+ mNames.addElement(ATTR_REALM);
}
/**
@@ -141,6 +140,8 @@ public class KeyRecord implements IDBObj, IKeyRecord {
mDataType = (String) object;
} else if (name.equalsIgnoreCase(ATTR_STATUS)) {
mStatus = (String) object;
+ } else if (name.equalsIgnoreCase(ATTR_REALM)) {
+ mRealm = (String) object;
} else {
throw new EBaseException(com.netscape.certsrv.apps.CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name));
}
@@ -181,6 +182,8 @@ public class KeyRecord implements IDBObj, IKeyRecord {
return mDataType;
} else if (name.equalsIgnoreCase(ATTR_STATUS)) {
return mStatus;
+ } else if (name.equalsIgnoreCase(ATTR_REALM)) {
+ return mRealm;
} else {
throw new EBaseException(com.netscape.certsrv.apps.CMS.getUserMessage("CMS_BASE_INVALID_ATTRIBUTE", name));
}
@@ -339,7 +342,7 @@ public class KeyRecord implements IDBObj, IKeyRecord {
}
/**
- * Sets the dateso of revocation.
+ * Sets the date of revocation.
* <P>
*/
public void setDateOfRevocation(Date dates[]) throws EBaseException {
@@ -389,4 +392,9 @@ public class KeyRecord implements IDBObj, IKeyRecord {
public String getDataType() throws EBaseException {
return mDataType;
}
+
+ @Override
+ public String getRealm() throws EBaseException {
+ return mRealm;
+ }
}
diff --git a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRepository.java b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRepository.java
index 556cab9f5..88028d798 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRepository.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/dbs/KeyRepository.java
@@ -27,8 +27,6 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
-import netscape.security.x509.X500Name;
-
import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.base.EBaseException;
import com.netscape.certsrv.dbs.EDBException;
@@ -43,6 +41,8 @@ import com.netscape.certsrv.dbs.keydb.IKeyRecordList;
import com.netscape.certsrv.dbs.keydb.IKeyRepository;
import com.netscape.certsrv.dbs.repository.IRepository;
+import netscape.security.x509.X500Name;
+
/**
* A class represents a Key repository. This is the container of
* archived keys.
@@ -148,6 +148,10 @@ public class KeyRepository extends Repository implements IKeyRepository {
reg.registerAttribute(KeyRecord.ATTR_DATA_TYPE, new
StringMapper(KeyDBSchema.LDAP_ATTR_DATA_TYPE));
}
+ if (!reg.isAttributeRegistered(KeyRecord.ATTR_REALM)) {
+ reg.registerAttribute(KeyRecord.ATTR_REALM, new
+ StringMapper(KeyDBSchema.LDAP_ATTR_REALM));
+ }
}