diff --git a/src/main/java/org/etsi/osl/metrico/mapper/AttachmentRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/AttachmentRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..19ac15bdde3831163f8a6833a3d66b941c63757e --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/AttachmentRefMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.common.model.AttachmentRef; +import org.etsi.osl.tmf.pm628.model.AttachmentRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface AttachmentRefMapper { + AttachmentRefMapper INSTANCE = Mappers.getMapper(AttachmentRefMapper.class); + + @Mapping(source = "id", target = "id") + @Mapping(source = "description", target = "description") + @Mapping(source = "url", target = "url") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + AttachmentRef toAttachmentRef(AttachmentRefMVO attachmentRefMVO); + + @Mapping(source = "id", target = "id") + @Mapping(source = "description", target = "description") + @Mapping(source = "url", target = "url") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + AttachmentRefMVO toAttachmentRefMVO(AttachmentRef attachmentRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..8aebd1e460cebb387b198531bfa110feea5e3035 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicMapper.java @@ -0,0 +1,30 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.Characteristic; +import org.etsi.osl.tmf.pm628.model.CharacteristicMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = {CharacteristicRelationshipMapper.class}) +public interface CharacteristicMapper { + CharacteristicMapper INSTANCE = Mappers.getMapper(CharacteristicMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "valueType", target = "valueType") + @Mapping(source = "characteristicRelationship", target = "characteristicRelationship") + Characteristic toCharacteristic(CharacteristicMVO characteristicMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "valueType", target = "valueType") + @Mapping(source = "characteristicRelationship", target = "characteristicRelationship") + CharacteristicMVO toCharacteristicMVO(Characteristic characteristic); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicRelationshipMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicRelationshipMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..00d87e52254b760e9bc54c65cf84798fc8cf296d --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/CharacteristicRelationshipMapper.java @@ -0,0 +1,26 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.CharacteristicRelationship; +import org.etsi.osl.tmf.pm628.model.CharacteristicRelationshipMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface CharacteristicRelationshipMapper { + CharacteristicRelationshipMapper INSTANCE = Mappers.getMapper(CharacteristicRelationshipMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "relationshipType", target = "relationshipType") + CharacteristicRelationship toCharacteristicRelationship(CharacteristicRelationshipMVO characteristicRelationshipMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "relationshipType", target = "relationshipType") + CharacteristicRelationshipMVO toCharacteristicRelationshipMVO(CharacteristicRelationship characteristicRelationship); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapItemMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapItemMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..b81f73a58db2caaa6fa3d92fdcc2ab4f963bc7d3 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapItemMapper.java @@ -0,0 +1,23 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.DataFilterMapItem; +import org.etsi.osl.tmf.pm628.model.DataFilterMapItemMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + DataFilterTemplateMapper.class, + DataFilterAttributeStringArrayMapper.class +}) +public interface DataFilterMapItemMapper { + DataFilterMapItemMapper INSTANCE = Mappers.getMapper(DataFilterMapItemMapper.class); + + @Mapping(source = "filterTemplate", target = "filterTemplate") + @Mapping(source = "stringArray", target = "stringArray") + DataFilterMapItem toDataFilterMapItem(DataFilterMapItemMVO dataFilterMapItemMVO); + + @Mapping(source = "filterTemplate", target = "filterTemplate") + @Mapping(source = "stringArray", target = "stringArray") + DataFilterMapItemMVO toDataFilterMapItemMVO(DataFilterMapItem dataFilterMapItem); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..a61597f5734fdd99c0dfac7fbfc724afe77b670f --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterMapMapper.java @@ -0,0 +1,26 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.DataFilterMap; +import org.etsi.osl.tmf.pm628.model.DataFilterMapMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + DataFilterMapItemMapper.class +}) +public interface DataFilterMapMapper { + DataFilterMapMapper INSTANCE = Mappers.getMapper(DataFilterMapMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "mappings", target = "mappings") + DataFilterMap toDataFilterMap(DataFilterMapMVO dataFilterMapMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "mappings", target = "mappings") + DataFilterMapMVO toDataFilterMapMVO(DataFilterMap dataFilterMap); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/DataFilterTemplateMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterTemplateMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..64c4f110dfd4703f65a71027844c3aaba60502ea --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/DataFilterTemplateMapper.java @@ -0,0 +1,30 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.DataFilterTemplate; +import org.etsi.osl.tmf.pm628.model.DataFilterTemplateMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface DataFilterTemplateMapper { + DataFilterTemplateMapper INSTANCE = Mappers.getMapper(DataFilterTemplateMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "id", target = "id") + @Mapping(source = "href", target = "href") + @Mapping(source = "name", target = "name") + @Mapping(source = "description", target = "description") + DataFilterTemplate toDataFilterTemplate(DataFilterTemplateMVO dataFilterTemplateMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "id", target = "id") + @Mapping(source = "href", target = "href") + @Mapping(source = "name", target = "name") + @Mapping(source = "description", target = "description") + DataFilterTemplateMVO toDataFilterTemplateMVO(DataFilterTemplate dataFilterTemplate); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/DayOfMonthRecurrenceMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/DayOfMonthRecurrenceMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..62836b015fc418e2f0530d81898212830fc997dc --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/DayOfMonthRecurrenceMapper.java @@ -0,0 +1,24 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.DayOfMonthRecurrence; +import org.etsi.osl.tmf.pm628.model.DayOfMonthRecurrenceMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface DayOfMonthRecurrenceMapper { + DayOfMonthRecurrenceMapper INSTANCE = Mappers.getMapper(DayOfMonthRecurrenceMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dates", target = "dates") + DayOfMonthRecurrence toDayOfMonthRecurrence(DayOfMonthRecurrenceMVO dayOfMonthRecurrenceMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dates", target = "dates") + DayOfMonthRecurrenceMVO toDayOfMonthRecurrenceMVO(DayOfMonthRecurrence dayOfMonthRecurrence); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/DayOfWeekRecurrenceMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/DayOfWeekRecurrenceMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..a4b857d59ddb3d26f8cce251977cc89eb59f94d9 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/DayOfWeekRecurrenceMapper.java @@ -0,0 +1,24 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.DayOfWeekRecurrence; +import org.etsi.osl.tmf.pm628.model.DayOfWeekRecurrenceMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface DayOfWeekRecurrenceMapper { + DayOfWeekRecurrenceMapper INSTANCE = Mappers.getMapper(DayOfWeekRecurrenceMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dates", target = "dates") + DayOfWeekRecurrence toDayOfWeekRecurrence(DayOfWeekRecurrenceMVO dayOfWeekRecurrenceMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dates", target = "dates") + DayOfWeekRecurrenceMVO toDayOfWeekRecurrenceMVO(DayOfWeekRecurrence dayOfWeekRecurrence); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ExternalIdentifierMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ExternalIdentifierMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0e825648d205cfe94d3cb5b264c3dd1a7fa44ad1 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ExternalIdentifierMapper.java @@ -0,0 +1,28 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.ExternalIdentifier; +import org.etsi.osl.tmf.pm628.model.ExternalIdentifierMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface ExternalIdentifierMapper { + ExternalIdentifierMapper INSTANCE = Mappers.getMapper(ExternalIdentifierMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "owner", target = "owner") + @Mapping(source = "externalIdentifierType", target = "externalIdentifierType") + @Mapping(source = "id", target = "id") + ExternalIdentifier toExternalIdentifier(ExternalIdentifierMVO externalIdentifierMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "owner", target = "owner") + @Mapping(source = "externalIdentifierType", target = "externalIdentifierType") + @Mapping(source = "id", target = "id") + ExternalIdentifierMVO toExternalIdentifierMVO(ExternalIdentifier externalIdentifier); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/FeatureMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/FeatureMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..fff7bcdb75fe934e833ff719c4bdaa092e393466 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/FeatureMapper.java @@ -0,0 +1,34 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.Feature; +import org.etsi.osl.tmf.pm628.model.FeatureMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface FeatureMapper { + FeatureMapper INSTANCE = Mappers.getMapper(FeatureMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "name", target = "name") + @Mapping(source = "isBundle", target = "isBundle") + @Mapping(source = "featureRelationship", target = "featureRelationship") + @Mapping(source = "featureCharacteristic", target = "featureCharacteristic") + @Mapping(source = "policyConstraint", target = "policyConstraint") + @Mapping(source = "isEnabled", target = "isEnabled") + Feature toFeature(FeatureMVO featureMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "name", target = "name") + @Mapping(source = "isBundle", target = "isBundle") + @Mapping(source = "featureRelationship", target = "featureRelationship") + @Mapping(source = "featureCharacteristic", target = "featureCharacteristic") + @Mapping(source = "policyConstraint", target = "policyConstraint") + @Mapping(source = "isEnabled", target = "isEnabled") + FeatureMVO toFeatureMVO(Feature feature); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/FileTransferDataMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/FileTransferDataMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..33f90d79b712cc7cd2c0394163d31c7b5aa300a0 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/FileTransferDataMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.FileTransferData; +import org.etsi.osl.tmf.pm628.model.FileTransferDataMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface FileTransferDataMapper { + FileTransferDataMapper INSTANCE = Mappers.getMapper(FileTransferDataMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "fileLocation", target = "fileLocation") + @Mapping(source = "fileFormat", target = "fileFormat") + @Mapping(source = "compressionType", target = "compressionType") + @Mapping(source = "retentionPeriod", target = "retentionPeriod") + @Mapping(source = "packingType", target = "packingType") + FileTransferDataMVO toFileTransferDataMVO(FileTransferData fileTransferData); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "fileLocation", target = "fileLocation") + @Mapping(source = "fileFormat", target = "fileFormat") + @Mapping(source = "compressionType", target = "compressionType") + @Mapping(source = "retentionPeriod", target = "retentionPeriod") + @Mapping(source = "packingType", target = "packingType") + FileTransferData toFileTransferData(FileTransferDataMVO fileTransferDataMVO); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/IntentRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/IntentRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..f631d622522ed4fff54a8e4a3bf391592595a9a8 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/IntentRefMapper.java @@ -0,0 +1,30 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.IntentRef; +import org.etsi.osl.tmf.pm628.model.IntentRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface IntentRefMapper { + IntentRefMapper INSTANCE = Mappers.getMapper(IntentRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "id", target = "id") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + IntentRef toIntentRef(IntentRefMVO intentRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "id", target = "id") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + IntentRefMVO toIntentRefMVO(IntentRef intentRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/LogicalResourceMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/LogicalResourceMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..181ecc2e6b9fbfb38a16231ec7f5ef61e9a2f8f0 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/LogicalResourceMapper.java @@ -0,0 +1,18 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.LogicalResource; +import org.etsi.osl.tmf.pm628.model.LogicalResourceMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = ResourceMapper.class) +public interface LogicalResourceMapper { + LogicalResourceMapper INSTANCE = Mappers.getMapper(LogicalResourceMapper.class); + + @Mapping(source = "value", target = "value") + LogicalResource toLogicalResource(LogicalResourceMVO logicalResourceMVO); + + @Mapping(source = "value", target = "value") + LogicalResourceMVO toLogicalResourceMVO(LogicalResource logicalResource); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ManagementJobMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ManagementJobMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..c0ba58e3c843cf86c8504181061ff6531a012b5f --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ManagementJobMapper.java @@ -0,0 +1,36 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.ManagementJob; +import org.etsi.osl.tmf.pm628.model.ManagementJobMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + FileTransferDataMapper.class, + DataAccessEndpointMapper.class, + ScheduleDefinitionMapper.class +}) +public interface ManagementJobMapper { + ManagementJobMapper INSTANCE = Mappers.getMapper(ManagementJobMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "fileTransferData", target = "fileTransferData") + @Mapping(source = "dataAccessEndpoint", target = "dataAccessEndpoint") + @Mapping(source = "scheduleDefinition", target = "scheduleDefinition") + ManagementJob toManagementJob(ManagementJobMVO managementJobMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "fileTransferData", target = "fileTransferData") + @Mapping(source = "dataAccessEndpoint", target = "dataAccessEndpoint") + @Mapping(source = "scheduleDefinition", target = "scheduleDefinition") + ManagementJobMVO toManagementJobMVO(ManagementJob managementJob); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/MeasurementCollectionJobMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/MeasurementCollectionJobMapper.java index 35489e6aa5f80542b2538e759d63743f8e86f435..5238a66dfab581253df29ade7c5c8e73521dc185 100644 --- a/src/main/java/org/etsi/osl/metrico/mapper/MeasurementCollectionJobMapper.java +++ b/src/main/java/org/etsi/osl/metrico/mapper/MeasurementCollectionJobMapper.java @@ -6,50 +6,39 @@ import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers; -@Mapper +@Mapper(uses = { + DataFilterMapMapper.class, + PerformanceIndicatorGroupSpecificationMapper.class, + PerformanceIndicatorSpecificationRefOrValueMapper.class, + TrackingRecordMapper.class, + FileTransferDataMapper.class, + DataAccessEndpointMapper.class, + ScheduleDefinitionMapper.class +}) public interface MeasurementCollectionJobMapper { - MeasurementCollectionJobMapper INSTANCE = Mappers.getMapper(MeasurementCollectionJobMapper.class); - @Mapping(source = "outputFormat", target = "outputFormat") @Mapping(source = "reportingPeriod", target = "reportingPeriod") @Mapping(source = "jobCollectionFilter", target = "jobCollectionFilter") @Mapping(source = "searchTaskFilter", target = "searchTaskFilter") @Mapping(source = "jobOnDemand", target = "jobOnDemand") - @Mapping(source = "consumingApplicationId", target = "consumingApplicationId") - @Mapping(source = "producingApplicationId", target = "producingApplicationId") - @Mapping(source = "granularity", target = "granularity") @Mapping(source = "performanceIndicatorGroupSpecification", target = "performanceIndicatorGroupSpecification") @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") @Mapping(source = "trackingRecord", target = "trackingRecord") @Mapping(source = "fileTransferData", target = "fileTransferData") @Mapping(source = "dataAccessEndpoint", target = "dataAccessEndpoint") @Mapping(source = "scheduleDefinition", target = "scheduleDefinition") - @Mapping(source = "type", target = "type") - @Mapping(source = "baseType", target = "baseType") - @Mapping(source = "schemaLocation", target = "schemaLocation") - @Mapping(source = "href", target = "href") - @Mapping(source = "uuid", target = "uuid") - MeasurementCollectionJobMVO toMeasurementCollectionJobMVO(MeasurementCollectionJob job); + MeasurementCollectionJob toMeasurementCollectionJob(MeasurementCollectionJobMVO measurementCollectionJobMVO); - @Mapping(source = "outputFormat", target = "outputFormat") @Mapping(source = "reportingPeriod", target = "reportingPeriod") @Mapping(source = "jobCollectionFilter", target = "jobCollectionFilter") @Mapping(source = "searchTaskFilter", target = "searchTaskFilter") @Mapping(source = "jobOnDemand", target = "jobOnDemand") - @Mapping(source = "consumingApplicationId", target = "consumingApplicationId") - @Mapping(source = "producingApplicationId", target = "producingApplicationId") - @Mapping(source = "granularity", target = "granularity") @Mapping(source = "performanceIndicatorGroupSpecification", target = "performanceIndicatorGroupSpecification") @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") @Mapping(source = "trackingRecord", target = "trackingRecord") @Mapping(source = "fileTransferData", target = "fileTransferData") @Mapping(source = "dataAccessEndpoint", target = "dataAccessEndpoint") @Mapping(source = "scheduleDefinition", target = "scheduleDefinition") - @Mapping(source = "type", target = "type") - @Mapping(source = "baseType", target = "baseType") - @Mapping(source = "schemaLocation", target = "schemaLocation") - @Mapping(source = "href", target = "href") - @Mapping(source = "uuid", target = "uuid") - MeasurementCollectionJob toMeasurementCollectionJob(MeasurementCollectionJobMVO jobMVO); + MeasurementCollectionJobMVO toMeasurementCollectionJobMVO(MeasurementCollectionJob measurementCollectionJob); } \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/MeasurementJobMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/MeasurementJobMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..8d6ed6d876e147b29c127ccc2d8e44ec9282e688 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/MeasurementJobMapper.java @@ -0,0 +1,35 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.MeasurementJob; +import org.etsi.osl.tmf.pm628.model.MeasurementJobMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + FileTransferDataMapper.class, + DataAccessEndpointMapper.class, + ScheduleDefinitionMapper.class, + PerformanceIndicatorGroupSpecificationMapper.class, + PerformanceIndicatorSpecificationRefOrValueMapper.class, + TrackingRecordMapper.class +}) +public interface MeasurementJobMapper { + MeasurementJobMapper INSTANCE = Mappers.getMapper(MeasurementJobMapper.class); + + @Mapping(source = "consumingApplicationId", target = "consumingApplicationId") + @Mapping(source = "producingApplicationId", target = "producingApplicationId") + @Mapping(source = "granularity", target = "granularity") + @Mapping(source = "performanceIndicatorGroupSpecification", target = "performanceIndicatorGroupSpecification") + @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") + @Mapping(source = "trackingRecord", target = "trackingRecord") + MeasurementJob toMeasurementJob(MeasurementJobMVO measurementJobMVO); + + @Mapping(source = "consumingApplicationId", target = "consumingApplicationId") + @Mapping(source = "producingApplicationId", target = "producingApplicationId") + @Mapping(source = "granularity", target = "granularity") + @Mapping(source = "performanceIndicatorGroupSpecification", target = "performanceIndicatorGroupSpecification") + @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") + @Mapping(source = "trackingRecord", target = "trackingRecord") + MeasurementJobMVO toMeasurementJobMVO(MeasurementJob measurementJob); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/MonthlyScheduleDayOfWeekDefinitionMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/MonthlyScheduleDayOfWeekDefinitionMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..e1dbf960da723c4bd8f4e09fb4db6cd29f5eb07c --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/MonthlyScheduleDayOfWeekDefinitionMapper.java @@ -0,0 +1,28 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.MonthlyScheduleDayOfWeekDefinition; +import org.etsi.osl.tmf.pm628.model.MonthlyScheduleDayOfWeekDefinitionMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + DayOfMonthRecurrenceMapper.class +}) +public interface MonthlyScheduleDayOfWeekDefinitionMapper { + MonthlyScheduleDayOfWeekDefinitionMapper INSTANCE = Mappers.getMapper(MonthlyScheduleDayOfWeekDefinitionMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dayOfMonthRecurrence", target = "dayOfMonthRecurrence") + @Mapping(source = "recurringDaySequence", target = "recurringDaySequence") + MonthlyScheduleDayOfWeekDefinition toMonthlyScheduleDayOfWeekDefinition(MonthlyScheduleDayOfWeekDefinitionMVO monthlyScheduleDayOfWeekDefinitionMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "dayOfMonthRecurrence", target = "dayOfMonthRecurrence") + @Mapping(source = "recurringDaySequence", target = "recurringDaySequence") + MonthlyScheduleDayOfWeekDefinitionMVO toMonthlyScheduleDayOfWeekDefinitionMVO(MonthlyScheduleDayOfWeekDefinition monthlyScheduleDayOfWeekDefinition); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/NoteMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/NoteMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..6f25a3788b754ecb22c1dd29396f2f6329549c79 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/NoteMapper.java @@ -0,0 +1,24 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.common.model.service.Note; +import org.etsi.osl.tmf.pm628.model.NoteMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface NoteMapper { + NoteMapper INSTANCE = Mappers.getMapper(NoteMapper.class); + + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "author", target = "author") + @Mapping(source = "date", target = "date") + @Mapping(source = "text", target = "text") + Note toNote(NoteMVO noteMVO); + + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "author", target = "author") + @Mapping(source = "date", target = "date") + @Mapping(source = "text", target = "text") + NoteMVO toNoteMVO(Note note); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorGroupSpecificationMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorGroupSpecificationMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..1af6d2eddebd60685f70f13d30afe4480180bdcd --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorGroupSpecificationMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorGroupSpecification; +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorGroupSpecificationMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + PerformanceIndicatorSpecificationRefOrValueMapper.class +}) +public interface PerformanceIndicatorGroupSpecificationMapper { + PerformanceIndicatorGroupSpecificationMapper INSTANCE = Mappers.getMapper(PerformanceIndicatorGroupSpecificationMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "groupCategory", target = "groupCategory") + @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") + PerformanceIndicatorGroupSpecification toPerformanceIndicatorGroupSpecification(PerformanceIndicatorGroupSpecificationMVO performanceIndicatorGroupSpecificationMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "groupCategory", target = "groupCategory") + @Mapping(source = "performanceIndicatorSpecification", target = "performanceIndicatorSpecification") + PerformanceIndicatorGroupSpecificationMVO toPerformanceIndicatorGroupSpecificationMVO(PerformanceIndicatorGroupSpecification performanceIndicatorGroupSpecification); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecRelationshipMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecRelationshipMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..cefb15ae575f42cde28e6eaed2da63147fcbe493 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecRelationshipMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecRelationship; +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecRelationshipMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface PerformanceIndicatorSpecRelationshipMapper { + PerformanceIndicatorSpecRelationshipMapper INSTANCE = Mappers.getMapper(PerformanceIndicatorSpecRelationshipMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "relationshipType", target = "relationshipType") + @Mapping(source = "role", target = "role") + @Mapping(source = "validFor", target = "validFor") + PerformanceIndicatorSpecRelationship toPerformanceIndicatorSpecRelationship(PerformanceIndicatorSpecRelationshipMVO performanceIndicatorSpecRelationshipMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "relationshipType", target = "relationshipType") + @Mapping(source = "role", target = "role") + @Mapping(source = "validFor", target = "validFor") + PerformanceIndicatorSpecRelationshipMVO toPerformanceIndicatorSpecRelationshipMVO(PerformanceIndicatorSpecRelationship performanceIndicatorSpecRelationship); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..f58269c99e213df365f263d64e6ba6bca19d1897 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationMapper.java @@ -0,0 +1,50 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecification; +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecificationMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + PerformanceIndicatorSpecRelationshipMapper.class, +}) +public interface PerformanceIndicatorSpecificationMapper { + PerformanceIndicatorSpecificationMapper INSTANCE = Mappers.getMapper(PerformanceIndicatorSpecificationMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "description", target = "description") + @Mapping(source = "perspective", target = "perspective") + @Mapping(source = "indicatorCategory", target = "indicatorCategory") + @Mapping(source = "indicatorType", target = "indicatorType") + @Mapping(source = "derivationAlgorithm", target = "derivationAlgorithm") + @Mapping(source = "derivationMethod", target = "derivationMethod") + @Mapping(source = "validFor", target = "validFor") + @Mapping(source = "collectionType", target = "collectionType") + @Mapping(source = "indicatorUnit", target = "indicatorUnit") + @Mapping(source = "performanceIndicatorSpecRelationship", target = "performanceIndicatorSpecRelationship") + PerformanceIndicatorSpecification toPerformanceIndicatorSpecification(PerformanceIndicatorSpecificationMVO performanceIndicatorSpecificationMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "description", target = "description") + @Mapping(source = "perspective", target = "perspective") + @Mapping(source = "indicatorCategory", target = "indicatorCategory") + @Mapping(source = "indicatorType", target = "indicatorType") + @Mapping(source = "derivationAlgorithm", target = "derivationAlgorithm") + @Mapping(source = "derivationMethod", target = "derivationMethod") + @Mapping(source = "validFor", target = "validFor") + @Mapping(source = "collectionType", target = "collectionType") + @Mapping(source = "indicatorUnit", target = "indicatorUnit") + @Mapping(source = "performanceIndicatorSpecRelationship", target = "performanceIndicatorSpecRelationship") + PerformanceIndicatorSpecificationMVO toPerformanceIndicatorSpecificationMVO(PerformanceIndicatorSpecification performanceIndicatorSpecification); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0e56edb6c9cc36c3c937ef525b64ffd9cd28c7d1 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecificationRef; +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecificationRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface PerformanceIndicatorSpecificationRefMapper { + PerformanceIndicatorSpecificationRefMapper INSTANCE = Mappers.getMapper(PerformanceIndicatorSpecificationRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + PerformanceIndicatorSpecificationRef toPerformanceIndicatorSpecificationRef(PerformanceIndicatorSpecificationRefMVO performanceIndicatorSpecificationRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + PerformanceIndicatorSpecificationRefMVO toPerformanceIndicatorSpecificationRefMVO(PerformanceIndicatorSpecificationRef performanceIndicatorSpecificationRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefOrValueMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefOrValueMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..b78ed7c1f637dbcef828c2c2052a0a5778207a6b --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PerformanceIndicatorSpecificationRefOrValueMapper.java @@ -0,0 +1,22 @@ +package org.etsi.osl.metrico.mapper; + + +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecificationRefOrValue; +import org.etsi.osl.tmf.pm628.model.PerformanceIndicatorSpecificationRefOrValueMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + PerformanceIndicatorSpecificationMapper.class, + PerformanceIndicatorSpecificationRefMapper.class +}) +public interface PerformanceIndicatorSpecificationRefOrValueMapper { + PerformanceIndicatorSpecificationRefOrValueMapper INSTANCE = Mappers.getMapper(PerformanceIndicatorSpecificationRefOrValueMapper.class); + + @Mapping(source = "type", target = "type") + PerformanceIndicatorSpecificationRefOrValue toPerformanceIndicatorSpecificationRefOrValue(PerformanceIndicatorSpecificationRefOrValueMVO performanceIndicatorSpecificationRefOrValueMVO); + + @Mapping(source = "type", target = "type") + PerformanceIndicatorSpecificationRefOrValueMVO toPerformanceIndicatorSpecificationRefOrValueMVO(PerformanceIndicatorSpecificationRefOrValue performanceIndicatorSpecificationRefOrValue); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/PolicyRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/PolicyRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..851e0b43c93ba98e46dd57137bda9b7392b01ad9 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/PolicyRefMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.PolicyRef; +import org.etsi.osl.tmf.pm628.model.PolicyRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface PolicyRefMapper { + PolicyRefMapper INSTANCE = Mappers.getMapper(PolicyRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + PolicyRef toPolicyRef(PolicyRefMVO policyRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + PolicyRefMVO toPolicyRefMVO(PolicyRef policyRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/RelatedPartyRefOrPartyRoleRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/RelatedPartyRefOrPartyRoleRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..bc6f59a94ff472a49b7f5ea4193d6aae1e2b25ce --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/RelatedPartyRefOrPartyRoleRefMapper.java @@ -0,0 +1,26 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.RelatedPartyRefOrPartyRoleRef; +import org.etsi.osl.tmf.pm628.model.RelatedPartyRefOrPartyRoleRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface RelatedPartyRefOrPartyRoleRefMapper { + RelatedPartyRefOrPartyRoleRefMapper INSTANCE = Mappers.getMapper(RelatedPartyRefOrPartyRoleRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "role", target = "role") + @Mapping(source = "partyOrPartyRole", target = "partyOrPartyRole") + RelatedPartyRefOrPartyRoleRef toRelatedPartyRefOrPartyRoleRef(RelatedPartyRefOrPartyRoleRefMVO relatedPartyRefOrPartyRoleRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "role", target = "role") + @Mapping(source = "partyOrPartyRole", target = "partyOrPartyRole") + RelatedPartyRefOrPartyRoleRefMVO toRelatedPartyRefOrPartyRoleRefMVO(RelatedPartyRefOrPartyRoleRef relatedPartyRefOrPartyRoleRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/RelatedPlaceRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/RelatedPlaceRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..9d60c1ae9175bc5e20edbdb6d0ebdf4a99fadae5 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/RelatedPlaceRefMapper.java @@ -0,0 +1,26 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.RelatedPlaceRef; +import org.etsi.osl.tmf.pm628.model.RelatedPlaceRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface RelatedPlaceRefMapper { + RelatedPlaceRefMapper INSTANCE = Mappers.getMapper(RelatedPlaceRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "role", target = "role") + @Mapping(source = "place", target = "place") + RelatedPlaceRef toRelatedPlaceRef(RelatedPlaceRefMVO relatedPlaceRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "role", target = "role") + @Mapping(source = "place", target = "place") + RelatedPlaceRefMVO toRelatedPlaceRefMVO(RelatedPlaceRef relatedPlaceRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/RelatedResourceOrderItemMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/RelatedResourceOrderItemMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..60c1ad80087c919f687d9951e756a372f812d9e0 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/RelatedResourceOrderItemMapper.java @@ -0,0 +1,34 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.RelatedResourceOrderItem; +import org.etsi.osl.tmf.pm628.model.RelatedResourceOrderItemMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface RelatedResourceOrderItemMapper { + RelatedResourceOrderItemMapper INSTANCE = Mappers.getMapper(RelatedResourceOrderItemMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "resourceOrderHref", target = "resourceOrderHref") + @Mapping(source = "resourceOrderId", target = "resourceOrderId") + @Mapping(source = "itemAction", target = "itemAction") + @Mapping(source = "itemId", target = "itemId") + @Mapping(source = "role", target = "role") + RelatedResourceOrderItem toRelatedResourceOrderItem(RelatedResourceOrderItemMVO relatedResourceOrderItemMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "resourceOrderHref", target = "resourceOrderHref") + @Mapping(source = "resourceOrderId", target = "resourceOrderId") + @Mapping(source = "itemAction", target = "itemAction") + @Mapping(source = "itemId", target = "itemId") + @Mapping(source = "role", target = "role") + RelatedResourceOrderItemMVO toRelatedResourceOrderItemMVO(RelatedResourceOrderItem relatedResourceOrderItem); +} diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ResourceMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ResourceMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..18a5b4290ae2690a0bdbe6f6cada3d91c7e98900 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ResourceMapper.java @@ -0,0 +1,82 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.Resource; +import org.etsi.osl.tmf.pm628.model.ResourceMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + NoteMapper.class, + RelatedResourceOrderItemMapper.class, + RelatedPlaceRefMapper.class, + RelatedPartyRefOrPartyRoleRefMapper.class, + ResourceRelationshipMapper.class, + CharacteristicMapper.class, + AttachmentRefMapper.class, + ResourceSpecificationRefMapper.class, + FeatureMapper.class, + IntentRefMapper.class, + ExternalIdentifierMapper.class +}) +public interface ResourceMapper { + ResourceMapper INSTANCE = Mappers.getMapper(ResourceMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "category", target = "category") + @Mapping(source = "description", target = "description") + @Mapping(source = "name", target = "name") + @Mapping(source = "endOperatingDate", target = "endOperatingDate") + @Mapping(source = "administrativeState", target = "administrativeState") + @Mapping(source = "operationalState", target = "operationalState") + @Mapping(source = "resourceStatus", target = "resourceStatus") + @Mapping(source = "usageState", target = "usageState") + @Mapping(source = "validFor", target = "validFor") + @Mapping(source = "note", target = "note") + @Mapping(source = "resourceOrderItem", target = "resourceOrderItem") + @Mapping(source = "place", target = "place") + @Mapping(source = "relatedParty", target = "relatedParty") + @Mapping(source = "resourceRelationship", target = "resourceRelationship") + @Mapping(source = "resourceCharacteristic", target = "resourceCharacteristic") + @Mapping(source = "attachment", target = "attachment") + @Mapping(source = "resourceSpecification", target = "resourceSpecification") + @Mapping(source = "startOperatingDate", target = "startOperatingDate") + @Mapping(source = "resourceVersion", target = "resourceVersion") + @Mapping(source = "activationFeature", target = "activationFeature") + @Mapping(source = "intent", target = "intent") + @Mapping(source = "externalIdentifier", target = "externalIdentifier") + Resource toResource(ResourceMVO resourceMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "category", target = "category") + @Mapping(source = "description", target = "description") + @Mapping(source = "name", target = "name") + @Mapping(source = "endOperatingDate", target = "endOperatingDate") + @Mapping(source = "administrativeState", target = "administrativeState") + @Mapping(source = "operationalState", target = "operationalState") + @Mapping(source = "resourceStatus", target = "resourceStatus") + @Mapping(source = "usageState", target = "usageState") + @Mapping(source = "validFor", target = "validFor") + @Mapping(source = "note", target = "note") + @Mapping(source = "resourceOrderItem", target = "resourceOrderItem") + @Mapping(source = "place", target = "place") + @Mapping(source = "relatedParty", target = "relatedParty") + @Mapping(source = "resourceRelationship", target = "resourceRelationship") + @Mapping(source = "resourceCharacteristic", target = "resourceCharacteristic") + @Mapping(source = "attachment", target = "attachment") + @Mapping(source = "resourceSpecification", target = "resourceSpecification") + @Mapping(source = "startOperatingDate", target = "startOperatingDate") + @Mapping(source = "resourceVersion", target = "resourceVersion") + @Mapping(source = "activationFeature", target = "activationFeature") + @Mapping(source = "intent", target = "intent") + @Mapping(source = "externalIdentifier", target = "externalIdentifier") + ResourceMVO toResourceMVO(Resource resource); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ResourceRefOrValueMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ResourceRefOrValueMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..2fae4c84907986a03cb3f9c53027fc6dc7b9345f --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ResourceRefOrValueMapper.java @@ -0,0 +1,18 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.ResourceRefOrValue; +import org.etsi.osl.tmf.pm628.model.ResourceRefOrValueMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface ResourceRefOrValueMapper { + ResourceRefOrValueMapper INSTANCE = Mappers.getMapper(ResourceRefOrValueMapper.class); + + @Mapping(source = "type", target = "type") + ResourceRefOrValueMVO toResourceRefOrValueMVO(ResourceRefOrValue resourceRefOrValue); + + @Mapping(source = "type", target = "type") + ResourceRefOrValue toResourceRefOrValue(ResourceRefOrValueMVO resourceRefOrValueMVO); +} diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ResourceRelationshipMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ResourceRelationshipMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..f91ba647bc066da1db065c0bd6ce6e6b18f9d271 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ResourceRelationshipMapper.java @@ -0,0 +1,30 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.ResourceRelationship; +import org.etsi.osl.tmf.pm628.model.ResourceRelationshipMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface ResourceRelationshipMapper { + ResourceRelationshipMapper INSTANCE = Mappers.getMapper(ResourceRelationshipMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "resourceRelationshipCharacteristic", target = "resourceRelationshipCharacteristic") + @Mapping(source = "resource", target = "resource") + @Mapping(source = "relationshipType", target = "relationshipType") + ResourceRelationship toResourceRelationship(ResourceRelationshipMVO resourceRelationshipMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "uuid", target = "uuid") + @Mapping(source = "resourceRelationshipCharacteristic", target = "resourceRelationshipCharacteristic") + @Mapping(source = "resource", target = "resource") + @Mapping(source = "relationshipType", target = "relationshipType") + ResourceRelationshipMVO toResourceRelationshipMVO(ResourceRelationship resourceRelationship); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ResourceSpecificationRefMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ResourceSpecificationRefMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..9041cab49b41f33f603ee31a3758769c5e07caf1 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ResourceSpecificationRefMapper.java @@ -0,0 +1,32 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef; +import org.etsi.osl.tmf.pm628.model.ResourceSpecificationRefMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface ResourceSpecificationRefMapper { + ResourceSpecificationRefMapper INSTANCE = Mappers.getMapper(ResourceSpecificationRefMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "id", target = "id") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + ResourceSpecificationRef toResourceSpecificationRef(ResourceSpecificationRefMVO resourceSpecificationRefMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "href", target = "href") + @Mapping(source = "id", target = "id") + @Mapping(source = "name", target = "name") + @Mapping(source = "referredType", target = "referredType") + @Mapping(source = "version", target = "version") + ResourceSpecificationRefMVO toResourceSpecificationRefMVO(ResourceSpecificationRef resourceSpecificationRef); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/ScheduleDefinitionMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/ScheduleDefinitionMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..8d62b206256e32bf66a472825ce03be0980431f9 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/ScheduleDefinitionMapper.java @@ -0,0 +1,37 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.ScheduleDefinition; +import org.etsi.osl.tmf.pm628.model.ScheduleDefinitionMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + DayOfWeekRecurrenceMapper.class, + MonthlyScheduleDayOfWeekDefinitionMapper.class +}) +public interface ScheduleDefinitionMapper { + ScheduleDefinitionMapper INSTANCE = Mappers.getMapper(ScheduleDefinitionMapper.class); + + @Mapping(source = "scheduleDefinitionStartTime", target = "scheduleDefinitionStartTime") + @Mapping(source = "scheduleDefinitionEndTime", target = "scheduleDefinitionEndTime") + @Mapping(source = "recurringFrequency", target = "recurringFrequency") + @Mapping(source = "excludedDate", target = "excludedDate") + @Mapping(source = "scheduleDefinitionHourRange", target = "scheduleDefinitionHourRange") + @Mapping(source = "weeklyScheduledDefinition", target = "weeklyScheduledDefinition") + @Mapping(source = "monthlyScheduleDayOfMonthDefinition", target = "monthlyScheduleDayOfMonthDefinition") + @Mapping(source = "monthlyScheduleDayOfWeekDefinition", target = "monthlyScheduleDayOfWeekDefinition") + @Mapping(source = "dateScheduleDefintion", target = "dateScheduleDefintion") + ScheduleDefinition toScheduleDefinition(ScheduleDefinitionMVO scheduleDefinitionMVO); + + @Mapping(source = "scheduleDefinitionStartTime", target = "scheduleDefinitionStartTime") + @Mapping(source = "scheduleDefinitionEndTime", target = "scheduleDefinitionEndTime") + @Mapping(source = "recurringFrequency", target = "recurringFrequency") + @Mapping(source = "excludedDate", target = "excludedDate") + @Mapping(source = "scheduleDefinitionHourRange", target = "scheduleDefinitionHourRange") + @Mapping(source = "weeklyScheduledDefinition", target = "weeklyScheduledDefinition") + @Mapping(source = "monthlyScheduleDayOfMonthDefinition", target = "monthlyScheduleDayOfMonthDefinition") + @Mapping(source = "monthlyScheduleDayOfWeekDefinition", target = "monthlyScheduleDayOfWeekDefinition") + @Mapping(source = "dateScheduleDefintion", target = "dateScheduleDefintion") + ScheduleDefinitionMVO toScheduleDefinitionMVO(ScheduleDefinition scheduleDefinition); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/mapper/TrackingRecordMapper.java b/src/main/java/org/etsi/osl/metrico/mapper/TrackingRecordMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..fceb1057193f93ebf5c436cc71e98db3aa13fe62 --- /dev/null +++ b/src/main/java/org/etsi/osl/metrico/mapper/TrackingRecordMapper.java @@ -0,0 +1,36 @@ +package org.etsi.osl.metrico.mapper; + +import org.etsi.osl.tmf.pm628.model.TrackingRecord; +import org.etsi.osl.tmf.pm628.model.TrackingRecordMVO; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.factory.Mappers; + +@Mapper(uses = { + CharacteristicMapper.class +}) +public interface TrackingRecordMapper { + TrackingRecordMapper INSTANCE = Mappers.getMapper(TrackingRecordMapper.class); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "description", target = "description") + @Mapping(source = "characteristic", target = "characteristic") + @Mapping(source = "systemId", target = "systemId") + @Mapping(source = "time", target = "time") + @Mapping(source = "user", target = "user") + @Mapping(source = "uuid", target = "uuid") + TrackingRecord toTrackingRecord(TrackingRecordMVO trackingRecordMVO); + + @Mapping(source = "type", target = "type") + @Mapping(source = "baseType", target = "baseType") + @Mapping(source = "schemaLocation", target = "schemaLocation") + @Mapping(source = "description", target = "description") + @Mapping(source = "characteristic", target = "characteristic") + @Mapping(source = "systemId", target = "systemId") + @Mapping(source = "time", target = "time") + @Mapping(source = "user", target = "user") + @Mapping(source = "uuid", target = "uuid") + TrackingRecordMVO toTrackingRecordMVO(TrackingRecord trackingRecord); +} \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/metrico/services/MetricoService.java b/src/main/java/org/etsi/osl/metrico/services/MetricoService.java index 0a281d5991ba0206de5c522962cffc0fdbf776f8..d816bee9d2710b05fe5b0d20c736572a03ee17d8 100644 --- a/src/main/java/org/etsi/osl/metrico/services/MetricoService.java +++ b/src/main/java/org/etsi/osl/metrico/services/MetricoService.java @@ -28,6 +28,9 @@ public class MetricoService { @Value("{PM_MEASUREMENT_COLLECTION_JOB_UPDATE}") private String PM_MEASUREMENT_COLLECTION_JOB_UPDATE = ""; + @Value("${PM_MEASUREMENT_COLLECTION_JOB_UPDATE_STATE}") + private String PM_UPDATE_STATE_MEASUREMENT_COLLECTION_JOB; + @Value("{PM_MEASUREMENT_COLLECTION_JOB_GET_BY_ID}") private String PM_MEASUREMENT_COLLECTION_JOB_GET_BY_ID = ""; @@ -69,10 +72,10 @@ public class MetricoService { List<DataAccessEndpointMVO> newDataAccessEndpointMVO = new ArrayList<>(); newDataAccessEndpointMVO.add(DataAccessEndpointMapper.INSTANCE.toDataAccessEndpointMVO(givenDataAccessEndpoint)); - MeasurementCollectionJobMVO promResponseMCJ = new MeasurementCollectionJobMVO(); +// MeasurementCollectionJobMVO promResponseMCJ = new MeasurementCollectionJobMVO(); - promResponseMCJ.setDataAccessEndpoint(newDataAccessEndpointMVO); - producerTemplate.sendBodyAndHeader(PM_MEASUREMENT_COLLECTION_JOB_UPDATE, JsonUtil.toJsonString(promResponseMCJ),"mcjid",givenMCJ.getUuid() ); +// promResponseMCJ.setDataAccessEndpoint(newDataAccessEndpointMVO); +// producerTemplate.sendBodyAndHeader(PM_MEASUREMENT_COLLECTION_JOB_UPDATE, JsonUtil.toJsonString(promResponseMCJ),"mcjid",givenMCJ.getUuid() ); return promResponse; } @@ -103,7 +106,8 @@ public class MetricoService { } - // MCJ UPdate kai stelnw state sto MCJ _ UPDATE + givenMCJ.setExecutionState(job.getState()); + producerTemplate.sendBody(PM_UPDATE_STATE_MEASUREMENT_COLLECTION_JOB, JsonUtil.toJsonString(givenMCJ)); } public void startPeriodicQueryToPrometheus(@NotNull MeasurementCollectionJobRef mcjRef){