Package org.fcrepo.server.security.xacml.pdp.finder

Examples of org.fcrepo.server.security.xacml.pdp.finder.AttributeFinderException


            try {
                logger.debug("Getting attribute using relationship " + relationship);
                relationships = m_relationshipResolver.getRelationships(queryTarget, relationship);
            } catch (MelcoeXacmlException e) {
                throw new AttributeFinderException(e.getMessage(), e);
            }

            if (relationships == null || relationships.isEmpty()) {
                return new EvaluationResult(BagAttribute.createEmptyBag(type));
            }

            // there will only be results for one attribute, this will get all the values
            results = relationships.get(relationship);

        } else {
            // get the language and query output variable
            String queryLang = attribute.get("queryLang"); // language
            String variable =  attribute.get("value"); // query text
            String resource =  attribute.get("resource"); // resource marker in query
            String object = attribute.get("object"); // object/pid marker in query

            String subjectURI = "info:fedora/" + subject;
            String pidURI  = "info:fedora/" + pid;

            // replace the resource marker in the query with the subject
            if (resource != null) {
                query = query.replace(resource, subjectURI);
            }
            // and the pid/object marker
            if (object != null) {
                query = query.replace(object, pidURI);
            }

            // run it
            try {
                logger.debug("Using a " + queryLang + " query to get attribute " + attribute);
                results = m_relationshipResolver.getAttributesFromQuery(query, queryLang, variable);
            } catch (MelcoeXacmlException e) {
                throw new AttributeFinderException(e.getMessage(), e);
            }
        }

        Set<AttributeValue> bagValues = new HashSet<AttributeValue>();
        logger.debug("Attribute values found: " + results.size());
View Full Code Here


                des = new Designator();
            }
            designators.put(new Integer(target), des);
            return des;
        } else {
            throw new AttributeFinderException("Invalid attribute designator name " + designatorName);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.security.xacml.pdp.finder.AttributeFinderException

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.