public class NotificationListener
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
NotificationListener.Event |
Modifier and Type | Field and Description |
---|---|
protected static java.util.Timer |
timer |
Constructor and Description |
---|
NotificationListener(java.lang.String host,
int port,
java.lang.String repositoryHost,
int repositoryPort,
org.apache.commons.httpclient.protocol.Protocol protocol,
org.apache.commons.httpclient.Credentials credentials,
java.lang.String repositoryDomain,
int pollInterval,
boolean udp) |
Modifier and Type | Method and Description |
---|---|
protected void |
fireEvent(int id,
java.util.Map information) |
void |
fireEvent(java.util.Map information,
org.apache.commons.httpclient.Credentials credentials) |
protected void |
fireEvent(org.apache.webdav.lib.NotificationListener.EventMethod eventMethod,
org.apache.commons.httpclient.Credentials credentials) |
void |
fireVetoableEvent(java.util.Map information,
org.apache.commons.httpclient.Credentials credentials) |
protected void |
poll(java.lang.String notifiedSubscribers) |
boolean |
subscribe(java.lang.String method,
java.lang.String uri,
int depth,
int lifetime,
int notificationDelay,
Subscriber listener,
org.apache.commons.httpclient.Credentials credentials)
Registers a Subscriber with the remote server.
|
boolean |
unsubscribe(java.lang.String uri,
Subscriber listener,
org.apache.commons.httpclient.Credentials credentials) |
public NotificationListener(java.lang.String host, int port, java.lang.String repositoryHost, int repositoryPort, org.apache.commons.httpclient.protocol.Protocol protocol, org.apache.commons.httpclient.Credentials credentials, java.lang.String repositoryDomain, int pollInterval, boolean udp)
host
- The ip-address or hostname on which the udp or http-server is running (e.g. "myhost.mydomain.mytld")port
- The port where the udp or http-server is listening on (e.g. 4444)repositoryHost
- The ip-adress or hostname of the WebDAV-repositoryrepositoryPort
- The port of the WebDAV-repository (e.g. 8080)protocol
- The protocol that should be used to connect to the WebDAV-repository (http or https)credentials
- The credentials which are used to connect to the WebDAV-repositoryrepositoryDomain
- The repository domain (e.g. "/slide")pollInterval
- The poll interval that will be used if no notifications are revieved via UDP/TCP (in milliseconds)udp
- If set to true, UDP server will be started, otherwise TCP server (must match the repository notification mode)public boolean subscribe(java.lang.String method, java.lang.String uri, int depth, int lifetime, int notificationDelay, Subscriber listener, org.apache.commons.httpclient.Credentials credentials)
method
- the "notification type", determines for what events do you
want do subscribe. one of "Update", "Update/newmember",
"Delete", "Move".uri
- the resource for that you subscribedepth
- the depth of the collection tree that you want to observelifetime
- the duration for that you want to observe (in seconds)notificationDelay
- the time the server waits before it sends a notify
message to the host provided in the constructor
(in seconds)listener
- the Subscriber that is called on incomming notificationscredentials
- credentials for authentication on the server observedWebdavResource.subscribeMethod(java.lang.String, java.lang.String, java.lang.String, long, int, long)
,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_webdav_subscribe.asp
public boolean unsubscribe(java.lang.String uri, Subscriber listener, org.apache.commons.httpclient.Credentials credentials)
public void fireEvent(java.util.Map information, org.apache.commons.httpclient.Credentials credentials) throws java.io.IOException
java.io.IOException
public void fireVetoableEvent(java.util.Map information, org.apache.commons.httpclient.Credentials credentials) throws java.io.IOException
java.io.IOException
protected void fireEvent(org.apache.webdav.lib.NotificationListener.EventMethod eventMethod, org.apache.commons.httpclient.Credentials credentials) throws java.io.IOException
java.io.IOException
protected void fireEvent(int id, java.util.Map information)
protected void poll(java.lang.String notifiedSubscribers)