diff options
Diffstat (limited to 'pki/base')
12 files changed, 202 insertions, 83 deletions
diff --git a/pki/base/ca/shared/conf/CS.cfg b/pki/base/ca/shared/conf/CS.cfg index 882f00f55..9dd158ed4 100644 --- a/pki/base/ca/shared/conf/CS.cfg +++ b/pki/base/ca/shared/conf/CS.cfg @@ -629,6 +629,10 @@ ca.ocsp_signing.cacertnickname=ocspSigningCert cert-[PKI_INSTANCE_ID] ca.ocsp_signing.defaultSigningAlgorithm=SHA1withRSA ca.ocsp_signing.tokenname=internal ca.publish.createOwnDNEntry=false +ca.publish.queue.enable=true +ca.publish.queue.maxNumberOfThreads=3 +ca.publish.queue.pageSize=40 +ca.publish.queue.priorityLevel=0 ca.publish.mapper.impl.LdapCaSimpleMap.class=com.netscape.cms.publish.mappers.LdapCaSimpleMap ca.publish.mapper.impl.LdapDNCompsMap.class=com.netscape.cms.publish.mappers.LdapCertCompsMap ca.publish.mapper.impl.LdapDNExactMap.class=com.netscape.cms.publish.mappers.LdapCertExactMap diff --git a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java index 31c8355aa..372683aeb 100644 --- a/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/pki/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -1554,32 +1554,7 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori mService = new CAService(this); CMS.debug("CA service inited"); - IConfigStore pubQueueConfig = mConfig.getSubStore(PROP_PUB_QUEUE_SUBSTORE); - boolean enablePublishingQueue = false; - // Publishing Queue Priority Levels: - // 2 - maximum, 1 - higher, 0 - normal, -1 - lower, -2 - minimum - int publishingQueuePriorityLevel = 0; - int maxNumberOfPublishingThreads = 1; - int publishingQueuePageSize = 100; - if (pubQueueConfig != null) { - try { - enablePublishingQueue = pubQueueConfig.getBoolean("enable", false); - publishingQueuePriorityLevel = pubQueueConfig.getInteger("priorityLevel", 0); - maxNumberOfPublishingThreads = pubQueueConfig.getInteger("maxNumberOfThreads", 1); - publishingQueuePageSize = pubQueueConfig.getInteger("pageSize", 100); - } catch (EBaseException e) { - CMS.debug("Error reading publishing queue parameters: "+e); - enablePublishingQueue = false; - } - } - CMS.debug("CA Publishing Queue Enabled: " + enablePublishingQueue+ - " Priority Level: " + publishingQueuePriorityLevel+ - " Maximum Number of Threads: " + maxNumberOfPublishingThreads+ - " Page Size: "+ publishingQueuePageSize); - mNotify = new ARequestNotifier (this, enablePublishingQueue, - publishingQueuePriorityLevel, - maxNumberOfPublishingThreads, - publishingQueuePageSize); + mNotify = new ARequestNotifier (this); CMS.debug("CA notifier inited"); mPNotify = new ARequestNotifier(); CMS.debug("CA pending notifier inited"); diff --git a/pki/base/common/src/com/netscape/certsrv/common/Constants.java b/pki/base/common/src/com/netscape/certsrv/common/Constants.java index 3c2f2b23e..c58eef14c 100644 --- a/pki/base/common/src/com/netscape/certsrv/common/Constants.java +++ b/pki/base/common/src/com/netscape/certsrv/common/Constants.java @@ -188,8 +188,8 @@ public interface Constants { public static final String PR_LOG_SYSTEM = "System"; public static final String PR_DEBUG_LOG_SHOWCALLER = "debug.showcaller"; - public static final String PR_DEBUG_LOG_ENABLE = "debug.enabled"; - public static final String PR_DEBUG_LOG_LEVEL = "debug.level"; + public static final String PR_DEBUG_LOG_ENABLE = "debug.enabled"; + public static final String PR_DEBUG_LOG_LEVEL = "debug.level"; /*======================================================== * LDAP Publishing @@ -244,7 +244,11 @@ public interface Constants { public final static String PR_BIND_PASSWD_AGAIN = "bindPasswdAgain"; public final static String PR_LDAP_MAX_CONNS = "maxConns"; public final static String PR_LDAP_MIN_CONNS = "minConns"; - + public final static String PR_PUBLISHING_QUEUE_ENABLE = "queue.enable"; + public final static String PR_PUBLISHING_QUEUE_THREADS = "queue.maxNumberOfThreads"; + public final static String PR_PUBLISHING_QUEUE_PAGE_SIZE = "queue.pageSize"; + public final static String PR_PUBLISHING_QUEUE_PRIORITY = "queue.priorityLevel"; + public final static String PR_BASE_DN = "baseDN"; public final static String PR_DNCOMPS = "dnComps"; public final static String PR_FILTERCOMPS = "filterComps"; diff --git a/pki/base/common/src/com/netscape/certsrv/publish/IPublisherProcessor.java b/pki/base/common/src/com/netscape/certsrv/publish/IPublisherProcessor.java index 5d2224362..445d0aa15 100644 --- a/pki/base/common/src/com/netscape/certsrv/publish/IPublisherProcessor.java +++ b/pki/base/common/src/com/netscape/certsrv/publish/IPublisherProcessor.java @@ -49,6 +49,7 @@ public interface IPublisherProcessor extends ISubsystem { public final static String PROP_PUBLISH_SUBSTORE = "publish"; public final static String PROP_LDAP_PUBLISH_SUBSTORE = "ldappublish"; + public final static String PROP_QUEUE_PUBLISH_SUBSTORE = "queue"; public static final String PROP_LOCAL_CA = "cacert"; public static final String PROP_LOCAL_CRL = "crl"; diff --git a/pki/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java b/pki/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java index 374b8ed48..bad0a99eb 100644 --- a/pki/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java +++ b/pki/base/common/src/com/netscape/certsrv/request/ARequestNotifier.java @@ -52,13 +52,19 @@ public class ARequestNotifier implements IRequestNotifier { mPublishingQueuePriority = Thread.currentThread().getPriority(); } - public ARequestNotifier (ICertificateAuthority ca, - boolean isPublishingQueueEnabled, - int publishingQueuePriorityLevel, - int maxNumberOfPublishingThreads, - int publishingQueuePageSize) { + public ARequestNotifier (ICertificateAuthority ca) { mCA = ca; if (mCA != null) mRequestQueue = mCA.getRequestQueue(); + } + + public void setPublishingQueue (boolean isPublishingQueueEnabled, + int publishingQueuePriorityLevel, + int maxNumberOfPublishingThreads, + int publishingQueuePageSize) { + CMS.debug("setPublishingQueue: Publishing Queue Enabled: " + isPublishingQueueEnabled+ + " Priority Level: " + publishingQueuePriorityLevel+ + " Maximum Number of Threads: " + maxNumberOfPublishingThreads+ + " Page Size: "+ publishingQueuePageSize); mIsPublishingQueueEnabled = isPublishingQueueEnabled; mMaxThreads = maxNumberOfPublishingThreads; mMaxRequests = publishingQueuePageSize; @@ -161,8 +167,7 @@ public class ARequestNotifier implements IRequestNotifier { if (mRequestQueue != null) { IRequestVirtualList list = mRequestQueue.getPagedRequestsByFilter( new RequestId((String)mRequests.elementAt(0)), - "(&(requeststate=complete)(requesttype=enrollment))", - mMaxRequests, "requestId"); + "(requeststate=complete)", mMaxRequests, "requestId"); int s = list.getSize() - list.getCurrentIndex(); CMS.debug("getRequest list size: "+s); for (int i = 0; i < s; i++) { @@ -175,6 +180,17 @@ public class ARequestNotifier implements IRequestNotifier { if (r == null) { continue; } + String requestType = r.getRequestType(); + if (requestType == null) { + continue; + } + if (!(requestType.equals(IRequest.ENROLLMENT_REQUEST) || + requestType.equals(IRequest.RENEWAL_REQUEST) || + requestType.equals(IRequest.REVOCATION_REQUEST) || + requestType.equals(IRequest.CMCREVOKE_REQUEST) || + requestType.equals(IRequest.UNREVOCATION_REQUEST))) { + continue; + } if (i == 0 && ((String)mRequests.elementAt(0)).equals(r.getRequestId().toString())) { if (s == 1) { break; @@ -257,10 +273,24 @@ public class ARequestNotifier implements IRequestNotifier { * @param r request */ public void notify(IRequest r) { - // spawn a seperate thread to call the listeners and return. - try { - new Thread(new RunListeners(r, mListeners.elements())).start(); - } catch (Throwable e) { + CMS.debug("ARequestNotifier notify mIsPublishingQueueEnabled="+mIsPublishingQueueEnabled+ + " mMaxThreads="+mMaxThreads); + if (mIsPublishingQueueEnabled) { + addToNotify(r); + } else if (mMaxThreads == 0) { + Enumeration listeners = mListeners.elements(); + if (listeners != null && r != null) { + while (listeners.hasMoreElements()) { + IRequestListener l = (IRequestListener) listeners.nextElement(); + CMS.debug("RunListeners: IRequestListener = " + l.getClass().getName()); + l.accept(r); + } + } + } else { + // spawn a seperate thread to call the listeners and return. + try { + new Thread(new RunListeners(r, mListeners.elements())).start(); + } catch (Throwable e) { /* CMS.getLogger().log( @@ -268,6 +298,7 @@ public class ARequestNotifier implements IRequestNotifier { "Could not run listeners for request " + r.getRequestId() + ". Error " + e + ";" + e.getMessage()); */ + } } } @@ -339,7 +370,6 @@ public class ARequestNotifier implements IRequestNotifier { * @param r request */ public synchronized void addToNotify(IRequest r) { - //mRequests.addElement(r); if (!mSearchForRequests) { if (mRequests.size() < mMaxRequests) { mRequests.addElement(r.getRequestId().toString()); diff --git a/pki/base/common/src/com/netscape/certsrv/request/IRequestNotifier.java b/pki/base/common/src/com/netscape/certsrv/request/IRequestNotifier.java index 92e61747b..b6af76584 100644 --- a/pki/base/common/src/com/netscape/certsrv/request/IRequestNotifier.java +++ b/pki/base/common/src/com/netscape/certsrv/request/IRequestNotifier.java @@ -114,4 +114,18 @@ public interface IRequestNotifier extends INotify { * @param r request */ public void addToNotify(IRequest r); + + /** + * Sets publishing queue parameters. + * + * @param isPublishingQueueEnabled publishing queue switch + * @param publishingQueuePriorityLevel publishing queue priority level + * @param maxNumberOfPublishingThreads maximum number of publishing threads + * @param publishingQueuePageSize publishing queue page size + */ + public void setPublishingQueue (boolean isPublishingQueueEnabled, + int publishingQueuePriorityLevel, + int maxNumberOfPublishingThreads, + int publishingQueuePageSize); + } diff --git a/pki/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java b/pki/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java index 352d21b42..c3b2a5ddc 100644 --- a/pki/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java +++ b/pki/base/common/src/com/netscape/cms/profile/common/CAEnrollProfile.java @@ -247,40 +247,6 @@ public class CAEnrollProfile extends EnrollProfile { request.setExtData("isEncryptionCert", "true"); else request.setExtData("isEncryptionCert", "false"); - - // Need to update request record to prevent issue 325612 and bug 516632 - IRequestQueue queue = ((IAuthority)ca).getRequestQueue(); - if (queue == null) { - CMS.debug("CAEnrollProfile: Cannot access CA's request queue"); - } else { - try { - queue.updateRequest(request); - CMS.debug("CAEnrollProfile: request "+request.getRequestId().toString()+" updated"); - } catch (EBaseException e) { - CMS.debug("CAEnrollProfile: Request commit error " + - e.toString()); - } - } - // End of fix for issue 325612 and bug 516632 - - IRequestNotifier notifier = ca.getRequestNotifier(); - if (notifier != null && notifier.isPublishingQueueEnabled()) { - CMS.debug("about to addToNotify"); - notifier.addToNotify(request); - CMS.debug("addToNotify done"); - } else { - Enumeration names = ca.getRequestListenerNames(); - if (names != null) { - while (names.hasMoreElements()) { - String name = (String) names.nextElement(); - CMS.debug("CAEnrollProfile: listener " + name); - IRequestListener listener = ca.getRequestListener(name); - if (listener != null) { - listener.accept(request); - } - } - } - } } } diff --git a/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java b/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java index 40e88b5dc..cec42e7a7 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java @@ -423,6 +423,14 @@ public class PublisherAdminServlet extends AdminServlet { continue; if (name.equals(Constants.PR_PUBLISHING_ENABLE)) continue; + if (name.equals(Constants.PR_PUBLISHING_QUEUE_ENABLE)) + continue; + if (name.equals(Constants.PR_PUBLISHING_QUEUE_THREADS)) + continue; + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE)) + continue; + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PRIORITY)) + continue; if (name.equals(Constants.PR_CERT_NAMES)) { ICryptoSubsystem jss = (ICryptoSubsystem) CMS.getSubsystem(CMS.SUBSYSTEM_CRYPTO); @@ -444,6 +452,14 @@ public class PublisherAdminServlet extends AdminServlet { } params.add(Constants.PR_PUBLISHING_ENABLE, publishcfg.getString(IPublisherProcessor.PROP_ENABLE, Constants.FALSE)); + params.add(Constants.PR_PUBLISHING_QUEUE_ENABLE, + publishcfg.getString(Constants.PR_PUBLISHING_QUEUE_ENABLE, Constants.TRUE)); + params.add(Constants.PR_PUBLISHING_QUEUE_THREADS, + publishcfg.getString(Constants.PR_PUBLISHING_QUEUE_THREADS, "3")); + params.add(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE, + publishcfg.getString(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE, "40")); + params.add(Constants.PR_PUBLISHING_QUEUE_PRIORITY, + publishcfg.getString(Constants.PR_PUBLISHING_QUEUE_PRIORITY, "0")); params.add(Constants.PR_ENABLE, ldapcfg.getString(IPublisherProcessor.PROP_ENABLE, Constants.FALSE)); sendResponse(SUCCESS, null, params, resp); @@ -493,6 +509,22 @@ public class PublisherAdminServlet extends AdminServlet { pwd = req.getParameter(name); continue; } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_ENABLE)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_THREADS)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PRIORITY)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } /* Don't enter the publishing pw into the config store */ ldap.putString(name, req.getParameter(name)); @@ -593,6 +625,22 @@ public class PublisherAdminServlet extends AdminServlet { pwd = req.getParameter(name); continue; } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_ENABLE)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_THREADS)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } + if (name.equals(Constants.PR_PUBLISHING_QUEUE_PRIORITY)) { + publishcfg.putString(name, req.getParameter(name)); + continue; + } /* Don't enter the publishing pw into the config store */ ldap.putString(name, req.getParameter(name)); diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java index 5b032abc5..389267678 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java +++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitServlet.java @@ -1247,7 +1247,11 @@ public class ProfileSubmitServlet extends ProfileServlet { } try { - profile.getRequestQueue().updateRequest(reqs[k]); + if (errorCode == null) { + profile.getRequestQueue().markAsServiced(reqs[k]); + } else { + profile.getRequestQueue().updateRequest(reqs[k]); + } } catch (EBaseException e) { CMS.debug("ProfileSubmitServlet: updateRequest " + e.toString()); diff --git a/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java b/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java index c3cbeb182..3ae3380e5 100644 --- a/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java +++ b/pki/base/common/src/com/netscape/cmscore/ldap/PublisherProcessor.java @@ -39,7 +39,7 @@ import com.netscape.certsrv.authority.*; import com.netscape.certsrv.ca.*; import com.netscape.certsrv.dbs.*; import com.netscape.certsrv.dbs.certdb.*; -import com.netscape.certsrv.request.IRequest; +import com.netscape.certsrv.request.*; import com.netscape.certsrv.apps.*; import com.netscape.certsrv.ldap.*; import com.netscape.certsrv.publish.*; @@ -412,6 +412,22 @@ public class PublisherProcessor implements mLdapRequestListener = new LdapRequestListener(); mLdapRequestListener.init(this, mLdapConfig); mAuthority.registerRequestListener(mLdapRequestListener); + IConfigStore queueConfig = mConfig.getSubStore(PROP_QUEUE_PUBLISH_SUBSTORE); + if (queueConfig != null) { + boolean isPublishingQueueEnabled = queueConfig.getBoolean("enable", false); + int publishingQueuePriorityLevel = queueConfig.getInteger("priorityLevel", 0); + int maxNumberOfPublishingThreads = queueConfig.getInteger("maxNumberOfThreads", 1); + int publishingQueuePageSize = queueConfig.getInteger("pageSize", 100); + CMS.debug("PublisherProcessor: startup: Publishing Queue Enabled: " + isPublishingQueueEnabled + + " Priority Level: " + publishingQueuePriorityLevel + + " Maximum Number of Threads: " + maxNumberOfPublishingThreads + + " Page Size: "+ publishingQueuePageSize); + IRequestNotifier reqNotifier = ((ICertificateAuthority)mAuthority).getRequestNotifier(); + reqNotifier.setPublishingQueue (isPublishingQueueEnabled, + publishingQueuePriorityLevel, + maxNumberOfPublishingThreads, + publishingQueuePageSize); + } } } diff --git a/pki/base/console/src/com/netscape/admin/certsrv/config/CMSBaseLDAPPanel.java b/pki/base/console/src/com/netscape/admin/certsrv/config/CMSBaseLDAPPanel.java index da853e7ea..3feceab2f 100644 --- a/pki/base/console/src/com/netscape/admin/certsrv/config/CMSBaseLDAPPanel.java +++ b/pki/base/console/src/com/netscape/admin/certsrv/config/CMSBaseLDAPPanel.java @@ -42,6 +42,7 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene private JCheckBox mSecurePort; private JCheckBox mEnable; private JCheckBox mEnablePublishing; + private JCheckBox mEnableQueue; private Color mActiveColor; private JLabel mHostLabel, mPortLabel, mBindAsLabel, mVersionLabel; protected JLabel mPasswordLabel; @@ -51,6 +52,10 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene private CMSTabPanel mParent; private boolean mPublishing = true; private boolean mLDAPPublishing = true; + private boolean mPublishingQueue = true; + private String mPublishingQueuePriorityLevel = "0"; + private String mMaxNumberOfPublishingThreads = "3"; + private String mPublishingQueuePageSize = "40"; private JLabel mAuthLabel, mCertLabel; private JComboBox mAuthBox, mCertBox; private String mPanelName; @@ -71,6 +76,7 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene mModel = parent.getResourceModel(); mParent = parent; mPublishing = flag; + mPublishingQueue = flag; mLDAPPublishing = flag; } @@ -95,6 +101,21 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene gb.setConstraints(mEnablePublishing, gbc); mCenterPanel.add(mEnablePublishing); + //add the enable queue + mEnableQueue = makeJCheckBox("ENABLEQUEUE"); + mEnableQueue.setSelected(true); + CMSAdminUtil.resetGBC(gbc); + gbc.anchor = gbc.NORTHWEST; + gbc.fill = gbc.NONE; + gbc.gridwidth = gbc.REMAINDER; + gbc.weightx = 1.0; + gbc.insets = new Insets(DIFFERENT_COMPONENT_SPACE, + DIFFERENT_COMPONENT_SPACE, + 0, + DIFFERENT_COMPONENT_SPACE); + gb.setConstraints(mEnableQueue, gbc); + mCenterPanel.add(mEnableQueue); + //add the enable checkbox mEnable = makeJCheckBox("ENABLE"); mEnable.setSelected(true); @@ -222,6 +243,11 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene nvps.add(Constants.PR_CERT_NAMES, ""); nvps.add(Constants.PR_LDAP_CLIENT_CERT, ""); + nvps.add(Constants.PR_PUBLISHING_QUEUE_ENABLE, ""); + nvps.add(Constants.PR_PUBLISHING_QUEUE_THREADS, ""); + nvps.add(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE, ""); + nvps.add(Constants.PR_PUBLISHING_QUEUE_PRIORITY, ""); + try { NameValuePairs val = mAdmin.read(mServletName, ScopeDef.SC_LDAP, Constants.RS_ID_CONFIG, nvps); @@ -268,6 +294,20 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene mEnablePublishing.setSelected(true); else mEnablePublishing.setSelected(false); + } else if (name.equals(Constants.PR_PUBLISHING_QUEUE_ENABLE)) { + if (nvp.getValue().equals(Constants.TRUE)) { + mEnableQueue.setSelected(true); + mPublishingQueue = true; + } else { + mEnableQueue.setSelected(false); + mPublishingQueue = false; + } + } else if (name.equals(Constants.PR_PUBLISHING_QUEUE_THREADS)) { + mMaxNumberOfPublishingThreads = nvp.getValue(); + } else if (name.equals(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE)) { + mPublishingQueuePageSize = nvp.getValue(); + } else if (name.equals(Constants.PR_PUBLISHING_QUEUE_PRIORITY)) { + mPublishingQueuePriorityLevel = nvp.getValue(); } else if (name.equals(Constants.PR_ENABLE)) { if (nvp.getValue().equals(Constants.TRUE)) mEnable.setSelected(true); @@ -335,8 +375,11 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene private void enableFieldsAndLDAP(boolean enable, Color color) { mEnable.setEnabled(enable); - if (!enable) + mEnableQueue.setEnabled(enable); + if (!enable) { mEnable.setSelected(false); + mEnableQueue.setSelected(false); + } enableFields(enable, color); } @@ -418,10 +461,12 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene public void actionPerformed(ActionEvent e) { super.actionPerformed(e); if (mEnablePublishing.isSelected()) { - mEnable.setEnabled(true); + mEnable.setEnabled(true); + mEnableQueue.setEnabled(true); enableFieldsAndLDAP(true, mActiveColor); } else { - mEnable.setEnabled(false); + mEnable.setEnabled(false); + mEnableQueue.setEnabled(false); enableFieldsAndLDAP(false, getBackground()); } if (mLDAPPublishing) { @@ -466,6 +511,14 @@ public abstract class CMSBaseLDAPPanel extends CMSBaseTab implements ItemListene nvps.add(Constants.PR_ENABLE,Constants.FALSE); } + if (mEnableQueue.isSelected()) + nvps.add(Constants.PR_PUBLISHING_QUEUE_ENABLE, Constants.TRUE); + else + nvps.add(Constants.PR_PUBLISHING_QUEUE_ENABLE, Constants.FALSE); + nvps.add(Constants.PR_PUBLISHING_QUEUE_THREADS, mMaxNumberOfPublishingThreads); + nvps.add(Constants.PR_PUBLISHING_QUEUE_PAGE_SIZE, mPublishingQueuePageSize); + nvps.add(Constants.PR_PUBLISHING_QUEUE_PRIORITY, mPublishingQueuePriorityLevel); + if (mEnable.isSelected()) { String host = mHostNameText.getText().trim(); String port = mPortText.getText().trim(); diff --git a/pki/base/console/src/com/netscape/certsrv/common/Constants.java b/pki/base/console/src/com/netscape/certsrv/common/Constants.java index 5dcf50810..460ede629 100644 --- a/pki/base/console/src/com/netscape/certsrv/common/Constants.java +++ b/pki/base/console/src/com/netscape/certsrv/common/Constants.java @@ -189,9 +189,9 @@ public interface Constants { public static final String PR_LOG_TRANSACTIONS = "Transactions"; public static final String PR_LOG_SYSTEM = "System"; - public static final String PR_DEBUG_LOG_SHOWCALLER = "debug.showcaller"; - public static final String PR_DEBUG_LOG_ENABLE = "debug.enabled"; - public static final String PR_DEBUG_LOG_LEVEL = "debug.level"; + public static final String PR_DEBUG_LOG_SHOWCALLER = "debug.showcaller"; + public static final String PR_DEBUG_LOG_ENABLE = "debug.enabled"; + public static final String PR_DEBUG_LOG_LEVEL = "debug.level"; /*======================================================== * LDAP Publishing @@ -246,6 +246,10 @@ public interface Constants { public final static String PR_BIND_PASSWD_AGAIN = "bindPasswdAgain"; public final static String PR_LDAP_MAX_CONNS = "maxConns"; public final static String PR_LDAP_MIN_CONNS = "minConns"; + public final static String PR_PUBLISHING_QUEUE_ENABLE = "queue.enable"; + public final static String PR_PUBLISHING_QUEUE_THREADS = "queue.maxNumberOfThreads"; + public final static String PR_PUBLISHING_QUEUE_PAGE_SIZE = "queue.pageSize"; + public final static String PR_PUBLISHING_QUEUE_PRIORITY = "queue.priorityLevel"; public final static String PR_BASE_DN = "baseDN"; public final static String PR_DNCOMPS = "dnComps"; |