Package org.apache.muse.ws.resource

Examples of org.apache.muse.ws.resource.WsResource


    public WsResource addRelationship(String name,
                                      RelationshipType type,
                                      Participant[] participants)
        throws BaseFault
    {
        WsResource relationship = createRelationship(name, type, participants);
        _relationships.add(relationship);
        return relationship;
    }
View Full Code Here


        String endpoint = getRelationshipContextPath();
       
        //
        // first create an empty instance of the relationship type
        //
        WsResource resource = null;
       
        try
        {
            resource = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new RelationshipCreationFailedFault(error);
        }
       
        //
        // use the relationship capability to set the fields before initializing
        //
        RelationshipResource relationship =
            (RelationshipResource)resource.getCapability(MuwsConstants.RELATIONSHIP_RESOURCE_URI);
       
        relationship.setName(name);
        relationship.setType(type);
        relationship.setParticipant(participants);
       
        try
        {
            resource.initialize();
            manager.addResource(resource.getEndpointReference(), resource);
        }
       
        catch (SoapFault error)
        {
            throw new RelationshipCreationFailedFault(error);
View Full Code Here

       
        //
        // make sure the RelationshipResource endpoint is exposed, since our
        // relationships are all first-class resources
        //
        WsResource resource = getWsResource();
       
        ResourceManager manager = resource.getResourceManager();
        _relationshipPath = manager.getResourceContextPath(RelationshipResource.class);
       
        if (_relationshipPath == null)
            throw new RuntimeException(_MESSAGES.get("NoRelationshipEndpoint"));
       
View Full Code Here

        super.initializeCompleted();
       
        //
        // add the capability URI to the ManageabilityCharacteristics list
        //
        WsResource resource = getWsResource();
        ManageabilityCharacteristics mc =
            (ManageabilityCharacteristics)resource.getCapability(MuwsConstants.CHARACTERISTICS_URI);
       
        if (mc != null)
            mc.addManageabilityCapability(getCapabilityURI());
    }
View Full Code Here

    public void initialize()
        throws SoapFault
    {
        super.initialize();
       
        WsResource resource = getWsResource();
        ResourcePropertyCollection props = resource.getPropertyCollection();
        MetadataDescriptor metadata = props.getMetadata();
       
        //
        // load all of the metric data from the RMD
        //
View Full Code Here

{
    public Element[] getMetadata(String dialect)
    {
        if (dialect != null && dialect.equals(WsrmdConstants.NAMESPACE_URI))
        {
            WsResource resource = (WsResource)getResource();
            MetadataDescriptor rmd = resource.getPropertyCollection().getMetadata();
            return new Element[]{ rmd.toXML() };
        }
       
        return super.getMetadata(dialect);
    }
View Full Code Here

        return _serviceGroup;
    }
   
    public EndpointReference getServiceGroupEPR()
    {
        WsResource sg = getServiceGroup();
        return sg == null ? null : sg.getEndpointReference();
    }
View Full Code Here

       
        //
        // find the entry resource, use the Entry capability to set the
        // member EPR and service group property values
        //
        WsResource entryResource = (WsResource)getResourceManager().getResource(entryEPR);       
        Entry entryCap = (Entry)entryResource.getCapability(WssgConstants.ENTRY_URI);
       
        WsResource sgResource = getServiceGroup();
       
        entryCap.setServiceGroup(sgResource);
        entryCap.setMemberEPR(memberEPR);
       
        ServiceGroup sgCap = (ServiceGroup)sgResource.getCapability(WssgConstants.SERVICE_GROUP_URI);
        sgCap.addEntry(memberEPR, entryResource);
       
        return entryResource;
    }
View Full Code Here

                               Element content,
                               Date termination)
        throws AddRefusedFault,
               BaseFault
    {
        WsResource entry = createEntry(memberEPR, content, termination);
        return addEntry(memberEPR, entry);
    }
View Full Code Here

        //
       
        if (epr == null)
            throw new NullPointerException(_MESSAGES.get("NullMemberServiceEPR"));
       
        WsResource sg = getWsResource();
       
        //
        // make sure this is a valid member of the group
        //
        if (!isMatch(epr))
            throw new AddRefusedFault(_MESSAGES.get("ContentCreationFailed"));

        ResourceManager manager = sg.getResourceManager();
        String endpoint = getEntryContextPath();
        WsResource resource = null;
       
        try
        {
            resource = (WsResource)manager.createResource(endpoint);
        }
       
        catch (SoapFault error)
        {
            throw new ResourceInitializationFault(error);
        }
       
        //
        // set the sg entry fields before initializing the entry resource
        //
       
        Entry entry = (Entry)resource.getCapability(WssgConstants.ENTRY_URI);
       
        entry.setServiceGroup(sg);
        entry.setMemberEPR(epr);
       
        try
        {
            resource.initialize();
            manager.addResource(resource.getEndpointReference(), resource);
        }
       
        catch (SoapFault error)
        {
            throw new ResourceInitializationFault(error);
        }
       
        //
        // set termination time AFTER we initialize so that we can rely
        // on the base Resource class' implementation of WS-RL (which
        // tries to apply the change immediately, rather than storing it
        // in a field and setting it during initialization)
        //
        if (resource.hasCapability(WsrlConstants.SCHEDULED_TERMINATION_URI))
        {
            ScheduledTermination wsrl =
                (ScheduledTermination)resource.getCapability(WsrlConstants.SCHEDULED_TERMINATION_URI);
            wsrl.setTerminationTime(termination);
        }
       
        return resource;
    }
View Full Code Here

TOP

Related Classes of org.apache.muse.ws.resource.WsResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.