From 2cddd5ea0a6732b561ae7a280773e79df7d7ba65 Mon Sep 17 00:00:00 2001
From: nancylizi
Date: Fri, 9 Sep 2016 10:31:53 +0800
Subject: Modify the change line tag crlf to lf, modify check style, add the
parser calling in package manager, remove Chinese comment.
Change-Id: I77226cb8d69b8a62c8364e371b83fdb9e462ce1d
Signed-off-by: nancylizi
---
.../org/openo/commontosca/catalog/CatalogApp.java | 346 ++--
.../catalog/CatalogAppConfiguration.java | 482 +++---
.../catalog/common/CommonErrorResponse.java | 84 +-
.../openo/commontosca/catalog/common/Config.java | 64 +-
.../openo/commontosca/catalog/common/FileUtil.java | 372 ++--
.../catalog/common/HttpServerAddrConfig.java | 64 +-
.../catalog/common/HttpServerPathConfig.java | 60 +-
.../commontosca/catalog/common/MsbAddrConfig.java | 62 +-
.../openo/commontosca/catalog/common/MsbUtil.java | 112 +-
.../openo/commontosca/catalog/common/RestUtil.java | 70 +-
.../catalog/common/ServiceRegistrer.java | 194 +--
.../commontosca/catalog/common/ZipCompressor.java | 246 +--
.../catalog/entity/CsarQueryCondition.java | 78 +-
.../catalog/entity/EnumOnboardState.java | 62 +-
.../catalog/entity/EnumOperationalState.java | 42 +-
.../catalog/entity/EnumProcessState.java | 42 +-
.../openo/commontosca/catalog/entity/EnumType.java | 42 +-
.../commontosca/catalog/entity/EnumUsageState.java | 42 +-
.../commontosca/catalog/entity/VnfPackage.java | 202 +--
.../catalog/entity/request/PackageBasicInfo.java | 78 +-
.../request/UploadPackageFromFtpRequest.java | 76 +-
.../entity/response/CsarFileUriResponse.java | 64 +-
.../catalog/entity/response/PackageMeta.java | 124 +-
.../entity/response/UpdatePackageResponse.java | 60 +-
.../entity/response/UploadPackageResponse.java | 62 +-
.../msb/MicroserviceBusConsumer.java | 94 +-
.../externalservice/msb/MicroserviceBusRest.java | 70 +-
.../catalog/externalservice/msb/ServiceNode.java | 68 +-
.../externalservice/msb/ServiceRegisterEntity.java | 108 +-
.../org/openo/commontosca/catalog/ftp/Ftp.java | 76 +-
.../org/openo/commontosca/catalog/ftp/FtpUtil.java | 416 ++---
.../catalog/health/ConsoleHealthCheck.java | 72 +-
.../model/common/EnumToscaNodeTypeDefinition.java | 132 +-
.../common/EnumToscaRelationShipDefinition.java | 94 +-
.../container/ContainerSelfServiceProvider.java | 3 +-
.../container/ContainerServicePackageProvider.java | 4 +-
.../ContainerServiceTemplateProvider.java | 4 +-
.../container/IContainerExtPackageRest.java | 5 +-
.../container/IContainerSelfServiceRest.java | 4 +-
.../container/IContainerTemplateRest.java | 6 +-
.../externalservice/container/NamespaceFilter.java | 202 +--
.../lifecycle/ILifeCycleServiceRest.java | 70 +-
.../lifecycle/LifeCycleServiceConsumer.java | 134 +-
.../externalservice/ro/IResourceServiceRest.java | 74 +-
.../ro/ResourceServiceConsumer.java | 156 +-
.../catalog/model/parser/AbstractModelParser.java | 52 +-
.../catalog/model/parser/EnumPackageFormat.java | 54 +-
.../catalog/model/parser/EnumTemplateType.java | 42 +-
.../catalog/model/parser/ModelParserFactory.java | 116 +-
.../catalog/model/parser/yaml/IYamlParseRest.java | 70 +-
.../parser/yaml/YamlParseServiceConsumer.java | 104 +-
.../yaml/entity/EnumYamlServiceTemplateInfo.java | 82 +-
.../yaml/entity/ParseYamlRequestParemeter.java | 132 +-
.../model/parser/yaml/entity/ParseYamlResult.java | 1780 ++++++++++----------
.../catalog/model/plan/wso2/Iwso2RestService.java | 114 +-
.../model/plan/wso2/Wso2ServiceConsumer.java | 378 ++---
.../model/wrapper/ServiceTemplateWrapper.java | 724 ++++----
.../commontosca/catalog/resources/RestUtils.java | 74 +-
.../catalog/wrapper/PackageWrapper.java | 1033 ++++++------
.../catalog/wrapper/PackageWrapperUtil.java | 847 +++++-----
.../catalog/wrapper/PackageWrapperTest.java | 662 ++++----
61 files changed, 5603 insertions(+), 5583 deletions(-)
(limited to 'catalog-core/catalog-mgr/src')
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java
index 2cd532bf..8a00fbe6 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java
@@ -1,175 +1,171 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-import io.dropwizard.Application;
-import io.dropwizard.assets.AssetsBundle;
-import io.dropwizard.db.DataSourceFactory;
-import io.dropwizard.hibernate.HibernateBundle;
-import io.dropwizard.migrations.MigrationsBundle;
-import io.dropwizard.server.SimpleServerFactory;
-import io.dropwizard.setup.Bootstrap;
-import io.dropwizard.setup.Environment;
-import io.swagger.jaxrs.config.BeanConfig;
-import io.swagger.jaxrs.listing.ApiListingResource;
-
-import org.eclipse.jetty.servlets.CrossOriginFilter;
-import org.glassfish.jersey.media.multipart.MultiPartFeature;
-import org.openo.commontosca.catalog.common.Config;
-import org.openo.commontosca.catalog.common.HttpServerAddrConfig;
-import org.openo.commontosca.catalog.common.HttpServerPathConfig;
-import org.openo.commontosca.catalog.common.MsbAddrConfig;
-import org.openo.commontosca.catalog.common.ServiceRegistrer;
-import org.openo.commontosca.catalog.db.dao.DaoManager;
-import org.openo.commontosca.catalog.db.entity.NodeTemplateData;
-import org.openo.commontosca.catalog.db.entity.PackageData;
-import org.openo.commontosca.catalog.db.entity.ServiceTemplateData;
-import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData;
-import org.openo.commontosca.catalog.health.ConsoleHealthCheck;
-import org.openo.commontosca.catalog.resources.PackageResource;
-import org.openo.commontosca.catalog.resources.TemplateResource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.EnumSet;
-import javax.servlet.DispatcherType;
-
-
-public class CatalogApp extends Application {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(CatalogApp.class);
-
- public static void main(String[] args) throws Exception {
- new CatalogApp().run(args);
- }
-
- @Override
- public String getName() {
- return "OPENO-Catalog";
- }
-
- private final HibernateBundle bundle =
- new HibernateBundle(ServiceTemplateData.class, PackageData.class,
- NodeTemplateData.class, ServiceTemplateMappingData.class) {
- @Override
- public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) {
- return configuration.getDataSourceFactory();
- }
- };
-
- @Override
- public void initialize(Bootstrap bootstrap) {
- bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc"));
- initDb(bootstrap);
- }
-
- private void initDao() {
- DaoManager.getInstance().setSessionFactory(bundle.getSessionFactory());
- }
-
- private void initDb(Bootstrap bootstrap) {
- bootstrap.addBundle(bundle);
- bootstrap.addBundle(new MigrationsBundle() {
- @Override
- public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) {
- return configuration.getDataSourceFactory();
- }
- });
- }
-
- @Override
- public void run(CatalogAppConfiguration configuration, Environment environment) {
- LOGGER.info("Start to initialize catalogue.");
- MsbAddrConfig.setMsbAddress(configuration.getMsbServerAddr());
- HttpServerAddrConfig.setHttpServerAddress(configuration.getHttpServerAddr());
- HttpServerPathConfig.setHttpServerPath(configuration.getHttpServerPath());
- initDao();
- final ConsoleHealthCheck healthCheck = new ConsoleHealthCheck(configuration.getTemplate());
- environment.healthChecks().register("template", healthCheck);
-
- environment.jersey().register(new PackageResource());
- environment.jersey().register(new TemplateResource());
- // environment.jersey().register(new VNFHostImageResource());
- // environment.jersey().register(new VNFSoftwareVersionResource());
-
- // register rest interface
- environment.jersey().packages("org.openo.commontosca.catalog.resources");
- // upload file by inputstream need to register MultiPartFeature
- environment.jersey().register(MultiPartFeature.class);
-
- initSwaggerConfig(environment, configuration);
-// initCometd(environment);
- Config.setConfigration(configuration);
- initService();
- LOGGER.info("Initialize catalogue finished.");
- }
-
- /**
- * initialize swagger configuration.
- *
- * @param environment environment information
- * @param configuration catalogue configuration
- */
- private void initSwaggerConfig(Environment environment, CatalogAppConfiguration configuration) {
- environment.jersey().register(new ApiListingResource());
- environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
-
- BeanConfig config = new BeanConfig();
- config.setTitle("Open-o Catalog Service rest API");
- config.setVersion("1.0.0");
- config.setResourcePackage("org.openo.commontosca.catalog.resources");
- // set rest api basepath in swagger
- SimpleServerFactory simpleServerFactory =
- (SimpleServerFactory) configuration.getServerFactory();
- String basePath = simpleServerFactory.getApplicationContextPath();
- String rootPath = simpleServerFactory.getJerseyRootPath();
- rootPath = rootPath.substring(0, rootPath.indexOf("/*"));
- basePath =
- basePath.equals("/") ? rootPath : (new StringBuilder()).append(basePath).append(rootPath)
- .toString();
- config.setBasePath(basePath);
- config.setScan(true);
- }
-
- private void initService() {
- Thread registerCatalogService = new Thread(new ServiceRegistrer());
- registerCatalogService.setName("register catalog service to Microservice Bus");
- registerCatalogService.start();
- }
-
- /**
- * initialize cometd server.
- *
- * @param environment environment information
- */
-// private void initCometd(Environment environment) {
-// // add filter
-// environment.getApplicationContext().addFilter(CrossOriginFilter.class,
-// "/api/nsoccataloguenotification/v1/*",
-// EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR));
-// // add servlet
-// environment.getApplicationContext()
-// .addServlet("org.cometd.server.CometDServlet", "/api/nsoccataloguenotification/v1/*")
-// .setInitOrder(1);
-// // add servlet
-// environment.getApplicationContext()
-// .addServlet("CometdServlet", "/api/nsoccataloguenotification/v1").setInitOrder(2);
-// }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import io.dropwizard.Application;
+import io.dropwizard.assets.AssetsBundle;
+import io.dropwizard.db.DataSourceFactory;
+import io.dropwizard.hibernate.HibernateBundle;
+import io.dropwizard.migrations.MigrationsBundle;
+import io.dropwizard.server.SimpleServerFactory;
+import io.dropwizard.setup.Bootstrap;
+import io.dropwizard.setup.Environment;
+import io.swagger.jaxrs.config.BeanConfig;
+import io.swagger.jaxrs.listing.ApiListingResource;
+
+import org.glassfish.jersey.media.multipart.MultiPartFeature;
+import org.openo.commontosca.catalog.common.Config;
+import org.openo.commontosca.catalog.common.HttpServerAddrConfig;
+import org.openo.commontosca.catalog.common.HttpServerPathConfig;
+import org.openo.commontosca.catalog.common.MsbAddrConfig;
+import org.openo.commontosca.catalog.common.ServiceRegistrer;
+import org.openo.commontosca.catalog.db.dao.DaoManager;
+import org.openo.commontosca.catalog.db.entity.NodeTemplateData;
+import org.openo.commontosca.catalog.db.entity.PackageData;
+import org.openo.commontosca.catalog.db.entity.ServiceTemplateData;
+import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData;
+import org.openo.commontosca.catalog.health.ConsoleHealthCheck;
+import org.openo.commontosca.catalog.resources.PackageResource;
+import org.openo.commontosca.catalog.resources.TemplateResource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class CatalogApp extends Application {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(CatalogApp.class);
+
+ public static void main(String[] args) throws Exception {
+ new CatalogApp().run(args);
+ }
+
+ @Override
+ public String getName() {
+ return "OPENO-Catalog";
+ }
+
+ private final HibernateBundle bundle =
+ new HibernateBundle(ServiceTemplateData.class, PackageData.class,
+ NodeTemplateData.class, ServiceTemplateMappingData.class) {
+ @Override
+ public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) {
+ return configuration.getDataSourceFactory();
+ }
+ };
+
+ @Override
+ public void initialize(Bootstrap bootstrap) {
+ bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc"));
+ initDb(bootstrap);
+ }
+
+ private void initDao() {
+ DaoManager.getInstance().setSessionFactory(bundle.getSessionFactory());
+ }
+
+ private void initDb(Bootstrap bootstrap) {
+ bootstrap.addBundle(bundle);
+ bootstrap.addBundle(new MigrationsBundle() {
+ @Override
+ public DataSourceFactory getDataSourceFactory(CatalogAppConfiguration configuration) {
+ return configuration.getDataSourceFactory();
+ }
+ });
+ }
+
+ @Override
+ public void run(CatalogAppConfiguration configuration, Environment environment) {
+ LOGGER.info("Start to initialize catalogue.");
+ MsbAddrConfig.setMsbAddress(configuration.getMsbServerAddr());
+ HttpServerAddrConfig.setHttpServerAddress(configuration.getHttpServerAddr());
+ HttpServerPathConfig.setHttpServerPath(configuration.getHttpServerPath());
+ initDao();
+ final ConsoleHealthCheck healthCheck = new ConsoleHealthCheck(configuration.getTemplate());
+ environment.healthChecks().register("template", healthCheck);
+
+ environment.jersey().register(new PackageResource());
+ environment.jersey().register(new TemplateResource());
+ // environment.jersey().register(new VNFHostImageResource());
+ // environment.jersey().register(new VNFSoftwareVersionResource());
+
+ // register rest interface
+ environment.jersey().packages("org.openo.commontosca.catalog.resources");
+ // upload file by inputstream need to register MultiPartFeature
+ environment.jersey().register(MultiPartFeature.class);
+
+ initSwaggerConfig(environment, configuration);
+ // initCometd(environment);
+ Config.setConfigration(configuration);
+ initService();
+ LOGGER.info("Initialize catalogue finished.");
+ }
+
+ /**
+ * initialize swagger configuration.
+ *
+ * @param environment environment information
+ * @param configuration catalogue configuration
+ */
+ private void initSwaggerConfig(Environment environment, CatalogAppConfiguration configuration) {
+ environment.jersey().register(new ApiListingResource());
+ environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+ BeanConfig config = new BeanConfig();
+ config.setTitle("Open-o Catalog Service rest API");
+ config.setVersion("1.0.0");
+ config.setResourcePackage("org.openo.commontosca.catalog.resources");
+ // set rest api basepath in swagger
+ SimpleServerFactory simpleServerFactory =
+ (SimpleServerFactory) configuration.getServerFactory();
+ String basePath = simpleServerFactory.getApplicationContextPath();
+ String rootPath = simpleServerFactory.getJerseyRootPath();
+ rootPath = rootPath.substring(0, rootPath.indexOf("/*"));
+ basePath =
+ basePath.equals("/") ? rootPath : (new StringBuilder()).append(basePath).append(rootPath)
+ .toString();
+ config.setBasePath(basePath);
+ config.setScan(true);
+ }
+
+ private void initService() {
+ Thread registerCatalogService = new Thread(new ServiceRegistrer());
+ registerCatalogService.setName("register catalog service to Microservice Bus");
+ registerCatalogService.start();
+ }
+
+// /**
+// * initialize cometd server.
+// *
+// * @param environment environment information
+// */
+// private void initCometd(Environment environment) {
+// // add filter
+// environment.getApplicationContext().addFilter(CrossOriginFilter.class,
+// "/api/nsoccataloguenotification/v1/*",
+// EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR));
+// // add servlet
+// environment.getApplicationContext()
+// .addServlet("org.cometd.server.CometDServlet", "/api/nsoccataloguenotification/v1/*")
+// .setInitOrder(1);
+// // add servlet
+// environment.getApplicationContext()
+// .addServlet("CometdServlet", "/api/nsoccataloguenotification/v1").setInitOrder(2);
+// }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java
index a951347f..d9a0eeac 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java
@@ -1,241 +1,241 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.dropwizard.Configuration;
-import io.dropwizard.db.DataSourceFactory;
-import org.hibernate.validator.constraints.NotEmpty;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-
-
-
-
-public class CatalogAppConfiguration extends Configuration {
- @NotEmpty
- private String template;
-
- @NotEmpty
- private String defaultName = "OPENO-Catalog";
-
- @NotEmpty
- private String msbServerAddr;
-
- @NotEmpty
- private String httpServerAddr;
-
- @NotEmpty
- private String opentoscaServerAddr;
-
- @NotEmpty
- private String yamlParseAddr;
-
- @NotEmpty
- private String wso2HostIp;
-
- @NotEmpty
- private String wso2HostPort;
-
- @NotEmpty
- private String cataloguePath;
- @NotEmpty
- private String httpServerPath;
- @NotEmpty
- private String ldapServerIp;
-
- @NotEmpty
- private String ldapServerPort;
-
- @NotEmpty
- private String ldapLogindn;
-
- @NotEmpty
- private String ldapPassword;
-
- @NotEmpty
- private String ldapVersion;
- @Valid
- @NotNull
- private DataSourceFactory database = new DataSourceFactory();
-
- @JsonProperty("database")
- public DataSourceFactory getDataSourceFactory() {
- return database;
- }
-
- @JsonProperty("database")
- public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
- this.database = dataSourceFactory;
- }
-
- @JsonProperty
- public String getTemplate() {
- return template;
- }
-
- @JsonProperty
- public void setTemplate(String template) {
- this.template = template;
- }
-
- @JsonProperty
- public String getDefaultName() {
- return defaultName;
- }
-
- @JsonProperty
- public void setDefaultName(String name) {
- this.defaultName = name;
- }
-
- @JsonProperty
- public String getMsbServerAddr() {
- return msbServerAddr;
- }
-
- @JsonProperty
- public void setMsbServerAddr(String msbServerAddr) {
- this.msbServerAddr = msbServerAddr;
- }
-
- @JsonProperty
- public String getHttpServerAddr() {
- return httpServerAddr;
- }
-
- @JsonProperty
- public void setHttpServerAddr(String httpServerAddr) {
- this.httpServerAddr = httpServerAddr;
- }
-
- @JsonProperty
- public String getOpentoscaServerAddr() {
- return opentoscaServerAddr;
- }
-
- @JsonProperty
- public void setOpentoscaServerAddr(String opentoscaServerAddr) {
- this.opentoscaServerAddr = opentoscaServerAddr;
- }
-
- @JsonProperty
- public String getYamlParseAddr() {
- return yamlParseAddr;
- }
-
- @JsonProperty
- public void setYamlParseAddr(String yamlParseAddr) {
- this.yamlParseAddr = yamlParseAddr;
- }
-
- @JsonProperty
- public String getWso2HostIp() {
- return wso2HostIp;
- }
-
- @JsonProperty
- public void setWso2HostIp(String wso2HostIp) {
- this.wso2HostIp = wso2HostIp;
- }
-
- @JsonProperty
- public String getWso2HostPort() {
- return wso2HostPort;
- }
-
- @JsonProperty
- public void setWso2HostPort(String wso2HostPort) {
- this.wso2HostPort = wso2HostPort;
- }
-
- public String getWso2BaseUrl() {
- return "http://" + this.wso2HostIp + ":" + this.wso2HostPort;
- }
-
- @JsonProperty
- public String getCataloguePath() {
- return cataloguePath;
- }
-
- @JsonProperty
- public void setCataloguePath(String cataloguePath) {
- this.cataloguePath = cataloguePath;
- }
-
- @JsonProperty
- public String getLdapServerIp() {
- return ldapServerIp;
- }
-
- @JsonProperty
- public void setLdapServerIp(String ldapServerIp) {
- this.ldapServerIp = ldapServerIp;
- }
-
- @JsonProperty
- public String getLdapServerPort() {
- return ldapServerPort;
- }
-
- @JsonProperty
- public void setLdapServerPort(String ldapServerPort) {
- this.ldapServerPort = ldapServerPort;
- }
-
- @JsonProperty
- public String getLdapLogindn() {
- return ldapLogindn;
- }
-
- @JsonProperty
- public void setLdapLogindn(String ldapLogindn) {
- this.ldapLogindn = ldapLogindn;
- }
-
- @JsonProperty
- public String getLdapPassword() {
- return ldapPassword;
- }
-
- @JsonProperty
- public void setLdapPassword(String ldapPassword) {
- this.ldapPassword = ldapPassword;
- }
-
- @JsonProperty
- public String getLdapVersion() {
- return ldapVersion;
- }
-
- @JsonProperty
- public void setLdapVersion(String ldapVersion) {
- this.ldapVersion = ldapVersion;
- }
-
- @JsonProperty
- public String getHttpServerPath() {
- return httpServerPath;
- }
-
- @JsonProperty
- public void setHttpServerPath(String httpServerPath) {
- this.httpServerPath = httpServerPath;
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.dropwizard.Configuration;
+import io.dropwizard.db.DataSourceFactory;
+import org.hibernate.validator.constraints.NotEmpty;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+
+
+
+
+public class CatalogAppConfiguration extends Configuration {
+ @NotEmpty
+ private String template;
+
+ @NotEmpty
+ private String defaultName = "OPENO-Catalog";
+
+ @NotEmpty
+ private String msbServerAddr;
+
+ @NotEmpty
+ private String httpServerAddr;
+
+ @NotEmpty
+ private String opentoscaServerAddr;
+
+ @NotEmpty
+ private String yamlParseAddr;
+
+ @NotEmpty
+ private String wso2HostIp;
+
+ @NotEmpty
+ private String wso2HostPort;
+
+ @NotEmpty
+ private String cataloguePath;
+ @NotEmpty
+ private String httpServerPath;
+ @NotEmpty
+ private String ldapServerIp;
+
+ @NotEmpty
+ private String ldapServerPort;
+
+ @NotEmpty
+ private String ldapLogindn;
+
+ @NotEmpty
+ private String ldapPassword;
+
+ @NotEmpty
+ private String ldapVersion;
+ @Valid
+ @NotNull
+ private DataSourceFactory database = new DataSourceFactory();
+
+ @JsonProperty("database")
+ public DataSourceFactory getDataSourceFactory() {
+ return database;
+ }
+
+ @JsonProperty("database")
+ public void setDataSourceFactory(DataSourceFactory dataSourceFactory) {
+ this.database = dataSourceFactory;
+ }
+
+ @JsonProperty
+ public String getTemplate() {
+ return template;
+ }
+
+ @JsonProperty
+ public void setTemplate(String template) {
+ this.template = template;
+ }
+
+ @JsonProperty
+ public String getDefaultName() {
+ return defaultName;
+ }
+
+ @JsonProperty
+ public void setDefaultName(String name) {
+ this.defaultName = name;
+ }
+
+ @JsonProperty
+ public String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ @JsonProperty
+ public void setMsbServerAddr(String msbServerAddr) {
+ this.msbServerAddr = msbServerAddr;
+ }
+
+ @JsonProperty
+ public String getHttpServerAddr() {
+ return httpServerAddr;
+ }
+
+ @JsonProperty
+ public void setHttpServerAddr(String httpServerAddr) {
+ this.httpServerAddr = httpServerAddr;
+ }
+
+ @JsonProperty
+ public String getOpentoscaServerAddr() {
+ return opentoscaServerAddr;
+ }
+
+ @JsonProperty
+ public void setOpentoscaServerAddr(String opentoscaServerAddr) {
+ this.opentoscaServerAddr = opentoscaServerAddr;
+ }
+
+ @JsonProperty
+ public String getYamlParseAddr() {
+ return yamlParseAddr;
+ }
+
+ @JsonProperty
+ public void setYamlParseAddr(String yamlParseAddr) {
+ this.yamlParseAddr = yamlParseAddr;
+ }
+
+ @JsonProperty
+ public String getWso2HostIp() {
+ return wso2HostIp;
+ }
+
+ @JsonProperty
+ public void setWso2HostIp(String wso2HostIp) {
+ this.wso2HostIp = wso2HostIp;
+ }
+
+ @JsonProperty
+ public String getWso2HostPort() {
+ return wso2HostPort;
+ }
+
+ @JsonProperty
+ public void setWso2HostPort(String wso2HostPort) {
+ this.wso2HostPort = wso2HostPort;
+ }
+
+ public String getWso2BaseUrl() {
+ return "http://" + this.wso2HostIp + ":" + this.wso2HostPort;
+ }
+
+ @JsonProperty
+ public String getCataloguePath() {
+ return cataloguePath;
+ }
+
+ @JsonProperty
+ public void setCataloguePath(String cataloguePath) {
+ this.cataloguePath = cataloguePath;
+ }
+
+ @JsonProperty
+ public String getLdapServerIp() {
+ return ldapServerIp;
+ }
+
+ @JsonProperty
+ public void setLdapServerIp(String ldapServerIp) {
+ this.ldapServerIp = ldapServerIp;
+ }
+
+ @JsonProperty
+ public String getLdapServerPort() {
+ return ldapServerPort;
+ }
+
+ @JsonProperty
+ public void setLdapServerPort(String ldapServerPort) {
+ this.ldapServerPort = ldapServerPort;
+ }
+
+ @JsonProperty
+ public String getLdapLogindn() {
+ return ldapLogindn;
+ }
+
+ @JsonProperty
+ public void setLdapLogindn(String ldapLogindn) {
+ this.ldapLogindn = ldapLogindn;
+ }
+
+ @JsonProperty
+ public String getLdapPassword() {
+ return ldapPassword;
+ }
+
+ @JsonProperty
+ public void setLdapPassword(String ldapPassword) {
+ this.ldapPassword = ldapPassword;
+ }
+
+ @JsonProperty
+ public String getLdapVersion() {
+ return ldapVersion;
+ }
+
+ @JsonProperty
+ public void setLdapVersion(String ldapVersion) {
+ this.ldapVersion = ldapVersion;
+ }
+
+ @JsonProperty
+ public String getHttpServerPath() {
+ return httpServerPath;
+ }
+
+ @JsonProperty
+ public void setHttpServerPath(String httpServerPath) {
+ this.httpServerPath = httpServerPath;
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java
index 3d85ee31..c32cfa02 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java
@@ -1,42 +1,42 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class CommonErrorResponse {
-
- private String code;
-
- private String message;
-
-
- public static Object failure(String message) {
- return message;
- }
-
- public CommonErrorResponse(String message) {
- super();
- this.message = message;
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CommonErrorResponse {
+
+ private String code;
+
+ private String message;
+
+
+ public static Object failure(String message) {
+ return message;
+ }
+
+ public CommonErrorResponse(String message) {
+ super();
+ this.message = message;
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java
index d9076715..76cefc85 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java
@@ -1,32 +1,32 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import org.openo.commontosca.catalog.CatalogAppConfiguration;
-
-
-public class Config {
- private static CatalogAppConfiguration configration;
-
- public static CatalogAppConfiguration getConfigration() {
- return configration;
- }
-
- public static void setConfigration(CatalogAppConfiguration config) {
- configration = config;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import org.openo.commontosca.catalog.CatalogAppConfiguration;
+
+
+public class Config {
+ private static CatalogAppConfiguration configration;
+
+ public static CatalogAppConfiguration getConfigration() {
+ return configration;
+ }
+
+ public static void setConfigration(CatalogAppConfiguration config) {
+ configration = config;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java
index a3370062..8408b97b 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java
@@ -1,186 +1,186 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-
-public final class FileUtil {
-
- public static final Logger LOG = LoggerFactory.getLogger(FileUtil.class);
-
- private static final int BUFFER_SIZE = 2 * 1024 * 1024;
-
- private static final int TRY_COUNT = 3;
-
- private FileUtil() {
-
- }
-
-
- /**
- * create dir.
- * @param dir dir to create
- * @return boolean
- */
- public static boolean createDirectory(String dir) {
- File folder = new File(dir);
- int tryCount = 0;
- while (tryCount < TRY_COUNT) {
- tryCount++;
- if (!folder.exists() && !folder.mkdirs()) {
- continue;
- } else {
- return true;
- }
- }
-
- return folder.exists();
- }
-
- /**
- * delete file.
- * @param file the file to delete
- * @return boolean
- */
- public static boolean deleteFile(File file) {
- String hintInfo = file.isDirectory() ? "dir " : "file ";
- boolean isFileDeleted = file.delete();
- boolean isFileExist = file.exists();
- if (!isFileExist) {
- if (isFileDeleted) {
- LOG.info("delete " + hintInfo + file.getAbsolutePath());
- } else {
- isFileDeleted = true;
- LOG.info("file not exist. no need delete " + hintInfo + file.getAbsolutePath());
- }
- } else {
- LOG.info("fail to delete " + hintInfo + file.getAbsolutePath());
- }
- return isFileDeleted;
- }
-
-
- /**
- * unzip zip file.
- * @param zipFileName file name to zip
- * @param extPlace extPlace
- * @return unzip file name
- * @throws IOException e1
- */
- public static ArrayList unzip(String zipFileName, String extPlace) throws IOException {
- ZipFile zipFile = null;
- ArrayList unzipFileNams = new ArrayList();
-
- try {
- zipFile = new ZipFile(zipFileName);
- Enumeration> fileEn = zipFile.entries();
- byte[] buffer = new byte[BUFFER_SIZE];
-
- while (fileEn.hasMoreElements()) {
- InputStream input = null;
- BufferedOutputStream bos = null;
- try {
- ZipEntry entry = (ZipEntry) fileEn.nextElement();
- if (entry.isDirectory()) {
- continue;
- }
-
- input = zipFile.getInputStream(entry);
- File file = new File(extPlace, entry.getName());
- if (!file.getParentFile().exists()) {
- createDirectory(file.getParentFile().getAbsolutePath());
- }
-
- bos = new BufferedOutputStream(new FileOutputStream(file));
- while (true) {
- int length = input.read(buffer);
- if (length == -1) {
- break;
- }
- bos.write(buffer, 0, length);
- }
- unzipFileNams.add(file.getAbsolutePath());
- } finally {
- closeOutputStream(bos);
- closeInputStream(input);
- }
- }
- } finally {
- closeZipFile(zipFile);
- }
- return unzipFileNams;
- }
-
- /**
- * close InputStream.
- *
- * @param inputStream the inputstream to close
- */
- private static void closeInputStream(InputStream inputStream) {
- try {
- if (inputStream != null) {
- inputStream.close();
- }
- } catch (Exception e1) {
- LOG.info("close InputStream error!");
- }
- }
-
- /**
- * close OutputStream.
- *
- * @param outputStream the output stream to close
- */
- private static void closeOutputStream(OutputStream outputStream) {
- try {
- if (outputStream != null) {
- outputStream.close();
- }
- } catch (Exception e1) {
- LOG.info("close OutputStream error!");
- }
- }
-
- /**
- * close zipFile.
- *
- * @param zipFile the zipFile to close
- */
- private static void closeZipFile(ZipFile zipFile) {
- try {
- if (zipFile != null) {
- zipFile.close();
- zipFile = null;
- }
- } catch (IOException e1) {
- LOG.info("close ZipFile error!");
- }
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+
+public final class FileUtil {
+
+ public static final Logger LOG = LoggerFactory.getLogger(FileUtil.class);
+
+ private static final int BUFFER_SIZE = 2 * 1024 * 1024;
+
+ private static final int TRY_COUNT = 3;
+
+ private FileUtil() {
+
+ }
+
+
+ /**
+ * create dir.
+ * @param dir dir to create
+ * @return boolean
+ */
+ public static boolean createDirectory(String dir) {
+ File folder = new File(dir);
+ int tryCount = 0;
+ while (tryCount < TRY_COUNT) {
+ tryCount++;
+ if (!folder.exists() && !folder.mkdirs()) {
+ continue;
+ } else {
+ return true;
+ }
+ }
+
+ return folder.exists();
+ }
+
+ /**
+ * delete file.
+ * @param file the file to delete
+ * @return boolean
+ */
+ public static boolean deleteFile(File file) {
+ String hintInfo = file.isDirectory() ? "dir " : "file ";
+ boolean isFileDeleted = file.delete();
+ boolean isFileExist = file.exists();
+ if (!isFileExist) {
+ if (isFileDeleted) {
+ LOG.info("delete " + hintInfo + file.getAbsolutePath());
+ } else {
+ isFileDeleted = true;
+ LOG.info("file not exist. no need delete " + hintInfo + file.getAbsolutePath());
+ }
+ } else {
+ LOG.info("fail to delete " + hintInfo + file.getAbsolutePath());
+ }
+ return isFileDeleted;
+ }
+
+
+ /**
+ * unzip zip file.
+ * @param zipFileName file name to zip
+ * @param extPlace extPlace
+ * @return unzip file name
+ * @throws IOException e1
+ */
+ public static ArrayList unzip(String zipFileName, String extPlace) throws IOException {
+ ZipFile zipFile = null;
+ ArrayList unzipFileNams = new ArrayList();
+
+ try {
+ zipFile = new ZipFile(zipFileName);
+ Enumeration> fileEn = zipFile.entries();
+ byte[] buffer = new byte[BUFFER_SIZE];
+
+ while (fileEn.hasMoreElements()) {
+ InputStream input = null;
+ BufferedOutputStream bos = null;
+ try {
+ ZipEntry entry = (ZipEntry) fileEn.nextElement();
+ if (entry.isDirectory()) {
+ continue;
+ }
+
+ input = zipFile.getInputStream(entry);
+ File file = new File(extPlace, entry.getName());
+ if (!file.getParentFile().exists()) {
+ createDirectory(file.getParentFile().getAbsolutePath());
+ }
+
+ bos = new BufferedOutputStream(new FileOutputStream(file));
+ while (true) {
+ int length = input.read(buffer);
+ if (length == -1) {
+ break;
+ }
+ bos.write(buffer, 0, length);
+ }
+ unzipFileNams.add(file.getAbsolutePath());
+ } finally {
+ closeOutputStream(bos);
+ closeInputStream(input);
+ }
+ }
+ } finally {
+ closeZipFile(zipFile);
+ }
+ return unzipFileNams;
+ }
+
+ /**
+ * close InputStream.
+ *
+ * @param inputStream the inputstream to close
+ */
+ private static void closeInputStream(InputStream inputStream) {
+ try {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ } catch (Exception e1) {
+ LOG.info("close InputStream error!");
+ }
+ }
+
+ /**
+ * close OutputStream.
+ *
+ * @param outputStream the output stream to close
+ */
+ private static void closeOutputStream(OutputStream outputStream) {
+ try {
+ if (outputStream != null) {
+ outputStream.close();
+ }
+ } catch (Exception e1) {
+ LOG.info("close OutputStream error!");
+ }
+ }
+
+ /**
+ * close zipFile.
+ *
+ * @param zipFile the zipFile to close
+ */
+ private static void closeZipFile(ZipFile zipFile) {
+ try {
+ if (zipFile != null) {
+ zipFile.close();
+ zipFile = null;
+ }
+ } catch (IOException e1) {
+ LOG.info("close ZipFile error!");
+ }
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java
index ccae9adf..270ff395 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java
@@ -1,32 +1,32 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-
-public class HttpServerAddrConfig {
-
- protected static String httpServerAddress;
-
- public static String getHttpServerAddress() {
- return httpServerAddress;
- }
-
- public static void setHttpServerAddress(String httpServerAddress) {
- HttpServerAddrConfig.httpServerAddress = httpServerAddress;
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+
+public class HttpServerAddrConfig {
+
+ protected static String httpServerAddress;
+
+ public static String getHttpServerAddress() {
+ return httpServerAddress;
+ }
+
+ public static void setHttpServerAddress(String httpServerAddress) {
+ HttpServerAddrConfig.httpServerAddress = httpServerAddress;
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java
index db66f935..b47a6cae 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java
@@ -1,30 +1,30 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-
-public class HttpServerPathConfig {
- protected static String httpServerPath;
-
- public static String getHttpServerPath() {
- return httpServerPath;
- }
-
- public static void setHttpServerPath(String httpServerPath) {
- HttpServerPathConfig.httpServerPath = httpServerPath;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+
+public class HttpServerPathConfig {
+ protected static String httpServerPath;
+
+ public static String getHttpServerPath() {
+ return httpServerPath;
+ }
+
+ public static void setHttpServerPath(String httpServerPath) {
+ HttpServerPathConfig.httpServerPath = httpServerPath;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java
index caecbc09..14665f1c 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java
@@ -1,31 +1,31 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-public class MsbAddrConfig {
-
- protected static String msbAddress;
-
- public static String getMsbAddress() {
- return msbAddress;
- }
-
- public static void setMsbAddress(String msbAddress) {
- MsbAddrConfig.msbAddress = msbAddress;
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+public class MsbAddrConfig {
+
+ protected static String msbAddress;
+
+ public static String getMsbAddress() {
+ return msbAddress;
+ }
+
+ public static void setMsbAddress(String msbAddress) {
+ MsbAddrConfig.msbAddress = msbAddress;
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java
index ac2c2c07..1a5eac6c 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbUtil.java
@@ -1,56 +1,56 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-/**
- * micro-service bus utility class.
- *
- */
-public class MsbUtil {
-
- public static String getRocBaseUrl() {
- return Config.getConfigration().getMsbServerAddr() + getRocApiRootDomain();
- }
-
- private static String getRocApiRootDomain() {
- return "/api/roc/v1";
- }
-
- public static String getNsocLifecycleBaseUrl() {
- return Config.getConfigration().getMsbServerAddr() + getNsocLifeCycleRootDomain();
- }
-
- private static String getNsocLifeCycleRootDomain() {
- return "/api/nsoc/v1";
- }
-
- public static String getVimBaseUrl() {
- return Config.getConfigration().getMsbServerAddr() + getVimRootDomain();
- }
-
- private static String getVimRootDomain() {
- return "/api/vim/v1";
- }
-
- public static String getPackageUrl() {
- return Config.getConfigration().getMsbServerAddr() + "/api/nsoc/v1/csar/";
- }
-
- public static String getYamlParseBaseUrl() {
- return Config.getConfigration().getYamlParseAddr() + "/api/yamlparser/v1";
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+/**
+ * micro-service bus utility class.
+ *
+ */
+public class MsbUtil {
+
+ public static String getRocBaseUrl() {
+ return Config.getConfigration().getMsbServerAddr() + getRocApiRootDomain();
+ }
+
+ private static String getRocApiRootDomain() {
+ return "/api/roc/v1";
+ }
+
+ public static String getNsocLifecycleBaseUrl() {
+ return Config.getConfigration().getMsbServerAddr() + getNsocLifeCycleRootDomain();
+ }
+
+ private static String getNsocLifeCycleRootDomain() {
+ return "/api/nsoc/v1";
+ }
+
+ public static String getVimBaseUrl() {
+ return Config.getConfigration().getMsbServerAddr() + getVimRootDomain();
+ }
+
+ private static String getVimRootDomain() {
+ return "/api/vim/v1";
+ }
+
+ public static String getPackageUrl() {
+ return Config.getConfigration().getMsbServerAddr() + "/api/nsoc/v1/csar/";
+ }
+
+ public static String getYamlParseBaseUrl() {
+ return Config.getConfigration().getYamlParseAddr() + "/api/yamlparser/v1";
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java
index 70a53f1f..57e24e0b 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java
@@ -1,35 +1,35 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import javax.ws.rs.core.Response;
-
-
-public class RestUtil {
-
- /**
- * get rest exception.
- * @param errorMsg error message
- * @return Response
- */
- public static Response getRestException(String errorMsg) {
- String code = "001";
- return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
- .entity(new CommonErrorResponse(code, errorMsg)).build();
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import javax.ws.rs.core.Response;
+
+
+public class RestUtil {
+
+ /**
+ * get rest exception.
+ * @param errorMsg error message
+ * @return Response
+ */
+ public static Response getRestException(String errorMsg) {
+ String code = "001";
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR)
+ .entity(new CommonErrorResponse(code, errorMsg)).build();
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java
index b83985f2..1312f2f0 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ServiceRegistrer.java
@@ -1,97 +1,97 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import org.openo.commontosca.catalog.externalservice.msb.MicroserviceBusConsumer;
-import org.openo.commontosca.catalog.externalservice.msb.ServiceRegisterEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class ServiceRegistrer implements Runnable {
- private final ArrayList serviceEntityList =
- new ArrayList();
- private static final Logger LOG = LoggerFactory.getLogger(ServiceRegistrer.class);
-
- public ServiceRegistrer() {
- initServiceEntity();
- }
-
- @Override
- public void run() {
- LOG.info("start microservice register");
- boolean flag = false;
- ServiceRegisterEntity entity = new ServiceRegisterEntity();
- int retry = 0;
- while (retry < 1000 && serviceEntityList.size() > 0) {
- Iterator it = serviceEntityList.iterator();
- while (it.hasNext()) {
- entity = it.next();
- LOG.info("start" + entity.getServiceName() + " catalog microservice register.retry:"
- + retry);
- flag = MicroserviceBusConsumer.registerService(entity);
- if (flag == false) {
- LOG.warn(entity.getServiceName()
- + " microservice register failed, sleep 30S and try again.");
- threadSleep(30000);
- } else {
- LOG.info(entity.getServiceName() + " microservice register success!");
- it.remove();
- }
- }
- retry++;
-
- }
- LOG.info("catalog microservice register end.");
-
- }
-
- /**
- * sleep thread.
- * @param second sleep second
- */
- private void threadSleep(int seconds) {
- LOG.info("start sleep ....");
- try {
- Thread.sleep(seconds);
- } catch (InterruptedException e1) {
- LOG.error("thread sleep error.errorMsg:" + e1.getMessage());
- }
- LOG.info("sleep end .");
- }
-
- private void initServiceEntity() {
- ServiceRegisterEntity catalogEntity = new ServiceRegisterEntity();
- catalogEntity.setServiceName("catalog");
- catalogEntity.setProtocol("REST");
- catalogEntity.setVersion("v1");
- catalogEntity.setUrl("/openoapi/catalog/v1");
- catalogEntity.setSingleNode(null, "8200", 0);
- catalogEntity.setVisualRange("1");
- serviceEntityList.add(catalogEntity);
- ServiceRegisterEntity httpServiceEntity = new ServiceRegisterEntity();
- httpServiceEntity.setServiceName("/files/catalog-http");
- httpServiceEntity.setProtocol("REST");
- httpServiceEntity.setVersion("v1");
- httpServiceEntity.setUrl("/");
- httpServiceEntity.setSingleNode(null, "8201", 0);
- httpServiceEntity.setVisualRange("1");
- serviceEntityList.add(httpServiceEntity);
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import org.openo.commontosca.catalog.externalservice.msb.MicroserviceBusConsumer;
+import org.openo.commontosca.catalog.externalservice.msb.ServiceRegisterEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class ServiceRegistrer implements Runnable {
+ private final ArrayList serviceEntityList =
+ new ArrayList();
+ private static final Logger LOG = LoggerFactory.getLogger(ServiceRegistrer.class);
+
+ public ServiceRegistrer() {
+ initServiceEntity();
+ }
+
+ @Override
+ public void run() {
+ LOG.info("start microservice register");
+ boolean flag = false;
+ ServiceRegisterEntity entity = new ServiceRegisterEntity();
+ int retry = 0;
+ while (retry < 1000 && serviceEntityList.size() > 0) {
+ Iterator it = serviceEntityList.iterator();
+ while (it.hasNext()) {
+ entity = it.next();
+ LOG.info("start" + entity.getServiceName() + " catalog microservice register.retry:"
+ + retry);
+ flag = MicroserviceBusConsumer.registerService(entity);
+ if (flag == false) {
+ LOG.warn(entity.getServiceName()
+ + " microservice register failed, sleep 30S and try again.");
+ threadSleep(30000);
+ } else {
+ LOG.info(entity.getServiceName() + " microservice register success!");
+ it.remove();
+ }
+ }
+ retry++;
+
+ }
+ LOG.info("catalog microservice register end.");
+
+ }
+
+ /**
+ * sleep thread.
+ * @param second sleep second
+ */
+ private void threadSleep(int seconds) {
+ LOG.info("start sleep ....");
+ try {
+ Thread.sleep(seconds);
+ } catch (InterruptedException e1) {
+ LOG.error("thread sleep error.errorMsg:" + e1.getMessage());
+ }
+ LOG.info("sleep end .");
+ }
+
+ private void initServiceEntity() {
+ ServiceRegisterEntity catalogEntity = new ServiceRegisterEntity();
+ catalogEntity.setServiceName("catalog");
+ catalogEntity.setProtocol("REST");
+ catalogEntity.setVersion("v1");
+ catalogEntity.setUrl("/openoapi/catalog/v1");
+ catalogEntity.setSingleNode(null, "8200", 0);
+ catalogEntity.setVisualRange("1");
+ serviceEntityList.add(catalogEntity);
+ ServiceRegisterEntity httpServiceEntity = new ServiceRegisterEntity();
+ httpServiceEntity.setServiceName("/files/catalog-http");
+ httpServiceEntity.setProtocol("REST");
+ httpServiceEntity.setVersion("v1");
+ httpServiceEntity.setUrl("/");
+ httpServiceEntity.setSingleNode(null, "8201", 0);
+ httpServiceEntity.setVisualRange("1");
+ serviceEntityList.add(httpServiceEntity);
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java
index e202e706..e378c36c 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java
@@ -1,123 +1,123 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.common;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.zip.CRC32;
-import java.util.zip.CheckedOutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-
-public class ZipCompressor {
-
- public static final Logger LOG = LoggerFactory.getLogger(ZipCompressor.class);
- static final int BUFFER = 8192;
-
- private File zipFile;
-
- public ZipCompressor(String pathName) {
- zipFile = new File(pathName);
- }
-
- /**
- * compress file according several path.
- * @param pathName file path name
- */
- public void compress(String... pathName) {
- ZipOutputStream out = null;
- try {
- FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
- CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32());
- out = new ZipOutputStream(cos);
- String basedir = "";
- for (int i = 0; i < pathName.length; i++) {
- compress(new File(pathName[i]), out, basedir);
- }
- out.close();
- } catch (Exception e1) {
- throw new RuntimeException(e1);
- }
- }
-
- /**
- * compress file according file path.
- * @param srcPathName file path name
- */
- public void compress(String srcPathName) {
- File file = new File(srcPathName);
- if (!file.exists()) {
- throw new RuntimeException(srcPathName + "not exist!");
- }
- try {
- FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
- CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32());
- ZipOutputStream out = new ZipOutputStream(cos);
- String basedir = "";
- compress(file, out, basedir);
- out.close();
- } catch (Exception e1) {
- throw new RuntimeException(e1);
- }
- }
-
- private void compress(File file, ZipOutputStream out, String basedir) {
- if (file.isDirectory()) {
- System.out.println("compress:" + basedir + file.getName());
- this.compressDirectory(file, out, basedir);
- } else {
- System.out.println("compress:" + basedir + file.getName());
- this.compressFile(file, out, basedir);
- }
- }
-
- private void compressDirectory(File dir, ZipOutputStream out, String basedir) {
- if (!dir.exists()) {
- return;
- }
-
- File[] files = dir.listFiles();
- for (int i = 0; i < files.length; i++) {
- compress(files[i], out, basedir + dir.getName() + "/");
- }
- }
-
- private void compressFile(File file, ZipOutputStream out, String basedir) {
- if (!file.exists()) {
- return;
- }
- try {
- byte data[] = new byte[BUFFER];
- BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
- ZipEntry entry = new ZipEntry(basedir + file.getName());
- out.putNextEntry(entry);
- int count;
- while ((count = bis.read(data, 0, BUFFER)) != -1) {
- out.write(data, 0, count);
- }
- bis.close();
- } catch (Exception e1) {
- throw new RuntimeException(e1);
- }
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.common;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.zip.CRC32;
+import java.util.zip.CheckedOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+
+public class ZipCompressor {
+
+ public static final Logger LOG = LoggerFactory.getLogger(ZipCompressor.class);
+ static final int BUFFER = 8192;
+
+ private File zipFile;
+
+ public ZipCompressor(String pathName) {
+ zipFile = new File(pathName);
+ }
+
+ /**
+ * compress file according several path.
+ * @param pathName file path name
+ */
+ public void compress(String... pathName) {
+ ZipOutputStream out = null;
+ try {
+ FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
+ CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32());
+ out = new ZipOutputStream(cos);
+ String basedir = "";
+ for (int i = 0; i < pathName.length; i++) {
+ compress(new File(pathName[i]), out, basedir);
+ }
+ out.close();
+ } catch (Exception e1) {
+ throw new RuntimeException(e1);
+ }
+ }
+
+ /**
+ * compress file according file path.
+ * @param srcPathName file path name
+ */
+ public void compress(String srcPathName) {
+ File file = new File(srcPathName);
+ if (!file.exists()) {
+ throw new RuntimeException(srcPathName + "not exist!");
+ }
+ try {
+ FileOutputStream fileOutputStream = new FileOutputStream(zipFile);
+ CheckedOutputStream cos = new CheckedOutputStream(fileOutputStream, new CRC32());
+ ZipOutputStream out = new ZipOutputStream(cos);
+ String basedir = "";
+ compress(file, out, basedir);
+ out.close();
+ } catch (Exception e1) {
+ throw new RuntimeException(e1);
+ }
+ }
+
+ private void compress(File file, ZipOutputStream out, String basedir) {
+ if (file.isDirectory()) {
+ System.out.println("compress:" + basedir + file.getName());
+ this.compressDirectory(file, out, basedir);
+ } else {
+ System.out.println("compress:" + basedir + file.getName());
+ this.compressFile(file, out, basedir);
+ }
+ }
+
+ private void compressDirectory(File dir, ZipOutputStream out, String basedir) {
+ if (!dir.exists()) {
+ return;
+ }
+
+ File[] files = dir.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ compress(files[i], out, basedir + dir.getName() + "/");
+ }
+ }
+
+ private void compressFile(File file, ZipOutputStream out, String basedir) {
+ if (!file.exists()) {
+ return;
+ }
+ try {
+ byte data[] = new byte[BUFFER];
+ BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
+ ZipEntry entry = new ZipEntry(basedir + file.getName());
+ out.putNextEntry(entry);
+ int count;
+ while ((count = bis.read(data, 0, BUFFER)) != -1) {
+ out.write(data, 0, count);
+ }
+ bis.close();
+ } catch (Exception e1) {
+ throw new RuntimeException(e1);
+ }
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java
index 1b8231ee..95b44681 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CsarQueryCondition.java
@@ -1,39 +1,39 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class CsarQueryCondition {
-
- private String csarId;
-
- private String name;
-
- private String provider;
-
- private String version;
-
- private Boolean deletionPending;
-
- private EnumType type;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CsarQueryCondition {
+
+ private String csarId;
+
+ private String name;
+
+ private String provider;
+
+ private String version;
+
+ private Boolean deletionPending;
+
+ private EnumType type;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java
index bbd87602..2fb83df1 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOnboardState.java
@@ -1,31 +1,31 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public enum EnumOnboardState {
- onBoarded("onBoarded"), nonOnBoarded("non-onBoarded");
-
- String value;
-
- EnumOnboardState(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public enum EnumOnboardState {
+ onBoarded("onBoarded"), nonOnBoarded("non-onBoarded");
+
+ String value;
+
+ EnumOnboardState(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java
index 1dd4acb5..fefa0692 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java
@@ -1,21 +1,21 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public enum EnumOperationalState {
- Enabled, Disabled
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public enum EnumOperationalState {
+ Enabled, Disabled
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java
index 2bcbd57e..84e85202 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java
@@ -1,21 +1,21 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public enum EnumProcessState {
- normal, onBoarding, onBoardFailed, deleting, deleteFailed
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public enum EnumProcessState {
+ normal, onBoarding, onBoardFailed, deleting, deleteFailed
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java
index 28e70fd7..23a0b66b 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java
@@ -1,21 +1,21 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public enum EnumType {
- GSAR, SSAR, NSAR, NFAR
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public enum EnumType {
+ GSAR, SSAR, NSAR, NFAR
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java
index 1f4a61ce..72fa680a 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java
@@ -1,21 +1,21 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public enum EnumUsageState {
- InUse, NotInUse
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public enum EnumUsageState {
+ InUse, NotInUse
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java
index 520ebe59..0344b301 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java
@@ -1,101 +1,101 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity;
-
-public class VnfPackage {
- private String vnfPackageId;
- private String name;
- private String version;
- private String provider;
- private String vnfd;
- private EnumOperationalState operationalState = EnumOperationalState.Disabled;
- private EnumUsageState usageState = EnumUsageState.InUse;
- private String deletionPending;
- private String vnfPackageUrl;
-
- public String getVnfPackageId() {
- return vnfPackageId;
- }
-
- public void setVnfPackageId(String vnfPackageId) {
- this.vnfPackageId = vnfPackageId;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getProvider() {
- return provider;
- }
-
- public void setProvider(String provider) {
- this.provider = provider;
- }
-
- public String getVnfd() {
- return vnfd;
- }
-
- public void setVnfd(String vnfd) {
- this.vnfd = vnfd;
- }
-
- public EnumOperationalState getOperationalState() {
- return operationalState;
- }
-
- public void setOperationalState(EnumOperationalState operationalState) {
- this.operationalState = operationalState;
- }
-
- public EnumUsageState getUsageState() {
- return usageState;
- }
-
- public void setUsageState(EnumUsageState usageState) {
- this.usageState = usageState;
- }
-
- public String getVnfPackageUrl() {
- return vnfPackageUrl;
- }
-
- public void setVnfPackageUrl(String vnfPackageUrl) {
- this.vnfPackageUrl = vnfPackageUrl;
- }
-
- public String getDeletionPending() {
- return deletionPending;
- }
-
- public void setDeletionPending(String deletionPending) {
- this.deletionPending = deletionPending;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity;
+
+public class VnfPackage {
+ private String vnfPackageId;
+ private String name;
+ private String version;
+ private String provider;
+ private String vnfd;
+ private EnumOperationalState operationalState = EnumOperationalState.Disabled;
+ private EnumUsageState usageState = EnumUsageState.InUse;
+ private String deletionPending;
+ private String vnfPackageUrl;
+
+ public String getVnfPackageId() {
+ return vnfPackageId;
+ }
+
+ public void setVnfPackageId(String vnfPackageId) {
+ this.vnfPackageId = vnfPackageId;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public String getVnfd() {
+ return vnfd;
+ }
+
+ public void setVnfd(String vnfd) {
+ this.vnfd = vnfd;
+ }
+
+ public EnumOperationalState getOperationalState() {
+ return operationalState;
+ }
+
+ public void setOperationalState(EnumOperationalState operationalState) {
+ this.operationalState = operationalState;
+ }
+
+ public EnumUsageState getUsageState() {
+ return usageState;
+ }
+
+ public void setUsageState(EnumUsageState usageState) {
+ this.usageState = usageState;
+ }
+
+ public String getVnfPackageUrl() {
+ return vnfPackageUrl;
+ }
+
+ public void setVnfPackageUrl(String vnfPackageUrl) {
+ this.vnfPackageUrl = vnfPackageUrl;
+ }
+
+ public String getDeletionPending() {
+ return deletionPending;
+ }
+
+ public void setDeletionPending(String deletionPending) {
+ this.deletionPending = deletionPending;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java
index 31924c89..34c3de4d 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java
@@ -1,39 +1,39 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.request;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import org.openo.commontosca.catalog.entity.EnumType;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class PackageBasicInfo {
-
- private String provider;
-
- private EnumType type;
-
- private String version;
-
- private String format;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.request;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import org.openo.commontosca.catalog.entity.EnumType;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PackageBasicInfo {
+
+ private String provider;
+
+ private EnumType type;
+
+ private String version;
+
+ private String format;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/UploadPackageFromFtpRequest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/UploadPackageFromFtpRequest.java
index 0bc271fc..074b418f 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/UploadPackageFromFtpRequest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/UploadPackageFromFtpRequest.java
@@ -1,38 +1,38 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.request;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import org.openo.commontosca.catalog.entity.EnumType;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class UploadPackageFromFtpRequest {
-
- private String provider;
-
- private EnumType type;
-
- private String version;
-
- private String ftpUrl;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.request;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import org.openo.commontosca.catalog.entity.EnumType;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UploadPackageFromFtpRequest {
+
+ private String provider;
+
+ private EnumType type;
+
+ private String version;
+
+ private String ftpUrl;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java
index 158a68a2..bdfbe82c 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java
@@ -1,32 +1,32 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class CsarFileUriResponse {
-
- private String downloadUri;
-
- private String localPath;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class CsarFileUriResponse {
+
+ private String downloadUri;
+
+ private String localPath;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java
index 356bc07b..45ad7494 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java
@@ -1,62 +1,62 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import org.openo.commontosca.catalog.entity.EnumOperationalState;
-import org.openo.commontosca.catalog.entity.EnumProcessState;
-import org.openo.commontosca.catalog.entity.EnumUsageState;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class PackageMeta {
-
- private String csarId;
-
- private String name;
-
- private String downloadUri;
-
- private String size;
-
- private String version;
-
- private String provider;
-
- private String type;
-
- private String format;
-
- private boolean deletionPending;
-
- private String createTime;
-
- private String modifyTime;
-
- private EnumOperationalState operationalState;
-
- private EnumUsageState usageState;
-
- private String onBoardState;
-
- private EnumProcessState processState;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import org.openo.commontosca.catalog.entity.EnumOperationalState;
+import org.openo.commontosca.catalog.entity.EnumProcessState;
+import org.openo.commontosca.catalog.entity.EnumUsageState;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class PackageMeta {
+
+ private String csarId;
+
+ private String name;
+
+ private String downloadUri;
+
+ private String size;
+
+ private String version;
+
+ private String provider;
+
+ private String type;
+
+ private String format;
+
+ private boolean deletionPending;
+
+ private String createTime;
+
+ private String modifyTime;
+
+ private EnumOperationalState operationalState;
+
+ private EnumUsageState usageState;
+
+ private String onBoardState;
+
+ private EnumProcessState processState;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UpdatePackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UpdatePackageResponse.java
index 1713e705..30ca11b4 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UpdatePackageResponse.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UpdatePackageResponse.java
@@ -1,30 +1,30 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class UpdatePackageResponse {
-
- private String usageState;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UpdatePackageResponse {
+
+ private String usageState;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java
index 761bfe3b..1e800377 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java
@@ -1,31 +1,31 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.entity.response;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class UploadPackageResponse {
-
- private String csarId;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.entity.response;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class UploadPackageResponse {
+
+ private String csarId;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java
index 03e45af5..2bb6afca 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusConsumer.java
@@ -1,47 +1,47 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.externalservice.msb;
-
-import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
-import org.glassfish.jersey.client.ClientConfig;
-import org.openo.commontosca.catalog.common.Config;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class MicroserviceBusConsumer {
- private static final Logger LOG = LoggerFactory.getLogger(MicroserviceBusConsumer.class);
-
- /**
- * register service to MSB.
- * @param entity ServiceRegisterEntity
- * @return boolean
- */
- public static boolean registerService(ServiceRegisterEntity entity) {
- ClientConfig config = new ClientConfig();
- try {
- MicroserviceBusRest resourceserviceproxy =
- ConsumerFactory.createConsumer(Config.getConfigration().getMsbServerAddr(), config,
- MicroserviceBusRest.class);
- resourceserviceproxy.registerServce("false", entity);
- } catch (Exception e1) {
- LOG.error("microservice register failed!" + e1.getMessage());
- return false;
- }
- return true;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.externalservice.msb;
+
+import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
+import org.glassfish.jersey.client.ClientConfig;
+import org.openo.commontosca.catalog.common.Config;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class MicroserviceBusConsumer {
+ private static final Logger LOG = LoggerFactory.getLogger(MicroserviceBusConsumer.class);
+
+ /**
+ * register service to MSB.
+ * @param entity ServiceRegisterEntity
+ * @return boolean
+ */
+ public static boolean registerService(ServiceRegisterEntity entity) {
+ ClientConfig config = new ClientConfig();
+ try {
+ MicroserviceBusRest resourceserviceproxy =
+ ConsumerFactory.createConsumer(Config.getConfigration().getMsbServerAddr(), config,
+ MicroserviceBusRest.class);
+ resourceserviceproxy.registerServce("false", entity);
+ } catch (Exception e1) {
+ LOG.error("microservice register failed!" + e1.getMessage());
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java
index 69e9b89f..b8a566f1 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/MicroserviceBusRest.java
@@ -1,35 +1,35 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.externalservice.msb;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-@Path("/openoapi/microservices/v1/services")
-// @Path("/api/microservices/v1/services")
-public interface MicroserviceBusRest {
- @Path("")
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- public ServiceRegisterEntity registerServce(@QueryParam("createOrUpdate") String createOrUpdate,
- ServiceRegisterEntity entity) throws Exception;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.externalservice.msb;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+@Path("/openoapi/microservices/v1/services")
+// @Path("/api/microservices/v1/services")
+public interface MicroserviceBusRest {
+ @Path("")
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public ServiceRegisterEntity registerServce(@QueryParam("createOrUpdate") String createOrUpdate,
+ ServiceRegisterEntity entity) throws Exception;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java
index 4f251577..28b17f27 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceNode.java
@@ -1,34 +1,34 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.externalservice.msb;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ServiceNode {
- private String ip;
- private String port;
- private int ttl;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.externalservice.msb;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceNode {
+ private String ip;
+ private String port;
+ private int ttl;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java
index 30bed2a0..513c30a8 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/externalservice/msb/ServiceRegisterEntity.java
@@ -1,54 +1,54 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.externalservice.msb;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.ArrayList;
-
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class ServiceRegisterEntity {
- private String serviceName;
- private String version;
- private String url;
- private String protocol;
- private String visualRange;
- private ArrayList nodes = new ArrayList();
-
- /**
- * set single node.
- * @param ip ip
- * @param port port
- * @param ttl ttl
- */
- public void setSingleNode(String ip, String port, int ttl) {
- ServiceNode node = new ServiceNode();
- node.setIp(ip);
- node.setPort(port);
- node.setTtl(ttl);
- nodes.add(node);
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.externalservice.msb;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.ArrayList;
+
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceRegisterEntity {
+ private String serviceName;
+ private String version;
+ private String url;
+ private String protocol;
+ private String visualRange;
+ private ArrayList nodes = new ArrayList();
+
+ /**
+ * set single node.
+ * @param ip ip
+ * @param port port
+ * @param ttl ttl
+ */
+ public void setSingleNode(String ip, String port, int ttl) {
+ ServiceNode node = new ServiceNode();
+ node.setIp(ip);
+ node.setPort(port);
+ node.setTtl(ttl);
+ nodes.add(node);
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java
index ed075ce2..8d6972eb 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java
@@ -1,38 +1,38 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.ftp;
-
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class Ftp {
-
- private String ipAddr;
-
- private Integer port;
-
- private String userName;
-
- private String pwd;
-
- private String path;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.ftp;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Ftp {
+
+ private String ipAddr;
+
+ private Integer port;
+
+ private String userName;
+
+ private String pwd;
+
+ private String path;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java
index 6f74bbf9..01ab5a24 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java
@@ -1,208 +1,208 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.ftp;
-
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPFile;
-import org.apache.commons.net.ftp.FTPReply;
-import org.apache.log4j.Logger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-public class FtpUtil {
-
- private static Logger logger = Logger.getLogger(FtpUtil.class);
-
- private static FTPClient ftp;
-
- /**
- * get ftp connection.
- *
- * @param conftp Ftp
- * @return boolean
- * @throws Exception e
- */
- public static boolean connectFtp(Ftp conftp) throws Exception {
- ftp = new FTPClient();
- boolean flag = false;
- if (conftp.getPort() == null) {
- ftp.connect(conftp.getIpAddr(), 21);
- } else {
- ftp.connect(conftp.getIpAddr(), conftp.getPort());
- }
- ftp.login(conftp.getUserName(), conftp.getPwd());
- ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
- int reply = ftp.getReplyCode();
- if (!FTPReply.isPositiveCompletion(reply)) {
- ftp.disconnect();
- return flag;
- }
- ftp.changeWorkingDirectory(conftp.getPath());
- flag = true;
- return flag;
- }
-
- /**
- * close ftp connection.
- */
- public static void closeFtp() {
- if (ftp != null && ftp.isConnected()) {
- try {
- ftp.logout();
- ftp.disconnect();
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- }
-
- /**
- * upload file by ftp.
- *
- * @param file file to upload
- * @throws Exception e
- */
- public static void upload(File file) throws Exception {
- if (file.isDirectory()) {
- ftp.makeDirectory(file.getName());
- ftp.changeWorkingDirectory(file.getName());
- String[] files = file.list();
- for (String fstr : files) {
- File file1 = new File(file.getPath() + "/" + fstr);
- if (file1.isDirectory()) {
- upload(file1);
- ftp.changeToParentDirectory();
- } else {
- File file2 = new File(file.getPath() + "/" + fstr);
- FileInputStream input = new FileInputStream(file2);
- ftp.storeFile(file2.getName(), input);
- input.close();
- }
- }
- } else {
- File file2 = new File(file.getPath());
- FileInputStream input = new FileInputStream(file2);
- ftp.storeFile(file2.getName(), input);
- input.close();
- }
- }
-
- /**
- * download inline config.
- *
- * @param downftp ftp to download
- * @param localBaseDir local directory
- * @param remoteBaseDir remote directory
- * @throws Exception e
- */
- public static void startDown(Ftp downftp, String localBaseDir, String remoteBaseDir)
- throws Exception {
- if (FtpUtil.connectFtp(downftp)) {
-
- try {
- FTPFile[] files = null;
- boolean changedir = ftp.changeWorkingDirectory(remoteBaseDir);
- if (changedir) {
- ftp.setControlEncoding("GBK");
- files = ftp.listFiles();
- for (int i = 0; i < files.length; i++) {
- try {
- downloadFile(files[i], localBaseDir, remoteBaseDir);
- } catch (Exception e1) {
- logger.error(e1);
- logger.error("<" + files[i].getName() + ">download failed");
- }
- }
- }
- } catch (Exception e1) {
- logger.error(e1);
- logger.error("error occoured while download");
- }
- } else {
- logger.error("Connect failed !");
- }
-
- }
-
-
- /**
- * download ftp file.
- *
- * @param ftpFile ftp file to download
- * @param relativeLocalPath relative local path
- * @param relativeRemotePath relative remote path
- */
- private static void downloadFile(FTPFile ftpFile, String relativeLocalPath,
- String relativeRemotePath) {
- if (ftpFile.isFile()) {
- if (ftpFile.getName().indexOf("?") == -1) {
- OutputStream outputStream = null;
- try {
- File locaFile = new File(relativeLocalPath + ftpFile.getName());
- // 判断文件是否存在,存在则返回
- if (locaFile.exists()) {
- return;
- } else {
- outputStream = new FileOutputStream(relativeLocalPath + ftpFile.getName());
- ftp.retrieveFile(ftpFile.getName(), outputStream);
- outputStream.flush();
- outputStream.close();
- }
- } catch (Exception e1) {
- logger.error(e1);
- } finally {
- try {
- if (outputStream != null) {
- outputStream.close();
- }
- } catch (IOException e1) {
- logger.error("输出文件流异常");
- }
- }
- }
- } else {
- String newlocalRelatePath = relativeLocalPath + ftpFile.getName();
- String newRemote = new String(relativeRemotePath + ftpFile.getName().toString());
- File fl = new File(newlocalRelatePath);
- if (!fl.exists()) {
- fl.mkdirs();
- }
- try {
- newlocalRelatePath = newlocalRelatePath + '/';
- newRemote = newRemote + "/";
- String currentWorkDir = ftpFile.getName().toString();
- boolean changedir = ftp.changeWorkingDirectory(currentWorkDir);
- if (changedir) {
- FTPFile[] files = null;
- files = ftp.listFiles();
- for (int i = 0; i < files.length; i++) {
- downloadFile(files[i], newlocalRelatePath, newRemote);
- }
- }
- if (changedir) {
- ftp.changeToParentDirectory();
- }
- } catch (Exception e1) {
- logger.error(e1);
- }
- }
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.ftp;
+
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPFile;
+import org.apache.commons.net.ftp.FTPReply;
+import org.apache.log4j.Logger;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+public class FtpUtil {
+
+ private static Logger logger = Logger.getLogger(FtpUtil.class);
+
+ private static FTPClient ftp;
+
+ /**
+ * get ftp connection.
+ *
+ * @param conftp Ftp
+ * @return boolean
+ * @throws Exception e
+ */
+ public static boolean connectFtp(Ftp conftp) throws Exception {
+ ftp = new FTPClient();
+ boolean flag = false;
+ if (conftp.getPort() == null) {
+ ftp.connect(conftp.getIpAddr(), 21);
+ } else {
+ ftp.connect(conftp.getIpAddr(), conftp.getPort());
+ }
+ ftp.login(conftp.getUserName(), conftp.getPwd());
+ ftp.setFileType(FTPClient.BINARY_FILE_TYPE);
+ int reply = ftp.getReplyCode();
+ if (!FTPReply.isPositiveCompletion(reply)) {
+ ftp.disconnect();
+ return flag;
+ }
+ ftp.changeWorkingDirectory(conftp.getPath());
+ flag = true;
+ return flag;
+ }
+
+ /**
+ * close ftp connection.
+ */
+ public static void closeFtp() {
+ if (ftp != null && ftp.isConnected()) {
+ try {
+ ftp.logout();
+ ftp.disconnect();
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * upload file by ftp.
+ *
+ * @param file file to upload
+ * @throws Exception e
+ */
+ public static void upload(File file) throws Exception {
+ if (file.isDirectory()) {
+ ftp.makeDirectory(file.getName());
+ ftp.changeWorkingDirectory(file.getName());
+ String[] files = file.list();
+ for (String fstr : files) {
+ File file1 = new File(file.getPath() + "/" + fstr);
+ if (file1.isDirectory()) {
+ upload(file1);
+ ftp.changeToParentDirectory();
+ } else {
+ File file2 = new File(file.getPath() + "/" + fstr);
+ FileInputStream input = new FileInputStream(file2);
+ ftp.storeFile(file2.getName(), input);
+ input.close();
+ }
+ }
+ } else {
+ File file2 = new File(file.getPath());
+ FileInputStream input = new FileInputStream(file2);
+ ftp.storeFile(file2.getName(), input);
+ input.close();
+ }
+ }
+
+ /**
+ * download inline config.
+ *
+ * @param downftp ftp to download
+ * @param localBaseDir local directory
+ * @param remoteBaseDir remote directory
+ * @throws Exception e
+ */
+ public static void startDown(Ftp downftp, String localBaseDir, String remoteBaseDir)
+ throws Exception {
+ if (FtpUtil.connectFtp(downftp)) {
+
+ try {
+ FTPFile[] files = null;
+ boolean changedir = ftp.changeWorkingDirectory(remoteBaseDir);
+ if (changedir) {
+ ftp.setControlEncoding("GBK");
+ files = ftp.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ try {
+ downloadFile(files[i], localBaseDir, remoteBaseDir);
+ } catch (Exception e1) {
+ logger.error(e1);
+ logger.error("<" + files[i].getName() + ">download failed");
+ }
+ }
+ }
+ } catch (Exception e1) {
+ logger.error(e1);
+ logger.error("error occoured while download");
+ }
+ } else {
+ logger.error("Connect failed !");
+ }
+
+ }
+
+
+ /**
+ * download ftp file.
+ *
+ * @param ftpFile ftp file to download
+ * @param relativeLocalPath relative local path
+ * @param relativeRemotePath relative remote path
+ */
+ private static void downloadFile(FTPFile ftpFile, String relativeLocalPath,
+ String relativeRemotePath) {
+ if (ftpFile.isFile()) {
+ if (ftpFile.getName().indexOf("?") == -1) {
+ OutputStream outputStream = null;
+ try {
+ File locaFile = new File(relativeLocalPath + ftpFile.getName());
+ // 判断文件是否存在,存在则返回
+ if (locaFile.exists()) {
+ return;
+ } else {
+ outputStream = new FileOutputStream(relativeLocalPath + ftpFile.getName());
+ ftp.retrieveFile(ftpFile.getName(), outputStream);
+ outputStream.flush();
+ outputStream.close();
+ }
+ } catch (Exception e1) {
+ logger.error(e1);
+ } finally {
+ try {
+ if (outputStream != null) {
+ outputStream.close();
+ }
+ } catch (IOException e1) {
+ logger.error("输出文件流异常");
+ }
+ }
+ }
+ } else {
+ String newlocalRelatePath = relativeLocalPath + ftpFile.getName();
+ String newRemote = new String(relativeRemotePath + ftpFile.getName().toString());
+ File fl = new File(newlocalRelatePath);
+ if (!fl.exists()) {
+ fl.mkdirs();
+ }
+ try {
+ newlocalRelatePath = newlocalRelatePath + '/';
+ newRemote = newRemote + "/";
+ String currentWorkDir = ftpFile.getName().toString();
+ boolean changedir = ftp.changeWorkingDirectory(currentWorkDir);
+ if (changedir) {
+ FTPFile[] files = null;
+ files = ftp.listFiles();
+ for (int i = 0; i < files.length; i++) {
+ downloadFile(files[i], newlocalRelatePath, newRemote);
+ }
+ }
+ if (changedir) {
+ ftp.changeToParentDirectory();
+ }
+ } catch (Exception e1) {
+ logger.error(e1);
+ }
+ }
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java
index a39428a6..14137c2a 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java
@@ -1,36 +1,36 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.health;
-
-import com.codahale.metrics.health.HealthCheck;
-
-public class ConsoleHealthCheck extends HealthCheck {
- private final String template;
-
- public ConsoleHealthCheck(String template) {
- this.template = template;
- }
-
- @Override
- protected Result check() throws Exception {
- final String saying = String.format(template, "TEST");
- if (!saying.contains("TEST")) {
- return Result.unhealthy("template doesn't include a name");
- }
- return Result.healthy();
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.health;
+
+import com.codahale.metrics.health.HealthCheck;
+
+public class ConsoleHealthCheck extends HealthCheck {
+ private final String template;
+
+ public ConsoleHealthCheck(String template) {
+ this.template = template;
+ }
+
+ @Override
+ protected Result check() throws Exception {
+ final String saying = String.format(template, "TEST");
+ if (!saying.contains("TEST")) {
+ return Result.unhealthy("template doesn't include a name");
+ }
+ return Result.healthy();
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java
index 6c519d93..085ec1e4 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java
@@ -1,66 +1,66 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.common;
-
-public enum EnumToscaNodeTypeDefinition {
- VNF {
- @Override
- public String getName() {
- return "tosca.nodes.nfv.VNF";
- }
- },
- VDU {
- @Override
- public String getName() {
- return "tosca.nodes.nfv.VDU";
- }
- },
- VNFC {
- @Override
- public String getName() {
- return "tosca.nodes.nfv.VNFC";
- }
- },
- VL {
- @Override
- public String getName() {
- return "tosca.nodes.nfv.VL";
- }
- },
- CP {
- @Override
- public String getName() {
- return "tosca.nodes.nfv.CP";
- }
- };
-
- public abstract String getName();
-
- /**
- * judge wether is tosca node type definition or not.
- * @param type node type
- * @return boolean
- */
- public static boolean isToscaNodeTypeDef(String type) {
- for (EnumToscaNodeTypeDefinition enumDef : EnumToscaNodeTypeDefinition.values()) {
- if (type.indexOf(enumDef.getName()) != -1) {
- return true;
- }
- }
- return false;
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.common;
+
+public enum EnumToscaNodeTypeDefinition {
+ VNF {
+ @Override
+ public String getName() {
+ return "tosca.nodes.nfv.VNF";
+ }
+ },
+ VDU {
+ @Override
+ public String getName() {
+ return "tosca.nodes.nfv.VDU";
+ }
+ },
+ VNFC {
+ @Override
+ public String getName() {
+ return "tosca.nodes.nfv.VNFC";
+ }
+ },
+ VL {
+ @Override
+ public String getName() {
+ return "tosca.nodes.nfv.VL";
+ }
+ },
+ CP {
+ @Override
+ public String getName() {
+ return "tosca.nodes.nfv.CP";
+ }
+ };
+
+ public abstract String getName();
+
+ /**
+ * judge wether is tosca node type definition or not.
+ * @param type node type
+ * @return boolean
+ */
+ public static boolean isToscaNodeTypeDef(String type) {
+ for (EnumToscaNodeTypeDefinition enumDef : EnumToscaNodeTypeDefinition.values()) {
+ if (type.indexOf(enumDef.getName()) != -1) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java
index 41998183..608fc9d2 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java
@@ -1,47 +1,47 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.common;
-
-public enum EnumToscaRelationShipDefinition {
- VirtualBindsTo {
- @Override
- public String getName() {
- return "tosca.relationships.nfv.VirtualBindsTo";
- }
- },
- VirtualLinksTo {
- @Override
- public String getName() {
- return "tosca.relationships.nfv.VirtualLinksTo";
- }
- },
- DeployedOn {
- @Override
- public String getName() {
- return "tosca.relationships.nfv.DeployedOn";
- }
- },
- BelongTo {
- @Override
- public String getName() {
- return "tosca.relationships.nfv.BelongTo";
- }
- };
-
- public abstract String getName();
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.common;
+
+public enum EnumToscaRelationShipDefinition {
+ VirtualBindsTo {
+ @Override
+ public String getName() {
+ return "tosca.relationships.nfv.VirtualBindsTo";
+ }
+ },
+ VirtualLinksTo {
+ @Override
+ public String getName() {
+ return "tosca.relationships.nfv.VirtualLinksTo";
+ }
+ },
+ DeployedOn {
+ @Override
+ public String getName() {
+ return "tosca.relationships.nfv.DeployedOn";
+ }
+ },
+ BelongTo {
+ @Override
+ public String getName() {
+ return "tosca.relationships.nfv.BelongTo";
+ }
+ };
+
+ public abstract String getName();
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java
index 66d14834..fab6e3c6 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java
@@ -16,6 +16,8 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService;
+
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
@@ -29,7 +31,6 @@ import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService;
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java
index a8f44d97..7e5ed60e 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java
@@ -16,6 +16,8 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList;
+
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
@@ -29,7 +31,7 @@ import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList;
+
/**
* The opentosca container service returns data to the package entity.
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java
index 9a0d70c8..d5becc9a 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java
@@ -16,6 +16,8 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList;
+
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
@@ -29,8 +31,6 @@ import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList;
-
/**
* The opentosca container self service returns data to the service template entity.
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java
index 8be43c9f..11179138 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java
@@ -16,6 +16,8 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList;
+
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -26,9 +28,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServicePackageList;
-
-
/**
* The opentosca container interface for csar.
*
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java
index 36ffa8ab..91d9dd7a 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java
@@ -16,13 +16,13 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService;
+
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerSelfService;
-
/**
* The opentosca container interface for self service.
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java
index b0cbec0b..02f9fbd9 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java
@@ -16,6 +16,9 @@
package org.openo.commontosca.catalog.model.externalservice.container;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceNodeTemplateList;
+import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList;
+
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -23,9 +26,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceNodeTemplateList;
-import org.openo.commontosca.catalog.model.externalservice.entity.container.ContainerServiceTemplateList;
-
/**
* The opentosca container interface for service template.
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java
index e5768b28..585240d3 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java
@@ -1,101 +1,101 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.externalservice.container;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.XMLFilterImpl;
-
-/**
- * NamespaceFilter.
- *
- * @author 10189609
- *
- */
-public class NamespaceFilter extends XMLFilterImpl {
-
- private String usedNamespaceUri;
- private boolean addNamespace;
-
- // State variable
- private boolean addedNamespace = false;
-
- /**
- * constructor.
- * @param namespaceUri namspace uri
- * @param addNamespace add namespace or not
- */
- public NamespaceFilter(String namespaceUri, boolean addNamespace) {
- super();
-
- if (addNamespace) {
- this.usedNamespaceUri = namespaceUri;
- } else {
- this.usedNamespaceUri = "";
- }
- this.addNamespace = addNamespace;
- }
-
-
-
- @Override
- public void startDocument() throws SAXException {
- super.startDocument();
- if (addNamespace) {
- startControlledPrefixMapping();
- }
- }
-
-
-
- @Override
- public void startElement(String arg0, String arg1, String arg2, Attributes arg3)
- throws SAXException {
-
- super.startElement(this.usedNamespaceUri, arg1, arg2, arg3);
- }
-
- @Override
- public void endElement(String arg0, String arg1, String arg2) throws SAXException {
-
- super.endElement(this.usedNamespaceUri, arg1, arg2);
- }
-
- @Override
- public void startPrefixMapping(String prefix, String url) throws SAXException {
-
-
- if (addNamespace) {
- this.startControlledPrefixMapping();
- } else {
- // Remove the namespace, i.e. don´t call startPrefixMapping for parent!
- }
-
- }
-
- private void startControlledPrefixMapping() throws SAXException {
-
- if (this.addNamespace && !this.addedNamespace) {
- // We should add namespace since it is set and has not yet been done.
- super.startPrefixMapping("", this.usedNamespaceUri);
-
- // Make sure we dont do it twice
- this.addedNamespace = true;
- }
- }
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.externalservice.container;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+/**
+ * NamespaceFilter.
+ *
+ * @author 10189609
+ *
+ */
+public class NamespaceFilter extends XMLFilterImpl {
+
+ private String usedNamespaceUri;
+ private boolean addNamespace;
+
+ // State variable
+ private boolean addedNamespace = false;
+
+ /**
+ * constructor.
+ * @param namespaceUri namspace uri
+ * @param addNamespace add namespace or not
+ */
+ public NamespaceFilter(String namespaceUri, boolean addNamespace) {
+ super();
+
+ if (addNamespace) {
+ this.usedNamespaceUri = namespaceUri;
+ } else {
+ this.usedNamespaceUri = "";
+ }
+ this.addNamespace = addNamespace;
+ }
+
+
+
+ @Override
+ public void startDocument() throws SAXException {
+ super.startDocument();
+ if (addNamespace) {
+ startControlledPrefixMapping();
+ }
+ }
+
+
+
+ @Override
+ public void startElement(String arg0, String arg1, String arg2, Attributes arg3)
+ throws SAXException {
+
+ super.startElement(this.usedNamespaceUri, arg1, arg2, arg3);
+ }
+
+ @Override
+ public void endElement(String arg0, String arg1, String arg2) throws SAXException {
+
+ super.endElement(this.usedNamespaceUri, arg1, arg2);
+ }
+
+ @Override
+ public void startPrefixMapping(String prefix, String url) throws SAXException {
+
+
+ if (addNamespace) {
+ this.startControlledPrefixMapping();
+ } else {
+ // Remove the namespace, i.e. don´t call startPrefixMapping for parent!
+ }
+
+ }
+
+ private void startControlledPrefixMapping() throws SAXException {
+
+ if (this.addNamespace && !this.addedNamespace) {
+ // We should add namespace since it is set and has not yet been done.
+ super.startPrefixMapping("", this.usedNamespaceUri);
+
+ // Make sure we dont do it twice
+ this.addedNamespace = true;
+ }
+ }
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java
index fd370ec6..6c65fc81 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java
@@ -1,35 +1,35 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.externalservice.lifecycle;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-/**
- * The lifecycle interface.
- *
- * @author 10189609
- *
- */
-@Path("/appinstances")
-public interface ILifeCycleServiceRest {
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public String getVnfInstances();
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.externalservice.lifecycle;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * The lifecycle interface.
+ *
+ * @author 10189609
+ *
+ */
+@Path("/appinstances")
+public interface ILifeCycleServiceRest {
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String getVnfInstances();
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java
index f09170ff..3a99b7ee 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java
@@ -1,67 +1,67 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.externalservice.lifecycle;
-
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-
-import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
-import org.openo.commontosca.catalog.common.MsbUtil;
-import org.openo.commontosca.catalog.common.ToolUtil;
-import org.openo.commontosca.catalog.model.externalservice.entity.lifecycle.InstanceEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-
-
-
-/**
- * The lifecycle service.
- *
- * @author 10189609
- *
- */
-public class LifeCycleServiceConsumer {
- private static final Logger LOG = LoggerFactory.getLogger(LifeCycleServiceConsumer.class);
-
- /**
- * get lifecycle application instances.
- *
- * @return instance entity
- */
- public static ArrayList getInstances() {
- ILifeCycleServiceRest resourceserviceproxy =
- ConsumerFactory.createConsumer(MsbUtil.getNsocLifecycleBaseUrl(),
- ILifeCycleServiceRest.class);
- String result = "";
- try {
- result = resourceserviceproxy.getVnfInstances();
- } catch (Exception e1) {
- LOG.error("query vim info faild.", e1);
- return null;
- }
- if (ToolUtil.isEmptyString(result)) {
- return null;
- }
-
- Gson gson = new Gson();
- Type listType = new TypeToken>() {}.getType();
- return gson.fromJson(result, listType);
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.externalservice.lifecycle;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
+import org.openo.commontosca.catalog.common.MsbUtil;
+import org.openo.commontosca.catalog.common.ToolUtil;
+import org.openo.commontosca.catalog.model.externalservice.entity.lifecycle.InstanceEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+
+
+
+/**
+ * The lifecycle service.
+ *
+ * @author 10189609
+ *
+ */
+public class LifeCycleServiceConsumer {
+ private static final Logger LOG = LoggerFactory.getLogger(LifeCycleServiceConsumer.class);
+
+ /**
+ * get lifecycle application instances.
+ *
+ * @return instance entity
+ */
+ public static ArrayList getInstances() {
+ ILifeCycleServiceRest resourceserviceproxy =
+ ConsumerFactory.createConsumer(MsbUtil.getNsocLifecycleBaseUrl(),
+ ILifeCycleServiceRest.class);
+ String result = "";
+ try {
+ result = resourceserviceproxy.getVnfInstances();
+ } catch (Exception e1) {
+ LOG.error("query vim info faild.", e1);
+ return null;
+ }
+ if (ToolUtil.isEmptyString(result)) {
+ return null;
+ }
+
+ Gson gson = new Gson();
+ Type listType = new TypeToken>() {}.getType();
+ return gson.fromJson(result, listType);
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java
index 1f82eaf4..5aa6537f 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java
@@ -1,37 +1,37 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.externalservice.ro;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-/**
- * The roc resource interface.
- *
- * @author 10189609
- *
- */
-@Path("/resource")
-public interface IResourceServiceRest {
- @Path("/vims/{vim_id}")
- @GET
- @Produces(MediaType.APPLICATION_JSON)
- public String getResourceVim(@PathParam("vim_id") String vimId) throws Exception;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.externalservice.ro;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * The roc resource interface.
+ *
+ * @author 10189609
+ *
+ */
+@Path("/resource")
+public interface IResourceServiceRest {
+ @Path("/vims/{vim_id}")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public String getResourceVim(@PathParam("vim_id") String vimId) throws Exception;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java
index 198c0025..b951e952 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java
@@ -1,78 +1,78 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.externalservice.ro;
-
-import com.google.gson.Gson;
-
-import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
-
-import org.openo.commontosca.catalog.common.MsbUtil;
-import org.openo.commontosca.catalog.common.ToolUtil;
-import org.openo.commontosca.catalog.model.externalservice.entity.ro.ResourceResponseEntity;
-import org.openo.commontosca.catalog.model.externalservice.entity.ro.VimEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * The roc resource service.
- *
- * @author 10189609
- *
- */
-public class ResourceServiceConsumer {
- private static final Logger LOG = LoggerFactory.getLogger(ResourceServiceConsumer.class);
-
- private static final String RESOURCE_REST_RESULT = "SUCCESS";
-
- /**
- * get vim entity from roc by vimid.
- *
- * @param vimId id
- * @return vim entity
- */
- public static VimEntity getResourceVim(String vimId) {
- LOG.info("begin query vim info from roc,vimId:" + vimId);
- IResourceServiceRest resourceserviceproxy =
- ConsumerFactory.createConsumer(MsbUtil.getRocBaseUrl(), IResourceServiceRest.class);
- String result = "";
- try {
- result = resourceserviceproxy.getResourceVim(vimId);
- } catch (Exception e1) {
- LOG.error("query vim info faild.", e1);
- return null;
- }
- if (ToolUtil.isEmptyString(result)) {
- LOG.error("query vim info faild, vim info is null, vimId:" + vimId);
- return null;
- }
-
- Gson gson = new Gson();
- ResourceResponseEntity responseEntity = gson.fromJson(result, ResourceResponseEntity.class);
- if (!RESOURCE_REST_RESULT.equalsIgnoreCase(responseEntity.getOperationResult())) {
- LOG.error("query vim info faild.vimId:" + vimId);
- return null;
- }
- if (responseEntity.getData().size() <= 0) {
- LOG.error("query vim info faild, vim info is empty, vimId:" + vimId);
- return null;
- }
-
- LOG.info("end query vim info from roc.");
- return responseEntity.getData().get(0);
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.externalservice.ro;
+
+import com.google.gson.Gson;
+
+import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
+
+import org.openo.commontosca.catalog.common.MsbUtil;
+import org.openo.commontosca.catalog.common.ToolUtil;
+import org.openo.commontosca.catalog.model.externalservice.entity.ro.ResourceResponseEntity;
+import org.openo.commontosca.catalog.model.externalservice.entity.ro.VimEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The roc resource service.
+ *
+ * @author 10189609
+ *
+ */
+public class ResourceServiceConsumer {
+ private static final Logger LOG = LoggerFactory.getLogger(ResourceServiceConsumer.class);
+
+ private static final String RESOURCE_REST_RESULT = "SUCCESS";
+
+ /**
+ * get vim entity from roc by vimid.
+ *
+ * @param vimId id
+ * @return vim entity
+ */
+ public static VimEntity getResourceVim(String vimId) {
+ LOG.info("begin query vim info from roc,vimId:" + vimId);
+ IResourceServiceRest resourceserviceproxy =
+ ConsumerFactory.createConsumer(MsbUtil.getRocBaseUrl(), IResourceServiceRest.class);
+ String result = "";
+ try {
+ result = resourceserviceproxy.getResourceVim(vimId);
+ } catch (Exception e1) {
+ LOG.error("query vim info faild.", e1);
+ return null;
+ }
+ if (ToolUtil.isEmptyString(result)) {
+ LOG.error("query vim info faild, vim info is null, vimId:" + vimId);
+ return null;
+ }
+
+ Gson gson = new Gson();
+ ResourceResponseEntity responseEntity = gson.fromJson(result, ResourceResponseEntity.class);
+ if (!RESOURCE_REST_RESULT.equalsIgnoreCase(responseEntity.getOperationResult())) {
+ LOG.error("query vim info faild.vimId:" + vimId);
+ return null;
+ }
+ if (responseEntity.getData().size() <= 0) {
+ LOG.error("query vim info faild, vim info is empty, vimId:" + vimId);
+ return null;
+ }
+
+ LOG.info("end query vim info from roc.");
+ return responseEntity.getData().get(0);
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java
index 5bc5f14b..4bfcac04 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java
@@ -1,26 +1,26 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser;
-
-import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
-
-public abstract class AbstractModelParser {
-
- public abstract String parse(String packageId, String fileLocation)
- throws CatalogResourceException;
-
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser;
+
+import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
+
+public abstract class AbstractModelParser {
+
+ public abstract String parse(String packageId, String fileLocation)
+ throws CatalogResourceException;
+
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java
index ea245ecb..ba7b4968 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java
@@ -1,27 +1,27 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser;
-
-/**
- * enum data.
- *
- * @author 10189609
- *
- */
-public enum EnumPackageFormat {
- TOSCA_XML, TOSCA_YAML
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser;
+
+/**
+ * enum data.
+ *
+ * @author 10189609
+ *
+ */
+public enum EnumPackageFormat {
+ TOSCA_XML, TOSCA_YAML
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java
index 07cc2e5b..6530d156 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java
@@ -1,21 +1,21 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser;
-
-public enum EnumTemplateType {
- NS, VNF
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser;
+
+public enum EnumTemplateType {
+ NS, VNF
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java
index f69e2ece..acd02068 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java
@@ -1,58 +1,58 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser;
-
-import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class ModelParserFactory {
- private static final ModelParserFactory instance = new ModelParserFactory();
-
- public static ModelParserFactory getInstance() {
- return instance;
- }
-
- private Map pkgType2ParseMap =
- new HashMap();
-
- private ModelParserFactory() {
- // PackageParseMap.put(EnumPackageFormat.TOSCA_XML, new
- // ToscaXmlModelParser());
- pkgType2ParseMap.put(EnumPackageFormat.TOSCA_YAML, new ToscaYamlModelParser());
- }
-
- /**
- * parse package.
- * @param packageId package id
- * @param fileLocation package location
- * @param format package format
- * @return service template id
- * @throws CatalogResourceException e
- */
- public String parse(String packageId, String fileLocation, EnumPackageFormat format)
- throws CatalogResourceException {
- if (pkgType2ParseMap.get(format) == null) {
- throw new CatalogResourceException("Can't find its parser. package type = "
- + format.toString());
- }
-
- return pkgType2ParseMap.get(format).parse(packageId, fileLocation);
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser;
+
+import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class ModelParserFactory {
+ private static final ModelParserFactory instance = new ModelParserFactory();
+
+ public static ModelParserFactory getInstance() {
+ return instance;
+ }
+
+ private Map pkgType2ParseMap =
+ new HashMap();
+
+ private ModelParserFactory() {
+ // PackageParseMap.put(EnumPackageFormat.TOSCA_XML, new
+ // ToscaXmlModelParser());
+ pkgType2ParseMap.put(EnumPackageFormat.TOSCA_YAML, new ToscaYamlModelParser());
+ }
+
+ /**
+ * parse package.
+ * @param packageId package id
+ * @param fileLocation package location
+ * @param format package format
+ * @return service template id
+ * @throws CatalogResourceException e
+ */
+ public String parse(String packageId, String fileLocation, EnumPackageFormat format)
+ throws CatalogResourceException {
+ if (pkgType2ParseMap.get(format) == null) {
+ throw new CatalogResourceException("Can't find its parser. package type = "
+ + format.toString());
+ }
+
+ return pkgType2ParseMap.get(format).parse(packageId, fileLocation);
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/IYamlParseRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/IYamlParseRest.java
index 82b1b47e..39e419cc 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/IYamlParseRest.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/IYamlParseRest.java
@@ -1,35 +1,35 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser.yaml;
-
-import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-
-@Path("/parse")
-public interface IYamlParseRest {
-
- @POST
- @Consumes(MediaType.APPLICATION_JSON)
- @Produces(MediaType.APPLICATION_JSON)
- String parse(ParseYamlRequestParemeter request) throws Exception;
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser.yaml;
+
+import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+
+@Path("/parse")
+public interface IYamlParseRest {
+
+ @POST
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ String parse(ParseYamlRequestParemeter request) throws Exception;
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/YamlParseServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/YamlParseServiceConsumer.java
index b62bd166..2b5ee9aa 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/YamlParseServiceConsumer.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/YamlParseServiceConsumer.java
@@ -1,52 +1,52 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser.yaml;
-
-import com.google.gson.Gson;
-
-import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
-
-import org.glassfish.jersey.client.ClientConfig;
-import org.openo.commontosca.catalog.common.MsbUtil;
-import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
-import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter;
-import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlResult;
-
-
-public class YamlParseServiceConsumer {
- /**
- * get service template by template id from container service.
- *
- * @param request parse yaml request
- * @return parase yaml result
- * @throws CatalogResourceException e
- */
- public static ParseYamlResult getServiceTemplates(final ParseYamlRequestParemeter request)
- throws CatalogResourceException {
- try {
- ClientConfig config = new ClientConfig();
- IYamlParseRest yamlParseProxy =
- ConsumerFactory.createConsumer(MsbUtil.getYamlParseBaseUrl(), config,
- IYamlParseRest.class);
- String jsonStr = yamlParseProxy.parse(request);
- return new Gson().fromJson(jsonStr, ParseYamlResult.class);
- } catch (Exception e1) {
- throw new CatalogResourceException("Call parser api failed.", e1);
- }
-
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser.yaml;
+
+import com.google.gson.Gson;
+
+import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
+
+import org.glassfish.jersey.client.ClientConfig;
+import org.openo.commontosca.catalog.common.MsbUtil;
+import org.openo.commontosca.catalog.db.exception.CatalogResourceException;
+import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter;
+import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlResult;
+
+
+public class YamlParseServiceConsumer {
+ /**
+ * get service template by template id from container service.
+ *
+ * @param request parse yaml request
+ * @return parase yaml result
+ * @throws CatalogResourceException e
+ */
+ public static ParseYamlResult getServiceTemplates(final ParseYamlRequestParemeter request)
+ throws CatalogResourceException {
+ try {
+ ClientConfig config = new ClientConfig();
+ IYamlParseRest yamlParseProxy =
+ ConsumerFactory.createConsumer(MsbUtil.getYamlParseBaseUrl(), config,
+ IYamlParseRest.class);
+ String jsonStr = yamlParseProxy.parse(request);
+ return new Gson().fromJson(jsonStr, ParseYamlResult.class);
+ } catch (Exception e1) {
+ throw new CatalogResourceException("Call parser api failed.", e1);
+ }
+
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java
index ba31eee6..54540bf0 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java
@@ -1,41 +1,41 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser.yaml.entity;
-
-
-public enum EnumYamlServiceTemplateInfo {
- ID {
- @Override
- public String getName() {
- return "id";
- }
- },
- VERSION {
- @Override
- public String getName() {
- return "version";
- }
- },
- PROVIDER {
- @Override
- public String getName() {
- return "vendor";
- }
- };
-
- public abstract String getName();
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser.yaml.entity;
+
+
+public enum EnumYamlServiceTemplateInfo {
+ ID {
+ @Override
+ public String getName() {
+ return "id";
+ }
+ },
+ VERSION {
+ @Override
+ public String getName() {
+ return "version";
+ }
+ },
+ PROVIDER {
+ @Override
+ public String getName() {
+ return "vendor";
+ }
+ };
+
+ public abstract String getName();
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java
index 0ba640ac..8bfb1650 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java
@@ -1,66 +1,66 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser.yaml.entity;
-
-import java.util.List;
-
-public class ParseYamlRequestParemeter {
- private String path = "E:\\NFVO\\130. yaml2xml\\0. tosca-parser\\sample\\ag-vnfd-floatingIp.zip";
-
- private List extensionList;
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public List getExtensionList() {
- return extensionList;
- }
-
- public void setExtensionList(List extensionList) {
- this.extensionList = extensionList;
- }
-
- public Extension createExtension() {
- return new Extension();
- }
-
- public class Extension {
- private String name;
- private String value;
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
- }
-}
+/**
+ * Copyright 2016 [ZTE] and others.
+ *
+ * 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.
+ */
+
+package org.openo.commontosca.catalog.model.parser.yaml.entity;
+
+import java.util.List;
+
+public class ParseYamlRequestParemeter {
+ private String path = "E:\\NFVO\\130. yaml2xml\\0. tosca-parser\\sample\\ag-vnfd-floatingIp.zip";
+
+ private List extensionList;
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public List getExtensionList() {
+ return extensionList;
+ }
+
+ public void setExtensionList(List extensionList) {
+ this.extensionList = extensionList;
+ }
+
+ public Extension createExtension() {
+ return new Extension();
+ }
+
+ public class Extension {
+ private String name;
+ private String value;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlResult.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlResult.java
index e64a6abb..61014a1f 100644
--- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlResult.java
+++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlResult.java
@@ -1,890 +1,890 @@
-/**
- * Copyright 2016 [ZTE] and others.
- *
- * 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.
- */
-
-package org.openo.commontosca.catalog.model.parser.yaml.entity;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.annotations.SerializedName;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-
-public class ParseYamlResult {
- private String toscaDefinitionsVersion;
- private String description;
- private JsonObject nodeTypes;
- private JsonObject capabilityTypes;
- private JsonObject relationshipTypes;
- private JsonObject policyTypes;
- private TopologyTemplate topologyTemplate;
- private Map metadata;
- private JsonObject plans;
-
-
- public String getToscaDefinitionsVersion() {
- return toscaDefinitionsVersion;
- }
-
- public void setToscaDefinitionsVersion(String toscaDefinitionsVersion) {
- this.toscaDefinitionsVersion = toscaDefinitionsVersion;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public JsonObject getNodeTypes() {
- return nodeTypes;
- }
-
- public void setNodeTypes(JsonObject nodeTypes) {
- this.nodeTypes = nodeTypes;
- }
-
- public List getNodeTypeList() {
- return jsonObject2NodeTypes(nodeTypes);
- }
-
- private ArrayList jsonObject2NodeTypes(JsonObject nodeTypes) {
- ArrayList nodeTypeList = new ArrayList();
- Iterator> iterator = nodeTypes.entrySet().iterator();
- while (iterator.hasNext()) {
- NodeType type = new NodeType();
- Entry next = iterator.next();
- type.setType(next.getKey());
- type.setValue(new Gson().fromJson(next.getValue(), NodeType.NodeTypeValue.class));
- nodeTypeList.add(type);
- }
- return nodeTypeList;
- }
-
- public JsonObject getCapabilityTypes() {
- return capabilityTypes;
- }
-
- public void setCapabilityTypes(JsonObject capabilityTypes) {
- this.capabilityTypes = capabilityTypes;
- }
-
- public JsonObject getRelationshipTypes() {
- return relationshipTypes;
- }
-
- public void setRelationshipTypes(JsonObject relationshipTypes) {
- this.relationshipTypes = relationshipTypes;
- }
-
- public List getRelationshipTypeList() {
- return jsonObject2RelationshipTypes(relationshipTypes);
- }
-
- private ArrayList jsonObject2RelationshipTypes(JsonObject relationshipTypes) {
- ArrayList relationshipTypeList = new ArrayList();
- Iterator> iterator = relationshipTypes.entrySet().iterator();
- while (iterator.hasNext()) {
- RelationshipType type = new RelationshipType();
- Entry next = iterator.next();
- type.setType(next.getKey());
- type.setValue(new Gson().fromJson(next.getValue(), RelationshipType.RelationshipValue.class));
- relationshipTypeList.add(type);
- }
- return relationshipTypeList;
- }
-
- public JsonObject getPolicyTypes() {
- return policyTypes;
- }
-
- public void setPolicyTypes(JsonObject policyTypes) {
- this.policyTypes = policyTypes;
- }
-
- public TopologyTemplate getTopologyTemplate() {
- return topologyTemplate;
- }
-
- public void setTopologyTemplate(TopologyTemplate topologyTemplate) {
- this.topologyTemplate = topologyTemplate;
- }
-
- public Map getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map metadata) {
- this.metadata = metadata;
- }
-
- public JsonObject getPlans() {
- return plans;
- }
-
- public void setPlans(JsonObject plans) {
- this.plans = plans;
- }
-
- public List getPlanList() {
- return jsonObject2PlanList(this.plans);
- }
-
- private List jsonObject2PlanList(JsonObject plans) {
- if (plans == null) {
- return new ArrayList<>();
- }
- List retList = new ArrayList<>();
- Iterator> iterator = plans.entrySet().iterator();
- while (iterator.hasNext()) {
- Plan ret = new Plan();
- Entry next = iterator.next();
- ret.setName(next.getKey());
- ret.setValue(new Gson().fromJson(next.getValue(), Plan.PlanValue.class));
- retList.add(ret);
- }
- return retList;
- }
-
- public class TopologyTemplate {
- private String description;
- private List inputs;
- private List