use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.
the class GeneralTopologyObjectMapper method buildConfigurationInformation.
/**
* Build ConfigurationInformation
*
* @param configuration
* @param includeModelInformation
* @return
*/
public GenericResourceApiConfigurationinformationConfigurationInformation buildConfigurationInformation(Configuration configuration, boolean includeModelInformation) {
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = new GenericResourceApiConfigurationinformationConfigurationInformation();
configurationInformation.setConfigurationId(configuration.getConfigurationId());
configurationInformation.setConfigurationName(configuration.getConfigurationName());
configurationInformation.setConfigurationType(configuration.getConfigurationType());
if (includeModelInformation) {
GenericResourceApiOnapmodelinformationOnapModelInformation onapModelInformation = new GenericResourceApiOnapmodelinformationOnapModelInformation();
onapModelInformation.setModelInvariantUuid(configuration.getModelInfoConfiguration().getModelInvariantId());
onapModelInformation.setModelUuid(configuration.getModelInfoConfiguration().getModelVersionId());
onapModelInformation.setModelCustomizationUuid(configuration.getModelInfoConfiguration().getModelCustomizationId());
configurationInformation.setOnapModelInformation(onapModelInformation);
}
return configurationInformation;
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.
the class GeneralTopologyObjectMapperTest method buildConfigurationInformationTest_excludesOnapModelInfo.
@Test
public void buildConfigurationInformationTest_excludesOnapModelInfo() {
Configuration configuration = new Configuration();
configuration.setConfigurationId("testConfigurationId");
configuration.setConfigurationType("VNR");
configuration.setConfigurationName("VNRCONF");
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = genObjMapper.buildConfigurationInformation(configuration, false);
assertEquals(configuration.getConfigurationId(), configurationInformation.getConfigurationId());
assertEquals(configuration.getConfigurationType(), configurationInformation.getConfigurationType());
assertEquals(configuration.getConfigurationName(), configurationInformation.getConfigurationName());
assertNull(configurationInformation.getOnapModelInformation());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.
the class GeneralTopologyObjectMapperTest method buildConfigurationInformationTest_includesOnapModelInfo.
@Test
public void buildConfigurationInformationTest_includesOnapModelInfo() {
Configuration configuration = new Configuration();
configuration.setConfigurationId("testConfigurationId");
configuration.setConfigurationType("VNR");
configuration.setConfigurationName("VNRCONF");
ModelInfoConfiguration modelInfoConfiguration = new ModelInfoConfiguration();
modelInfoConfiguration.setModelVersionId("modelVersionId");
modelInfoConfiguration.setModelInvariantId("modelInvariantId");
modelInfoConfiguration.setModelCustomizationId("modelCustomizationId");
configuration.setModelInfoConfiguration(modelInfoConfiguration);
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = genObjMapper.buildConfigurationInformation(configuration, true);
assertEquals(configuration.getConfigurationId(), configurationInformation.getConfigurationId());
assertEquals(configuration.getConfigurationType(), configurationInformation.getConfigurationType());
assertEquals(configuration.getConfigurationName(), configurationInformation.getConfigurationName());
assertNotNull(configurationInformation.getOnapModelInformation());
assertEquals(configuration.getModelInfoConfiguration().getModelVersionId(), configurationInformation.getOnapModelInformation().getModelUuid());
assertEquals(configuration.getModelInfoConfiguration().getModelInvariantId(), configurationInformation.getOnapModelInformation().getModelInvariantUuid());
assertEquals(configuration.getModelInfoConfiguration().getModelCustomizationId(), configurationInformation.getOnapModelInformation().getModelCustomizationUuid());
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.
the class GCTopologyOperationRequestMapper method assignOrActivateVnrReqMapper.
public GenericResourceApiGcTopologyOperationInformation assignOrActivateVnrReqMapper(SDNCSvcAction svcAction, GenericResourceApiRequestActionEnumeration reqAction, ServiceInstance serviceInstance, RequestContext requestContext, Customer customer, Configuration vnrConfiguration, GenericVnf voiceVnf, String sdncReqId, URI callbackUri) {
String msoRequestId = UUID.randomUUID().toString();
if (requestContext != null && requestContext.getMsoRequestId() != null) {
msoRequestId = requestContext.getMsoRequestId();
}
GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUri.toString());
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, reqAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation = generalTopologyObjectMapper.buildServiceInformation(serviceInstance, requestContext, customer, false);
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = generalTopologyObjectMapper.buildConfigurationInformation(vnrConfiguration, true);
GenericResourceApiGcrequestinputGcRequestInput gcRequestInput = generalTopologyObjectMapper.buildGcRequestInformation(voiceVnf, null);
req.setRequestInformation(requestInformation);
req.setSdncRequestHeader(sdncRequestHeader);
req.setServiceInformation(serviceInformation);
req.setConfigurationInformation(configurationInformation);
req.setGcRequestInput(gcRequestInput);
return req;
}
use of org.onap.sdnc.northbound.client.model.GenericResourceApiConfigurationinformationConfigurationInformation in project so by onap.
the class GCTopologyOperationRequestMapper method deactivateOrUnassignVnrReqMapper.
public GenericResourceApiGcTopologyOperationInformation deactivateOrUnassignVnrReqMapper(SDNCSvcAction svcAction, ServiceInstance serviceInstance, RequestContext requestContext, Configuration vnrConfiguration, String sdncReqId, URI callbackUri) {
String msoRequestId = null;
if (requestContext != null) {
msoRequestId = requestContext.getMsoRequestId();
}
GenericResourceApiGcTopologyOperationInformation req = new GenericResourceApiGcTopologyOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader = generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUri.toString());
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, GenericResourceApiRequestActionEnumeration.DELETEGENERICCONFIGURATIONINSTANCE);
GenericResourceApiServiceinformationServiceInformation serviceInformation = new GenericResourceApiServiceinformationServiceInformation();
serviceInformation.setServiceInstanceId(serviceInstance.getServiceInstanceId());
GenericResourceApiConfigurationinformationConfigurationInformation configurationInformation = new GenericResourceApiConfigurationinformationConfigurationInformation();
configurationInformation.setConfigurationId(vnrConfiguration.getConfigurationId());
configurationInformation.setConfigurationType(vnrConfiguration.getConfigurationType());
req.setRequestInformation(requestInformation);
req.setSdncRequestHeader(sdncRequestHeader);
req.setServiceInformation(serviceInformation);
req.setConfigurationInformation(configurationInformation);
return req;
}
Aggregations