com.sun.ws.management.server
Class EventingSupport

java.lang.Object
  extended by com.sun.ws.management.server.BaseSupport
      extended by com.sun.ws.management.server.EventingSupport

public final class EventingSupport
extends BaseSupport

A helper class that encapsulates some of the arcane logic to manage subscriptions using the WS-Eventing protocol.


Field Summary
static int DEFAULT_EXPIRATION_MILLIS
           
static int DEFAULT_QUEUE_SIZE
           
 
Fields inherited from class com.sun.ws.management.server.BaseSupport
contextMap
 
Method Summary
static Filter createFilter(Eventing request)
          Create a Filter from an Eventing request
static Addressing createPushEventMessage(java.util.UUID id, java.lang.Object content)
          Retrieve the Context associated to passed ID, then create the WS-Man request for the provided content.
static EndpointReferenceType createSubscriptionManagerEpr(Eventing request, Eventing response, java.lang.Object context)
           
static EventingIteratorFactory getIteratorFactory(java.lang.String resourceURI)
          Gets an IteratorFactory for the specified resource URI.
static java.lang.String[] getSupportedDeliveryModes()
           
static boolean isDeliveryModeSupported(java.lang.String deliveryMode)
           
static void registerIteratorFactory(java.lang.String resourceURI, EventingIteratorFactory iteratorFactory)
          Add an iterator factory to EnumerationSupport.
static boolean sendEvent(java.lang.Object context, Addressing msg, NamespaceMap nsMap)
           
static boolean sendEvent(java.util.UUID id, java.lang.Object content)
           
static java.util.UUID subscribe(HandlerContext handlerContext, Eventing request, Eventing response, boolean isFiltered, int queueSize, ContextListener listener)
           
static java.util.UUID subscribe(HandlerContext handlerContext, Eventing request, Eventing response, ContextListener listener)
           
static void unsubscribe(HandlerContext handlerContext, Eventing request, Eventing response)
           
 
Methods inherited from class com.sun.ws.management.server.BaseSupport
addSupportedFilterDialect, createFilter, createXmlFragment, createXmlFragment, getSupportedDialects, isSupportedDialect, stopTimer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_QUEUE_SIZE

public static final int DEFAULT_QUEUE_SIZE
See Also:
Constant Field Values

DEFAULT_EXPIRATION_MILLIS

public static final int DEFAULT_EXPIRATION_MILLIS
See Also:
Constant Field Values
Method Detail

getSupportedDeliveryModes

public static java.lang.String[] getSupportedDeliveryModes()

isDeliveryModeSupported

public static boolean isDeliveryModeSupported(java.lang.String deliveryMode)

subscribe

public static java.util.UUID subscribe(HandlerContext handlerContext,
                                       Eventing request,
                                       Eventing response,
                                       ContextListener listener)
                                throws javax.xml.datatype.DatatypeConfigurationException,
                                       javax.xml.soap.SOAPException,
                                       javax.xml.bind.JAXBException,
                                       FaultException
Throws:
javax.xml.datatype.DatatypeConfigurationException
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
FaultException

subscribe

public static java.util.UUID subscribe(HandlerContext handlerContext,
                                       Eventing request,
                                       Eventing response,
                                       boolean isFiltered,
                                       int queueSize,
                                       ContextListener listener)
                                throws javax.xml.datatype.DatatypeConfigurationException,
                                       javax.xml.soap.SOAPException,
                                       javax.xml.bind.JAXBException,
                                       FaultException
Throws:
javax.xml.datatype.DatatypeConfigurationException
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
FaultException

createSubscriptionManagerEpr

public static EndpointReferenceType createSubscriptionManagerEpr(Eventing request,
                                                                 Eventing response,
                                                                 java.lang.Object context)
                                                          throws javax.xml.soap.SOAPException,
                                                                 javax.xml.bind.JAXBException
Throws:
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException

unsubscribe

public static void unsubscribe(HandlerContext handlerContext,
                               Eventing request,
                               Eventing response)
                        throws javax.xml.soap.SOAPException,
                               javax.xml.bind.JAXBException,
                               FaultException
Throws:
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
FaultException

sendEvent

public static boolean sendEvent(java.lang.Object context,
                                Addressing msg,
                                NamespaceMap nsMap)
                         throws javax.xml.soap.SOAPException,
                                javax.xml.bind.JAXBException,
                                java.io.IOException,
                                javax.xml.xpath.XPathExpressionException,
                                java.lang.Exception
Throws:
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
java.io.IOException
javax.xml.xpath.XPathExpressionException
java.lang.Exception

createFilter

public static Filter createFilter(Eventing request)
                           throws CannotProcessFilterFault,
                                  FilteringRequestedUnavailableFault
Create a Filter from an Eventing request

Returns:
Returns a Filter object if a filter exists in the request, otherwise null.
Throws:
CannotProcessFilterFault, - FilteringRequestedUnavailableFault, InternalErrorFault
CannotProcessFilterFault
FilteringRequestedUnavailableFault

registerIteratorFactory

public static void registerIteratorFactory(java.lang.String resourceURI,
                                           EventingIteratorFactory iteratorFactory)
                                    throws java.lang.Exception
Add an iterator factory to EnumerationSupport.

Parameters:
resourceURI - ResourceURI for which this iterator factory is to be used to fufill Enumeration requests.
iteratorFactory - The Iterator Factory that creates EnumerationIterator objects that are used by EnumerationSupport to fufill Enumeration requests. If a factory is already registered it will be overwritten with the specified factory.
Throws:
java.lang.Exception

getIteratorFactory

public static EventingIteratorFactory getIteratorFactory(java.lang.String resourceURI)
Gets an IteratorFactory for the specified resource URI.

Parameters:
resourceURI - the URI associated with the IteratorFactory
Returns:
the IteratorFactory if one is registered, otherwise null

createPushEventMessage

public static Addressing createPushEventMessage(java.util.UUID id,
                                                java.lang.Object content)
                                         throws javax.xml.soap.SOAPException,
                                                javax.xml.bind.JAXBException,
                                                java.io.IOException
Retrieve the Context associated to passed ID, then create the WS-Man request for the provided content.

Throws:
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
java.io.IOException

sendEvent

public static boolean sendEvent(java.util.UUID id,
                                java.lang.Object content)
                         throws javax.xml.soap.SOAPException,
                                javax.xml.bind.JAXBException,
                                java.io.IOException
Throws:
javax.xml.soap.SOAPException
javax.xml.bind.JAXBException
java.io.IOException