Package org.wso2.carbon.discovery

Examples of org.wso2.carbon.discovery.DiscoveryException


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


    public OMNode findEndpoint(String uuid, String protocol) throws Exception {
        ConfigurationContext cfgCtx = ConfigHolder.getInstance().getClientConfigurationContext();
        String proxyURL = properties.getProperty(DISCOVERY_PROXY_URL);
        if (proxyURL == null) {
            throw new DiscoveryException("The discovery proxy URL is not specified");
        }
        DiscoveryClient client = new DiscoveryClient(cfgCtx, proxyURL);
        TargetService service = client.resolve(uuid);
        client.cleanup();
        return getEndpointFromService(service, protocol);
View Full Code Here

    public DiscoveryClient(ConfigurationContext cfgCtx, String proxyURL) throws DiscoveryException {
        try {
            serviceClient = new ServiceClient(cfgCtx, null);
            serviceClient.setTargetEPR(new EndpointReference(proxyURL));
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while initializing the WS-Discovery client", axisFault);
        }
    }
View Full Code Here

     */
    public void engageModule(String module) throws DiscoveryException {
        try {
            serviceClient.engageModule(module);
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while engaging the module : " + module, axisFault);
        }
    }
View Full Code Here

                    OMAbstractFactory.getSOAP11Factory()));
            QueryMatch match = DiscoveryOMUtils.getProbeMatchFromOM(probeMatch);
            serviceClient.cleanupTransport();
            return match.getTargetServices();
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while executing the WS-Discovery probe", axisFault);
        }
    }
View Full Code Here

     * @return a TargetService object or null if the ID cannot be resolved
     * @throws DiscoveryException if an error occured while contacting the WS-D proxy
     */
    public TargetService resolve(String epr) throws DiscoveryException {
        if (epr == null) {
            throw new DiscoveryException("Cannot perform the Resolve operation with a null EPR");
        }

        Resolve resolve = new Resolve(new EndpointReference(epr));

        serviceClient.getOptions().setAction(DiscoveryConstants.WS_DISCOVERY_RESOLVE_ACTION);

        try {
            OMElement resolveMatch = serviceClient.sendReceive(DiscoveryOMUtils.toOM(resolve,
                    OMAbstractFactory.getSOAP11Factory()));
            QueryMatch match = DiscoveryOMUtils.getResolveMatchFromOM(resolveMatch);
            serviceClient.cleanupTransport();
            if (match.getTargetServices() != null && match.getTargetServices().length == 1) {
                return match.getTargetServices()[0];
            }
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while executing the WS-Discovery resolve", axisFault);
        }
        return null;
    }
View Full Code Here

     */
    public void cleanup() throws DiscoveryException {
        try {
            serviceClient.cleanup();
        } catch (AxisFault axisFault) {
            throw new DiscoveryException("Error while cleaning up the WS-Discovery client", axisFault);
        }
    }
View Full Code Here

     */
    public static void addDiscoveryProxy(DiscoveryProxyDetails pd, Registry registry)
            throws DiscoveryException, RegistryException {

        if (pd.getName() == null || "".equals(pd.getName())) {
            throw new DiscoveryException("No name specified for the discovery proxy");
        }

        String path = DISCOVERY_PROXY_ROOT + pd.getName();
        if (registry.resourceExists(path)) {
            throw new DiscoveryException("The discovery proxy named " + pd.getName() +
                    " already exists");
        }

        if (pd.getUrl() == null || "".equals(pd.getUrl())) {
            throw new DiscoveryException("No URL specified for the discovery proxy");
        }

        if (pd.getPolicy() != null && !registry.resourceExists(pd.getPolicy())) {
            throw new DiscoveryException("The policy resource: " + pd.getPolicy() +
                    " does not exist");
        }

        URL url;
        try {
            url = new URL(pd.getUrl());
        } catch (MalformedURLException e) {
            throw new DiscoveryException("Invalid URL specified for the discovery proxy", e);
        }

        Resource proxy = registry.newResource();
        proxy.setContent(url.toString());
        proxy.setProperty(DISCOVERY_PROXY_NAME, pd.getName());
View Full Code Here

                            DISCOVERY_CLIENT_POLICY);
                }
            }
            registry.delete(path);
        } else {
            throw new DiscoveryException("The discovery proxy named " + name + " does not exist");
        }
    }
View Full Code Here

        QName[] types = null;
        URI[] scopes = null;

        DiscoveryProxyDetails proxy = getDiscoveryProxy(name, registry);
        if (proxy == null) {
            throw new DiscoveryException("No discovery proxy exists by the name " + name);
        }

        if (pd.getTypes() != null) {
            types = Util.toQNameArray(pd.getTypes());
        }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.discovery.DiscoveryException

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.