use of no.altinn.schemas.services.serviceengine.notification._2009._10 in project efm-integrasjonspunkt by felleslosninger.
the class CorrespondenceAgencyMessageFactory method createReceiptRequest.
public CorrespondenceStatusHistoryRequest createReceiptRequest(Set<Conversation> conversations) {
no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory of = new no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory();
CorrespondenceStatusHistoryRequest historyRequest = of.createCorrespondenceStatusHistoryRequest();
com.microsoft.schemas._2003._10.serialization.arrays.ObjectFactory arrayOf = new com.microsoft.schemas._2003._10.serialization.arrays.ObjectFactory();
ArrayOfstring arrayOfstring = arrayOf.createArrayOfstring();
conversations.stream().map(Conversation::getMessageId).forEach(id -> arrayOfstring.getString().add(id));
JAXBElement<ArrayOfstring> strings = of.createCorrespondenceStatusHistoryRequestCorrespondenceSendersReferences(arrayOfstring);
historyRequest.setCorrespondenceSendersReferences(strings);
return historyRequest;
}
use of no.altinn.schemas.services.serviceengine.notification._2009._10 in project steve by RWTH-i5-IDSG.
the class Issue73Fix method test.
private static void test() {
ocpp.cs._2015._10.CentralSystemService client = getForOcpp16(path);
String chargeBox1 = getRandomString();
String chargeBox2 = getRandomString();
sendBoot(client, Lists.newArrayList(chargeBox1, chargeBox2));
sendAuth(client, chargeBox1, AuthorizationStatus.ACCEPTED);
sendStartTx(client, chargeBox1);
sendAuth(client, chargeBox1, AuthorizationStatus.ACCEPTED);
sendAuth(client, chargeBox2, AuthorizationStatus.CONCURRENT_TX);
}
use of no.altinn.schemas.services.serviceengine.notification._2009._10 in project steve by RWTH-i5-IDSG.
the class SetChargingProfileTask method getOcpp16Request.
@Override
public ocpp.cp._2015._10.SetChargingProfileRequest getOcpp16Request() {
ChargingProfileRecord profile = params.getDetails().getProfile();
List<ChargingSchedulePeriod> schedulePeriods = params.getDetails().getPeriods().stream().map(k -> {
ChargingSchedulePeriod p = new ChargingSchedulePeriod();
p.setStartPeriod(k.getStartPeriodInSeconds());
p.setLimit(k.getPowerLimit());
p.setNumberPhases(k.getNumberPhases());
return p;
}).collect(Collectors.toList());
ChargingSchedule schedule = new ChargingSchedule().withDuration(profile.getDurationInSeconds()).withStartSchedule(profile.getStartSchedule()).withChargingRateUnit(ChargingRateUnitType.fromValue(profile.getChargingRateUnit())).withMinChargingRate(profile.getMinChargingRate()).withChargingSchedulePeriod(schedulePeriods);
ChargingProfile ocppProfile = new ChargingProfile().withChargingProfileId(profile.getChargingProfilePk()).withStackLevel(profile.getStackLevel()).withChargingProfilePurpose(ChargingProfilePurposeType.fromValue(profile.getChargingProfilePurpose())).withChargingProfileKind(ChargingProfileKindType.fromValue(profile.getChargingProfileKind())).withRecurrencyKind(profile.getRecurrencyKind() == null ? null : RecurrencyKindType.fromValue(profile.getRecurrencyKind())).withValidFrom(profile.getValidFrom()).withValidTo(profile.getValidTo()).withChargingSchedule(schedule);
return new SetChargingProfileRequest().withConnectorId(params.getDelegate().getConnectorId()).withCsChargingProfiles(ocppProfile);
}
use of no.altinn.schemas.services.serviceengine.notification._2009._10 in project efm-integrasjonspunkt by felleslosninger.
the class CorrespondenceAgencyClientTest method createInsertCorrespondenceV2.
private static InsertCorrespondenceV2 createInsertCorrespondenceV2() {
ObjectFactory objectFactory = new ObjectFactory();
String systemUserCode = "AAS_TEST";
String externalReference = "12345678";
MyInsertCorrespondenceV2 correspondence = new MyInsertCorrespondenceV2();
correspondence.setServiceCode(objectFactory.createMyInsertCorrespondenceV2ServiceCode("4255"));
correspondence.setServiceEdition(objectFactory.createMyInsertCorrespondenceV2ServiceEdition("4"));
correspondence.setReportee(objectFactory.createMyInsertCorrespondenceV2Reportee("910926551"));
ExternalContentV2 externalContentV2 = new ExternalContentV2();
externalContentV2.setLanguageCode(objectFactory.createExternalContentV2LanguageCode("1044"));
externalContentV2.setMessageTitle(objectFactory.createExternalContentV2MessageTitle("Dette er en test"));
externalContentV2.setMessageSummary(objectFactory.createExternalContentV2MessageSummary("Her kommmer meldingssammendraget."));
externalContentV2.setMessageBody(objectFactory.createExternalContentV2MessageBody("<html>Dette er en test</html>"));
AttachmentsV2 attachmentsV2 = new AttachmentsV2();
BinaryAttachmentExternalBEV2List attachmentExternalBEV2List = new BinaryAttachmentExternalBEV2List();
BinaryAttachmentV2 binaryAttachmentV2 = new BinaryAttachmentV2();
binaryAttachmentV2.setFunctionType(AttachmentFunctionType.fromValue("Unspecified"));
no.altinn.services.serviceengine.reporteeelementlist._2010._10.ObjectFactory reporteeFactory = new no.altinn.services.serviceengine.reporteeelementlist._2010._10.ObjectFactory();
binaryAttachmentV2.setFileName(reporteeFactory.createBinaryAttachmentV2FileName("brev_med_innhold.pdf"));
binaryAttachmentV2.setName(reporteeFactory.createBinaryAttachmentV2Name("Brev"));
binaryAttachmentV2.setEncrypted(false);
binaryAttachmentV2.setSendersReference(reporteeFactory.createBinaryAttachmentV2SendersReference("AttachmentReference_as123452"));
try {
byte[] data = FileUtils.readFileToByteArray(new File("src/test/resources/test_data"));
DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(data, "application/octet-stream"));
binaryAttachmentV2.setData(reporteeFactory.createBinaryAttachmentV2Data(dataHandler));
} catch (IOException e) {
throw new RuntimeException(e);
}
attachmentExternalBEV2List.getBinaryAttachmentV2().add(binaryAttachmentV2);
attachmentsV2.setBinaryAttachments(objectFactory.createAttachmentsV2BinaryAttachments(attachmentExternalBEV2List));
externalContentV2.setAttachments(objectFactory.createExternalContentV2Attachments(attachmentsV2));
correspondence.setContent(objectFactory.createMyInsertCorrespondenceV2Content(externalContentV2));
XMLGregorianCalendar date = DateTimeUtil.toXMLGregorianCalendar(OffsetDateTime.now().plusMinutes(5));
correspondence.setVisibleDateTime(date);
correspondence.setAllowSystemDeleteDateTime(objectFactory.createMyInsertCorrespondenceV2AllowSystemDeleteDateTime(date));
NotificationBEList notifications = new NotificationBEList();
Notification2009 notification = new Notification2009();
no.altinn.schemas.services.serviceengine.notification._2009._10.ObjectFactory notificationFactory = new no.altinn.schemas.services.serviceengine.notification._2009._10.ObjectFactory();
notification.setFromAddress(notificationFactory.createNotification2009FromAddress("no-reply@altinn.no"));
notification.setShipmentDateTime(date);
notification.setLanguageCode(notificationFactory.createNotification2009LanguageCode("1044"));
notification.setNotificationType(notificationFactory.createNotification2009NotificationType("offentlig_etat"));
TextTokenSubstitutionBEList tokens = new TextTokenSubstitutionBEList();
tokens.getTextToken().add(createTextToken(0, "Avsender"));
tokens.getTextToken().add(createTextToken(1, "Idrett og kultur"));
tokens.getTextToken().add(createTextToken(2, "$reporteeName$"));
notification.setTextTokens(notificationFactory.createNotification2009TextTokens(tokens));
JAXBElement<ReceiverEndPointBEList> receiverEndpoints = createReceiverEndPoint();
notification.setReceiverEndPoints(receiverEndpoints);
correspondence.setAllowForwarding(objectFactory.createMyInsertCorrespondenceV2AllowForwarding(false));
correspondence.setMessageSender(objectFactory.createMyInsertCorrespondenceV2MessageSender("Avsender"));
notifications.getNotification().add(notification);
correspondence.setNotifications(objectFactory.createMyInsertCorrespondenceV2Notifications(notifications));
no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory correspondenceObjectFactory = new no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory();
final InsertCorrespondenceV2 myInsertCorrespondenceV2 = correspondenceObjectFactory.createInsertCorrespondenceV2();
myInsertCorrespondenceV2.setCorrespondence(correspondence);
myInsertCorrespondenceV2.setSystemUserCode(systemUserCode);
myInsertCorrespondenceV2.setExternalShipmentReference("12345678");
return myInsertCorrespondenceV2;
}
Aggregations