summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/certsrv/notification/IEmailFormProcessor.java
blob: 234c7a46d7d146489e1d8dbd123e490bfe06c156 (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
// --- 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.notification;


import com.netscape.certsrv.logging.*;
import com.netscape.certsrv.notification.*;
import java.util.*;
import java.lang.*;


/**
 * formulates the final email.  Escape character '\' is understood.
 * '$' is used preceeding a token name.  A token name should not be a
 * substring of any other token name
 * <p>
 *
 * @version $Revision$, $Date$
 */
public interface IEmailFormProcessor {

    // list of token names
    public final static String TOKEN_ID = "InstanceID";
    public final static String TOKEN_SERIAL_NUM = "SerialNumber";
    public final static String TOKEN_HEX_SERIAL_NUM = "HexSerialNumber";
    public final static String TOKEN_REQUEST_ID = "RequestId";
    public final static String TOKEN_HTTP_HOST = "HttpHost";
    public final static String TOKEN_HTTP_PORT = "HttpPort";
    public final static String TOKEN_ISSUER_DN = "IssuerDN";
    public final static String TOKEN_SUBJECT_DN = "SubjectDN";
    public final static String TOKEN_REQUESTOR_EMAIL = "RequestorEmail";
    public final static String TOKEN_CERT_TYPE = "CertType";
    public final static String TOKEN_REQUEST_TYPE = "RequestType";
    public final static String TOKEN_STATUS = "Status";
    public final static String TOKEN_NOT_AFTER = "NotAfter";
    public final static String TOKEN_NOT_BEFORE = "NotBefore";
    public final static String TOKEN_SENDER_EMAIL = "SenderEmail";
    public final static String TOKEN_RECIPIENT_EMAIL = "RecipientEmail";
    public final static String TOKEN_SUMMARY_ITEM_LIST = "SummaryItemList";
    public final static String TOKEN_SUMMARY_TOTAL_NUM = "SummaryTotalNum";
    public final static String TOKEN_SUMMARY_SUCCESS_NUM = "SummaryTotalSuccess";
    public final static String TOKEN_SUMMARY_FAILURE_NUM = "SummaryTotalFailure";
    public final static String TOKEN_EXECUTION_TIME = "ExecutionTime";

    public final static String TOKEN_REVOCATION_DATE = "RevocationDate";

    /*
     * takes the form template, parse and replace all $tokens with the
     *		 right values.  It handles escape character '\'
     * @param form The locale specific form template,
     * @param tok2vals a hashtable containing one to one mapping
     *	 from $tokens used by the admins in the form template to the real
     *	 values corresponding to the $tokens
     * @return mail content
     */
    public String getEmailContent(String form,
        Hashtable tok2vals);

    /**
     * takes a vector of strings and concatenate them
     */
    public String formContent(Vector vec);

    /**
     * logs an entry in the log file.
     */
    public void log(int level, String msg);
}