org.ws4d.java.service
Class ProxyService

java.lang.Object
  extended by org.ws4d.java.service.ServiceCommons
      extended by org.ws4d.java.service.ProxyService
All Implemented Interfaces:
Service

public class ProxyService
extends ServiceCommons

Proxy class of a dpws service.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.ws4d.java.service.ServiceCommons
ServiceCommons.OperationSignature, ServiceCommons.PortType
 
Constructor Summary
ProxyService(ServiceReference serviceReference)
           
 
Method Summary
 void appendPortTypes(QNameSet portTypes)
           
 WSDL getDescription(java.lang.String targetNamespace)
          Returns a WSDL document describing this service by the given namespace.
 Iterator getEprInfos()
          Returns an iterator of EprInfo.
 DeviceReference getParentDeviceReference()
          Gets device reference of parent device.
 int getPortTypeCount()
           
 Iterator getPortTypes()
          Gets service port types.
 URI getServiceId()
          Gets service id
 ServiceReference getServiceReference()
          Gets the service reference.
 long getStatus(ClientSubscription subscription)
          Returns the duration in milliseconds until expiration of the specified client subscription.
 boolean isRemote()
          Is the service remote (proxy) or local?
 long renew(ClientSubscription subscription, long duration)
          Renews an existing subscription with new duration.
 ClientSubscription subscribe(EventSink sink, java.lang.String clientSubscriptionId, URISet eventActionURIs, long duration)
          Initializes event receiving from specified event sender.
 void unsubscribe(ClientSubscription subscription)
          Unsubscribes from specified subscription.
 
Methods inherited from class org.ws4d.java.service.ServiceCommons
getAnyEventSource, getAnyOperation, getCertificate, getDescriptions, getEventSource, getEventSource, getEventSources, getEventSources, getOperation, getOperation, getOperations, getOperations, getPortTypeAttribute, getPortTypeAttributes, getPrivateKey, hasPortTypeAttributes, isSecure, setCertificate, setPortTypeAttribute, setPortTypeAttributes, setPrivateKey, setSecure, setSecureService, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxyService

public ProxyService(ServiceReference serviceReference)
             throws MissingMetadataException
Parameters:
serviceReference -
Throws:
MissingMetadataException - in case no service description metadata (i.e. WSDL) was found for at least one of the service's port types
Method Detail

getServiceReference

public ServiceReference getServiceReference()
Description copied from interface: Service
Gets the service reference.

Returns:
service reference

getParentDeviceReference

public DeviceReference getParentDeviceReference()
Description copied from interface: Service
Gets device reference of parent device. This method may return null in case this service doesn't reside on a device or its underlying device is not known at this time.

Returns:
device reference of parent device, may be null

isRemote

public boolean isRemote()
Description copied from interface: Service
Is the service remote (proxy) or local?

Returns:
whether this is a remote service (proxy) or not

getServiceId

public URI getServiceId()
Description copied from interface: Service
Gets service id

Returns:
service id

getEprInfos

public Iterator getEprInfos()
Description copied from interface: Service
Returns an iterator of EprInfo.

Returns:
an iterator of EprInfo.

getPortTypes

public Iterator getPortTypes()
Description copied from interface: Service
Gets service port types.

Returns:
service port types, data structure is read only.

getPortTypeCount

public int getPortTypeCount()

appendPortTypes

public void appendPortTypes(QNameSet portTypes)
                     throws MissingMetadataException
Parameters:
portTypes - new port types to add to this proxy service
Throws:
MissingMetadataException - if no metadata (WSDL) is found for at least one of the specified portTypes

subscribe

public ClientSubscription subscribe(EventSink sink,
                                    java.lang.String clientSubscriptionId,
                                    URISet eventActionURIs,
                                    long duration)
                             throws EventingException,
                                    TimeoutException
Initializes event receiving from specified event sender.

Parameters:
sink - event sink which will receive the notifications.
clientSubscriptionId -
eventActionURIs - set of action URIs to subscribe to.
duration - duration in milliseconds of subscription. If 0 no expiration of subscription.
Returns:
subscription id (wse:identifier)
Throws:
EventingException
TimeoutException

unsubscribe

public void unsubscribe(ClientSubscription subscription)
                 throws EventingException,
                        TimeoutException
Unsubscribes from specified subscription.

Parameters:
subscription - subscription to terminate.
Throws:
EventingException
TimeoutException

renew

public long renew(ClientSubscription subscription,
                  long duration)
           throws EventingException,
                  TimeoutException
Renews an existing subscription with new duration. If duration is "0" subscription never terminates.

Parameters:
subscription -
duration -
Returns:
either the actual subscription duration as reported by the service or0 if the subscription doesn't expire at all
Throws:
EventingException
TimeoutException

getStatus

public long getStatus(ClientSubscription subscription)
               throws EventingException,
                      TimeoutException
Description copied from interface: Service
Returns the duration in milliseconds until expiration of the specified client subscription.

Returns:
Throws:
EventingException
TimeoutException

getDescription

public WSDL getDescription(java.lang.String targetNamespace)
Description copied from interface: Service
Returns a WSDL document describing this service by the given namespace. This method makes a recursive search within all WSDLs directly attached to that service.

Parameters:
targetNamespace - the namespace.
Returns:
the WSDL document describing this service by the given namespace.