當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。