Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.muse.ws.dm.muws.impl
Class SimpleRelationships

    java.lang.Object
      org.apache.muse.core.AbstractCapability
          org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
              org.apache.muse.ws.dm.muws.impl.AbstractManageabilityCapability
                  org.apache.muse.ws.dm.muws.impl.SimpleRelationships

All Implemented Interfaces:
  Capability, Initialization, InitializationParameters, ManageabilityCapability, Relationships, Shutdown, WsResourceCapability, org.apache.muse.ws.resource.WsResourceCapabilityProperties

public class SimpleRelationships
extends AbstractManageabilityCapability
implements Relationships

SimpleRelationships is Muse's default implementation of the MUWS (Part 2) Relationships capability. It performs the following tasks:

- Ensures that the application has a resource type with the RelationshipResource capability so that there will be SOAP-level access to the relationships resources,
- Provides lifecycle management for the relationship resources, and
- Implements the muws2:Relationship property and QueryRelationshipsByType operation.

Author:
  Dan Jemiolo (danj)

Field Summary

Fields inherited from interface org.apache.muse.ws.dm.muws.Relationships
`PROPERTIES`

Constructor Summary
`SimpleRelationships()`

Method Summary
`WsResource` | `addRelationship(java.lang.String name, RelationshipType type, Participant[] participants)` Creates a new Relationship resource with the given values, adds it to the ResourceManager and the participant resources' WS-RP container, and returns it to the caller.
`protected MessageHandler` | `createQueryHandler()`
`protected WsResource` | `createRelationship(org.w3c.dom.Element xml)` This method reads the relationship fields from the XML and forwards them to createRelationship(String, RelationshipType, Participant[]).
`protected WsResource` | `createRelationship(java.lang.String name, RelationshipType type, Participant[] participants)` Creates a new relationship resource with the given fields, initializes it, and adds it to the ResourceManager before returning it.
`org.w3c.dom.Element[]` | `getProperty(QName propertyName)`
`QName[]` | `getPropertyNames()` Concrete capability classes that define properties MUST override this method and provide the names of the properties.
`WsResource[]` | `getRelationship()`
`protected java.lang.String` | `getRelationshipContextPath()`
`protected org.w3c.dom.Element[]` | `getRelationshipElements()` This method converts the WsResource[] returned by getRelationship() into an Element[] with muws2:Relationship XML that is compliant with the MUWS Part 2 spec.
`void` | `initialize()` AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it. AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties.
`WsResource[]` | `queryRelationshipsByType(QName[] types)` This method is defined by MUWS Part 2 in order to optimize the query of a resource property that will often have a large number of instances (which would make XPath-like queries and catch-all Get requests a performance bottleneck).
`void` | `removeRelationship(WsResource relationship)` Deletes the RelationshipResource from the owner's WS-RP container.

Methods inherited from class org.apache.muse.ws.dm.muws.impl.AbstractManageabilityCapability
`initializeCompleted`

Methods inherited from class org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
`createGettersAndSetters, deleteProperty, getGetter, getPropertyElements, getSetter, getWsResource, insertProperty, invokeMethod, setResource, updateProperty`

Methods inherited from class org.apache.muse.core.AbstractCapability
`getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, prepareShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence, shutdown`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.apache.muse.ws.resource.WsResourceCapability
`deleteProperty, getWsResource, insertProperty, updateProperty`

Methods inherited from interface org.apache.muse.core.Capability
`getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence, setResource`

Methods inherited from interface org.apache.muse.core.Initialization
`hasBeenInitialized`

Methods inherited from interface org.apache.muse.core.InitializationParameters
`getInitializationParameter, getInitializationParameters, setInitializationParameters`

Methods inherited from interface org.apache.muse.core.Shutdown
`hasBeenShutdown, shutdown`

Constructor Detail

### SimpleRelationships

    public SimpleRelationships()

Method Detail

### addRelationship

    public WsResource addRelationship(java.lang.String name,
                                      RelationshipType type,
                                      Participant[] participants)
                               throws BaseFault

  Description copied from interface: `Relationships`
  Creates a new Relationship resource with the given values, adds it to the ResourceManager and the participant resources' WS-RP container, and returns it to the caller.

  Specified by:
    `addRelationship` in interface `Relationships`
  Parameters:
    `name` - The descriptive name of the new relationship.
    `type` - The XSD-defined type of the new relationship.
    `participants` - The participant resources for the relationship. The array must have a length of at least 2.
  Returns:
    The newly-created (and stored) Relationship resource.
  Throws:
    `BaseFault` -
    - If there was an error during the initialization of the Relationship resource instance.
    - If there was an error inserting into the participant's WS-RP container.

### createQueryHandler

    protected MessageHandler createQueryHandler()

### createRelationship

    protected WsResource createRelationship(org.w3c.dom.Element xml)
                                     throws BaseFault

  This method reads the relationship fields from the XML and forwards them to createRelationship(String, RelationshipType, Participant[]).

  Throws:
    `BaseFault`

### createRelationship

    protected WsResource createRelationship(java.lang.String name,
                                            RelationshipType type,
                                            Participant[] participants)
                                     throws BaseFault

  Creates a new relationship resource with the given fields, initializes it, and adds it to the ResourceManager before returning it.

  Throws:
    `BaseFault`

### getProperty

    public org.w3c.dom.Element[] getProperty(QName propertyName)
                                      throws BaseFault

  Specified by:
    `getProperty` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Overrides:
    `getProperty` in class `AbstractWsResourceCapability`
  Throws:
    `BaseFault`

### getPropertyNames

    public QName[] getPropertyNames()

  Description copied from interface: `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Concrete capability classes that define properties MUST override this method and provide the names of the properties.

  Specified by:
    `getPropertyNames` in interface `org.apache.muse.ws.resource.WsResourceCapabilityProperties`
  Overrides:
    `getPropertyNames` in class `AbstractWsResourceCapability`

### getRelationship

    public WsResource[] getRelationship()

  Specified by:
    `getRelationship` in interface `Relationships`
  Returns:
    The resources that represent the relationships this resource participates in. This is also the muws2:Relationship property. The implementation of this capability must provide a means of converting the WsResource objects into the proper XML format for WSRP clients.

### getRelationshipContextPath

    protected java.lang.String getRelationshipContextPath()

### getRelationshipElements

    protected org.w3c.dom.Element[] getRelationshipElements()

  This method converts the WsResource[] returned by getRelationship() into an Element[] with muws2:Relationship XML that is compliant with the MUWS Part 2 spec.

### initialize

    public void initialize()
                    throws SoapFault

  Description copied from class: `AbstractWsResourceCapability`
  AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it.

  Specified by:
    `initialize` in interface `Initialization`
  Overrides:
    `initialize` in class `AbstractWsResourceCapability`
  Throws:
    `SoapFault`

### queryRelationshipsByType

    public WsResource[] queryRelationshipsByType(QName[] types)
                                          throws BaseFault

  Description copied from interface: `Relationships`
  This method is defined by MUWS Part 2 in order to optimize the query of a resource property that will often have a large number of instances (which would make XPath-like queries and catch-all Get requests a performance bottleneck). The functional equivalent of this call would be WS-RP QueryResourceProperties with an XPath query that tries to match the value of the relationship's muws2:Type field.

  Specified by:
    `queryRelationshipsByType` in interface `Relationships`
  Parameters:
    `types` - The names of the types of relationships that should be returned by the query processor.
  Returns:
    An array of resources that can be used to manipulate the relationships that match the query. The array may be empty.
  Throws:
    `BaseFault`

### removeRelationship

    public void removeRelationship(WsResource relationship)

  Description copied from interface: `Relationships`
  Deletes the RelationshipResource from the owner's WS-RP container.

  Specified by:
    `removeRelationship` in interface `Relationships`
  Parameters:
    `relationship` -

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD