本文整理了Java中no.difi.vefa.peppol.common.model.Header
类的一些代码示例,展示了Header
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header
类的具体详情如下:
包路径:no.difi.vefa.peppol.common.model.Header
类名称:Header
暂无
代码示例来源:origin: difi/oxalis
public PeppolStandardBusinessHeader(Header header) {
senderId = header.getSender();
recipientId = header.getReceiver();
creationDateAndTime = header.getCreationTimestamp();
peppolDocumentTypeId = header.getDocumentType();
profileTypeIdentifier = header.getProcess();
instanceId = new InstanceId(header.getIdentifier().getIdentifier());
}
代码示例来源:origin: difi/oxalis
public HeaderStub(Header header) {
this.receiver = header.getReceiver();
this.documentType = header.getDocumentType();
this.process = header.getProcess();
}
代码示例来源:origin: no.difi.vefa/peppol-evidence
public Evidence header(Header header) {
Evidence evidence = copy();
evidence.sender = header.getSender();
evidence.receiver = header.getReceiver();
evidence.documentTypeIdentifier = header.getDocumentType();
evidence.documentIdentifier = header.getIdentifier();
return evidence;
}
代码示例来源:origin: no.difi.oxalis/oxalis-statistics
public void persist(InboundMetadata inboundMetadata) {
// Persists raw statistics when message was received (ignore if stats couldn't be persisted, just warn)
try {
DefaultRawStatistics rawStatistics = new DefaultRawStatistics.RawStatisticsBuilder()
.accessPointIdentifier(ourAccessPointIdentifier)
.direction(Direction.IN)
.documentType(inboundMetadata.getHeader().getDocumentType())
.sender(inboundMetadata.getHeader().getSender())
.receiver(inboundMetadata.getHeader().getReceiver())
.profile(inboundMetadata.getHeader().getProcess())
.channel(new ChannelId("AS2"))
.build();
rawStatisticsRepository.persist(rawStatistics);
} catch (Exception e) {
logger.error("Unable to persist statistics for " + inboundMetadata.toString() + ";\n " + e.getMessage(), e);
}
}
}
代码示例来源:origin: no.difi.vefa/peppol-sbdh
sbdh.getSender().add(SbdhHelper.createPartner(header.getSender()));
sbdh.getReceiver().add(SbdhHelper.createPartner(header.getReceiver()));
sbdh.getDocumentIdentification().setStandard(header.getInstanceType().getStandard());
sbdh.getDocumentIdentification().setTypeVersion(header.getInstanceType().getVersion());
sbdh.getDocumentIdentification().setInstanceIdentifier(header.getIdentifier().getIdentifier());
sbdh.getDocumentIdentification().setType(header.getInstanceType().getType());
SbdhHelper.toXmlGregorianCalendar(header.getCreationTimestamp()));
scopes.add(SbdhHelper.createScope(header.getDocumentType()));
scopes.add(SbdhHelper.createScope(header.getProcess()));
header.getArguments().forEach(ai -> scopes.add(SbdhHelper.createScope(ai)));
代码示例来源:origin: difi/oxalis
@Override
public void verify(Header header, Direction direction) {
log.info("Direction: {} | Sender/Receiver: {}/{} | Instance identifier: {}",
direction,
header.getSender().getIdentifier(),
header.getReceiver().getIdentifier(),
header.getIdentifier());
}
}
代码示例来源:origin: no.difi.vefa/peppol-sbdh
static Header read(StandardBusinessDocumentHeader sbdh) throws SbdhException {
Header header = Header.newInstance();
header = header.sender(
ParticipantIdentifier.of(senderIdentifier.getValue(), Scheme.of(senderIdentifier.getAuthority())));
header = header.receiver(
ParticipantIdentifier.of(receiverIdentifier.getValue(), Scheme.of(receiverIdentifier.getAuthority())));
header = header.identifier(InstanceIdentifier.of(docIdent.getInstanceIdentifier()));
header = header.instanceType(InstanceType.of(
docIdent.getStandard(), docIdent.getType(), docIdent.getTypeVersion()));
header = header.creationTimestamp(
SbdhHelper.fromXMLGregorianCalendar(docIdent.getCreationDateAndTime()));
Scheme scheme = scope.getIdentifier() != null ?
Scheme.of(scope.getIdentifier()) : DocumentTypeIdentifier.DEFAULT_SCHEME;
header = header.documentType(DocumentTypeIdentifier.of(scope.getInstanceIdentifier(), scheme));
break;
Scheme scheme = scope.getIdentifier() != null ?
Scheme.of(scope.getIdentifier()) : ProcessIdentifier.DEFAULT_SCHEME;
header = header.process(ProcessIdentifier.of(scope.getInstanceIdentifier(), scheme));
break;
header = header.argument(ArgumentIdentifier.of(type, scope.getInstanceIdentifier()));
break;
代码示例来源:origin: no.difi.oxalis/oxalis-commons
/**
* Computes the Path for a directory into which your file artifacts associated with
* the supplied header may be written. Any intermediate directories are created for you.
*
* @param baseFolder the root folder to use as the basis for appending additional folders.
* @param header meta data to be used as input for computation.
* @return a path to a directory into which you may store your artifacts.
* @throws IOException
*/
public static Path createArtifactFolders(Path baseFolder, Header header) throws IOException {
Path folder = baseFolder.resolve(Paths.get(
FileUtils.filterString(header.getReceiver().getIdentifier()),
FileUtils.filterString(header.getSender().getIdentifier())));
Files.createDirectories(folder);
return folder;
}
}
代码示例来源:origin: no.difi.oxalis/oxalis-extension-testbed
@Override
public Path persist(TransmissionIdentifier transmissionIdentifier, Header header, InputStream inputStream)
throws IOException {
Path path = File.createTempFile("oxalis-testbed-inbound", header.getIdentifier().getIdentifier()).toPath();
try (OutputStream outputStream = Files.newOutputStream(path)) {
ByteStreams.copy(inputStream, outputStream);
}
return path;
}
代码示例来源:origin: difi/oxalis
public void persist(InboundMetadata inboundMetadata) {
// Persists raw statistics when message was received (ignore if stats couldn't be persisted, just warn)
try {
DefaultRawStatistics rawStatistics = new DefaultRawStatistics.RawStatisticsBuilder()
.accessPointIdentifier(ourAccessPointIdentifier)
.direction(Direction.IN)
.documentType(inboundMetadata.getHeader().getDocumentType())
.sender(inboundMetadata.getHeader().getSender())
.receiver(inboundMetadata.getHeader().getReceiver())
.profile(inboundMetadata.getHeader().getProcess())
.channel(new ChannelId("AS2"))
.build();
rawStatisticsRepository.persist(rawStatistics);
} catch (Exception e) {
logger.error("Unable to persist statistics for " + inboundMetadata.toString() + ";\n " + e.getMessage(), e);
}
}
}
代码示例来源:origin: no.difi.vefa/peppol-lookup
public Endpoint getEndpoint(Header header, TransportProfile... transportProfiles)
throws LookupException, PeppolSecurityException, EndpointNotFoundException {
return getEndpoint(header.getReceiver(), header.getDocumentType(),
header.getProcess(), transportProfiles);
}
}
代码示例来源:origin: difi/oxalis
/**
* Computes the Path for a directory into which your file artifacts associated with
* the supplied header may be written. Any intermediate directories are created for you.
*
* @param baseFolder the root folder to use as the basis for appending additional folders.
* @param header meta data to be used as input for computation.
* @return a path to a directory into which you may store your artifacts.
* @throws IOException
*/
public static Path createArtifactFolders(Path baseFolder, Header header) throws IOException {
Path folder = baseFolder.resolve(Paths.get(
FileUtils.filterString(header.getReceiver().getIdentifier()),
FileUtils.filterString(header.getSender().getIdentifier())));
Files.createDirectories(folder);
return folder;
}
}
代码示例来源:origin: difi/oxalis
@Override
public Path persist(TransmissionIdentifier transmissionIdentifier, Header header, InputStream inputStream)
throws IOException {
Path path = File.createTempFile("oxalis-testbed-inbound", header.getIdentifier().getIdentifier()).toPath();
try (OutputStream outputStream = Files.newOutputStream(path)) {
ByteStreams.copy(inputStream, outputStream);
}
return path;
}
代码示例来源:origin: no.difi.oxalis/oxalis-statistics
.accessPointIdentifier(ourAccessPointIdentifier)
.direction(Direction.OUT)
.documentType(transmissionResponse.getHeader().getDocumentType())
.sender(transmissionResponse.getHeader().getSender())
.receiver(transmissionResponse.getHeader().getReceiver())
.profile(transmissionResponse.getHeader().getProcess())
代码示例来源:origin: no.difi.oxalis/oxalis-standalone
protected TransmissionResponse performTransmission(File evidencePath, Transmitter transmitter,
TransmissionRequest transmissionRequest, Span root)
throws OxalisTransmissionException, EvidenceException, IOException {
Span span = tracer.buildSpan("transmission").asChildOf(root).start();
try {
// ... and performs the transmission
long start = System.nanoTime();
TransmissionResponse transmissionResponse = transmitter.transmit(transmissionRequest, span);
long elapsed = System.nanoTime() - start;
long durartionInMs = TimeUnit.MILLISECONDS.convert(elapsed, TimeUnit.NANOSECONDS);
// Write the transmission id and where the message was delivered
log.debug(String.format("Message using messageId %s sent to %s using %s was assigned transmissionId %s took %dms\n",
transmissionResponse.getHeader().getIdentifier().getIdentifier(),
transmissionResponse.getEndpoint().getAddress(),
transmissionResponse.getProtocol().getIdentifier(),
transmissionResponse.getTransmissionIdentifier(),
durartionInMs
));
saveEvidence(transmissionResponse, evidencePath, span);
return transmissionResponse;
} finally {
span.finish();
}
}
代码示例来源:origin: difi/oxalis
.accessPointIdentifier(ourAccessPointIdentifier)
.direction(Direction.OUT)
.documentType(transmissionResponse.getHeader().getDocumentType())
.sender(transmissionResponse.getHeader().getSender())
.receiver(transmissionResponse.getHeader().getReceiver())
.profile(transmissionResponse.getHeader().getProcess())
代码示例来源:origin: difi/oxalis
protected TransmissionResponse performTransmission(File evidencePath, Transmitter transmitter,
TransmissionRequest transmissionRequest, Span root)
throws OxalisTransmissionException, EvidenceException, IOException {
Span span = tracer.buildSpan("transmission").asChildOf(root).start();
try {
// ... and performs the transmission
long start = System.nanoTime();
TransmissionResponse transmissionResponse = transmitter.transmit(transmissionRequest, span);
long elapsed = System.nanoTime() - start;
long durartionInMs = TimeUnit.MILLISECONDS.convert(elapsed, TimeUnit.NANOSECONDS);
// Write the transmission id and where the message was delivered
log.debug(String.format("Message using messageId %s sent to %s using %s was assigned transmissionId %s took %dms\n",
transmissionResponse.getHeader().getIdentifier().getIdentifier(),
transmissionResponse.getEndpoint().getAddress(),
transmissionResponse.getProtocol().getIdentifier(),
transmissionResponse.getTransmissionIdentifier(),
durartionInMs
));
saveEvidence(transmissionResponse, evidencePath, span);
return transmissionResponse;
} finally {
span.finish();
}
}
代码示例来源:origin: difi/oxalis
try {
header = headerParser.parse(peekingInputStream);
span.setTag("identifier", header.getIdentifier().getIdentifier());
} catch (OxalisContentException e) {
span.setTag("exception", e.getMessage());
try {
header = contentDetector.parse(new ByteArrayInputStream(payload));
span.setTag("identifier", header.getIdentifier().getIdentifier());
} catch (OxalisContentException ex) {
span.setTag("exception", ex.getMessage());
内容来源于网络,如有侵权,请联系作者删除!