|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 package com.nokia.mj.impl.security.utils; |
|
19 |
|
20 import com.nokia.mj.impl.utils.ErrorMessageBase; |
|
21 import com.nokia.mj.impl.utils.ResourceLoader; |
|
22 import java.util.Hashtable; |
|
23 |
|
24 /** |
|
25 * Class defining Security detailed error messages. |
|
26 * |
|
27 * @author Nokia Corporation |
|
28 * @version 1.0 |
|
29 */ |
|
30 public final class SecurityDetailedErrorMessage extends ErrorMessageBase |
|
31 { |
|
32 // Security related detailed error codes. |
|
33 public static final int JAR_TAMPERED = 1; |
|
34 public static final int CERT_DISABLED = 2; |
|
35 public static final int CERT_DELETED = 3; |
|
36 public static final int SIM_CHANGED = 4; |
|
37 public static final int UNIDENTIFIED_APPLICATION = 5; |
|
38 public static final int NETWORK_RESTRICTION_VIOLATION = 6; |
|
39 public static final int OCSP_GENERAL_ERR = 7; |
|
40 public static final int OCSP_SETTINGS_ERR = 8; |
|
41 public static final int OCSP_REVOKED_ERR = 9; |
|
42 |
|
43 |
|
44 /*** ----------------------------- PUBLIC ------------------------------ */ |
|
45 /*** ---------------------------- PROTECTED --------------------------- */ |
|
46 |
|
47 /** |
|
48 * Method for getting message table where key is an Integer value for |
|
49 * the error code, and value is an error message String id. |
|
50 */ |
|
51 private static Hashtable iMessageTable = null; |
|
52 protected Hashtable getMessageTable() |
|
53 { |
|
54 if (iMessageTable != null) |
|
55 { |
|
56 return iMessageTable; |
|
57 } |
|
58 Hashtable messageTable = new Hashtable(); |
|
59 messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered_details"); |
|
60 messageTable.put(new Integer(CERT_DISABLED), "cert_disabled"); |
|
61 messageTable.put(new Integer(CERT_DELETED), "cert_deleted"); |
|
62 messageTable.put(new Integer(SIM_CHANGED), "sim_changed"); |
|
63 messageTable.put(new Integer(UNIDENTIFIED_APPLICATION), "unidentified_application"); |
|
64 messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation_details"); |
|
65 messageTable.put(new Integer(OCSP_GENERAL_ERR), "ocsp_general_details"); |
|
66 messageTable.put(new Integer(OCSP_SETTINGS_ERR), "ocsp_settings"); |
|
67 messageTable.put(new Integer(OCSP_REVOKED_ERR), "ocsp_revoked"); |
|
68 iMessageTable = messageTable; |
|
69 return iMessageTable; |
|
70 } |
|
71 |
|
72 /** |
|
73 * Method for retrieving the ResourceLoader instance that is used |
|
74 * to localise error messages. |
|
75 */ |
|
76 private static ResourceLoader iRes = null; |
|
77 protected ResourceLoader getResourceLoader() |
|
78 { |
|
79 if (iRes == null) |
|
80 { |
|
81 iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_error_"); |
|
82 } |
|
83 return iRes; |
|
84 } |
|
85 |
|
86 /*** ----------------------------- PACKAGE ---------------------------- */ |
|
87 /*** ----------------------------- PRIVATE ---------------------------- */ |
|
88 /*** ----------------------------- NATIVE ----------------------------- */ |
|
89 } |