Package org.openbel.framework.ws.core

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


        kam = kamCacheService.getKam(handle.getHandle());

        if (kam == null) {
            final String fmt = KAM_REQUEST_NO_KAM_FOR_HANDLE;
            final String msg = format(fmt, handle.getHandle());
            throw new RequestException(msg);
        }

        return dialect == null
                ? kam
                : new KamDialect(kam, dialect);
View Full Code Here


            throw new MissingRequest(GET_DEFAULT_DIALECT_REQUEST);
        }

        Kam kam = kamCache.getKam(request.getKam().getHandle());
        if (kam == null) {
            throw new RequestException("Invalid KamHandle: "
                    + request.getKam().getHandle());
        }

        Dialect d = dialectFactory.createDefaultDialect(kam.getKamInfo());
View Full Code Here

            throw new MissingRequest(GET_CUSTOM_DIALECT_REQUEST);
        }

        Kam kam = kamCache.getKam(request.getKam().getHandle());
        if (kam == null) {
            throw new RequestException("Invalid KamHandle: "
                    + request.getKam().getHandle());
        }

        List<Namespace> geneNamespaces = convert(request.getGeneNamespaces());
        List<Namespace> bpNamespaces = convert(request.getBpNamespaces());
        List<Namespace> chemNamespaces = convert(request.getChemNamespaces());

        Dialect d;
        try {
            d =
                    dialectFactory.createCustomDialect(kam.getKamInfo(),
                            geneNamespaces, bpNamespaces, chemNamespaces,
                            Converter.convert(request.getSyntax()),
                            request.isHideNamespacePrefixes());
        } catch (KAMStoreException e) {
            throw new RequestException("Failed to construct dialect", e);
        }

        GetCustomDialectResponse resp =
                OBJECT_FACTORY.createGetCustomDialectResponse();
        DialectHandle dh = OBJECT_FACTORY.createDialectHandle();
View Full Code Here

            throw new MissingRequest(LOAD_KAM_REQUEST);
        }

        Kam kam = request.getKam();
        if (kam == null) {
            throw new RequestException(KAM_REQUEST_NO_KAM);
        }
        if (kam.getName() == null) {
            throw new RequestException(KAM_REQUEST_NO_NAME);
        }

        KamInfo kamInfo = null;
        List<KamInfo> catalog;
        try {
View Full Code Here

        // Get the real Kam from the KamCache
        org.openbel.framework.api.Kam objKam =
                kamCacheService.getKam(kamHandle.getHandle());
        if (objKam == null) {
            throw new RequestException(format(KAM_REQUEST_NO_KAM_FOR_HANDLE,
                    kamHandle.getHandle()));
        }

        // Use the KamUtils class to do the work
        org.openbel.framework.api.Kam objNewKamInstance;
View Full Code Here

            throw new MissingRequest(KAM_UNION_REQUEST);
        }

        KamHandle kam1 = request.getKam1();
        if (null == kam1) {
            throw new RequestException("kamHandle for Kam1 payload is missing");
        }

        KamHandle kam2 = request.getKam2();
        List<KamEdge> kamEdges = request.getKamEdges();

        if (kam2 == null && noItems(kamEdges)) {
            final String msg = "Missing kam2 and kamEdges - nothing to do";
            throw new RequestException(msg);
        }

        org.openbel.framework.api.Kam objKam1;
        objKam1 = kamCacheService.getKam(kam1.getHandle());
        if (objKam1 == null) {
            throw new RequestException(format(KAM_REQUEST_NO_KAM_FOR_HANDLE,
                    kam1.getHandle()));
        }

        org.openbel.framework.api.Kam objNewKam = null;
        if (null != kam2) {
            org.openbel.framework.api.Kam objKam2;
            objKam2 = kamCacheService.getKam(kam2.getHandle());
            if (objKam2 == null) {
                throw new RequestException(format(
                        KAM_REQUEST_NO_KAM_FOR_HANDLE, kam2.getHandle()));
            }

            objNewKam = union(objKam1, objKam2);
        } else {
View Full Code Here

            throw new MissingRequest(KAM_INTERSECTION_REQUEST);
        }

        KamHandle kam1 = request.getKam1();
        if (null == kam1) {
            throw new RequestException("kamHandle for Kam1 payload is missing");
        }

        KamHandle kam2 = request.getKam2();
        List<KamEdge> kamEdges = request.getKamEdges();

        if (kam2 == null && noItems(kamEdges)) {
            final String msg = "Missing kam2 and kamEdges - nothing to do";
            throw new RequestException(msg);
        }

        org.openbel.framework.api.Kam objKam1;
        objKam1 = kamCacheService.getKam(kam1.getHandle());
        if (objKam1 == null) {
            throw new RequestException(format(KAM_REQUEST_NO_KAM_FOR_HANDLE,
                    kam1.getHandle()));
        }

        org.openbel.framework.api.Kam objNewKam = null;
        if (null != kam2) {
            // Get the real Kam from the KamCache
            org.openbel.framework.api.Kam objKam2;
            objKam2 = kamCacheService.getKam(kam2.getHandle());
            if (objKam2 == null) {
                throw new RequestException(format(
                        KAM_REQUEST_NO_KAM_FOR_HANDLE, kam2.getHandle()));
            }
            objNewKam = intersection(objKam1, objKam2);
        } else {
            List<org.openbel.framework.api.Kam.KamEdge> edges =
View Full Code Here

            throw new MissingRequest(KAM_DIFFERENCE_REQUEST);
        }

        KamHandle kam1 = request.getKam1();
        if (null == kam1) {
            throw new RequestException("kamHandle for Kam1 payload is missing");
        }

        KamHandle kam2 = request.getKam2();
        List<KamEdge> kamEdges = request.getKamEdges();

        if (kam2 == null && noItems(kamEdges)) {
            final String msg = "Missing kam2 and kamEdges - nothing to do";
            throw new RequestException(msg);
        }

        org.openbel.framework.api.Kam objKam1;
        objKam1 = kamCacheService.getKam(kam1.getHandle());
        if (objKam1 == null) {
            throw new RequestException(format(KAM_REQUEST_NO_KAM_FOR_HANDLE,
                    kam1.getHandle()));
        }

        org.openbel.framework.api.Kam objNewKam = null;
        if (null != kam2) {
            org.openbel.framework.api.Kam objKam2;
            objKam2 = kamCacheService.getKam(kam2.getHandle());
            if (objKam2 == null) {
                throw new RequestException(format(
                        KAM_REQUEST_NO_KAM_FOR_HANDLE, kam2.getHandle()));
            }
            objNewKam = difference(objKam1, objKam2);
        } else {
            List<org.openbel.framework.api.Kam.KamEdge> edges =
View Full Code Here

                // only add edge if it existed in kam1.
                if (edge != null) {
                    edges.add(edge);
                }
            } catch (InvalidIdException e) {
                throw new RequestException(
                        "KamEdge was not found in Kam1. ", e);
            }
        }
        return edges;
    }
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.