diff options
Diffstat (limited to 'actn-interface-tools/global-control/api')
9 files changed, 316 insertions, 0 deletions
diff --git a/actn-interface-tools/global-control/api/pom.xml b/actn-interface-tools/global-control/api/pom.xml new file mode 100644 index 0000000..868f443 --- /dev/null +++ b/actn-interface-tools/global-control/api/pom.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ ============LICENSE_START======================================================= + ~ Actn Interface Tools + ~ ================================================================================ + ~ Copyright (C) 2023 Huawei Canada Limited. + ~ ================================================================================ + ~ 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========================================================= + --> +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.onap.integration.ietf-actn-tools</groupId> + <artifactId>global-control</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> + <groupId>org.onap.integration.ietf-actn-tools</groupId> + <artifactId>globalapi</artifactId> + <version>1.0-SNAPSHOT</version> + <properties> + <jackson.version>2.11.0</jackson.version> + </properties> + <dependencies> + <dependency> + <groupId>org.onap.integration.ietf-actn-tools</groupId> + <artifactId>actn-model</artifactId> + <version>1.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.onosproject</groupId> + <artifactId>onos-yang-runtime</artifactId> + <version>2.6.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <version>${jackson.version}</version> + </dependency> + + <!-- jackson-core --> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-core</artifactId> + <version>${jackson.version}</version> + </dependency> + <!-- jackson-annotations --> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + <version>${jackson.version}</version> + </dependency> + <dependency> + <groupId>org.onap.integration.ietf-actn-tools</groupId> + <artifactId>restconf-client-api</artifactId> + <version>1.0-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + </dependencies> +</project> diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnClientService.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnClientService.java new file mode 100644 index 0000000..89a2586 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnClientService.java @@ -0,0 +1,28 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +import org.onap.integration.actninterfacetools.protocol.restconf.PncInstance; + +public interface ActnClientService { + void registerDataConverter(ActnDataConverter converter); + PncClient getPncClient(PncInstance pncInstance); +} + diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnDataConverter.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnDataConverter.java new file mode 100644 index 0000000..c64732f --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/ActnDataConverter.java @@ -0,0 +1,42 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + + +import org.onosproject.yang.gen.v11.ietfethtranservice.rev20210111.ietfethtranservice.DefaultEthtSvc; +import org.onosproject.yang.gen.v11.ietfnetwork.rev20180226.ietfnetwork.networks.Network; +import org.onosproject.yang.gen.v11.ietfte.rev20210220.ietfte.tunnelsgrouping.tunnels.DefaultTunnel; +public abstract class ActnDataConverter { + public CustomerOtnTopology convertActnOtnTopology(Network actnOtnTopology) throws Exception { + throw new Exception("unsupported method"); + } + public CustomerOtnTunnel convertActnOtnTunnel(DefaultTunnel actnOtnTunnel) throws Exception { + throw new Exception("unsupported method"); + } + public DefaultTunnel convertActnOtnTunnel(CustomerOtnTunnel customerOtnTunnel) throws Exception { + throw new Exception("unsupported method"); + } + public CustomerEthService convertActnEthService(DefaultEthtSvc actnEthService) throws Exception { + throw new Exception("unsupported method"); + } + public DefaultEthtSvc convertActnEthService(CustomerEthService customerEthService) throws Exception { + throw new Exception("unsupported method"); + } +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerEthService.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerEthService.java new file mode 100644 index 0000000..959b57d --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerEthService.java @@ -0,0 +1,23 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +public abstract class CustomerEthService { +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTopology.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTopology.java new file mode 100644 index 0000000..d0f4d79 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTopology.java @@ -0,0 +1,23 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +public abstract class CustomerOtnTopology extends CustomerTopology { +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTunnel.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTunnel.java new file mode 100644 index 0000000..8b6cb39 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerOtnTunnel.java @@ -0,0 +1,23 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +public abstract class CustomerOtnTunnel { +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerTopology.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerTopology.java new file mode 100644 index 0000000..0e25650 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/CustomerTopology.java @@ -0,0 +1,23 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +public abstract class CustomerTopology { +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/GlobalService.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/GlobalService.java new file mode 100644 index 0000000..47829d4 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/GlobalService.java @@ -0,0 +1,49 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2023 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + + +import org.onosproject.yang.runtime.impl.DefaultModelConverter; +import org.onosproject.yang.runtime.impl.DefaultYangModelRegistry; +import org.onosproject.yang.runtime.impl.DefaultYangRuntimeHandler; +import org.onosproject.yang.runtime.impl.DefaultYangSerializerRegistry; +import org.onosproject.yang.runtime.impl.DefaultSchemaContextProvider; +import java.net.URISyntaxException; +import java.util.Map; +import java.util.ServiceLoader; + +public interface GlobalService { + String getServiceName(); + void initialize() throws URISyntaxException; + ActnClientService getActnClientService(ActnDataConverter actnDataConverter) throws URISyntaxException; + DefaultYangModelRegistry getModelRegistry(); + DefaultYangSerializerRegistry getSerializerRegistry(); + DefaultYangRuntimeHandler getRuntimeService(); + DefaultModelConverter getModelConverter(); + DefaultSchemaContextProvider getSchemaContextProvider(); + + Map<String, ClassLoader> getClassLoaders(); + static ActnClientService getActnClientSvc(ActnDataConverter actnDataConverter) throws URISyntaxException { + ServiceLoader<GlobalService> serviceLoader = ServiceLoader.load(GlobalService.class); + GlobalService globalService = serviceLoader.iterator().next(); + return globalService.getActnClientService(actnDataConverter); + } + +} diff --git a/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/PncClient.java b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/PncClient.java new file mode 100644 index 0000000..c4d6551 --- /dev/null +++ b/actn-interface-tools/global-control/api/src/main/java/org/onap/integration/actninterfacetools/globalapi/PncClient.java @@ -0,0 +1,33 @@ +/* + * ============LICENSE_START======================================================= + * Actn Interface Tools + * ================================================================================ + * Copyright (C) 2022 Huawei Canada Limited. + * ================================================================================ + * 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.onap.integration.actninterfacetools.globalapi; + +public interface PncClient { + CustomerOtnTopology getNetworkTopology(String topologyId) throws Exception; + void createOtnTunnel(CustomerOtnTunnel customerOtnTunnel) throws Exception; + void updateOtnTunnel(CustomerOtnTunnel customerOtnTunnel, String otnName) throws Exception; + CustomerOtnTunnel getOtnTunnel(String actnOtnTunnelId) throws Exception; + void createEthService(CustomerEthService customerEthService) throws Exception; + void updateEthService(CustomerEthService customerEthService) throws Exception; + CustomerEthService getEthService(String actnEthServiceId) throws Exception; + void deleteOtnTunnel(String actnOtnTunnelId) throws Exception; + void deleteEthService(String actnEthServiceId) throws Exception; +} |