Package condor.classad

Examples of condor.classad.RecordExpr


        ArrayList<OutputDataRecord> outputDataAttribute = new ArrayList<OutputDataRecord>(0);

        if (expr instanceof ListExpr) {
            Iterator iteratorExpr = ((ListExpr) expr).iterator();
            RecordExpr jdlRecExpr = null;
            Expr exprTmp = null;
            OutputDataRecord outputDataRecord = null;

            while (iteratorExpr.hasNext()) {
                outputDataRecord = new OutputDataRecord();
                jdlRecExpr = (RecordExpr) iteratorExpr.next();

                exprTmp = jdlRecExpr.lookup(OUTPUTDATA_OUTPUTFILE);
                if (exprTmp == null) {
                    throw new Exception("OutputFile is mandatory for the OutputData jdl attribute.");
                }
                outputDataRecord.setODOutputFile(exprTmp.stringValue().trim());

                exprTmp = jdlRecExpr.lookup(OUTPUTDATA_LOGICALFILENAME);
                outputDataRecord.setODLogicalFilename((exprTmp != null) ? exprTmp.stringValue().trim() : "");

                exprTmp = jdlRecExpr.lookup(OUTPUTDATA_STORAGEELEMENT);
                outputDataRecord.setODStorageElement((exprTmp != null) ? exprTmp.stringValue().trim() : "");

                outputDataAttribute.add(outputDataRecord);
            }
        } else {
View Full Code Here


            throw new Exception("Unable to parse: doesn't seem to be a valid Expression");
        } else if (expr.type != Expr.RECORD) {
            throw new Exception("Unable to parse: the parsed expression is not a ClassAd");
        }

        RecordExpr jdlExpr = (RecordExpr) expr;

        String type = null;
        expr = jdlExpr.lookup(TYPE);

        if (expr == null) {
            type = "Job";
        } else if (!expr.isConstant()) {
            throw new Exception(TYPE + " \"" + expr.stringValue() + "\" not allowed");
        } else {
            type = expr.stringValue();
        }

        if (type.equalsIgnoreCase("Job")) {
            String jobType = null;

            expr = jdlExpr.lookup(JOBTYPE);

            if (expr == null) {
                jobType = "Normal";
            } else {
                jobType = expr.stringValue();
            }

            if (!jobType.equalsIgnoreCase("Normal")) {
                throw new Exception(JOBTYPE + " \"" + jobType + "\" not allowed");
            }

            @SuppressWarnings("unchecked")
            Iterator<AttrName> it = (Iterator<AttrName>) jdlExpr.attributes();

            String key = null;
            // String value = null;

            final char[] notAllowed = { ' ', ':', '#', '@', '[', ']', '+', '*', '$', '%', '!', '?', '~' };

            while (it.hasNext()) {
                key = it.next().toString().toLowerCase();

                for (int i = 0; i < notAllowed.length; i++) {
                    if (key.indexOf(notAllowed[i]) != -1) {
                        throw new Exception(key + ": Not allowed char '" + notAllowed[i] + "' found");
                    }
                    expr = jdlExpr.lookup(key);

                    if (expr == null) {
                        throw new Exception(key + ": none expression found");
                    } /*else if (!expr.isConstant()) {
                        throw new Exception(key + ": not constant expression found");
View Full Code Here

        ArrayList<OutputDataRecord> outputDataAttribute = new ArrayList<OutputDataRecord>(0);

        if (expression instanceof ListExpr) {
            Iterator iteratorExpr = ((ListExpr) expression).iterator();
            RecordExpr jdlRecExpr    = null;
            Expr exprTmp             = null;
            OutputDataRecord outputDataRecord = null;

            while (iteratorExpr.hasNext()) {
                outputDataRecord = new OutputDataRecord();
                jdlRecExpr = (RecordExpr)iteratorExpr.next();
                exprTmp = jdlRecExpr.lookup(Jdl.OD_OUTPUT_FILE);
                if (exprTmp == null) {
                   throw new IllegalArgumentException("OutputFile is mandatory for the OutputData jdl attribute.");
                }
                outputDataRecord.setODOutputFile(exprTmp.stringValue());
                exprTmp = jdlRecExpr.lookup(Jdl.OD_LOGICAL_FILENAME);
                outputDataRecord.setODLogicalFilename((exprTmp != null) ? exprTmp.stringValue() : "");
                exprTmp = jdlRecExpr.lookup(Jdl.OD_STORAGE_ELEMENT);
                outputDataRecord.setODStorageElement((exprTmp != null) ? exprTmp.stringValue() : "");

                outputDataAttribute.add(outputDataRecord);
            }
        } else {
View Full Code Here

TOP

Related Classes of condor.classad.RecordExpr

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.