Search in sources :

Example 1 with GetKeysRequestData

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData in project open-smart-grid-platform by OSGP.

the class GetKeysRequestMessageProcessor method handleMessage.

@Override
protected void handleMessage(final MessageMetadata messageMetadata, final Object dataObject) throws FunctionalException {
    final GetKeysRequestData getKeysRequestData = (GetKeysRequestData) dataObject;
    this.configurationService.getKeys(messageMetadata, getKeysRequestData);
}
Also used : GetKeysRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData)

Example 2 with GetKeysRequestData

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData in project open-smart-grid-platform by OSGP.

the class SmartMeteringConfigurationEndpoint method getKeys.

@PayloadRoot(localPart = "GetKeysRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetKeysAsyncResponse getKeys(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetKeysRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
    final GetKeysRequestData dataRequest = this.configurationMapper.map(request.getGetKeysData(), GetKeysRequestData.class);
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_KEYS).withMessageType(MessageType.GET_KEYS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
    final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, dataRequest);
    this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
    return this.configurationMapper.map(asyncResponse, GetKeysAsyncResponse.class);
}
Also used : GetKeysRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData) SetSpecialDaysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetSpecialDaysAsyncResponse) GetFirmwareVersionGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionGasAsyncResponse) GenerateAndReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse) ReplaceKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ReplaceKeysAsyncResponse) SetPushSetupSmsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupSmsAsyncResponse) SetAdministrativeStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAdministrativeStatusAsyncResponse) GetConfigurationObjectAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetConfigurationObjectAsyncResponse) SetEncryptionKeyExchangeOnGMeterAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetEncryptionKeyExchangeOnGMeterAsyncResponse) SetClockConfigurationAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetClockConfigurationAsyncResponse) GetMbusEncryptionKeyStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusAsyncResponse) UpdateFirmwareAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareAsyncResponse) SetConfigurationObjectAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetConfigurationObjectAsyncResponse) SetPushSetupAlarmAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetPushSetupAlarmAsyncResponse) GetKeysAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncResponse) GetAdministrativeStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) SetAlarmNotificationsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAlarmNotificationsAsyncResponse) ConfigureDefinableLoadProfileAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ConfigureDefinableLoadProfileAsyncResponse) GetFirmwareVersionAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionAsyncResponse) SetRandomisationSettingsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetRandomisationSettingsAsyncResponse) SetActivityCalendarAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetActivityCalendarAsyncResponse) SetMbusUserKeyByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetMbusUserKeyByChannelAsyncResponse) GetMbusEncryptionKeyStatusByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusByChannelAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 3 with GetKeysRequestData

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData in project open-smart-grid-platform by OSGP.

the class ConfigurationService method getKeys.

public void getKeys(final MessageMetadata messageMetadata, final GetKeysRequestData getKeysRequestData) throws FunctionalException {
    log.info("getKeys for organisationIdentification: {} for deviceIdentification: {}", messageMetadata.getOrganisationIdentification(), messageMetadata.getDeviceIdentification());
    final SmartMeter smartMeter = this.domainHelperService.findSmartMeter(messageMetadata.getDeviceIdentification());
    final List<SecretTypeDto> secretTypes = getKeysRequestData.getSecretTypes().stream().map(secretType -> SecretTypeDto.valueOf(secretType.name())).collect(Collectors.toList());
    final GetKeysRequestDto requestDto = new GetKeysRequestDto(secretTypes);
    this.osgpCoreRequestMessageSender.send(requestDto, messageMetadata.builder().withIpAddress(smartMeter.getIpAddress()).withNetworkSegmentIds(smartMeter.getBtsId(), smartMeter.getCellId()).build());
}
Also used : Arrays(java.util.Arrays) AdministrativeStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType) SpecialDaysRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecialDaysRequest) ResponseMessageResultType(org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType) SetKeysRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetKeysRequestDto) MessageMetadata(org.opensmartgridplatform.shared.infra.jms.MessageMetadata) Autowired(org.springframework.beans.factory.annotation.Autowired) GetKeysRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData) SetRandomisationSettingsRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetRandomisationSettingsRequestData) GetConfigurationObjectResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse) ChannelDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ChannelDto) AlarmNotifications(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AlarmNotifications) SetKeysRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetKeysRequestData) UpdateFirmwareResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareResponse) GetKeysResponseData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysResponseData) DefinableLoadProfileConfigurationDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.DefinableLoadProfileConfigurationDto) GetMbusEncryptionKeyStatusRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusRequestDto) SetConfigurationObjectRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetConfigurationObjectRequestDto) GetMbusEncryptionKeyStatusByChannelRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelRequestData) AdministrativeStatusTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.AdministrativeStatusTypeDto) PushSetupAlarmDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.PushSetupAlarmDto) GetKeysResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysResponse) PushSetupSmsDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.PushSetupSmsDto) FirmwareVersionGasResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FirmwareVersionGasResponse) UpdateFirmwareRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareRequestData) FirmwareVersionGasDto(org.opensmartgridplatform.dto.valueobjects.FirmwareVersionGasDto) Collectors(java.util.stream.Collectors) ActivityCalendar(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActivityCalendar) GetMbusEncryptionKeyStatusByChannelRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelRequestDataDto) PushSetupAlarm(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushSetupAlarm) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ConfigurationMapper(org.opensmartgridplatform.adapter.domain.smartmetering.application.mapping.ConfigurationMapper) GetKeysRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetKeysRequestDto) SetRandomisationSettingsRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetRandomisationSettingsRequestDataDto) SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter) AlarmNotificationsDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.AlarmNotificationsDto) JmsMessageSender(org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.core.JmsMessageSender) GetMbusEncryptionKeyStatusResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusResponseDto) GMeterInfoDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GMeterInfoDto) GetMbusEncryptionKeyStatusByChannelResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetMbusEncryptionKeyStatusByChannelResponseDto) ResponseMessage(org.opensmartgridplatform.shared.infra.jms.ResponseMessage) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) SecretType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SecretType) FunctionalExceptionType(org.opensmartgridplatform.shared.exceptionhandling.FunctionalExceptionType) GetFirmwareVersionQueryDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetFirmwareVersionQueryDto) WebServiceResponseMessageSender(org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.ws.WebServiceResponseMessageSender) SetConfigurationObjectRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetConfigurationObjectRequest) DefinableLoadProfileConfigurationData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DefinableLoadProfileConfigurationData) Service(org.springframework.stereotype.Service) GetFirmwareVersionQuery(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetFirmwareVersionQuery) Qualifier(org.springframework.beans.factory.annotation.Qualifier) GetConfigurationObjectRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetConfigurationObjectRequestDto) KeyDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.KeyDto) UpdateFirmwareResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.UpdateFirmwareResponseDto) ComponentType(org.opensmartgridplatform.shared.exceptionhandling.ComponentType) EncryptionKeyStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType) SetClockConfigurationRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetClockConfigurationRequestDto) UpdateFirmwareRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.UpdateFirmwareRequestDto) GetConfigurationObjectRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectRequest) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) FirmwareVersionDto(org.opensmartgridplatform.dto.valueobjects.FirmwareVersionDto) GatewayDeviceNotSetForMbusDeviceException(org.opensmartgridplatform.domain.smartmetering.exceptions.GatewayDeviceNotSetForMbusDeviceException) SpecialDaysRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SpecialDaysRequestDto) SecretTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SecretTypeDto) SetClockConfigurationRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetClockConfigurationRequestData) FirmwareVersion(org.opensmartgridplatform.domain.core.valueobjects.FirmwareVersion) GetConfigurationObjectResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetConfigurationObjectResponseDto) Device(org.opensmartgridplatform.domain.core.entities.Device) FirmwareVersionResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.FirmwareVersionResponse) GetKeysResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetKeysResponseDto) SetMbusUserKeyByChannelRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestData) PushSetupSms(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PushSetupSms) SetMbusUserKeyByChannelRequestDataDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetMbusUserKeyByChannelRequestDataDto) ActivityCalendarDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActivityCalendarDto) Transactional(org.springframework.transaction.annotation.Transactional) GetKeysRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetKeysRequestDto) SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter) SecretTypeDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SecretTypeDto)

Aggregations

GetKeysRequestData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetKeysRequestData)3 Arrays (java.util.Arrays)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Slf4j (lombok.extern.slf4j.Slf4j)1 ConfigurationMapper (org.opensmartgridplatform.adapter.domain.smartmetering.application.mapping.ConfigurationMapper)1 JmsMessageSender (org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.core.JmsMessageSender)1 WebServiceResponseMessageSender (org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.ws.WebServiceResponseMessageSender)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ConfigureDefinableLoadProfileAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ConfigureDefinableLoadProfileAsyncResponse)1 GenerateAndReplaceKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GenerateAndReplaceKeysAsyncResponse)1 GetAdministrativeStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse)1 GetConfigurationObjectAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetConfigurationObjectAsyncResponse)1 GetFirmwareVersionAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionAsyncResponse)1 GetFirmwareVersionGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetFirmwareVersionGasAsyncResponse)1 GetKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysAsyncResponse)1 GetMbusEncryptionKeyStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusAsyncResponse)1 GetMbusEncryptionKeyStatusByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusByChannelAsyncResponse)1 ReplaceKeysAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.ReplaceKeysAsyncResponse)1 SetActivityCalendarAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetActivityCalendarAsyncResponse)1