|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ws4d.java.service.ServiceCommons
public abstract class ServiceCommons
Class represents the common part of a proxy/local DPWS device.
Nested Class Summary | |
---|---|
static class |
ServiceCommons.OperationSignature
|
static class |
ServiceCommons.PortType
|
Method Summary | |
---|---|
EventSource |
getAnyEventSource(QName portType,
java.lang.String eventName)
Returns the first (or last, or ANY other) event source with the specified portType and eventName . |
Operation |
getAnyOperation(QName portType,
java.lang.String operationName)
Returns the first (or last, or ANY other) operation with the specified portType and operationName . |
java.lang.Object |
getCertificate()
This certificate is used to validate signatures. |
Iterator |
getDescriptions()
Returns an iterator over all WSDLs directly attached to this service. |
EventSource |
getEventSource(QName portType,
java.lang.String eventName,
java.lang.String inputName,
java.lang.String outputName)
Gets event source of specified portType with given
eventName . |
EventSource |
getEventSource(java.lang.String outputAction)
Gets event source with specified unique outputAction . |
Iterator |
getEventSources()
Gets all events sources. |
Iterator |
getEventSources(QName portType)
Gets all event sources of the specified service port type. |
Operation |
getOperation(QName portType,
java.lang.String opName,
java.lang.String inputName,
java.lang.String outputName)
Gets an operation of specified portType with given
opName . |
Operation |
getOperation(java.lang.String inputAction)
Gets operation with specified unique inputAction . |
Iterator |
getOperations()
Gets all operations. |
Iterator |
getOperations(QName portType)
Gets all operations of the specified service port type. |
CustomAttributeValue |
getPortTypeAttribute(QName portTypeName,
QName attributeName)
Returns the value of the port type attribute with the given name for the port type with the specified unique
portTypeName or with null if this attribute is
not available (or if its value is explicitly set to null ). |
HashMap |
getPortTypeAttributes(QName portTypeName)
Returns all port type attributes explicitly set on this service instance for the port type with the given unique portTypeName . |
java.lang.Object |
getPrivateKey()
|
boolean |
hasPortTypeAttributes(QName portTypeName)
Returns true only if this service instance has at least one
port type attribute set for the port type with the specified unique
portTypeName . |
boolean |
isSecure()
Sends using WS-Security techniques. |
void |
setCertificate(java.lang.Object certificate)
Sets the certificate of this service. |
void |
setPortTypeAttribute(QName portTypeName,
QName attributeName,
CustomAttributeValue value)
Sets the value of the port type attribute with the specified
name of the port type with the given unique
portTypeName . |
void |
setPortTypeAttributes(QName portTypeName,
HashMap attributes)
Sets all port type attributes of the port type with unique portTypeName at once to those contained within argument
attributes . |
void |
setPrivateKey(java.lang.Object privKey)
|
void |
setSecure(boolean sec)
|
void |
setSecureService()
Sets the service to use security techniques. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ws4d.java.service.Service |
---|
getDescription, getEprInfos, getParentDeviceReference, getPortTypes, getServiceId, getServiceReference, getStatus, isRemote, renew, subscribe, unsubscribe |
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public Iterator getOperations()
Service
getOperations
in interface Service
public Iterator getOperations(QName portType)
Service
getOperations
in interface Service
portType
- specific port type
public Operation getOperation(QName portType, java.lang.String opName, java.lang.String inputName, java.lang.String outputName)
Service
portType
with given
opName
. The inputName
and/or
outputName
may be null
only if the requested
operation doesn't have any input/output. Otherwise, this method won't get
any results.
When an operation is added to a service, and it doesn't provide an
explicit name for either its input or output elements (see
OperationCommons.setInputName(String)
and
OperationCommons.setOutputName(String)
), a default name is generated
according to the WSDL 1.1 Specification. As long as there are other
operations with the same input/output name which have already been added
to this service, an incremental index is appended to the default
generated name.
portType
and with the given opName
is
NOT overloaded (i.e. there is no other operation within the same
port type with the same operation name), then you can use method
Service.getAnyOperation(QName, String)
instead of this one.
getOperation
in interface Service
portType
- specific port type of operationopName
- name of operationinputName
- the name of the input element which belongs to this
operation according to its WSDL; must be null
, if
operation has no inputoutputName
- the name of the output element which belongs to this
operation according to its WSDL; must be null
, if
operation has no output
null
, if not foundService.getAnyOperation(QName, String)
public Operation getOperation(java.lang.String inputAction)
Service
inputAction
.
getOperation
in interface Service
inputAction
- the WS-Addressing action URI of the requested
operation according to its WSDL
null
, if not foundpublic Operation getAnyOperation(QName portType, java.lang.String operationName)
Service
portType
and operationName
. Note that
there might be more than one operation with the same name and port type
in the case of overloading. In such situations, it is the user's
responsibility to determine which of the overloaded versions was returned
by this method. This method returns null
, if there are no
operations matching the portType
and
operationName
arguments.
This method is useful in case it is known that there is only one operation with a given name within a port type.
getAnyOperation
in interface Service
portType
- the port type to which the desired operationoperationName
- the name of the operation
Service.getOperation(QName, String, String, String)
public Iterator getEventSources()
Service
getEventSources
in interface Service
public Iterator getEventSources(QName portType)
Service
getEventSources
in interface Service
portType
- specific port type
public EventSource getEventSource(QName portType, java.lang.String eventName, java.lang.String inputName, java.lang.String outputName)
Service
portType
with given
eventName
. The inputName
and/or
outputName
may be null
only if the requested
event source doesn't have any input/output. Otherwise, this method won't
find any results. *
When an event source is added to a service, and it doesn't provide an
explicit name for either its input or output elements (see
OperationCommons.setInputName(String)
and
OperationCommons.setOutputName(String)
), a default name is
therefore generated according to the WSDL 1.1 Specification. If there are
other event sources with the same input/output name already added to this
service, an incremental index is appended to the default generated name.
portType
and with the given eventName
is
NOT overloaded (i.e. there is no other event source within the
same port type with the same event name), then you can use method
Service.getAnyEventSource(QName, String)
instead of this one.
getEventSource
in interface Service
portType
- specific port type of operationeventName
- name of event sourceinputName
- the name of the input element that belongs to this event
source according to its WSDL; must be null
, if
event source has no inputoutputName
- the name of the output element that belongs to this
event source according to its WSDL; must be null
,
if event source has no output
null
, if not foundService.getAnyEventSource(QName, String)
public EventSource getEventSource(java.lang.String outputAction)
Service
outputAction
.
getEventSource
in interface Service
outputAction
- the WS-Addressing action URI of the requested event
source according to its WSDL
null
if not foundpublic EventSource getAnyEventSource(QName portType, java.lang.String eventName)
Service
portType
and eventName
. Note that
there might be more than one event source with the same name and port
type in the case of overloading. In such situations, it is the user's
responsibility to determine which of the overloaded versions was returned
by this method. This method returns null
, if there are no
event source matching the portType
and
eventName
arguments.
This method is useful in case it is known that there is only one event source with a given name within a port type.
getAnyEventSource
in interface Service
portType
- the port type the desired event source belongs toeventName
- the name of the event source
Service.getEventSource(QName, String, String, String)
public CustomAttributeValue getPortTypeAttribute(QName portTypeName, QName attributeName)
Service
name
for the port type with the specified unique
portTypeName
or with null
if this attribute is
not available (or if its value is explicitly set to null
).
This method throws a java.lang.IllegalArgumentException
if a
port type with the given portTypeName
is not found within
this service instance.
getPortTypeAttribute
in interface Service
portTypeName
- the unique name of the port type within the scope of
this service instance, see Service.getPortTypes()
attributeName
- the name of the port type attribute to query the
value of
null
public void setPortTypeAttribute(QName portTypeName, QName attributeName, CustomAttributeValue value)
value
of the port type attribute with the specified
name
of the port type with the given unique
portTypeName
. Throws a
java.lang.IllegalArgumentException
in case there is no port
type with the given portTypeName
within this service
instance or if name
is null
.
portTypeName
- the unique name of the port type within the scope of
this service instance, see Service.getPortTypes()
attributeName
- the name of the port type attribute to set, must not
be null
value
- the value to set the named port type attribute to (may be
null
java.lang.IllegalArgumentException
- if there is no port type with the given
portTypeName
within this service instance or if
name
is null
public HashMap getPortTypeAttributes(QName portTypeName)
Service
portTypeName
. Note
that depending on the actual implementation the returned reference may
point at the 'life map', i .e. the actual storage for the port type
attributes. Thus, modifications to that map should be performed with care
and keeping this in mind.
This method throws a java.lang.IllegalArgumentException
if a
port type with the given portTypeName
is not found within
this instance.
getPortTypeAttributes
in interface Service
portTypeName
- the unique name of the port type within the scope of
this instance, see Service.getPortTypes()
public void setPortTypeAttributes(QName portTypeName, HashMap attributes)
portTypeName
at once to those contained within argument
attributes
. Note that depending on the actual
implementation, it is possible that the map attributes
points at may be used for the actual internal storage of the port type
attributes (i.e. without copying it). That is why, after passing it to
this method, modifications to this map should be made with care. This
method throws a java.lang.IllegalArgumentException
in case
attributes
is null
.
portTypeName
- the unique name of the port type within the scope of
this service instance, see Service.getPortTypes()
attributes
- the new port type attributes to set
java.lang.IllegalArgumentException
- if no port type with the given
portTypeName
is found or if
attributes
is null
public boolean hasPortTypeAttributes(QName portTypeName)
Service
true
only if this service instance has at least one
port type attribute set for the port type with the specified unique
portTypeName
. Returns false
in any other case,
including when there is no port type with the given
portTypeName
.
hasPortTypeAttributes
in interface Service
portTypeName
- the unique name of the port type within the scope of
this service instance, see Service.getPortTypes()
true
only if there is at least one port type
attribute set for the named port type within this service
instancepublic void setSecureService() throws java.lang.Exception
java.lang.Exception
public boolean isSecure()
isSecure
in interface Service
public void setSecure(boolean sec)
setSecure
in interface Service
public void setCertificate(java.lang.Object certificate)
Service
setCertificate
in interface Service
certificate
- must be the java.security.cert.Certificate of the
sender device/servicepublic java.lang.Object getCertificate()
Service
getCertificate
in interface Service
public java.lang.Object getPrivateKey()
public void setPrivateKey(java.lang.Object privKey)
privKey
- must be the java.security.PrivateKey of the sender device/
servicepublic Iterator getDescriptions()
Service
getDescriptions
in interface Service
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |