public class ProxyService extends ServiceCommons
| Modifier and Type | Class and Description |
|---|---|
protected class |
ProxyService.ProxyServiceCallback |
ServiceCommons.PortTypecustomMData, events, operations, portTypes, wsdlsNO_PARAMETER| Constructor and Description |
|---|
ProxyService(ServiceReferenceInternal serviceReference,
HashMap customMData,
java.lang.String comManId) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendPortTypes(QNameSet portTypes,
CredentialInfo credentialInfo,
java.lang.String comManId) |
protected ProxyService.ProxyServiceCallback |
createCallbackHandler(XAddressInfo xaddrInfo,
Operation op,
ClientSubscription subscription)
Added by SSch in order to allow extension.
|
protected EventSource |
createEventSource(WSDLOperation wsdlOperation)
Creates a
DefaultEventSource instance suitable for usage within this service instance. |
protected Operation |
createOperation(WSDLOperation wsdlOperation)
Creates an
Operation instance suitable for usage within this service instance. |
void |
disconnectAllServiceReferences(boolean resetServiceRefs)
The method disconnected all ServiceReferences from this service.
|
protected ParameterValue |
dispatchInvoke(InvokeMessage msg,
Operation op,
ParameterValue parameterValue,
CredentialInfo credentialInfo) |
protected ParameterValue |
dispatchInvoke(InvokeMessage msg,
Operation op,
ParameterValue parameterValue,
ProxyService.ProxyServiceCallback handler,
CredentialInfo credentialInfo) |
protected ParameterValue |
dispatchInvoke(Operation op,
ParameterValue parameterValue,
CredentialInfo credentialInfo) |
java.lang.String |
getComManId() |
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(SecurityKey securityKey)
Gets device reference of parent device.
|
int |
getPortTypeCount() |
Iterator |
getPortTypes()
Gets service port types.
|
URI |
getServiceId()
Gets service id
|
ServiceReference |
getServiceReference(SecurityKey securityKey)
Gets the service reference.
|
long |
getStatus(ClientSubscription subscription,
CredentialInfo credentialInfo)
Returns the duration in milliseconds until expiration of the specified client subscription.
|
protected void |
initialize(ServiceReferenceInternal serviceReference,
java.lang.String comManId)
Must be called after construction of ProxyService without
ServiceReference as parameter. |
boolean |
isRemote()
Is the service remote (proxy) or local?
|
protected void |
prepareWSDLOnServiceLevel(WSDL wsdl) |
long |
renew(ClientSubscription subscription,
long duration,
CredentialInfo credentialInfo)
Renews an existing subscription with new duration.
|
protected void |
setCustomMData(HashMap customMData)
Set the custom metadata
|
ClientSubscription |
subscribe(EventSink sink,
java.lang.String clientSubscriptionId,
URISet filterURIs,
long duration,
CredentialInfo credentialInfo)
Initializes event receiving from specified event sender.
|
void |
unsubscribe(ClientSubscription subscription,
CredentialInfo credentialInfo)
Unsubscribes from specified subscription.
|
equals, getAllEventSources, getAllOperations, getCustomMData, getDescriptions, getEventsInternal, getEventSource, getEventSources, getExistingDescription, getOperation, getOperations, getPortTypeAttribute, getPortTypeAttributes, getPortTypesInternal, hashCode, hasPortTypeAttributes, processWSDLPortType, setPortTypeAttribute, setPortTypeAttributes, toStringpublic ProxyService(ServiceReferenceInternal serviceReference, HashMap customMData, java.lang.String comManId) throws MissingMetadataException
serviceReference - MissingMetadataException - in case no service description metadata (i.e. WSDL) was found for at least one of the service's port
typesprotected void initialize(ServiceReferenceInternal serviceReference, java.lang.String comManId) throws java.lang.InstantiationException, MissingMetadataException
ServiceReference as parameter.serviceReference - java.lang.InstantiationExceptionMissingMetadataExceptionpublic ServiceReference getServiceReference(SecurityKey securityKey)
Servicepublic void disconnectAllServiceReferences(boolean resetServiceRefs)
Servicetrue all service
references will be reseted.public DeviceReference getParentDeviceReference(SecurityKey securityKey)
Servicenull in case this
service doesn't reside on a device or its underlying device is not known at this time.nullpublic boolean isRemote()
Servicepublic URI getServiceId()
Servicepublic Iterator getEprInfos()
ServiceEprInfo.EprInfo.public Iterator getPortTypes()
ServiceQName.public int getPortTypeCount()
public void appendPortTypes(QNameSet portTypes, CredentialInfo credentialInfo, java.lang.String comManId) throws MissingMetadataException
portTypes - new port types to add to this proxy serviceMissingMetadataException - if no metadata (WSDL) is found for at least one of the specified portTypespublic ClientSubscription subscribe(EventSink sink, java.lang.String clientSubscriptionId, URISet filterURIs, long duration, CredentialInfo credentialInfo) throws EventingException, java.io.IOException, CommunicationException
sink - event sink which will receive the notifications.clientSubscriptionId - filterURIs - set of action URIs to subscribe to.duration - duration in milliseconds of subscription. If 0 no expiration of subscription.EventingExceptionCommunicationExceptionjava.io.IOExceptionprotected ProxyService.ProxyServiceCallback createCallbackHandler(XAddressInfo xaddrInfo, Operation op, ClientSubscription subscription)
object - public void unsubscribe(ClientSubscription subscription, CredentialInfo credentialInfo) throws EventingException, java.io.IOException, CommunicationException
subscription - subscription to terminate.EventingExceptionCommunicationExceptionjava.io.IOExceptionpublic long renew(ClientSubscription subscription, long duration, CredentialInfo credentialInfo) throws EventingException, java.io.IOException, CommunicationException
subscription - duration - 0 if the subscription
doesn't expire at allEventingExceptionCommunicationExceptionjava.io.IOExceptionpublic long getStatus(ClientSubscription subscription, CredentialInfo credentialInfo) throws EventingException, java.io.IOException, CommunicationException
ServiceEventingExceptionCommunicationExceptionjava.io.IOExceptionpublic WSDL getDescription(java.lang.String targetNamespace)
ServicetargetNamespace - the namespace.protected void prepareWSDLOnServiceLevel(WSDL wsdl)
wsdl - protected Operation createOperation(WSDLOperation wsdlOperation)
ServiceCommonsOperation instance suitable for usage within this service instance. This
method is only called from within ServiceCommons.processWSDLPortType(WSDLPortType) and should not be
used in other contexts.createOperation in class ServiceCommonswsdlOperation - the WSDL operation describing the operation to createprotected EventSource createEventSource(WSDLOperation wsdlOperation)
ServiceCommonsDefaultEventSource instance suitable for usage within this service instance.
This method is only called from within ServiceCommons.processWSDLPortType(WSDLPortType) and should
not be used in other contexts.createEventSource in class ServiceCommonswsdlOperation - the WSDL operation describing the event source to createprotected ParameterValue dispatchInvoke(Operation op, ParameterValue parameterValue, CredentialInfo credentialInfo) throws InvocationException, CommunicationException
protected void setCustomMData(HashMap customMData)
customMData - String which contains the new custom metadata.protected ParameterValue dispatchInvoke(InvokeMessage msg, Operation op, ParameterValue parameterValue, CredentialInfo credentialInfo) throws InvocationException, CommunicationException
protected ParameterValue dispatchInvoke(InvokeMessage msg, Operation op, ParameterValue parameterValue, ProxyService.ProxyServiceCallback handler, CredentialInfo credentialInfo) throws InvocationException, CommunicationException
public java.lang.String getComManId()