Package org.openbel.framework.common

Examples of org.openbel.framework.common.InvalidArgument


            SkinnyUUID uuid) throws SQLException {
        if (functionType == null) {
            return getKamNodeCandidates(uuid);
        }
        if (uuid == null) {
            throw new InvalidArgument("uuid", null);
        }
        PreparedStatement ps =
                getPreparedStatement(SELECT_KAM_NODE_IDS_FOR_UUID_FUNCTION_SQL);
        ps.setInt(1, functionType.getValue());
        ps.setLong(2, uuid.getMostSignificantBits());
View Full Code Here


     */
    @Override
    public List<Integer> getKamNodeCandidates(KamNode example)
            throws SQLException {
        if (example == null || example.getId() == null) {
            throw new InvalidArgument("example", example);
        }

        List<Integer> kamNodeIds = nodeExampleMatchCache.get(example.getId());
        if (kamNodeIds != null) {
            return kamNodeIds;
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Integer getKamNodeForTerm(String term, FunctionEnum fx,
            SkinnyUUID[] u) throws SQLException {
        if (term == null) throw new InvalidArgument("term is null");
        if (fx == null) throw new InvalidArgument("fx is null");
        if (u == null) throw new InvalidArgument("u is null");
        if (u.length == 0) throw new InvalidArgument("u is empty");

        // build sql by concatenation
        String sql = SELECT_KAM_NODE_BY_TERM_UUIDS;
        String tpt = "";
        String kput = "";
View Full Code Here

    @Override
    public List<String> getAnnotationTypeDomainValues(
            AnnotationType annotationType) throws SQLException,
            ExternalResourceException {
        if (annotationType == null) {
            throw new InvalidArgument("annotationType", annotationType);
        }

        if (CITATION.equals(annotationType.getName())) {
            return Arrays.asList(".*");
        }
View Full Code Here

     * {@link KamNode#getKam() node's KAM})
     */
    protected SimplePath(final Kam kam, final KamNode source,
            final KamNode target, final List<KamEdge> edges) {
        if (kam == null) {
            throw new InvalidArgument("kam", kam);
        }
        if (source == null) {
            throw new InvalidArgument("source", source);
        }
        if (edges == null) {
            throw new InvalidArgument("edges", edges);
        }
        if (!kam.equals(source.getKam())) {
            throw new InvalidArgument(
                    "Source node must be part of the Path Kam");
        }

        this.kam = kam;
        this.source = source;
        this.target = target;

        if (target != null && !kam.equals(target.getKam())) {
            throw new InvalidArgument(
                    "Target node must be part of the Path Kam");
        }

        if (target == null && !edges.isEmpty()) {
            throw new InvalidArgument(
                    "Cannot add edges to a Path with a null target");
        }

        List<KamEdge> kamEdges = new ArrayList<KamEdge>(edges.size());
        for (KamEdge e : edges) {
            if (!kam.equals(e.getKam())) {
                throw new InvalidArgument("Edge must be part of the Path Kam");
            }
            kamEdges.add(e);
        }
        this.edgeList = Collections.unmodifiableList(kamEdges);
    }
View Full Code Here

    public KAMCatalogDao(DBConnection dbc, String kamCatalogSchema,
            String kamSchemaPrefix) throws SQLException {
        super(dbc, kamCatalogSchema);

        if (StringUtils.isBlank(kamCatalogSchema)) {
            throw new InvalidArgument("kamCatalogSchema is not set");
        }

        if (StringUtils.isBlank(kamSchemaPrefix)) {
            throw new InvalidArgument("kamSchemaPrefix is not set");
        }

        if (dbc == null) {
            throw new InvalidArgument("dbc is null");
        }

        if (dbc.getConnection().isClosed()) {
            throw new InvalidArgument("dbc is closed and cannot be used");
        }

        this.kamSchemaPrefix = kamSchemaPrefix;
    }
View Full Code Here

     * a null name.
     */
    public void saveToCatalog(KamDbObject updated) throws SQLException {

        if (updated == null) {
            throw new InvalidArgument("kamInfo", updated);
        }

        if (updated.getName() == null) {
            throw new InvalidArgument("kamInfo contains a null name");
        }

        if (updated.getDescription() == null) {
            throw new InvalidArgument("kamInfo contains a null description");
        }

        // First check to see if the KAM already exists in the Catalog. This
        // returns the name of the schema for the KAM or null if the KAM is
        // not already there.  The existence of KAMs is checked first by id
View Full Code Here

        public KamInfo(KamDbObject kamDb) {
            super(kamDb.getId()); //kamDb must not be null
            this.kamDb = kamDb;
            if (kamDb.getId() == null) {
                throw new InvalidArgument(
                        "KamDbObject and KamDbObject Id cannot be null.");
            }

            this.hashCode = generateHashCode();
        }
View Full Code Here

     * @param kAMStore {@link KAMStore}
     * @throws InvalidArgument Thrown if {@code kamStore} is null
     */
    public DefaultKamCacheService(KAMStore kAMStore) {
        if (kAMStore == null) {
            throw new InvalidArgument("kamStore", kAMStore);
        }
        this.kAMStore = kAMStore;

        kamMap = new HashMap<String, Kam>();
        unfltrdMap = new HashMap<KamInfo, String>();
View Full Code Here

     */
    @Override
    public String cacheKam(String kamName, Kam kam) {

        if (kam == null) {
            throw new InvalidArgument("kam", kam);
        }

        if (kamName == null) {
            kamName = kam.getKamInfo().getName();
            if (kamName == null) {
                throw new InvalidArgument("no KAM name available");
            }
        }

        read.lock();
        try {
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.InvalidArgument

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.