Examples of WsResourceClient


Examples of org.apache.muse.ws.resource.remote.WsResourceClient

        Element root = XmlUtils.createElement(factory, WssgConstants.ADD_QNAME);
       
        EndpointReference epr = getMemberEPR();
        XmlUtils.setElement(root, WssgConstants.MEMBER_EPR_QNAME, epr.toXML());
       
        WsResourceClient member = new WsResourceClient(epr);
        Element content = getContent();
       
        //
        // if no content recorded, retrieve content values at runtime using
        // remote client
        //
        try
        {
            if (content == null)
            {
                Element[] results = member.getResourceProperty(WssgConstants.CONTENT_QNAME);
                content = results[0];
            }
        }
       
        catch (SoapFault error)
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

            addReferenceParameter(epr);

            //
            // create proxy - turn on tracing of SOAP messages
            //
            WsResourceClient client = new WsResourceClient(epr);
            client.setTrace(tracing);
           
            ServiceGroupClient sg = new ServiceGroupClient(epr);
            sg.setTrace(tracing);
           
            WsResourceClient[] members = sg.getMembers();
           
            System.out.println("Addresses of each service group entry:\n");
           
            EndpointReference repr = null;
            EndpointReference sepr = null;
            EndpointReference curr = null;

            for (int n = 0; n < members.length; ++n){
              System.out.println(members[n].getEndpointReference());
            }
            for (int n = 0; n < members.length; ++n){
                System.out.println(members[n].getEndpointReference().getAddress());
                curr = members[n].getEndpointReference();
                if(curr.getAddress().toString().endsWith("OSGiBundleResource")){
                  String id = curr.getParameterString(new QName("http://ws.apache.org/muse/addressing", "ResourceId"));
                  if(repr == null && id != null && id.startsWith("dummy.bundle")){
                    repr = curr;
                  }
                }
                if(curr.getAddress().toString().endsWith("OSGiServiceResource")){
                  String id = curr.getParameterString(new QName("http://ws.apache.org/muse/addressing", "ResourceId"));
                  if(sepr == null && id != null && id.startsWith(("org.apache.muse.util.osgi.ResourceManagementImplementation"))){
                    sepr = curr;
                  }
                }
            }
           

            //Query bundle relationships
            epr = new EndpointReference(repr.getAddress());
           
            Element[] parms = repr.getParameters();
            for(int i=0;i<parms.length;i++){
              epr.addParameter(parms[i]);
            }
           
            WsResourceClient resource_client = new WsResourceClient(repr);
            resource_client.setTrace(tracing);
           
            resource_client.getResourcePropertyDocument();

            RelationshipsClient rc = new RelationshipsClient(epr);
            rc.setTrace(tracing);
            QName names[] = {
                new QName("http://resource.management.osgi/Bundle","Requires","osgi")
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

            //
            // convert ws-sg entry XML -> EPRs -> clients
            //
            Element eprXML = XmlUtils.getElement(entries[n], WssgConstants.MEMBER_SERVICE_EPR_QNAME);
            dest = new EndpointReference(eprXML);
            clients[n] = new WsResourceClient(dest, src);           
        }
       
        return clients;       
    }
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

       
        Element[] here = null;
        ResourcePropertyCollection props = getWsResource().getPropertyCollection();
        here = props.getResourceProperty(qname);
       
        WsResourceClient otherResource = new WsResourceClient(epr);
        Element[] there = otherResource.getResourceProperty(qname);
       
        //
        // if one has more than the other, we have a problem
        //
        if (here.length != there.length)
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

    {
        if (epr == null)
            throw new NullPointerException(_MESSAGES.get("NullResource"));
       
        EndpointReference sgEPR = getServiceGroupEPR();       
        WsResourceClient resource = new WsResourceClient(epr, sgEPR);
        QName[] content = getContentElements();
       
        try
        {
            //
            // all we have to do is try and read all the properties
            // in the list - if any of them is undefined, this will
            // fault, and we don't have a match. there is no fault if
            // the property is defined but has zero instances
            //
            // note that we only do the test if there are some property
            // names - an empty array means "any resource is allowed"
            //
            if (content.length > 0)
                resource.getMultipleResourceProperties(content);
        }
       
        //
        // in this case, there is no error - this just means that
        // the resource does not match the membership rule
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

        Element root = XmlUtils.createElement(factory, WssgConstants.ADD_QNAME);
       
        EndpointReference epr = getMemberEPR();
        XmlUtils.setElement(root, WssgConstants.MEMBER_EPR_QNAME, epr.toXML());
       
        WsResourceClient member = new WsResourceClient(epr);
        Element content = getContent();
       
        //
        // if no content recorded, retrieve content values at runtime using
        // remote client
        //
        try
        {
            if (content == null)
            {
                Element[] results = member.getResourceProperty(WssgConstants.CONTENT_QNAME);
                content = results[0];
            }
        }
       
        catch (SoapFault error)
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

        throws SoapFault
    {
        if (epr == null)
            throw new NullPointerException(_MESSAGES.get("NullRemoteResource"));
       
        WsResourceClient resource = new WsResourceClient(epr);
       
        String dialect = XPathUtils.NAMESPACE_URI;
        Node[] results = resource.queryResourceProperties(_xpath, dialect);
       
        //
        // no results - failed!
        //
        if (results.length == 0)
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

       
        for (int n = 0; n < xml.length; ++n)
        {
            Element eprXML = XmlUtils.getElement(xml[n], MuwsConstants.ACCESS_EPR_QNAME);
            EndpointReference epr = new EndpointReference(eprXML);
            clients[n] = new WsResourceClient(epr);
        }
       
        return clients;
    }
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

     */
    public Element getContent()
        throws BaseFault
    {
        Element[] content = _EMPTY_CONTENT;
        WsResourceClient client = getMemberClient();
       
        if (client == null)
            return null;
       
        ServiceGroup sg = (ServiceGroup)getServiceGroup().getCapability(WssgConstants.SERVICE_GROUP_URI);
        QName[] contentNames = sg.getContentElements();       
       
        try
        {
            if (contentNames.length != 0)
                content = client.getMultipleResourceProperties(contentNames);
        }
       
        catch (SoapFault fault)
        {
            throw new ContentCreationFailedFault(fault);
View Full Code Here

Examples of org.apache.muse.ws.resource.remote.WsResourceClient

        return _member;
    }

    public EndpointReference getMemberEPR()
    {
        WsResourceClient client = getMemberClient();
        return client == null ? null : client.getEndpointReference();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.