Package org.jboss.security.xacml.sunxacml

Examples of org.jboss.security.xacml.sunxacml.ParsingException


     * @throws ParsingException if the root node is invalid
     */
    public static StatusDetail getInstance(Node root) throws ParsingException {
        // check that it's really a StatusDetailType root
        if (! SunxacmlUtil.getNodeName(root).equals("StatusDetail"))
            throw new ParsingException("not a StatusDetail node");

        return new StatusDetail(root);
    }
View Full Code Here


            if (entry instanceof FunctionProxy) {
                try {
                    return ((FunctionProxy)entry).getInstance(root,
                                                              xpathVersion);
                } catch (Exception e) {
                    throw new ParsingException("couldn't create abstract" +
                                               " function " + identity, e);
                }
            } else {
                // this is actually a concrete function, which means that
                // the other create method should have been called
View Full Code Here

        try {
            // there's always an Id
          Node attributeIdNode = attrs.getNamedItem("AttributeId");
          if(attributeIdNode == null)
            throw new ParsingException("Required AttributeId missing in " +
                        "AttributeDesignator ->" + root.getNodeName() );
            id = new URI(attributeIdNode.getNodeValue());
        } catch (Exception e) {
            throw new ParsingException("Required AttributeId missing in " +
                                       "AttributeDesignator", e);
        }
       
        try {
            // there's always a data type
          Node dataTypeNode = attrs.getNamedItem("DataType");
          if(dataTypeNode == null)
            throw new IllegalStateException("Required DataType missing in " +
                        "AttributeDesignator ->"  + root.getNodeName());
            type = new URI(dataTypeNode.getNodeValue());
        } catch (Exception e) {
            throw new ParsingException("Required DataType missing in " +
                                       "AttributeDesignator", e);
        }
       
        try {
            // there might be an issuer
            Node node = attrs.getNamedItem("Issuer");
            if (node != null)
                issuer = new URI(node.getNodeValue());

            // if it's for the Subject section, there's another attr
            if (target == SUBJECT_TARGET) {
                Node scnode = attrs.getNamedItem("SubjectCategory");
                if (scnode != null)
                    subjectCategory = new URI(scnode.getNodeValue());
                else
                    subjectCategory = new URI(SUBJECT_CATEGORY_DEFAULT);
            }

            // there might be a mustBePresent flag
            node = attrs.getNamedItem("MustBePresent");
            if (node != null)
                if (node.getNodeValue().equals("true"))
                    mustBePresent = true;
        } catch (Exception e) {
            // this shouldn't ever happen, but in theory something could go
            // wrong in the code in this try block
            throw new ParsingException("Error parsing AttributeDesignator " +
                                       "optional attributes", e);
        }

        AttributeDesignator ad =
            new AttributeDesignator(target, type, id, mustBePresent, issuer);
View Full Code Here

            return Apply.getInstance(root, metaData, manager);
        } else if (name.equals("AttributeValue")) {
            try {
                return AttributeFactory.getInstance().createValue(root);
            } catch (UnknownIdentifierException uie) {
                throw new ParsingException("Unknown DataType", uie);
            }
        } else if (name.equals("SubjectAttributeDesignator")) {
            return AttributeDesignator.
                getInstance(root, AttributeDesignator.SUBJECT_TARGET,
                            metaData);
View Full Code Here

        try {
            // try to get an instance of the given function
            return factory.createFunction(functionName);
        } catch (UnknownIdentifierException uie) {
            throw new ParsingException("Unknown FunctionId", uie);
        } catch (FunctionTypeException fte) {
            // try creating as an abstract function
            try {
                FunctionFactory ff = FunctionFactory.getGeneralInstance();
                return ff.createAbstractFunction(functionName, root,
                                                 metaData.
                                                 getXPathIdentifier());
            } catch (Exception e) {
                // any exception at this point is a failure
                throw new ParsingException("failed to create abstract function"
                                           + " " + functionName, e);
            }
        }
    }
View Full Code Here

        AttributeValue value = null;

        try {
            value = attrFactory.createValue(root.getFirstChild());
        } catch (UnknownIdentifierException uie) {
            throw new ParsingException("Unknown AttributeId", uie);
        }
       
        return new CombinerParameter(name, value);
    }
View Full Code Here

                            createAbstractFunction(funcName, root);
                        returnType = function.getReturnType();
                        break;
                    } catch (Exception e) {
                        // any exception here is an error
                        throw new ParsingException("invalid abstract map", e);
                    }
                } catch (Exception e) {
                    // any exception that's not function type is an error
                    throw new ParsingException("couldn't parse map body", e);
                }
            }
        }

        // see if we found the return type
        if (returnType == null)
            throw new ParsingException("couldn't find the return type");

        return new MapFunction(returnType);
    }
View Full Code Here

            return AttributeFactory.getInstance().createValue(child, type);
         }
         catch (UnknownIdentifierException uie)
         {
            throw new ParsingException("Unknown AttributeId", uie);
         }
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.xacml.sunxacml.ParsingException

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.