Java Code Examples for org.apache.neethi.PolicyReference#getURI()

The following examples show how to use org.apache.neethi.PolicyReference#getURI() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Wsdl11AttachmentPolicyProvider.java    From cxf with Apache License 2.0 6 votes vote down vote up
Policy resolveLocal(PolicyReference ref, DescriptionInfo di) {
    String uri = ref.getURI().substring(1);
    String absoluteURI = di.getBaseURI();
    if (absoluteURI == null) {
        absoluteURI = Integer.toString(di.hashCode()) + ref.getURI();
    } else {
        absoluteURI = absoluteURI + ref.getURI();
    }
    Policy resolved = registry.lookup(absoluteURI);
    if (null != resolved) {
        return resolved;
    }

    ReferenceResolver resolver = new LocalServiceModelReferenceResolver(di, builder);
    resolved = resolver.resolveReference(uri);
    if (null != resolved) {
        ref.setURI(absoluteURI);
        registry.register(absoluteURI, resolved);
    }
    return resolved;
}
 
Example 2
Source File: ExternalAttachmentProvider.java    From cxf with Apache License 2.0 5 votes vote down vote up
Policy resolveLocal(PolicyReference ref, Document doc) {
    String relativeURI = ref.getURI().substring(1);
    String absoluteURI = doc.getBaseURI() + ref.getURI();
    Policy resolved = registry.lookup(absoluteURI);
    if (null != resolved) {
        return resolved;
    }
    ReferenceResolver resolver = new LocalDocumentReferenceResolver(doc, builder);
    resolved = resolver.resolveReference(relativeURI);
    if (null != resolved) {
        ref.setURI(absoluteURI);
        registry.register(absoluteURI, resolved);
    }
    return resolved;
}
 
Example 3
Source File: WSPolicyFeature.java    From cxf with Apache License 2.0 5 votes vote down vote up
Policy resolveReference(PolicyReference ref, PolicyBuilder builder, Bus bus, DescriptionInfo i) {
    Policy p = null;
    if (!ref.getURI().startsWith("#")) {
        String base = i == null ? null : i.getBaseURI();
        p = resolveExternal(ref, base, bus);
    } else {
        p = resolveLocal(ref, bus, i);
    }
    if (null == p) {
        throw new PolicyException(new Message("UNRESOLVED_POLICY_REFERENCE_EXC", BUNDLE, ref.getURI()));
    }

    return p;
}
 
Example 4
Source File: AbstractPolicyProvider.java    From cxf with Apache License 2.0 4 votes vote down vote up
protected void checkResolved(PolicyReference ref, Policy p) {
    if (null == p) {
        throw new PolicyException(new Message("UNRESOLVED_POLICY_REFERENCE_EXC", BUNDLE, ref.getURI()));
    }
}