public static ServiceReference of(DocumentTypeIdentifier documentTypeIdentifier, List<ProcessIdentifier> processIdentifiers) { return new ServiceReference(documentTypeIdentifier, processIdentifiers); }
@SuppressWarnings("all") @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { try { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); ServiceGroupType serviceGroup = unmarshaller.unmarshal( XmlUtils.streamReader(fetcherResponse.getInputStream()), ServiceGroupType.class).getValue(); List<ServiceReference> serviceReferences = new ArrayList<>(); for (ServiceMetadataReferenceType reference : serviceGroup.getServiceMetadataReferenceCollection().getServiceMetadataReference()) { String hrefDocumentTypeIdentifier = URLDecoder.decode(reference.getHref(), "UTF-8").split("/services/")[1]; String[] parts = hrefDocumentTypeIdentifier.split("::", 2); try { serviceReferences.add(ServiceReference.of(DocumentTypeIdentifierWithUri.of( parts[1], Scheme.of(parts[0]), URI.create(reference.getHref())))); } catch (ArrayIndexOutOfBoundsException e) { LOGGER.warn("Unable to parse '{}'.", hrefDocumentTypeIdentifier); } } return serviceReferences; } catch (JAXBException | XMLStreamException | UnsupportedEncodingException e) { throw new LookupException(e.getMessage(), e); } }
@SuppressWarnings("all") @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { try { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); ServiceGroupType serviceGroup = unmarshaller.unmarshal( XmlUtils.streamReader(fetcherResponse.getInputStream()), ServiceGroupType.class).getValue(); List<ServiceReference> serviceReferences = new ArrayList<>(); for (ServiceMetadataReferenceType reference : serviceGroup.getServiceMetadataReferenceCollection().getServiceMetadataReference()) { String hrefDocumentTypeIdentifier = URLDecoder.decode(reference.getHref(), "UTF-8").split("/services/")[1]; String[] parts = hrefDocumentTypeIdentifier.split("::", 2); try { serviceReferences.add(ServiceReference.of(DocumentTypeIdentifierWithUri.of( parts[1], Scheme.of(parts[0]), URI.create(reference.getHref())))); } catch (ArrayIndexOutOfBoundsException e) { LOGGER.warn("Unable to parse '{}'.", hrefDocumentTypeIdentifier); } } return serviceReferences; } catch (JAXBException | XMLStreamException | UnsupportedEncodingException e) { throw new LookupException(e.getMessage(), e); } }
@SuppressWarnings("all") @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { try { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); ServiceGroupType serviceGroup = unmarshaller.unmarshal( XmlUtils.streamReader(fetcherResponse.getInputStream()), ServiceGroupType.class).getValue(); List<ServiceReference> serviceReferences = new ArrayList<>(); for (ServiceMetadataReferenceType reference : serviceGroup.getServiceMetadataReferenceCollection().getServiceMetadataReference()) { String hrefDocumentTypeIdentifier = URLDecoder.decode(reference.getHref(), "UTF-8").split("/services/")[1]; String[] parts = hrefDocumentTypeIdentifier.split("::", 2); try { serviceReferences.add(ServiceReference.of(DocumentTypeIdentifierWithUri.of( parts[1], Scheme.of(parts[0]), URI.create(reference.getHref())))); } catch (ArrayIndexOutOfBoundsException e) { LOGGER.warn("Unable to parse '{}'.", hrefDocumentTypeIdentifier); } } return serviceReferences; } catch (JAXBException | XMLStreamException | UnsupportedEncodingException e) { throw new LookupException(e.getMessage(), e); } }
public static ServiceReference of(DocumentTypeIdentifier documentTypeIdentifier, ProcessIdentifier... processIdentifiers) { return new ServiceReference(documentTypeIdentifier, Arrays.asList(processIdentifiers)); }