use of net.opengis.filter.v_1_1_0.ObjectFactory in project testnorge by navikt.
the class RefusjonDTO method toXmlElement.
@Override
public XMLRefusjon toXmlElement() {
ObjectFactory factory = new ObjectFactory();
XMLRefusjon xmlRefusjon = factory.createXMLRefusjon();
if (endringIRefusjonListe != null) {
XMLEndringIRefusjonsListe xmlEndringIRefusjonsListe = factory.createXMLEndringIRefusjonsListe();
xmlEndringIRefusjonsListe.withEndringIRefusjon(EndringIRefusjonDTO.convert(endringIRefusjonListe));
xmlRefusjon.withEndringIRefusjonListe(factory.createXMLRefusjonEndringIRefusjonListe(xmlEndringIRefusjonsListe));
}
xmlRefusjon.setRefusjonsbeloepPrMnd(factory.createXMLRefusjonRefusjonsbeloepPrMnd(refusjonsbeloepPrMnd != null ? BigDecimal.valueOf(refusjonsbeloepPrMnd) : null));
xmlRefusjon.setRefusjonsopphoersdato(factory.createXMLRefusjonRefusjonsopphoersdato(refusjonsopphoersdato));
return xmlRefusjon;
}
use of net.opengis.filter.v_1_1_0.ObjectFactory in project testnorge by navikt.
the class SykepengerIArbeidsgiverperiodenDTO method toXmlElement.
@Override
public XMLSykepengerIArbeidsgiverperioden toXmlElement() {
ObjectFactory factory = new ObjectFactory();
XMLSykepengerIArbeidsgiverperioden xmlSykepengerIArbeidsgiverperioden = factory.createXMLSykepengerIArbeidsgiverperioden();
if (arbeidsgiverperiodeListe != null) {
XMLArbeidsgiverperiodeListe xmlArbeidsgiverperiodeListe = factory.createXMLArbeidsgiverperiodeListe();
xmlArbeidsgiverperiodeListe.withArbeidsgiverperiode(PeriodeDTO.convert(arbeidsgiverperiodeListe));
xmlSykepengerIArbeidsgiverperioden.setArbeidsgiverperiodeListe(factory.createXMLSykepengerIArbeidsgiverperiodenArbeidsgiverperiodeListe(xmlArbeidsgiverperiodeListe));
}
xmlSykepengerIArbeidsgiverperioden.setBruttoUtbetalt(factory.createXMLSykepengerIArbeidsgiverperiodenBruttoUtbetalt(bruttoUtbetalt != null ? BigDecimal.valueOf(bruttoUtbetalt) : null));
xmlSykepengerIArbeidsgiverperioden.setBegrunnelseForReduksjonEllerIkkeUtbetalt(factory.createXMLSykepengerIArbeidsgiverperiodenBegrunnelseForReduksjonEllerIkkeUtbetalt(begrunnelseForReduksjonEllerIkkeUtbetalt));
return xmlSykepengerIArbeidsgiverperioden;
}
use of net.opengis.filter.v_1_1_0.ObjectFactory in project testnorge by navikt.
the class UtsettelseAvForeldrepengerDTO method toXmlElement.
@Override
public XMLUtsettelseAvForeldrepenger toXmlElement() {
ObjectFactory factory = new ObjectFactory();
XMLUtsettelseAvForeldrepenger xmlUtsettelseAvForeldrepenger = factory.createXMLUtsettelseAvForeldrepenger();
xmlUtsettelseAvForeldrepenger.setPeriode(factory.createXMLUtsettelseAvForeldrepengerPeriode(periode != null ? periode.toXmlElement() : null));
xmlUtsettelseAvForeldrepenger.setAarsakTilUtsettelse(factory.createXMLUtsettelseAvForeldrepengerAarsakTilUtsettelse(aarsakTilUtsettelse));
return xmlUtsettelseAvForeldrepenger;
}
use of net.opengis.filter.v_1_1_0.ObjectFactory in project phoss-smp by phax.
the class MainCreate1MillionEndpoints method main.
public static void main(final String[] args) throws Throwable {
final SMPServerRESTTestRule aRule = new SMPServerRESTTestRule(ClassPathResource.getAsFile("test-smp-server-mongodb.properties").getAbsolutePath());
aRule.before();
try {
// Set the special PhotonSecurityManager factory
PhotonSecurityManager.setFactory(new PhotonSecurityManagerFactoryMongoDB());
final ObjectFactory aObjFactory = new ObjectFactory();
final PeppolDocumentTypeIdentifier aDT = EPredefinedDocumentTypeIdentifier.INVOICE_EN16931_PEPPOL_V30.getAsDocumentTypeIdentifier();
final String sDT = aDT.getURIEncoded();
final PeppolProcessIdentifier aProcID = EPredefinedProcessIdentifier.BIS3_BILLING.getAsProcessIdentifier();
final StopWatch aSWOverall = StopWatch.createdStarted();
for (int i = 639276; i < 1_000_000; ++i) {
final StopWatch aSW = StopWatch.createdStarted();
final PeppolParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9999:test-philip-" + StringHelper.getLeadingZero(i, 7));
final String sPI = aPI.getURIEncoded();
final ServiceMetadataType aSM = new ServiceMetadataType();
final ServiceInformationType aSI = new ServiceInformationType();
aSI.setParticipantIdentifier(new SimpleParticipantIdentifier(aPI));
aSI.setDocumentIdentifier(aDT);
{
final ProcessListType aPL = new ProcessListType();
final ProcessType aProcess = new ProcessType();
aProcess.setProcessIdentifier(aProcID);
final ServiceEndpointList aSEL = new ServiceEndpointList();
final EndpointType aEndpoint = new EndpointType();
aEndpoint.setEndpointReference(W3CEndpointReferenceHelper.createEndpointReference("http://test.smpserver/as2"));
aEndpoint.setRequireBusinessLevelSignature(false);
aEndpoint.setCertificate("blacert");
aEndpoint.setServiceDescription("Unit test service");
aEndpoint.setTechnicalContactUrl("https://github.com/phax/phoss-smp");
aEndpoint.setTransportProfile(ESMPTransportProfile.TRANSPORT_PROFILE_AS2.getID());
aSEL.addEndpoint(aEndpoint);
aProcess.setServiceEndpointList(aSEL);
aPL.addProcess(aProcess);
aSI.setProcessList(aPL);
}
aSM.setServiceInformation(aSI);
try (final WebScoped aWS = new WebScoped(new MockHttpServletRequest())) {
// Delete old - don't care about the result
if (false)
ClientBuilder.newClient().target(aRule.getFullURL()).path(sPI).path("services").path(sDT).request().header(CHttpHeader.AUTHORIZATION, CREDENTIALS.getRequestValue()).delete();
// Create a new
final Response aResponseMsg = ClientBuilder.newClient().target(aRule.getFullURL()).path(sPI).path("services").path(sDT).request().header(CHttpHeader.AUTHORIZATION, CREDENTIALS.getRequestValue()).put(Entity.xml(aObjFactory.createServiceMetadata(aSM)));
_testResponseJerseyClient(aResponseMsg, 200);
}
aSW.stop();
LOGGER.info(sPI + " took " + aSW.getMillis() + " ms");
}
aSWOverall.stop();
LOGGER.info("Overall process took " + aSWOverall.getMillis() + " ms or " + aSWOverall.getDuration());
} finally {
aRule.after();
}
}
use of net.opengis.filter.v_1_1_0.ObjectFactory in project ddf by codice.
the class CswEndpoint method getInsertResultFromResponse.
private InsertResultType getInsertResultFromResponse(CreateResponse createResponse) throws CswException {
InsertResultType result = new InsertResultType();
WKTReader reader = new WKTReader();
for (Metacard metacard : createResponse.getCreatedMetacards()) {
BoundingBoxType boundingBox = new BoundingBoxType();
Geometry geometry = null;
String bbox = null;
try {
if (metacard.getAttribute(CswConstants.BBOX_PROP) != null) {
bbox = metacard.getAttribute(CswConstants.BBOX_PROP).getValue().toString();
geometry = reader.read(bbox);
} else if (StringUtils.isNotBlank(metacard.getLocation())) {
bbox = metacard.getLocation();
geometry = reader.read(bbox);
}
} catch (ParseException e) {
LOGGER.debug("Unable to parse BoundingBox : {}", bbox, e);
}
BriefRecordType briefRecordType = new BriefRecordType();
if (geometry != null) {
Envelope bounds = geometry.getEnvelopeInternal();
if (bounds != null) {
boundingBox.setCrs(CswConstants.SRS_NAME);
boundingBox.setLowerCorner(Arrays.asList(bounds.getMinX(), bounds.getMinY()));
boundingBox.setUpperCorner(Arrays.asList(bounds.getMaxX(), bounds.getMaxY()));
briefRecordType.getBoundingBox().add(new net.opengis.ows.v_1_0_0.ObjectFactory().createBoundingBox(boundingBox));
}
}
SimpleLiteral identifier = new SimpleLiteral();
identifier.getContent().add(metacard.getId());
briefRecordType.getIdentifier().add(new JAXBElement<>(CswConstants.DC_IDENTIFIER_QNAME, SimpleLiteral.class, identifier));
SimpleLiteral title = new SimpleLiteral();
title.getContent().add(metacard.getTitle());
briefRecordType.getTitle().add(new JAXBElement<>(CswConstants.DC_TITLE_QNAME, SimpleLiteral.class, title));
SimpleLiteral type = new SimpleLiteral();
type.getContent().add(metacard.getContentTypeName());
briefRecordType.setType(type);
result.getBriefRecord().add(briefRecordType);
}
return result;
}
Aggregations