Package org.openbel.framework.ws.core

Examples of org.openbel.framework.ws.core.RequestException


            response.setNamespaceValue(equivalentNsValue);
            return response;
        } catch (EquivalencerException e) {
            final String fmt = "error equivalencing %s";
            final String msg = format(fmt, sourceNsValue.getValue());
            throw new RequestException(msg, e);
        }
    }
View Full Code Here


            response.getNamespaceValues().addAll(equivalences);
            return response;
        } catch (EquivalencerException e) {
            final String fmt = "error equivalencing %s";
            final String msg = format(fmt, sourceNsValue.getValue());
            throw new RequestException(msg, e);
        }
    }
View Full Code Here

                    values.add(nv);
                }
                response.getNamespaceValues().addAll(values);
            } catch (IndexingFailure ife) {
                final String msg = "error searching namespaces";
                throw new RequestException(msg, ife);
            } catch (ResourceDownloadError rde) {
                final String msg = "error searching namespaces";
                throw new RequestException(msg, rde);
            } catch (EquivalencerException e) {
                final String msg = "error equivalencing patterns";
                throw new RequestException(msg, e);
            }
        }

        return response;
    }
View Full Code Here

    private NamespaceValue verifyNamespaceValue(final NamespaceValue nsValue)
            throws RequestException {
        if (nsValue == null) {
            final String msg = "missing namespace value";
            throw new RequestException(msg);
        }

        verifyNamespace(nsValue.getNamespace());

        if (noLength(nsValue.getValue())) {
            final String msg = "missing namespace value";
            throw new RequestException(msg);
        }

        return nsValue;
    }
View Full Code Here

    private Namespace verifyNamespace(final Namespace ns)
            throws RequestException {
        if (ns == null) {
            final String msg = "missing namespace";
            throw new RequestException(msg);
        }

        if (ns.getResourceLocation() == null
                || noLength(ns.getResourceLocation())) {
            final String msg = "invalid namespace";
            throw new RequestException(msg);
        }

        return ns;
    }
View Full Code Here

    private Pattern verifyPattern(final String s) throws RequestException {
        try {
            return Pattern.compile(s, Pattern.CASE_INSENSITIVE);
        } catch (PatternSyntaxException e) {
            final String msg = String.format("Invalid pattern: %s", s);
            throw new RequestException(msg);
        }
    }
View Full Code Here

        }

        // Make sure a Kam was specified in the request
        KamHandle kamHandle = request.getHandle();
        if (null == kamHandle) {
            throw new RequestException("KamHandle payload is missing");
        }

        // Get the real Kam from the KamCache
        final org.openbel.framework.api.Kam objKam = getKam(
                kamHandle, null);
View Full Code Here

            throw new MissingRequest(FIND_KAM_NODES_BY_IDS_REQUEST);
        }

        KamHandle kamHandle = request.getHandle();
        if (null == kamHandle) {
            throw new RequestException("Handle is missing");
        }

        List<String> ids = request.getIds();
        if (CollectionUtils.isEmpty(ids)) {
            throw new RequestException("IDs are missing");
        }

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());

        final org.openbel.framework.api.Kam objKam = getKam(
                kamHandle, dialect);

        final org.openbel.framework.api.NodeFilter filter =
                convertNodeFilterInRequest(
                        request.getFilter(), objKam);

        List<KamNode> kamNodes = new ArrayList<KamNode>();
        for (String id : ids) {
            KamStoreObjectRef kamElementRef;
            try {
                kamElementRef = KamStoreObjectRef.decode(id);
            } catch (InvalidIdException e) {
                throw new RequestException("Error with KAM node ids", e);
            }

            Integer elemid = kamElementRef.getKamStoreObjectId();
            org.openbel.framework.api.Kam.KamNode node;
            node = objKam.findNode(elemid, filter);
View Full Code Here

            throw new MissingRequest(FIND_KAM_NODES_BY_LABELS_REQUEST);
        }

        KamHandle kamHandle = request.getHandle();
        if (null == kamHandle) {
            throw new RequestException("Handle is missing");
        }

        List<String> labels = request.getLabels();
        if (CollectionUtils.isEmpty(labels)) {
            throw new RequestException("Labels are missing");
        }

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());
View Full Code Here

            throw new MissingRequest(FIND_KAM_NODES_BY_PATTERNS_REQUEST);
        }

        final KamHandle kamHandle = request.getHandle();
        if (null == kamHandle) {
            throw new RequestException("Handle is missing");
        }

        final List<String> patterns = request.getPatterns();
        if (CollectionUtils.isEmpty(patterns)) {
            throw new RequestException(
                    "Regular expression patterns are missing");
        }

        // Get the Dialect (may be null)
        final Dialect dialect = getDialect(request.getDialect());

        final org.openbel.framework.api.Kam objKam = getKam(
                kamHandle, dialect);
        final org.openbel.framework.api.NodeFilter filter =
                convertNodeFilterInRequest(
                        request.getFilter(), objKam);

        List<KamNode> kamNodes = new ArrayList<KamNode>();
        for (String pattern : patterns) {
            Pattern javaPattern;
            try {
                javaPattern = compile(pattern);
            } catch (PatternSyntaxException e) {
                throw new RequestException("Could not compile pattern: "
                        + pattern, e);
            }

            final Set<org.openbel.framework.api.Kam.KamNode> nodes =
                    objKam
View Full Code Here

TOP

Related Classes of org.openbel.framework.ws.core.RequestException

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.