Skip to content
Snippets Groups Projects
Commit 52b5d703 authored by trantzas's avatar trantzas
Browse files

Merge branch 'develop' into 'main'

MR for Release 2024Q4
parents 52b888df 5a642bf0
No related branches found
No related tags found
2 merge requests!6Merge branch 'main' into 'develop',!5MR for Release 2024Q4
Pipeline #11319 passed
Showing
with 778 additions and 0 deletions
/target
*.iml
.classpath
.project
\ No newline at end of file
include:
- project: osl/code/org.etsi.osl.main
ref: main
file:
- ci-templates/default.yml
- ci-templates/build.yml
rules:
- if: '$CI_COMMIT_REF_NAME == "main"'
- project: osl/code/org.etsi.osl.main
ref: develop
file:
- ci-templates/default.yml
- ci-templates/build.yml
rules:
- if: '$CI_COMMIT_REF_NAME == "develop"'
- project: osl/code/org.etsi.osl.main
ref: $CI_COMMIT_REF_NAME
file:
- ci-templates/default.yml
- ci-templates/build.yml
rules:
- if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'
- project: osl/code/org.etsi.osl.main
ref: develop
file:
- ci-templates/default.yml
- ci-templates/build_unprotected.yml
rules:
- if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && $CI_COMMIT_REF_PROTECTED == "false"'
maven_build:
extends: .maven_build
docker_build:
extends: .docker_build
needs:
- maven_build
eclipse.preferences.version=1
encoding//src/main/java=utf-8
encoding//src/main/resources=utf-8
encoding//src/test/java=utf-8
encoding//src/test/resources=utf-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=17
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
FROM ibm-semeru-runtimes:open-17.0.7_7-jdk
RUN mkdir /opt/shareclasses
RUN mkdir -p /opt/openslice/lib/
COPY target/org.etsi.osl.metrico-0.9-exec.jar /opt/openslice/lib/
CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/openslice/lib/org.etsi.osl.metrico-0.9-exec.jar"]
# Metrics Component (METRICO)
## Definitions of the problem
Services (& resources) created through OSL provide a vast amount of data and metrics. The data can be used to perform actions on the said services. Up until now (OSL v1.0) external tools are used to leverage those data.
The goal of this feature is to create a mechanism that, through OSL, can retrieve the data and return them to the services (and/or resources) they are associated with.
This goal creates challenges on multiple levels:
* How does OSL retrieves data that come from multiple, non-homogenous environments?
* How does OSL associates the data with their respective services?
* How the services receive the data that were retrieved by the MDAS?
* What mechanisms are trigered to perform actions based on the data recieved?
Most of the above challenges can be split in further tecnhical and technology challenges.
## High Level Design
* METRICO enables users to retrieve metrics monitored via a Prometheus.
* The infrastructure has to be monitored with any monitoring tool that has a Prometheus exporter and will export the collected data to a Prometheus.
![METRICOInANutshell](https://labs.etsi.org/rep/groups/osl/code/-/uploads/085c07b57f24ee97251ccfd95c25dd01/NewFeatureInANutshell.png)
@startuml FlowDiagram
actor "ACTOR" as actor
participant "OSOM" as osom
participant "TMF API" as tmf_api
queue amq as amq
participant "METRICO" as metrico
participant prometheus as prom
actor -> tmf_api: CREATE: Service Order Monitoring aaS
osom -> osom: PROCESS ORDER
osom -> tmf_api: CREATE: service instance of monitoring aaS (RFS)(Initial Status: Reseved)
osom -> tmf_api: CREATE: service instance of monitoring aaS (CFS)(Initial Status: Reseved)
osom -> amq: CREATE: TMF628 Measurement Collection Job \n<color:green>queue:PM_MEASUREMENT_COLLECTION_JOB_ADD \n<color:green>payload: MeasurementCollectionJobFVO
amq -> tmf_api: CREATE: TMF628 Measurement Collection Job \n<color:green>queue:PM_MEASUREMENT_COLLECTION_JOB_ADD \n<color:green>payload: MeasurementCollectionJobFVO (Here I can find the MCJ ID)
tmf_api -> amq: CREATE: TMF628 Measurement Collection Job \n<color:green>queue:PM_MEASUREMENT_COLLECTION_JOB_ADD \n<color:green>payload: MeasurementCollectionJob (Here I can find the MCJ ID)
osom -> tmf_api: CREATE: Resource Instance (Initial Status: Reseved)(associate to RFS)(add the MCJ UUID)
amq -> osom: CREATE: TMF628 Measurement Collection Job \n<color:green>queue:PM_MEASUREMENT_COLLECTION_JOB_ADD \n<color:green>payload: MeasurementCollectionJob (Here I can find the MCJ ID)
tmf_api -> amq: PUBLISH EVENT: Monitoring Job Created\n<color:green>topic: PM_MEASUREMENT_COLLECTION_JOB_CREATED\n<color:green>payload: Measurement Collection Job Ref
amq -> metrico: RECEIVE EVENT: Monitoring Job Created\n<color:green>topic: PM_MEASUREMENT_COLLECTION_JOB_CREATED\n<color:green>payload: Measurement Collection Job Ref
metrico -> tmf_api: fetch Measurement Collection Job from ref
tmf_api -> metrico: fetch Measurement Collection Job from ref
metrico -> metrico: create METRICO job
metrico -> amq: UPDATE Measurement Collection Job Status
group "java job"
metrico -> metrico : set how often job is done
metrico -> prom : send prom req
prom -> metrico : reply to prom req
metrico -> metrico : parse data from reply and cast them to data access endpoint
metrico -> amq : UPDATE: Related service to the Service Inventory\n<color:green>queue:jms:queue:CATALOG.UPD.SERVICE \n<color:green>payload: ServiceUpdate, serviceId
amq -> tmf_api: UPDATE: Related service to the Service Inventory\n<color:green>queue:jms:queue:CATALOG.UPD.SERVICE \n<color:green>payload: ServiceUpdate, serviceId
end
@enduml
\ No newline at end of file
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
pom.xml 0 → 100644
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.etsi.osl</groupId>
<artifactId>org.etsi.osl.main</artifactId>
<version>2024Q4</version>
<relativePath>../org.etsi.osl.main</relativePath>
</parent>
<artifactId>org.etsi.osl.metrico</artifactId>
<name>org.etsi.osl.metrico</name>
<version>${org.etsi.osl.metrico.version}</version>
<organization>
<name>OpenSlice by ETSI</name>
<url>https://osl.etsi.org</url>
</organization>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.boot-version>3.2.2</spring.boot-version>
<spring.boot-version>${spring-boot-version}</spring.boot-version>
<camel.version>4.0.0-RC1</camel.version>
<slf4j-api.version>1.7.5</slf4j-api.version>
<slf4j-simple.version>1.7.28</slf4j-simple.version>
<mysql-connector.version>${mysql.connector.version}</mysql-connector.version>
</properties>
<repositories>
<repository>
<id>gitlab-maven</id>
<url>https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</repository>
<snapshotRepository>
<id>gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</snapshotRepository>
</distributionManagement>
<dependencyManagement>
<dependencies>
<!-- Spring Boot BOM -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Camel BOM -->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-dependencies</artifactId>
<version>${camel.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- org.etsi.osl -->
<dependency>
<groupId>org.etsi.osl</groupId>
<artifactId>org.etsi.osl.model.tmf</artifactId>
<version>${org.etsi.osl.model.tmf.version}</version>
</dependency>
<dependency>
<groupId>org.etsi.osl</groupId>
<artifactId>org.etsi.osl.centrallog.client</artifactId>
<version>${org.etsi.osl.centrallog.client.version}</version>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- security -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
</dependency>
<!-- activeMQ -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-amqp</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.qpid</groupId>
<artifactId>proton-j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.messaginghub</groupId>
<artifactId>pooled-jms</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Camel -->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-activemq</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-service-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-http-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-stream</artifactId>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
<version>${mysql-connector.version}</version>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<version>3.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>6.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<!-- run mvn license:update-file-header to manually update all headers
everywhere -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${maven-license-plugin.version}</version>
<configuration>
<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
<processStartTag>========================LICENSE_START=================================</processStartTag>
<processEndTag>=========================LICENSE_END==================================</processEndTag>
<excludes>*.json</excludes>
</configuration>
<executions>
<execution>
<id>generate-license-headers</id>
<goals>
<goal>update-file-header</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<licenseName>${license.licenseName}</licenseName>
</configuration>
</execution>
<execution>
<id>download-licenses</id>
<goals>
<goal>download-licenses</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-version}</version>
<configuration>
<classifier>exec</classifier>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package org.etsi.osl.metrico;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.etsi.osl.tmf.pm628.model.MeasurementCollectionJobMVO;
import java.io.IOException;
public class JsonUtil {
public static <T> T toJsonObj(String content, Class<T> valueType) throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
return mapper.readValue( content, valueType);
}
public static <T> String toJsonString(T object) {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
try {
return mapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
e.printStackTrace();
return null;
}
}
}
\ No newline at end of file
/*-
* ========================LICENSE_START=================================
* org.etsi.osl.tmf.api
* %%
* Copyright (C) 2019 openslice.io
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =========================LICENSE_END==================================
*/
package org.etsi.osl.metrico;
import org.hibernate.dialect.MySQLDialect; ;
public class LocalMysqlDialect extends MySQLDialect {
@Override
public String getTableTypeString() {
return " DEFAULT CHARSET=utf8";
}
}
package org.etsi.osl.metrico;
import org.etsi.osl.metrico.services.MetricoService;
import org.etsi.osl.tmf.pm628.model.MeasurementCollectionJob;
import org.etsi.osl.tmf.pm628.model.MeasurementCollectionJobRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.EventListener;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import jakarta.validation.constraints.NotNull;
@SpringBootApplication
@EnableJpaRepositories("org.etsi.osl.metrico.repo")
@EntityScan( basePackages = {
"org.etsi.osl.metrico.repo",
"org.etsi.osl.metrico.model",
"org.etsi.osl.metrico",
"org.etsi.osl.metrico.reposervices",
"org.etsi.osl.metrico.services"
})
public class MetricoSpringBoot implements CommandLineRunner {
private static final Logger logger =
LoggerFactory.getLogger(MetricoSpringBoot.class.getSimpleName());
//
// @Autowired
// private MetricoService aMetricoService;
@Override
public void run(String... arg0) {
if (arg0.length > 0 && arg0[0].equals("exitcode")) {
throw new ExitException();
}
// @NotNull
// MeasurementCollectionJob mcj = new MeasurementCollectionJob();
//
// @NotNull
// MeasurementCollectionJobRef mjref = new MeasurementCollectionJobRef();
// mjref.setId("268cd191-21ac-4a81-84d8-933445a65ec1");
// aMetricoService.startPeriodicQueryToPrometheusRef(mjref );
}
public static void main(String[] args) {
logger.info("============================== STARTING METRICO ==============================");
ApplicationContext applicationContext = new SpringApplication(MetricoSpringBoot.class).run(args);
}
static class ExitException extends RuntimeException implements ExitCodeGenerator {
private static final long serialVersionUID = 1L;
@Override
public int getExitCode() {
return 10;
}
}
}
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 = "atBaseType", 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
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
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
package org.etsi.osl.metrico.mapper;
import org.etsi.osl.tmf.pm628.model.DataAccessEndpoint;
import org.etsi.osl.tmf.pm628.model.DataAccessEndpointMVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
@Mapper
public interface DataAccessEndpointMapper {
DataAccessEndpointMapper INSTANCE = Mappers.getMapper(DataAccessEndpointMapper.class);
@Mapping(target = "type", source = "type")
@Mapping(target = "baseType", source = "baseType")
@Mapping(target = "schemaLocation", source = "schemaLocation")
@Mapping(target = "href", source = "href")
@Mapping(target = "uuid", source = "uuid")
@Mapping(target = "category", source = "category")
@Mapping(target = "description", source = "description")
@Mapping(target = "name", source = "name")
@Mapping(target = "endOperatingDate", source = "endOperatingDate")
@Mapping(target = "administrativeState", source = "administrativeState")
@Mapping(target = "operationalState", source = "operationalState")
@Mapping(target = "resourceStatus", source = "resourceStatus")
@Mapping(target = "usageState", source = "usageState")
@Mapping(target = "validFor", source = "validFor")
@Mapping(target = "note", source = "note")
@Mapping(target = "resourceOrderItem", source = "resourceOrderItem")
@Mapping(target = "place", source = "place")
@Mapping(target = "relatedParty", source = "relatedParty")
@Mapping(target = "resourceRelationship", source = "resourceRelationship")
@Mapping(target = "resourceCharacteristic", source = "resourceCharacteristic")
@Mapping(target = "attachment", source = "attachment")
@Mapping(target = "resourceSpecification", source = "resourceSpecification")
@Mapping(target = "startOperatingDate", source = "startOperatingDate")
@Mapping(target = "resourceVersion", source = "resourceVersion")
@Mapping(target = "activationFeature", source = "activationFeature")
@Mapping(target = "intent", source = "intent")
@Mapping(target = "externalIdentifier", source = "externalIdentifier")
@Mapping(target = "value", source = "value")
@Mapping(target = "uri", source = "uri")
@Mapping(target = "uriQueryFilter", source = "uriQueryFilter")
@Mapping(target = "apiType", source = "apiType")
DataAccessEndpointMVO toDataAccessEndpointMVO(DataAccessEndpoint dataAccessEndpoint);
}
\ No newline at end of file
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment