Search in sources :

Example 1 with no.altinn.schemas.services.serviceengine.notification._2009._10

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;
}
Also used : CorrespondenceStatusHistoryRequest(no.altinn.services.serviceengine.correspondence._2009._10.CorrespondenceStatusHistoryRequest) ArrayOfstring(com.microsoft.schemas._2003._10.serialization.arrays.ArrayOfstring) ObjectFactory(no.altinn.schemas.services.serviceengine.correspondence._2010._10.ObjectFactory) no.altinn.schemas.services.serviceengine.notification._2009._10(no.altinn.schemas.services.serviceengine.notification._2009._10)

Example 2 with no.altinn.schemas.services.serviceengine.notification._2009._10

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);
}
Also used : CentralSystemService(ocpp.cs._2015._10.CentralSystemService) Helpers.getRandomString(de.rwth.idsg.steve.utils.Helpers.getRandomString)

Example 3 with no.altinn.schemas.services.serviceengine.notification._2009._10

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);
}
Also used : ChargingProfileKindType(ocpp.cp._2015._10.ChargingProfileKindType) ChargingProfile(ocpp.cp._2015._10.ChargingProfile) EnhancedSetChargingProfileParams(de.rwth.idsg.steve.service.dto.EnhancedSetChargingProfileParams) ChargingProfilePurposeType(ocpp.cp._2015._10.ChargingProfilePurposeType) SetChargingProfileRequest(ocpp.cp._2015._10.SetChargingProfileRequest) AsyncHandler(javax.xml.ws.AsyncHandler) Collectors(java.util.stream.Collectors) ChargingSchedule(ocpp.cp._2015._10.ChargingSchedule) RecurrencyKindType(ocpp.cp._2015._10.RecurrencyKindType) List(java.util.List) OcppCallback(de.rwth.idsg.steve.ocpp.OcppCallback) Ocpp16AndAboveTask(de.rwth.idsg.steve.ocpp.Ocpp16AndAboveTask) ChargingRateUnitType(ocpp.cp._2015._10.ChargingRateUnitType) OcppVersion(de.rwth.idsg.steve.ocpp.OcppVersion) ChargingProfileRepository(de.rwth.idsg.steve.repository.ChargingProfileRepository) ChargingProfileRecord(jooq.steve.db.tables.records.ChargingProfileRecord) ChargingSchedulePeriod(ocpp.cp._2015._10.ChargingSchedulePeriod) ChargingProfileRecord(jooq.steve.db.tables.records.ChargingProfileRecord) ChargingSchedule(ocpp.cp._2015._10.ChargingSchedule) ChargingProfile(ocpp.cp._2015._10.ChargingProfile) SetChargingProfileRequest(ocpp.cp._2015._10.SetChargingProfileRequest) ChargingSchedulePeriod(ocpp.cp._2015._10.ChargingSchedulePeriod)

Example 4 with no.altinn.schemas.services.serviceengine.notification._2009._10

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("&lt;html>Dette er en test&lt;/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;
}
Also used : BinaryAttachmentExternalBEV2List(no.altinn.services.serviceengine.reporteeelementlist._2010._10.BinaryAttachmentExternalBEV2List) MyInsertCorrespondenceV2(no.altinn.schemas.services.serviceengine.correspondence._2010._10.MyInsertCorrespondenceV2) DataHandler(javax.activation.DataHandler) ObjectFactory(no.altinn.schemas.services.serviceengine.correspondence._2010._10.ObjectFactory) BinaryAttachmentV2(no.altinn.services.serviceengine.reporteeelementlist._2010._10.BinaryAttachmentV2) ByteArrayDataSource(javax.mail.util.ByteArrayDataSource) AttachmentsV2(no.altinn.schemas.services.serviceengine.correspondence._2010._10.AttachmentsV2) MyInsertCorrespondenceV2(no.altinn.schemas.services.serviceengine.correspondence._2010._10.MyInsertCorrespondenceV2) InsertCorrespondenceV2(no.altinn.services.serviceengine.correspondence._2009._10.InsertCorrespondenceV2) IOException(java.io.IOException) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) File(java.io.File) ExternalContentV2(no.altinn.schemas.services.serviceengine.correspondence._2010._10.ExternalContentV2) no.altinn.schemas.services.serviceengine.notification._2009._10(no.altinn.schemas.services.serviceengine.notification._2009._10)

Aggregations

ObjectFactory (no.altinn.schemas.services.serviceengine.correspondence._2010._10.ObjectFactory)2 no.altinn.schemas.services.serviceengine.notification._2009._10 (no.altinn.schemas.services.serviceengine.notification._2009._10)2 ArrayOfstring (com.microsoft.schemas._2003._10.serialization.arrays.ArrayOfstring)1 Ocpp16AndAboveTask (de.rwth.idsg.steve.ocpp.Ocpp16AndAboveTask)1 OcppCallback (de.rwth.idsg.steve.ocpp.OcppCallback)1 OcppVersion (de.rwth.idsg.steve.ocpp.OcppVersion)1 ChargingProfileRepository (de.rwth.idsg.steve.repository.ChargingProfileRepository)1 EnhancedSetChargingProfileParams (de.rwth.idsg.steve.service.dto.EnhancedSetChargingProfileParams)1 Helpers.getRandomString (de.rwth.idsg.steve.utils.Helpers.getRandomString)1 File (java.io.File)1 IOException (java.io.IOException)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 DataHandler (javax.activation.DataHandler)1 ByteArrayDataSource (javax.mail.util.ByteArrayDataSource)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 AsyncHandler (javax.xml.ws.AsyncHandler)1 ChargingProfileRecord (jooq.steve.db.tables.records.ChargingProfileRecord)1 AttachmentsV2 (no.altinn.schemas.services.serviceengine.correspondence._2010._10.AttachmentsV2)1 ExternalContentV2 (no.altinn.schemas.services.serviceengine.correspondence._2010._10.ExternalContentV2)1