summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/certsrv/publish/IPublisherProcessor.java
blob: 445d0aa1513223919cb0a3687278f08c5dd2939a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
// --- BEGIN COPYRIGHT BLOCK ---
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// (C) 2007 Red Hat, Inc.
// All rights reserved.
// --- END COPYRIGHT BLOCK ---
package com.netscape.certsrv.publish;


import java.io.*;
import java.util.*;
import java.net.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.security.*;
import java.security.cert.X509Certificate;
import netscape.ldap.*;
import java.security.cert.*;
import netscape.security.util.*;
import netscape.security.x509.*;
import com.netscape.certsrv.common.*;
import com.netscape.certsrv.base.*;
import com.netscape.certsrv.logging.*;
import com.netscape.certsrv.dbs.certdb.*;
import com.netscape.certsrv.request.IRequest;
import com.netscape.certsrv.ldap.*;


/**
 *  Controls the publishing process from the top level.  Maintains
 *  a collection of Publishers , Mappers, and Publish Rules.
 *
 * @version $Revision$ $Date$
 */

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";
    public static final String PROP_CERTS = "certs";
    public static final String PROP_XCERT = "xcert";

    public static final String PROP_CLASS = "class";
    public static final String PROP_IMPL = "impl";
    public static final String PROP_PLUGIN = "pluginName";
    public static final String PROP_INSTANCE = "instance";

    public static final String PROP_PREDICATE = "predicate";
    public static final String PROP_ENABLE = "enable";
    public static final String PROP_LDAP = "ldap";
    public static final String PROP_MAPPER = "mapper";
    public static final String PROP_PUBLISHER = "publisher";
    public static final String PROP_TYPE = "type";

    /**
     *
     * Returns Hashtable of rule plugins.
     */

    public Hashtable getRulePlugins();

    /**
     *
     * Returns Hashtable of rule  instances.
     */

    public Hashtable getRuleInsts();

    /**
     *
     * Returns Hashtable of mapper plugins.
     */

    public Hashtable getMapperPlugins();

    /**
     *
     * Returns Hashtable of publisher plugins.
     */
    public Hashtable getPublisherPlugins();

    /**
     *
     * Returns Hashtable of rule mapper instances.
     */
    public Hashtable getMapperInsts();

    /**
     *
     * Returns Hashtable of rule publisher instances.
     */
    public Hashtable getPublisherInsts();

    /**
     *
     * Returns list of rules based on publishing type.
     * @param publishingType Type for which to retrieve rule list.
     */

    public Enumeration getRules(String publishingType);

    /**
     *
     * Returns list of rules based on publishing type and publishing request.
     * @param publishingType Type for which to retrieve rule list.
     * @param req  Corresponding publish request.
     */
    public Enumeration getRules(String publishingType, IRequest req);

    /**
     *
     * Returns mapper initial default parameters.
     * @param implName name of MapperPlugin.
     */

    public Vector getMapperDefaultParams(String implName) throws
            ELdapException;

    /**
     *
     * Returns mapper current instance  parameters.
     * @param insName name of MapperProxy.
     * @exception ELdapException failed due to Ldap error.
     */

    public Vector getMapperInstanceParams(String insName) throws
            ELdapException;

    /**
     *
     * Returns publisher initial default parameters.
     * @param implName name of PublisherPlugin.
     * @exception ELdapException failed due to Ldap error.
     */
    public Vector getPublisherDefaultParams(String implName) throws
            ELdapException;

    /**
     *
     * Returns true if MapperInstance is enabled.
     * @param insName name of MapperProxy.
     * @return true if enabled. false if disabled.
     */

    public boolean isMapperInstanceEnable(String insName);

    /**
     *
     * Returns ILdapMapper instance that is currently active.
     * @param insName name of MapperProxy.
     * @return instance of ILdapMapper.
     */ 
    public ILdapMapper getActiveMapperInstance(String insName);

    /**
     *
     * Returns ILdapMapper instance based on name of MapperProxy.
     * @param insName name of MapperProxy.
     * @return instance of ILdapMapper.
     */
    public ILdapMapper getMapperInstance(String insName);

    /**
     *
     * Returns true publisher instance is currently enabled.
     * @param insName name of PublisherProxy.
     * @return true if enabled.
     */
    public boolean isPublisherInstanceEnable(String insName);

    /**
     *
     * Returns ILdapPublisher instance that is currently active.
     * @param insName name of PublisherProxy.
     * @return instance of ILdapPublisher.
     */
    public ILdapPublisher getActivePublisherInstance(String insName);

    /**
     *
     * Returns ILdapPublisher instance.
     * @param insName name of PublisherProxy.
     * @return instance of ILdapPublisher.
     */
    public ILdapPublisher getPublisherInstance(String insName);

    /**
     *
     * Returns Vector of PublisherIntance's current instance parameters.
     * @param insName name of PublisherProxy.
     * @return Vector of current instance parameters.
     */
    public Vector getPublisherInstanceParams(String insName) throws
            ELdapException;

    /**
     *
     * Returns Vector of RulePlugin's initial default parameters.
     * @param implName name of RulePlugin.
     * @return Vector of initial default parameters.
     * @exception ELdapException failed due to Ldap error.
     */
    public Vector getRuleDefaultParams(String implName) throws
            ELdapException;

    /**
     *
     * Returns Vector of RulePlugin's current instance parameters.
     * @param implName name of RulePlugin.
     * @return Vector of current instance parameters.
     * @exception ELdapException failed due to Ldap error.
     */
    public Vector getRuleInstanceParams(String implName) throws
            ELdapException;

    /**
     * Set published flag - true when published, false when unpublished. 
     * Not exist means not published. 
     * @param serialNo serial number of publishable object.
     * @param published true for published, false for not.
     */
    public void setPublishedFlag(BigInteger serialNo, boolean published);

    /**
     * Publish ca cert, UpdateDir.java, jobs, request listeners
     * @param cert X509 certificate to be published.
     * @exception ELdapException publish failed due to Ldap error.
     */
    public void publishCACert(X509Certificate cert)
        throws ELdapException;

    /**
     * This function is never called. CMS does not unpublish
     * CA certificate.
     */
    public void unpublishCACert(X509Certificate cert)
        throws ELdapException;

    /**
     * Publishs regular user certificate based on the criteria
     * set in the request.
     * @param cert X509 certificate to be published.
     * @param req  request which provides the criteria
     * @exception ELdapException publish failed due to Ldap error.
     */
    public void publishCert(X509Certificate cert, IRequest req)
        throws ELdapException;

    /**
     * Unpublish user certificate. This is used by 
     * UnpublishExpiredJob.
     * @param cert X509 certificate to be unpublished.
     * @param req  request which provides the criteria
     * @exception ELdapException unpublish failed due to Ldap error.
     */
    public void unpublishCert(X509Certificate cert, IRequest req)
        throws ELdapException;

    /**
     * publishes a crl by mapping the issuer name in the crl to an entry
     * and publishing it there. entry must be a certificate authority.
     * Note that this is used by cmsgateway/cert/UpdateDir.java
     * @param crl Certificate Revocation List
     * @param crlIssuingPointId name of the issuing point.
    * @exception ELdapException publish failed due to Ldap error.
     */
    public void publishCRL(X509CRLImpl crl,String crlIssuingPointId) 
        throws ELdapException;

    /**
     * publishes a crl by mapping the issuer name in the crl to an entry
     * and publishing it there. entry must be a certificate authority.
     * @param dn  Distinguished name to publish.
     * @param crl Certificate Revocation List
     * @exception ELdapException publish failed due to Ldap error.
     */
    public void publishCRL(String dn, X509CRL crl) 
        throws ELdapException;

    /**
     *
     * Return true if Ldap is enabled.
     * @return true if Ldap is enabled,otherwise false.
     */

    public boolean ldapEnabled();

    /**
     *
     * Return true of PublisherProcessor is enabled.
     * @return true if is enabled, otherwise false.
     *
     */
    public boolean enabled();

    /**
     *
     *  Return Authority for which this Processor operates.
     * @return Authority.
     */

    public ISubsystem getAuthority();

    /**
     *
     * Perform logging function for this Processor.
     * @param level  Log level to be used for this message
     * @param msg    Message to be logged.
     */

    public void log(int level, String msg);

    /**
     *
     * Returns LdapConnModule belonging to this Processor.
     * @return LdapConnModule.
     */
    public ILdapConnModule getLdapConnModule();

    /**
     * Sets the LdapConnModule belonging to this Processor.
     * @param m ILdapConnModule.
     */
    public void setLdapConnModule(ILdapConnModule m);
}