1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.org.iscream.client.alerters; |
2 |
> |
package uk.org.iscream.cms.server.client.alerters; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
< |
import uk.org.iscream.client.*; |
6 |
< |
import uk.org.iscream.core.*; |
7 |
< |
import uk.org.iscream.util.*; |
8 |
< |
import uk.org.iscream.componentmanager.*; |
5 |
> |
import uk.org.iscream.cms.server.client.*; |
6 |
> |
import uk.org.iscream.cms.server.core.*; |
7 |
> |
import uk.org.iscream.cms.server.util.*; |
8 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
9 |
|
import java.io.*; |
10 |
|
import java.util.StringTokenizer; |
11 |
|
|
25 |
|
*/ |
26 |
|
public final String REVISION = "$Revision$"; |
27 |
|
|
28 |
+ |
/** |
29 |
+ |
* A description of this alerter |
30 |
+ |
*/ |
31 |
|
public final String DESC = "Sends alerts over e-mail."; |
32 |
|
|
30 |
– |
public final String NOT_CONFIGURED = "<NOT CONFIGURED>"; |
31 |
– |
|
33 |
|
//---STATIC METHODS--- |
34 |
|
|
35 |
|
//---CONSTRUCTORS--- |
36 |
|
|
37 |
|
//---PUBLIC METHODS--- |
38 |
|
|
39 |
+ |
/** |
40 |
+ |
* Implements the abstract method from the skeleton class. |
41 |
+ |
* This method will attempt to send an alert |
42 |
+ |
* message using the configured email configuration. |
43 |
+ |
* |
44 |
+ |
* @param alert the alert to send |
45 |
+ |
*/ |
46 |
|
public void sendAlert(Alert alert) { |
47 |
|
// get the subject and replace fields |
48 |
|
String subject; |
102 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
103 |
|
* method to provide clean logging (every class should have this). |
104 |
|
* |
105 |
< |
* This uses the uk.org.iscream.util.NameFormat class |
105 |
> |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
106 |
|
* to format the toString() |
107 |
|
* |
108 |
|
* @return the name of this class and its CVS revision |
115 |
|
} |
116 |
|
|
117 |
|
/** |
118 |
< |
* return the String representation of what the alerter does |
118 |
> |
* Return the String representation of what the alerter does |
119 |
> |
* |
120 |
> |
* @return the description |
121 |
|
*/ |
122 |
|
public String getDescription(){ |
123 |
|
return DESC; |
126 |
|
//---PRIVATE METHODS--- |
127 |
|
|
128 |
|
//---ACCESSOR/MUTATOR METHODS--- |
129 |
+ |
|
130 |
+ |
/** |
131 |
+ |
* Returns the "friendly" name of this class. This |
132 |
+ |
* is simply an accessor for _name, required due to |
133 |
+ |
* inheritance issues with extending AlerterSkeleton. |
134 |
+ |
* |
135 |
+ |
* @return the friendly name |
136 |
+ |
*/ |
137 |
+ |
protected String getFName() { |
138 |
+ |
return _name; |
139 |
+ |
} |
140 |
|
|
141 |
|
//---ATTRIBUTES--- |
142 |
|
|
150 |
|
* be changed to null for utility classes. |
151 |
|
*/ |
152 |
|
protected String _name = "EMail"; |
132 |
– |
|
133 |
– |
/** |
134 |
– |
* This holds a reference to the |
135 |
– |
* system logger that is being used. |
136 |
– |
*/ |
137 |
– |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
153 |
|
|
154 |
|
//---STATIC ATTRIBUTES--- |
155 |
|
|