Search in sources :

Example 1 with GetAdministrativeStatusAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse in project open-smart-grid-platform by OSGP.

the class GetAdministrativeStatus method theRetrieveAdministrativeStatusRequestIsReceivedForDevices.

@When("^the get administrative status request is received for devices$")
public void theRetrieveAdministrativeStatusRequestIsReceivedForDevices(final List<String> deviceIdentifications) throws Throwable {
    final Map<String, String> parameterMap = new HashMap<>();
    final Map<String, String> correlationUidMap = new HashMap<>();
    for (final String deviceIdentification : deviceIdentifications) {
        parameterMap.put(PlatformKeys.KEY_DEVICE_IDENTIFICATION, deviceIdentification);
        final GetAdministrativeStatusRequest getAdministrativeStatusRequest = GetAdministrativeStatusRequestFactory.fromParameterMap(parameterMap);
        final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(getAdministrativeStatusRequest);
        assertThat(getAdministrativeStatusAsyncResponse).as("Get administrative status asyncResponse should not be null").isNotNull();
        correlationUidMap.put(deviceIdentification, getAdministrativeStatusAsyncResponse.getCorrelationUid());
    }
    ScenarioContext.current().put(CORRELATION_UID_BY_DEVICE_IDENTIFICATION, correlationUidMap);
}
Also used : GetAdministrativeStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse) HashMap(java.util.HashMap) GetAdministrativeStatusRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest) When(io.cucumber.java.en.When)

Example 2 with GetAdministrativeStatusAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse in project open-smart-grid-platform by OSGP.

the class AddDeviceSteps method aRequestToTheDeviceCanBePerformedAfterActivation.

@Then("^a request to the device can be performed after activation$")
public void aRequestToTheDeviceCanBePerformedAfterActivation() throws Throwable {
    final Device device = this.activateDevice();
    /*
     * Fire any request that causes communication to the device, and check
     * that the actual response is not an error.
     */
    final GetAdministrativeStatusRequest request = new GetAdministrativeStatusRequest();
    request.setDeviceIdentification(device.getDeviceIdentification());
    final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(request);
    final GetAdministrativeStatusAsyncRequest asyncRequest = new GetAdministrativeStatusAsyncRequest();
    asyncRequest.setCorrelationUid(getAdministrativeStatusAsyncResponse.getCorrelationUid());
    asyncRequest.setDeviceIdentification(device.getDeviceIdentification());
    final GetAdministrativeStatusResponse getAdministrativeStatusResponse = this.smartMeteringConfigurationClient.retrieveGetAdministrativeStatusResponse(asyncRequest);
    assertThat(getAdministrativeStatusResponse.getEnabled()).as("Administrative status should contain information if it is enabled").isNotNull();
}
Also used : GetAdministrativeStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse) Device(org.opensmartgridplatform.domain.core.entities.Device) DlmsDevice(org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice) GetAdministrativeStatusRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest) GetAdministrativeStatusAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncRequest) GetAdministrativeStatusResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusResponse) Then(io.cucumber.java.en.Then)

Example 3 with GetAdministrativeStatusAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse in project open-smart-grid-platform by OSGP.

the class SmartMeteringConfigurationEndpoint method getAdministrativeStatus.

@PayloadRoot(localPart = "GetAdministrativeStatusRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetAdministrativeStatusAsyncResponse getAdministrativeStatus(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetAdministrativeStatusRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_ADMINISTRATIVE_STATUS).withMessageType(MessageType.GET_ADMINISTRATIVE_STATUS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
    final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType.UNDEFINED);
    this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
    return this.configurationMapper.map(asyncResponse, GetAdministrativeStatusAsyncResponse.class);
}
Also used : 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 4 with GetAdministrativeStatusAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse in project open-smart-grid-platform by OSGP.

the class GetAdministrativeStatus method theRetrieveAdministrativeStatusRequestIsReceived.

@When("^the get administrative status request is received$")
public void theRetrieveAdministrativeStatusRequestIsReceived(final Map<String, String> requestData) throws Throwable {
    final GetAdministrativeStatusRequest getAdministrativeStatusRequest = GetAdministrativeStatusRequestFactory.fromParameterMap(requestData);
    final GetAdministrativeStatusAsyncResponse getAdministrativeStatusAsyncResponse = this.smartMeteringConfigurationClient.getAdministrativeStatus(getAdministrativeStatusRequest);
    LOGGER.info("Get administrative status asyncResponse is received {}", getAdministrativeStatusAsyncResponse);
    assertThat(getAdministrativeStatusAsyncResponse).as("Get administrative status asyncResponse should not be null").isNotNull();
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, getAdministrativeStatusAsyncResponse.getCorrelationUid());
}
Also used : GetAdministrativeStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse) GetAdministrativeStatusRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest) When(io.cucumber.java.en.When)

Aggregations

GetAdministrativeStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncResponse)4 GetAdministrativeStatusRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusRequest)3 When (io.cucumber.java.en.When)2 Then (io.cucumber.java.en.Then)1 HashMap (java.util.HashMap)1 DlmsDevice (org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice)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 GetAdministrativeStatusAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusAsyncRequest)1 GetAdministrativeStatusResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetAdministrativeStatusResponse)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 SetAdministrativeStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAdministrativeStatusAsyncResponse)1