|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.voms.notification.Notification
Abstract class representing a notification sent to one or more recipients.
This abstract class focuses on the message and the status of the notification. Subclasses shall implement the actual notification mechanism and the way of deriving the recipients from various sources.
Field Summary | |
private static org.apache.log4j.Logger |
log
|
protected java.lang.String |
message
|
protected java.lang.String |
recipients
|
protected java.lang.String |
sender
|
protected boolean |
sent
|
protected java.lang.String |
subject
|
Constructor Summary | |
Notification()
|
Method Summary | |
protected void |
fillMap(java.util.Map map,
CreateUserAction action)
Fills the substitution map for newMessage from the
action. |
protected void |
fillMap(java.util.Map map,
Request req)
Fills the substitution map for newMessage from the
request. |
java.lang.String |
getMessage()
Returns the message itself. |
java.lang.String |
getRecipients()
Returns the recipients (To:) of this notification. |
java.lang.String |
getSender()
Returns the sender (From:) of this message. |
java.lang.String |
getSubject()
Returns the subject (Subject:). |
boolean |
isPending()
Pending = not sent (convenience method). |
boolean |
isSent()
Status of this notification. |
protected void |
newMessage(java.lang.String templateName,
java.util.Map subst)
Creates a new message using a template file and substitution map. |
boolean |
send()
Once the notification is created this method tries to send the message. |
protected void |
setRecipientsToAdmins(Action action)
Sets the recipients to the email addresses of the action's administrators. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static org.apache.log4j.Logger log
protected boolean sent
protected java.lang.String recipients
protected java.lang.String message
protected java.lang.String subject
protected java.lang.String sender
Constructor Detail |
public Notification()
Method Detail |
public boolean isSent()
public boolean isPending()
public boolean send()
isSent()
method.
public java.lang.String getRecipients()
public java.lang.String getMessage()
public java.lang.String getSubject()
public java.lang.String getSender()
protected void newMessage(java.lang.String templateName, java.util.Map subst) throws VOMSException
notification
subdirectory
of the
.msg
extension.
The substitutions are processed in the alphabetical order of
the map keys. Every string in the template with '%' pre- and
postfix is substituted. For example if the map has a
CN -- Joe
entry and the template has a
%CN% wants to ...
string, then the message will
contain the Joe wants to ...
string.
The generated message is stored in this Notification object.
templateName
- name of the template filesubst
- substitution map
VOMSException
protected void fillMap(java.util.Map map, Request req) throws VOMSException
newMessage
from the
request. This method copies the action parameters and the
optional parameters from the request, which may
include the following fields for substitution:
%urlBase%
base URL for the web interface%urlUser%
URL path to the user's web interface %urlAdmin%
URL path to the admin's web interface%urlcookie%
name of the cookie in a GET URL%urlid%
name of the requesit id in a GET URL%VO%
VO or container name%comment%
the last comment%history%
comment(s) from the request
map
- the substitution map (has to exist)req
- the request itself
VOMSException
protected void fillMap(java.util.Map map, CreateUserAction action)
newMessage
from the
action. This method copies the user's details, which
include the following fields for substitution:
%CN%
common name%email%
email address%institute%
institute name%phone%
phone number%DN%
distinguished name%CA%
CA name
map
- the substitution map (has to exist)action
- the user creation actionprotected void setRecipientsToAdmins(Action action) throws VOMSException
VOMSException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |