public static ParticipantIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse participant identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); }
public static ProcessIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse process identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); }
public static DocumentTypeIdentifier parse(String str) throws PeppolParsingException { String[] parts = str.split("::", 2); if (parts.length != 2) throw new PeppolParsingException(String.format("Unable to parse document type identifier '%s'.", str)); return of(parts[1], Scheme.of(parts[0])); }
@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 ParticipantIdentifier readElectronicAddressType(AttributedElectronicAddressType o) { return ParticipantIdentifier.of(o.getValue(), Scheme.of(o.getScheme())); }
@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); } }
ProcessIdentifier.of( processType.getProcessIdentifier().getValue(), Scheme.of(processType.getProcessIdentifier().getScheme()) ), endpoints ParticipantIdentifier.of( serviceInformation.getParticipantIdentifier().getValue(), Scheme.of(serviceInformation.getParticipantIdentifier().getScheme()) ), DocumentTypeIdentifier.of( serviceInformation.getDocumentIdentifier().getValue(), Scheme.of(serviceInformation.getDocumentIdentifier().getScheme()) ), processMetadatas
ProcessIdentifier.of( processType.getProcessIdentifier().getValue(), Scheme.of(processType.getProcessIdentifier().getScheme()) ), endpoints ParticipantIdentifier.of( serviceInformation.getParticipantIdentifier().getValue(), Scheme.of(serviceInformation.getParticipantIdentifier().getScheme()) ), DocumentTypeIdentifier.of( serviceInformation.getDocumentIdentifier().getValue(), Scheme.of(serviceInformation.getDocumentIdentifier().getScheme()) ), processMetadatas
ProcessIdentifier.of( processType.getProcessIdentifier().getValue(), Scheme.of(processType.getProcessIdentifier().getScheme()) ), endpoints ParticipantIdentifier.of( serviceInformation.getParticipantIdentifier().getValue(), Scheme.of(serviceInformation.getParticipantIdentifier().getScheme()) ), DocumentTypeIdentifier.of( serviceInformation.getDocumentIdentifier().getValue(), Scheme.of(serviceInformation.getDocumentIdentifier().getScheme()) ), processMetadatas
ParticipantIdentifier.of(senderIdentifier.getValue(), Scheme.of(senderIdentifier.getAuthority()))); ParticipantIdentifier.of(receiverIdentifier.getValue(), Scheme.of(receiverIdentifier.getAuthority()))); case "DOCUMENTID": { Scheme scheme = scope.getIdentifier() != null ? Scheme.of(scope.getIdentifier()) : DocumentTypeIdentifier.DEFAULT_SCHEME; header = header.documentType(DocumentTypeIdentifier.of(scope.getInstanceIdentifier(), scheme)); break; Scheme.of(scope.getIdentifier()) : ProcessIdentifier.DEFAULT_SCHEME; header = header.process(ProcessIdentifier.of(scope.getInstanceIdentifier(), scheme)); break;