public class NotificationServer
extends java.lang.Object
Notification
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
atomNS
The Constant atomNS.
|
static java.lang.String |
IGNOREALLREQUESTS
If this property is set to "true" this catalog will be disabled and no requests about the StaticCatalog
file will be ever sent.
|
static java.lang.String |
NOTIFICATIONLIST
The constant NotificationsList is used on PropertyChangeEvents.
|
Modifier and Type | Method and Description |
---|---|
void |
addNotification(Notification.NotificationType type,
java.lang.String message)
Generates a new Notification instance and submit it to the
notification server.
|
void |
addNotification(Notification.NotificationType type,
java.lang.String message,
java.lang.String link)
Generates a new Notification instance and submit it to the
notification server.
|
void |
addNotification(Notification notification)
Adds the notification.
|
void |
addNotificationsListener(java.beans.PropertyChangeListener listener)
Register a notification listener instance that will be informed
about new notifications added.
|
static NotificationServer |
getInstance()
Obtains access to the NotificationServer.
|
Notification |
getLastNotification()
Gets the last notification.
|
Notification |
getNotification(int notificationIndex)
Gets the notification.
|
java.util.Collection<Notification> |
getNotifications()
Gets the notifications.
|
static java.util.List<Notification> |
readNotificationsServer(net.sf.saxon.s9api.XdmNode docNode)
This method reads notifications from the XML document received in the parameter
the document must conform with the Atom format.
|
static net.sf.saxon.s9api.XdmNode |
readNotificationsURL(java.net.URL serverFileName)
Read the file pointed to by the URL parameter and builds up an XdmNode
document from it.
|
void |
removeNotification(Notification notification)
Removes a notification from the list.
|
void |
removeNotificationsListener(java.beans.PropertyChangeListener listener)
Removes a notification listener from the queue .
|
int |
size()
Size.
|
public static final java.lang.String atomNS
public static final java.lang.String IGNOREALLREQUESTS
public static final java.lang.String NOTIFICATIONLIST
public static NotificationServer getInstance()
public void addNotification(Notification.NotificationType type, java.lang.String message)
type
- the typemessage
- the messagepublic void addNotification(Notification.NotificationType type, java.lang.String message, java.lang.String link)
type
- the typemessage
- the messagelink
- optionalpublic void addNotificationsListener(java.beans.PropertyChangeListener listener)
listener
- the listenerpublic void removeNotificationsListener(java.beans.PropertyChangeListener listener)
listener
- the listenerpublic void addNotification(Notification notification)
notification
- the notificationpublic void removeNotification(Notification notification)
notification
- the notificationpublic static net.sf.saxon.s9api.XdmNode readNotificationsURL(java.net.URL serverFileName) throws java.io.IOException, net.sf.saxon.s9api.SaxonApiException
serverFileName
- the server file namejava.io.IOException
- Signals that an I/O exception has occurred.net.sf.saxon.s9api.SaxonApiException
- the saxon api exceptionpublic static java.util.List<Notification> readNotificationsServer(net.sf.saxon.s9api.XdmNode docNode) throws net.sf.saxon.s9api.SaxonApiException
atom:entry
are
processed and only elements atom:id, atom:link, atom:content
are used in a NotificationdocNode
- the doc nodenet.sf.saxon.s9api.SaxonApiException
- the saxon api exceptionpublic Notification getLastNotification()
public java.util.Collection<Notification> getNotifications()
public int size()
public Notification getNotification(int notificationIndex)
notificationIndex
- the notification indexCopyright 2006-2015 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa