当前位置: 首页>>代码示例>>Java>>正文


Java UnknownIdentifierException类代码示例

本文整理汇总了Java中org.wso2.balana.UnknownIdentifierException的典型用法代码示例。如果您正苦于以下问题:Java UnknownIdentifierException类的具体用法?Java UnknownIdentifierException怎么用?Java UnknownIdentifierException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UnknownIdentifierException类属于org.wso2.balana包,在下文中一共展示了UnknownIdentifierException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributeValue

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Private methods constructing a Balana <code>{@link AttributeValue}</code> from given parameters
 *
 * @param value          <code>String</code> with the actual value of the Attribute
 * @param dataType       <code>URI</code> of the DataType of the value
 * @param parentDataType <code>URI</code> of the DataType of <code>{@link Attribute}</code> this belongs to
 * @return <code>{@link AttributeValue}</code>
 * @throws UnknownIdentifierException
 */
private static AttributeValue getAttributeValue(String value, URI dataType, URI parentDataType)
        throws UnknownIdentifierException {
    URI type = dataType;
    AttributeValue attributeValue = null;

    //check if dataType attribute is set, if not use the parent data type
    if (dataType == null) {
        type = parentDataType;
    }

    try {
        attributeValue = Balana.getInstance().getAttributeFactory().createValue(type, value);
    } catch (Exception e) {
        throw new UnknownIdentifierException();
    }
    return attributeValue;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:27,代码来源:JSONRequestParser.java

示例2: createFunction

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Tries to get an instance of the specified function.
 * 
 * @param identity the name of the function
 * 
 * @throws UnknownIdentifierException if the name isn't known
 * @throws FunctionTypeException if the name is known to map to an abstract function, and should
 *             therefore be created through createAbstractFunction
 */
public Function createFunction(String identity) throws UnknownIdentifierException,
        FunctionTypeException {
    Object entry = functionMap.get(identity);

    if (entry != null) {
        if (entry instanceof Function) {
            return (Function) entry;
        } else {
            // this is actually a proxy, which means the other create
            // method should have been called
            throw new FunctionTypeException("function is abstract");
        }
    } else {
        // we couldn't find a match
        throw new UnknownIdentifierException("functions of type " + identity + " are not "
                + "supported by this factory");
    }
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:28,代码来源:BaseFunctionFactory.java

示例3: createAbstractFunction

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Tries to get an instance of the specified abstract function.
 * 
 * @param identity the name of the function
 * @param root the DOM root containing info used to create the function
 * @param xpathVersion the version specified in the contianing policy, or null if no version was
 *            specified
 * 
 * @throws UnknownIdentifierException if the name isn't known
 * @throws FunctionTypeException if the name is known to map to a concrete function, and should
 *             therefore be created through createFunction
 * @throws ParsingException if the function can't be created with the given inputs
 */
public Function createAbstractFunction(String identity, Node root, String xpathVersion)
        throws UnknownIdentifierException, ParsingException, FunctionTypeException {
    Object entry = functionMap.get(identity);

    if (entry != null) {
        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
            throw new FunctionTypeException("function is concrete");
        }
    } else {
        // we couldn't find a match
        throw new UnknownIdentifierException("abstract functions of " + "type " + identity
                + " are not supported by " + "this factory");
    }
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:37,代码来源:BaseFunctionFactory.java

示例4: createValue

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Creates a value based on the given DOM root node and data type.
 * 
 * @param root the DOM root of an attribute value
 * @param type the type of the attribute
 * 
 * @return a new <code>AttributeValue</code>
 * 
 * @throws UnknownIdentifierException if the type isn't known to the factory
 * @throws ParsingException if the node is invalid or can't be parsed by the appropriate proxy
 */
public AttributeValue createValue(Node root, String type) throws UnknownIdentifierException,
        ParsingException {
    AttributeProxy proxy = (AttributeProxy) (attributeMap.get(type));

    if (proxy != null) {
        try {
            return proxy.getInstance(root);
        } catch (Exception e) {
            throw new ParsingException("couldn't create " + type
                    + " attribute based on DOM node");
        }
    } else {
        throw new UnknownIdentifierException("Attributes of type " + type
                + " aren't supported.");
    }
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:28,代码来源:BaseAttributeFactory.java

示例5: getInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a new instance of the <code>CombinerParameter</code> class based on a DOM node. The
 * node must be the root of an XML CombinerParameterType.
 * 
 * @param root the DOM root of a CombinerParameterType XML type
 * 
 * @throws ParsingException if the CombinerParameterType is invalid
 * @return an instance of <code>CombinerParameter</code>
 */
public static CombinerParameter getInstance(Node root) throws ParsingException {
    // get the name, which is a required attribute
    String name = root.getAttributes().getNamedItem("ParameterName").getNodeValue();

    // get the attribute value, the only child of this element
    AttributeFactory attrFactory = Balana.getInstance().getAttributeFactory();
    AttributeValue value = null;

    try {
        value = attrFactory.createValue(root.getFirstChild());
    } catch (UnknownIdentifierException uie) {
        throw new ParsingException(uie.getMessage(), uie);
    }

    return new CombinerParameter(name, value);
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:26,代码来源:CombinerParameter.java

示例6: createValue

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Creates a value based on the given DOM root node and data type.
 * 
 * @param root the DOM root of an attribute value
 * @param type the type of the attribute
 * 
 * @return a new <code>AttributeValue</code>
 * 
 * @throws UnknownIdentifierException if the type isn't known to the factory
 * @throws ParsingException if the node is invalid or can't be parsed by the appropriate proxy
 */
public AttributeValue createValue(Node root, String type) throws UnknownIdentifierException,
        ParsingException {

    AttributeValue attributeValue;
    AttributeProxy proxy = (AttributeProxy) (attributeMap.get(type));

    if (proxy != null) {
        try {
            attributeValue =  proxy.getInstance(root);
        } catch (Exception e) {
            throw new ParsingException("couldn't create " + type
                    + " attribute based on DOM node");
        }
    } else {
        throw new UnknownIdentifierException("Attributes of type " + type
                + " aren't supported.");
    }

    if (attributeValue == null) {
        throw new ParsingException("Could not create " + type + " attribute based on DOM node");
    }

    return attributeValue;
}
 
开发者ID:wso2,项目名称:balana,代码行数:36,代码来源:BaseAttributeFactory.java

示例7: getRegisteredProxy

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Private helper that resolves the proxy for the given identifier, or throws an exception if no
 * proxy is registered for that identifier.
 */
private static FunctionFactoryProxy getRegisteredProxy(String identifier)
        throws UnknownIdentifierException {
    FunctionFactoryProxy proxy = (FunctionFactoryProxy) (registeredFactories.get(identifier));

    if (proxy == null)
        throw new UnknownIdentifierException("Uknown FunctionFactory " + "identifier: "
                + identifier);

    return proxy;
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:15,代码来源:FunctionFactory.java

示例8: createAlgorithm

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Tries to return the correct combinging algorithm based on the given algorithm ID.
 * 
 * @param algId the identifier by which the algorithm is known
 * 
 * @return a combining algorithm
 * 
 * @throws UnknownIdentifierException algId is unknown
 */
public CombiningAlgorithm createAlgorithm(URI algId) throws UnknownIdentifierException {
    String id = algId.toString();

    if (algMap.containsKey(id)) {
        return (CombiningAlgorithm) (algMap.get(algId.toString()));
    } else {
        throw new UnknownIdentifierException("unknown combining algId: " + id);
    }
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:19,代码来源:BaseCombiningAlgFactory.java

示例9: getInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a factory based on the given identifier. You may register as many factories as you
 * like, and then retrieve them through this interface, but a factory may only be registered
 * once using a given identifier. By default, the standard XACML 1.0 and 2.0 identifiers are
 * regsietered to provide the standard factory.
 * 
 * @param identifier the identifier for a factory
 * 
 * @return an <code>AttributeFactory</code>
 * 
 * @throws UnknownIdentifierException if the given identifier isn't registered
 */
public static final AttributeFactory getInstance(String identifier)
        throws UnknownIdentifierException {
    AttributeFactoryProxy proxy = (AttributeFactoryProxy) (registeredFactories.get(identifier));

    if (proxy == null)
        throw new UnknownIdentifierException("Uknown AttributeFactory " + "identifier: "
                + identifier);

    return proxy.getFactory();
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:23,代码来源:AttributeFactory.java

示例10: getStandardDatatypes

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns the identifiers supported for the given version of XACML. Because this factory
 * supports identifiers from all versions of the XACML specifications, this method is useful for
 * getting a list of which specific identifiers are supported by a given version of XACML.
 * 
 * @param xacmlVersion a standard XACML identifier string, as provided in
 *            <code>PolicyMetaData</code>
 * 
 * @return a <code>Set</code> of identifiers
 * 
 * @throws UnknownIdentifierException if the version string is unknown
 */
public static Set getStandardDatatypes(String xacmlVersion) throws UnknownIdentifierException {
    if (xacmlVersion.equals(XACMLConstants.XACML_1_0_IDENTIFIER)) {
        return supportedV1Identifiers;
    } else if (xacmlVersion.equals(XACMLConstants.XACML_2_0_IDENTIFIER)) {
        return supportedV2Identifiers;
    } else if(xacmlVersion.equals(XACMLConstants.XACML_3_0_IDENTIFIER)){
        return supportedV3Identifiers;
    }

    throw new UnknownIdentifierException("Unknown XACML version: " + xacmlVersion);
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:24,代码来源:StandardAttributeFactory.java

示例11: getStandardAlgorithms

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns the identifiers supported for the given version of XACML. Because this factory
 * supports identifiers from all versions of the XACML specifications, this method is useful for
 * getting a list of which specific identifiers are supported by a given version of XACML.
 * 
 * @param xacmlVersion a standard XACML identifier string, as provided in
 *            <code>PolicyMetaData</code>
 * 
 * @return a <code>Set</code> of identifiers
 * 
 * @throws UnknownIdentifierException if the version string is unknown
 */
public static Set getStandardAlgorithms(String xacmlVersion) throws UnknownIdentifierException {
    if (xacmlVersion.equals(XACMLConstants.XACML_1_0_IDENTIFIER)
            || xacmlVersion.equals(XACMLConstants.XACML_2_0_IDENTIFIER) ||
            xacmlVersion.equals(XACMLConstants.XACML_3_0_IDENTIFIER)){
        return supportedAlgIds;
    }

    throw new UnknownIdentifierException("Unknown XACML version: " + xacmlVersion);
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:22,代码来源:StandardCombiningAlgFactory.java

示例12: getInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a factory based on the given identifier. You may register as many factories as you
 * like, and then retrieve them through this interface, but a factory may only be registered
 * once using a given identifier. By default, the standard XACML 1.0 2.0 and 3.0 identifiers are
 * registered to provide the standard factory.
 * 
 * @param identifier the identifier for a factory
 * 
 * @return a <code>CombiningAlgFactory</code>
 * 
 * @throws UnknownIdentifierException if the given identifier isn't registered
 */
public static final CombiningAlgFactory getInstance(String identifier)
        throws UnknownIdentifierException {

    CombiningAlgFactoryProxy proxy = registeredFactories.get(identifier);
    if (proxy == null) {
        throw new UnknownIdentifierException("Unknown CombiningAlgFactory " + "identifier: "
                + identifier);
    }
    return proxy.getFactory();
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:23,代码来源:CombiningAlgFactory.java

示例13: getTargetInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a factory based on the given identifier. You may register as many factories as you
 * like, and then retrieve them through this interface, but a factory may only be registered
 * once using a given identifier. By default, the standard XACML 1.0 and 2.0 identifiers are
 * regsietered to provide the standard factory.
 * 
 * @param identifier the identifier for a factory
 * 
 * @return a <code>FunctionFactory</code> that supports Target functions
 * 
 * @throws UnknownIdentifierException if the given identifier isn't registered
 */
public static final FunctionFactory getTargetInstance(String identifier)
        throws UnknownIdentifierException {
    return getRegisteredProxy(identifier).getTargetFactory();
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:17,代码来源:FunctionFactory.java

示例14: getConditionInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a factory based on the given identifier. You may register as many factories as you
 * like, and then retrieve them through this interface, but a factory may only be registered
 * once using a given identifier. By default, the standard XACML 1.0 and 2.0 identifiers are
 * regsietered to provide the standard factory.
 * 
 * @param identifier the identifier for a factory
 * 
 * @return a <code>FunctionFactory</code> that supports Condition functions
 * 
 * @throws UnknownIdentifierException if the given identifier isn't registered
 */
public static final FunctionFactory getConditionInstance(String identifier)
        throws UnknownIdentifierException {
    return getRegisteredProxy(identifier).getConditionFactory();
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:17,代码来源:FunctionFactory.java

示例15: getGeneralInstance

import org.wso2.balana.UnknownIdentifierException; //导入依赖的package包/类
/**
 * Returns a factory based on the given identifier. You may register as many factories as you
 * like, and then retrieve them through this interface, but a factory may only be registered
 * once using a given identifier. By default, the standard XACML 1.0 and 2.0 identifiers are
 * regsietered to provide the standard factory.
 * 
 * @param identifier the identifier for a factory
 * 
 * @return a <code>FunctionFactory</code> that supports General functions
 * 
 * @throws UnknownIdentifierException if the given identifier isn't registered
 */
public static final FunctionFactory getGeneralInstance(String identifier)
        throws UnknownIdentifierException {
    return getRegisteredProxy(identifier).getGeneralFactory();
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:17,代码来源:FunctionFactory.java


注:本文中的org.wso2.balana.UnknownIdentifierException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。