/** * Returns the address declared in the specified * {@link W3CEndpointReference W3C endpoint reference}. * * @param endpointReference * the endpoint reference to analyze. * * @return the address declared in the specified W3C endpoint reference. */ public static String getAddress(W3CEndpointReference endpointReference) { Object address = ReflectionUtils.getFieldValue(endpointReference, "address"); if (address != null) { return (String) ReflectionUtils.getFieldValue(address, "uri"); } return null; }
@SuppressWarnings("unchecked") private static void logAttributes(String type, Object obj, String fieldName) { Map<QName, String> attributes = (Map<QName, String>) ReflectionUtils.getFieldValue( obj, fieldName); if (attributes != null) { for (Entry<QName, String> entry : attributes.entrySet()) { log.info("* type={}, attributes=<{}, {}>", new Object[] { type, entry.getKey(), entry.getValue()}); } } else { log.info("type={}, attributes is null", type); } }
/** * Returns the {@link SubscriptionId subscription identifier} contained into * the specified {@link SubscribeResponse subscribe response}. * * @param subscribeResponse * the subscribe response containing the subscription identifier. * * @return the subscription identifier contained into the specified * subscribe response. */ @SuppressWarnings("unchecked") public static SubscriptionId getSubcriptionId(SubscribeResponse subscribeResponse) { W3CEndpointReference subscriptionReference = subscribeResponse.getSubscriptionReference(); if (subscriptionReference != null) { Object referenceParameters = ReflectionUtils.getFieldValue( subscriptionReference, "referenceParameters"); if (referenceParameters != null) { List<Element> elements = (List<Element>) ReflectionUtils.getFieldValue( referenceParameters, "elements"); if (elements.size() > 0) { return getSubcriptionId(elements.get(0)); } } } return null; }
String type) { if (ref != null) { Object address = ReflectionUtils.getFieldValue(ref, "address"); if (address != null) { log.info( "type={}, address={}", type, ReflectionUtils.getFieldValue(address, "uri")); logAttributes( type + " Address Attributes", address, "attributes"); Object metadata = ReflectionUtils.getFieldValue(ref, "metadata"); if (metadata != null) { Object metadataElts = ReflectionUtils.getFieldValue(metadata, "elements"); Object elements = ReflectionUtils.getFieldValue(ref, "elements"); if (elements != null) { log.info("type={}, elements=", type);
if (producerReference != null) { Object address = ReflectionUtils.getFieldValue( notificationMessage.getProducerReference(), "address"); if (address != null) { publicationSource = ReflectionUtils.getFieldValue(address, "uri") .toString(); } else {
ReflectionUtils.getFieldValue(producerReference, "address"); if (producerAddress != null) { producerAddressUri = (String) ReflectionUtils.getFieldValue( producerAddress, "uri"); if (producerAddressUri != null) { ReflectionUtils.getFieldValue( notificationMessage.getProducerReference(), "metadata"); @SuppressWarnings("unchecked") List<Element> producerMetadataElements = (List<Element>) ReflectionUtils.getFieldValue( metadata, "elements"); producerMetadataNodes =