From: huangjian Date: Thu, 18 Aug 2016 10:39:15 +0000 (+0800) Subject: 1. Adjust the directory hierarchy 2. Fix the compile issue 3.Fix the licences check... X-Git-Tag: release/sun~74 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=49302058ca6f43eb04d5cd5287aba012d489ebff;p=vfc%2Fnfvo%2Fcatalog.git 1. Adjust the directory hierarchy 2. Fix the compile issue 3.Fix the licences check warning Change-Id: I0b9326d2dcdf08ced160ebe367b4b88e292137ee Signed-off-by: huangjian --- diff --git a/catalog/pom.xml b/catalog-core/catalog-mgr/pom.xml similarity index 59% rename from catalog/pom.xml rename to catalog-core/catalog-mgr/pom.xml index 0bb17aa9..3ca842fd 100644 --- a/catalog/pom.xml +++ b/catalog-core/catalog-mgr/pom.xml @@ -1,67 +1,57 @@ - 4.0.0 - catalog-parent - org.openo.orchestrator.nfv.catalog - 0.0.1-SNAPSHOT + org.openo.commontosca.catalog + catalog-core-parent + 1.0.0-SNAPSHOT - catalog - openo/catalog/catalog + + 4.0.0 + catalog-mgr + openo/commontosca/catalog/catalog-mgr jar - - 0.8.0 - 2.5.1 - 2.16 - 1.5.3 - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-dependency-plugin - [2.0,) - - copy-dependencies - - - - - - - - - - - - + + org.eclipse.m2e + lifecycle-mapping + + + + + + org.apache.maven.plugins + maven-dependency-plugin + [2.0,) + + copy-dependencies + + + + + + + + + + org.apache.maven.plugins maven-jar-plugin @@ -99,7 +89,7 @@ - org.openo.orchestrator.nfv.catalog.catalogApp + org.openo.commontosca.catalog.catalogApp @@ -133,6 +123,7 @@ + io.dropwizard dropwizard-core @@ -141,6 +132,15 @@ io.dropwizard dropwizard-assets + + io.dropwizard + dropwizard-hibernate + + + io.dropwizard + dropwizard-migrations + + io.swagger swagger-jersey2-jaxrs @@ -150,7 +150,7 @@ org.projectlombok lombok - + org.glassfish.jersey.core jersey-server @@ -186,12 +186,12 @@ com.google.code.gson - gson + gson + dom4j dom4j - 1.6 @@ -205,6 +205,7 @@ org.cometd.java cometd-java-client + ${cometd.version} org.cometd.java @@ -223,72 +224,56 @@ commons-net commons-net - + + + mysql + mysql-connector-java + + + + commons-fileupload + commons-fileupload + + + commons-io + commons-io + + io.dropwizard - dropwizard-hibernate + dropwizard-testing + test + + + junit + junit + test - - io.dropwizard - dropwizard-migrations - + + org.powermock + powermock-module-junit4 + test + + + org.powermock + powermock-api-mockito + test + + + org.mockito + mockito-all + test + + + com.h2database + h2 + test + - mysql - mysql-connector-java - 5.1.18 - - - - commons-fileupload - commons-fileupload - 1.2.1 - - - commons-io - commons-io - 1.4 - - - - io.dropwizard - dropwizard-testing - test - - - junit - junit - 4.10 - test - - - org.powermock - powermock-api-mockito - 1.4.12 - test - - - org.powermock - powermock-module-junit4 - 1.4.12 - test - - - org.mockito - mockito-all - 1.9.5 - test - - - com.h2database - h2 - test - - - org.apache.ant - ant - 1.8.2 - test - - - + org.apache.ant + ant + test + + + diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogApp.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java similarity index 74% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogApp.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java index 4181a636..0b97867d 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogApp.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogApp.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog; +package org.openo.commontosca.catalog; import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; @@ -32,18 +32,18 @@ import javax.servlet.DispatcherType; import org.eclipse.jetty.servlets.CrossOriginFilter; import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.openo.orchestrator.nfv.catalog.common.Config; -import org.openo.orchestrator.nfv.catalog.common.HttpServerAddrConfig; -import org.openo.orchestrator.nfv.catalog.common.HttpServerPathConfig; -import org.openo.orchestrator.nfv.catalog.common.MsbAddrConfig; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.health.ConsoleHealthCheck; -import org.openo.orchestrator.nfv.catalog.resources.PackageResource; -import org.openo.orchestrator.nfv.catalog.resources.TemplateResource; +import org.openo.commontosca.catalog.common.Config; +import org.openo.commontosca.catalog.common.MsbAddrConfig; +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.openo.commontosca.catalog.common.HttpServerAddrConfig; +import org.openo.commontosca.catalog.common.HttpServerPathConfig; +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.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -107,7 +107,7 @@ public class CatalogApp extends Application { // environment.jersey().register(new VNFSoftwareVersionResource()); // register rest interface - environment.jersey().packages("org.openo.orchestrator.nfv.catalog.resources"); + environment.jersey().packages("org.openo.commontosca.catalog.resources"); // upload file by inputstream need to register MultiPartFeature environment.jersey().register(MultiPartFeature.class); @@ -130,7 +130,7 @@ public class CatalogApp extends Application { BeanConfig config = new BeanConfig(); config.setTitle("Open-o Catalog Service rest API"); config.setVersion("1.0.0"); - config.setResourcePackage("org.openo.orchestrator.nfv.catalog.resources"); + config.setResourcePackage("org.openo.commontosca.catalog.resources"); // set rest api basepath in swagger SimpleServerFactory simpleServerFactory = (SimpleServerFactory) configuration.getServerFactory(); @@ -161,7 +161,7 @@ public class CatalogApp extends Application { // servlet environment .getApplicationContext() - .addServlet("org.openo.orchestrator.nfv.catalog.cometd.CometdServlet", + .addServlet("CometdServlet", "/api/nsoccataloguenotification/v1").setInitOrder(2);// add // servlet } diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogAppConfiguration.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java similarity index 81% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogAppConfiguration.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java index 3d7dd48c..1f74f61b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/CatalogAppConfiguration.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/CatalogAppConfiguration.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog; +package org.openo.commontosca.catalog; import javax.validation.Valid; import javax.validation.constraints.NotNull; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java similarity index 57% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdException.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java index 32f52a4c..0a84ce3e 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdException.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdException.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.cometd; +package org.openo.commontosca.catalog.cometd; /** * @author 10189609 diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java similarity index 78% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdService.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java index 35a96e21..9af11450 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdService.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdService.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.cometd; +package org.openo.commontosca.catalog.cometd; import java.io.IOException; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdServlet.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java similarity index 76% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdServlet.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java index 7a9c2d06..6b69542a 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdServlet.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdServlet.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.cometd; +package org.openo.commontosca.catalog.cometd; import java.io.IOException; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java similarity index 65% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java index 0b9ae71b..6955451c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/cometd/CometdUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/cometd/CometdUtil.java @@ -1,17 +1,17 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ /** * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) @@ -28,7 +28,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.openo.orchestrator.nfv.catalog.cometd; +package org.openo.commontosca.catalog.cometd; import java.io.IOException; import java.util.Map; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonConstant.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java similarity index 56% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonConstant.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java index 0c3444ce..08741619 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonConstant.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonConstant.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; public class CommonConstant { 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 new file mode 100644 index 00000000..c260b923 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/CommonErrorResponse.java @@ -0,0 +1,49 @@ +/** + * 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; + +/** + * @author 00164331 + * + */ + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class CommonErrorResponse { + + private String code; + + private String message; + + /** + * @param message2 + * @return + */ + 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 new file mode 100644 index 00000000..b0799017 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/Config.java @@ -0,0 +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; + +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/DateTimeUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/DateTimeUtil.java new file mode 100644 index 00000000..41c38672 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/DateTimeUtil.java @@ -0,0 +1,33 @@ +/** + * 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 java.text.SimpleDateFormat; +import java.util.Date; + +public class DateTimeUtil { + public static String getCurrentTime() { + return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()); + } + + public static String getFormatTime(Date date) { + return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(date); + } + + public static String getFormatTime(Date date, String format) { + return new SimpleDateFormat(format).format(date); + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java new file mode 100644 index 00000000..0c811bde --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/EnumUploadStatus.java @@ -0,0 +1,20 @@ +/** + * 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 enum EnumUploadStatus { + Create_Directory_Success, Create_Directory_Fail, File_Exist, Upload_From_Break_Success, Upload_From_Break_Failed, Upload_New_File_Success, Upload_New_File_Failed +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FileUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java similarity index 83% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FileUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java index 3d8db9f9..ce90f34c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FileUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FileUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; import java.io.BufferedOutputStream; import java.io.File; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FtpClient.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java similarity index 89% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FtpClient.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java index fdf74a32..a7a9e37b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/FtpClient.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/FtpClient.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; import java.io.FileOutputStream; import java.io.IOException; 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 new file mode 100644 index 00000000..e8f27b56 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerAddrConfig.java @@ -0,0 +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.common; + +/** + * @author 00164331 + * + */ +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 new file mode 100644 index 00000000..6a538713 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/HttpServerPathConfig.java @@ -0,0 +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; + +/** + * @author 00164331 + * + */ +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/src/main/java/org/openo/orchestrator/nfv/catalog/common/MSBUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MSBUtil.java similarity index 58% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/MSBUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MSBUtil.java index a827604a..357d1943 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/MSBUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MSBUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; /** * micro-service bus utility class; 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 new file mode 100644 index 00000000..5fcf6849 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/MsbAddrConfig.java @@ -0,0 +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.common; + +/** + * @author 00164331 + * + */ +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/RestUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java new file mode 100644 index 00000000..f754974e --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/RestUtil.java @@ -0,0 +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; + +/** + * @author 00164331 + * + */ +public class RestUtil { + /** + * @param e + * @return + */ + 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/src/main/java/org/openo/orchestrator/nfv/catalog/common/ToolUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java similarity index 91% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/ToolUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java index ed025a0b..60a08583 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/ToolUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ToolUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; import java.io.File; import java.io.FileOutputStream; @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.UUID; -import org.openo.orchestrator.nfv.catalog.model.common.EnumToscaNodeTypeDefinition; +import org.openo.commontosca.catalog.model.common.EnumToscaNodeTypeDefinition; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/ZipCompressor.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java similarity index 80% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/ZipCompressor.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java index 53f9c1cb..8d24eac9 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/ZipCompressor.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/common/ZipCompressor.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.common; +package org.openo.commontosca.catalog.common; import java.io.BufferedInputStream; import java.io.File; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java new file mode 100644 index 00000000..6a12ffef --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/CatalogResuorceType.java @@ -0,0 +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.db.common; + +/** + ** @author 10159474 + */ +public enum CatalogResuorceType { + SERVICETEMPLATE, PACKAGE, NODETEMPLATE, TEMPLATE, SERVICETEMPLATEMAPPING; + + public static CatalogResuorceType getType(String type) { + return valueOf(type); + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java new file mode 100644 index 00000000..ddd414b8 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/common/Parameters.java @@ -0,0 +1,24 @@ +/** + * 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.db.common; + +/** + * *@author 10159474 + * + */ +public enum Parameters { + oid, name, provider, version, deletionPending, type, status, csarId, vendor, serviceTemplateId, nodeTemplateId, mappingId, nodeType; +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/BaseDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java similarity index 85% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/BaseDao.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java index 728d7333..f6b4d48b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/BaseDao.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/BaseDao.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.dao; +package org.openo.commontosca.catalog.db.dao; import java.util.List; import java.util.Map; @@ -24,8 +24,8 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.HqlFactory; import io.dropwizard.hibernate.AbstractDAO; import io.dropwizard.util.Generics; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/DaoManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java similarity index 76% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/DaoManager.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java index f5de4d27..6c9a5333 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/DaoManager.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/DaoManager.java @@ -1,22 +1,22 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.dao; +package org.openo.commontosca.catalog.db.dao; import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; /** * DAO manager class @@ -115,5 +115,11 @@ public class DaoManager { public void setTemplateMappingDao(ServiceTemplateMappingDao templateMappingDao) { this.templateMappingDao = templateMappingDao; } - -} + public void setDaoNull() + { + this.nodeTemplateDao=null; + this.templateDao=null; + this.serviceTemplateDao=null; + this.packageDao=null; + this.templateMappingDao=null; +}} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java new file mode 100644 index 00000000..41253d96 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/NodeTemplateDao.java @@ -0,0 +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.db.dao; + +import org.hibernate.SessionFactory; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; + + +/** + * host DAO class + * + * *@author 10159474 + * + */ +public class NodeTemplateDao extends BaseDao { + + public NodeTemplateDao(SessionFactory sessionFactory) { + super(sessionFactory); + } + + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java new file mode 100644 index 00000000..7f8a5036 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/PackageDao.java @@ -0,0 +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.db.dao; + +import org.hibernate.SessionFactory; +import org.openo.commontosca.catalog.db.entity.PackageData; + + +/** + * host DAO class + * + * *@author 10159474 + * + */ +public class PackageDao extends BaseDao { + + public PackageDao(SessionFactory sessionFactory) { + super(sessionFactory); + } + + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java new file mode 100644 index 00000000..e2a5f3c2 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateDao.java @@ -0,0 +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.db.dao; + +import org.hibernate.SessionFactory; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DAO class + * + * *@author 10159474 + * + */ +public class ServiceTemplateDao extends BaseDao { + private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateDao.class); + + public ServiceTemplateDao(SessionFactory sessionFactory) { + super(sessionFactory); + } + + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java new file mode 100644 index 00000000..558ce13a --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/ServiceTemplateMappingDao.java @@ -0,0 +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.db.dao; + +import org.hibernate.SessionFactory; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DAO class + * + * *@author 10159474 + * + */ +public class ServiceTemplateMappingDao extends BaseDao { + private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateMappingDao.class); + + public ServiceTemplateMappingDao(SessionFactory sessionFactory) { + super(sessionFactory); + } + + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/TemplateDao.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java similarity index 67% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/TemplateDao.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java index bb7c0376..5c39a9e8 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/TemplateDao.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/dao/TemplateDao.java @@ -1,26 +1,26 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.dao; +package org.openo.commontosca.catalog.db.dao; import org.hibernate.HibernateException; import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java new file mode 100644 index 00000000..99fe14ec --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/BaseData.java @@ -0,0 +1,20 @@ +/** + * 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.db.entity; + +public class BaseData { + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/NodeTemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java similarity index 71% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/NodeTemplateData.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java index e060ed49..aeef00b9 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/NodeTemplateData.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/NodeTemplateData.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.entity; +package org.openo.commontosca.catalog.db.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/PackageData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java similarity index 83% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/PackageData.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java index 3d403be5..6c4a8110 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/PackageData.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/PackageData.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.entity; +package org.openo.commontosca.catalog.db.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java similarity index 78% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateData.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java index 1e094566..6e5963aa 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateData.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateData.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.entity; +package org.openo.commontosca.catalog.db.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateMappingData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java similarity index 69% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateMappingData.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java index f85ce627..a0a632c5 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/ServiceTemplateMappingData.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/ServiceTemplateMappingData.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.entity; +package org.openo.commontosca.catalog.db.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java new file mode 100644 index 00000000..ff139b1e --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/entity/TemplateData.java @@ -0,0 +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.db.entity; + +import java.util.ArrayList; + +public class TemplateData extends BaseData { + private ServiceTemplateData serviceTemplate; + private ArrayList nodeTemplates = new ArrayList(); + + public ServiceTemplateData getServiceTemplate() { + return serviceTemplate; + } + + public void setServiceTemplate(ServiceTemplateData serviceTemplate) { + this.serviceTemplate = serviceTemplate; + } + + public ArrayList getNodeTemplates() { + return nodeTemplates; + } + + public void setNodeTemplates(ArrayList nodeTemplates) { + this.nodeTemplates = nodeTemplates; + } + + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/CatalogResourceException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java similarity index 65% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/CatalogResourceException.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java index da10bf9a..5a858d31 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/CatalogResourceException.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/CatalogResourceException.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.exception; +package org.openo.commontosca.catalog.db.exception; /** * diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/ErrorCodeException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java similarity index 79% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/ErrorCodeException.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java index ef9d2c85..33e6d9fa 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/exception/ErrorCodeException.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/exception/ErrorCodeException.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.exception; +package org.openo.commontosca.catalog.db.exception; /** diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java similarity index 79% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManager.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java index 8d6bae26..124fc358 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManager.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/PackageManager.java @@ -1,31 +1,31 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; -import org.openo.orchestrator.nfv.catalog.db.wrapper.PackageHandler; +import org.openo.commontosca.catalog.db.common.Parameters; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; +import org.openo.commontosca.catalog.db.wrapper.PackageHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java similarity index 84% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManager.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java index 9d706649..564116d8 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManager.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/resource/TemplateManager.java @@ -1,37 +1,37 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; -import org.openo.orchestrator.nfv.catalog.db.wrapper.NodeTemplateHandler; -import org.openo.orchestrator.nfv.catalog.db.wrapper.ServiceTemplateHandler; -import org.openo.orchestrator.nfv.catalog.db.wrapper.ServiceTemplateMappingHandler; -import org.openo.orchestrator.nfv.catalog.db.wrapper.TemplateHandler; +import org.openo.commontosca.catalog.db.common.Parameters; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.wrapper.ServiceTemplateHandler; +import org.openo.commontosca.catalog.db.wrapper.ServiceTemplateMappingHandler; +import org.openo.commontosca.catalog.db.wrapper.TemplateHandler; +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.wrapper.NodeTemplateHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java new file mode 100644 index 00000000..6924a305 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/CatalogDbUtil.java @@ -0,0 +1,44 @@ +/** + * 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.db.util; + +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.gson.Gson; + +public class CatalogDbUtil { + private final static Logger logger = LoggerFactory.getLogger(CatalogDbUtil.class); + + public static String generateId() { + return UUID.randomUUID().toString(); + } + + public static boolean isNotEmpty(String s) { + return s != null && !"".equals(s) && s.length() > 0; + } + + public static String objectToString(Object obj) { + Gson gson = new Gson(); + if (obj != null) + return gson.toJson(obj); + else + return null; + } + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java similarity index 88% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactory.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java index 6e84f28e..c7db51bf 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactory.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/util/HqlFactory.java @@ -1,26 +1,24 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Arrays; -import org.openo.orchestrator.nfv.catalog.db.entity.BaseData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/BaseHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java similarity index 82% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/BaseHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java index 926694f9..d5840930 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/BaseHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/BaseHandler.java @@ -1,29 +1,28 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.List; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.dao.BaseDao; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.BaseData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.entity.BaseData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.dao.BaseDao; +import org.openo.commontosca.catalog.db.dao.DaoManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/NodeTemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java similarity index 53% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/NodeTemplateHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java index fd01de03..a96e9371 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/NodeTemplateHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/NodeTemplateHandler.java @@ -1,26 +1,26 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.ArrayList; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/PackageHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java similarity index 77% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/PackageHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java index 2e3752a8..8fd4d04c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/PackageHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/PackageHandler.java @@ -1,29 +1,29 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.ArrayList; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.common.Parameters; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.util.HqlFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java similarity index 63% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java index 65f539c2..4412dee3 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateHandler.java @@ -1,32 +1,27 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.ArrayList; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.dao.ServiceTemplateDao; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateMappingHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java similarity index 71% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateMappingHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java index 0fa2e493..25f7982e 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/ServiceTemplateMappingHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/ServiceTemplateMappingHandler.java @@ -1,30 +1,27 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.ArrayList; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/TemplateHandler.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java similarity index 66% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/TemplateHandler.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java index ff9d6885..714dd06b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/wrapper/TemplateHandler.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/db/wrapper/TemplateHandler.java @@ -1,28 +1,28 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.wrapper; +package org.openo.commontosca.catalog.db.wrapper; import java.util.ArrayList; -import org.openo.orchestrator.nfv.catalog.db.common.CatalogResuorceType; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.CatalogDbUtil; +import org.openo.commontosca.catalog.db.common.CatalogResuorceType; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARPackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CSARPackage.java similarity index 68% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARPackage.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CSARPackage.java index 0586d012..671a8514 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARPackage.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CSARPackage.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.entity; +package org.openo.commontosca.catalog.entity; public class CSARPackage { private String id; 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 new file mode 100644 index 00000000..a9c43e4c --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/CSARQueryCondition.java @@ -0,0 +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; + +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/EnumOperationalState.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java new file mode 100644 index 00000000..b1f16ec6 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumOperationalState.java @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 00000000..62dab552 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumProcessState.java @@ -0,0 +1,24 @@ +/** + * 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; + +/** + * @author 00164331 + * + */ +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 new file mode 100644 index 00000000..7a25d748 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumType.java @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 00000000..e2ffed13 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/EnumUsageState.java @@ -0,0 +1,20 @@ +/** + * 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/src/main/java/org/openo/orchestrator/nfv/catalog/entity/VnfPackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java similarity index 70% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/VnfPackage.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java index 71004912..2d3e80c4 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/VnfPackage.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/VnfPackage.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.entity; +package org.openo.commontosca.catalog.entity; public class VnfPackage { private String vnfPackageId; 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 new file mode 100644 index 00000000..998c2121 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/PackageBasicInfo.java @@ -0,0 +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 org.openo.commontosca.catalog.entity.EnumType; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +@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 new file mode 100644 index 00000000..c3a7850b --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/request/UploadPackageFromFtpRequest.java @@ -0,0 +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.entity.request; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import org.openo.commontosca.catalog.entity.EnumType; + +/** + * @author 00164331 + * + */ +@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 new file mode 100644 index 00000000..a418cc75 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/CsarFileUriResponse.java @@ -0,0 +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.entity.response; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * @author 00164331 + * + */ +@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 new file mode 100644 index 00000000..e727c3e6 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/PackageMeta.java @@ -0,0 +1,61 @@ +/** + * 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 org.openo.commontosca.catalog.entity.EnumProcessState; +import org.openo.commontosca.catalog.entity.EnumOperationalState; +import org.openo.commontosca.catalog.entity.EnumUsageState; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@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 new file mode 100644 index 00000000..6c7beb73 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UpdatePackageResponse.java @@ -0,0 +1,29 @@ +/** + * 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 new file mode 100644 index 00000000..3542155f --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/entity/response/UploadPackageResponse.java @@ -0,0 +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 UploadPackageResponse { + + private String csarId; + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java new file mode 100644 index 00000000..69870d0c --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManager.java @@ -0,0 +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.filemanage; + +import java.util.ArrayList; + +import org.openo.commontosca.catalog.filemanage.entity.FileLink; + +public interface FileManager { + /** + * @param srcPath + * @param dstPath/packageType/provider/packageName/version + * @return + */ + boolean upload(String srcPath, String dstPath); + + boolean download(String srcPath, String dstPath); + + boolean delete(String srcPath); + + ArrayList queryWorkFlow(String path); + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java similarity index 52% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerFactory.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java index 28db5729..b8e4ba90 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerFactory.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerFactory.java @@ -1,21 +1,21 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.filemanage; +package org.openo.commontosca.catalog.filemanage; -import org.openo.orchestrator.nfv.catalog.filemanage.http.HttpFileManagerImpl; +import org.openo.commontosca.catalog.filemanage.http.HttpFileManagerImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java new file mode 100644 index 00000000..eab0ee3f --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/FileManagerType.java @@ -0,0 +1,23 @@ +/** + * 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.filemanage; + +public enum FileManagerType { + ftp, http; + public static FileManagerType getType(String type) { + return valueOf(type); + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/entity/FileLink.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/entity/FileLink.java new file mode 100644 index 00000000..9149d529 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/entity/FileLink.java @@ -0,0 +1,29 @@ +/** + * 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.filemanage.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class FileLink { + private String fileName; + private String downloadUri; + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/HttpFileManagerImpl.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java similarity index 74% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/HttpFileManagerImpl.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java index 8ce1d87b..c323f11a 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/HttpFileManagerImpl.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/HttpFileManagerImpl.java @@ -1,26 +1,26 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.filemanage.http; +package org.openo.commontosca.catalog.filemanage.http; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import org.openo.orchestrator.nfv.catalog.filemanage.FileManager; -import org.openo.orchestrator.nfv.catalog.filemanage.entity.FileLink; +import org.openo.commontosca.catalog.filemanage.FileManager; +import org.openo.commontosca.catalog.filemanage.entity.FileLink; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/ToolUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java similarity index 82% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/ToolUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java index c0ac1362..c90e6dbe 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/http/ToolUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/filemanage/http/ToolUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.filemanage.http; +package org.openo.commontosca.catalog.filemanage.http; import java.io.File; import java.io.FileInputStream; @@ -23,9 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import org.openo.orchestrator.nfv.catalog.common.Config; -import org.openo.orchestrator.nfv.catalog.common.HttpServerAddrConfig; -import org.openo.orchestrator.nfv.catalog.common.HttpServerPathConfig; +import org.openo.commontosca.catalog.common.HttpServerPathConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 new file mode 100644 index 00000000..74b30662 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/Ftp.java @@ -0,0 +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.ftp; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * @author 00164331 + * + */ +@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/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/FtpUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java similarity index 87% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/FtpUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java index 257b4e20..cec4d30f 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/FtpUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/ftp/FtpUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.ftp; +package org.openo.commontosca.catalog.ftp; import java.io.File; import java.io.FileInputStream; 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 new file mode 100644 index 00000000..b517bc8b --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/health/ConsoleHealthCheck.java @@ -0,0 +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.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaNodeTypeDefinition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java similarity index 55% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaNodeTypeDefinition.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java index 06b9f29a..0627d743 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaNodeTypeDefinition.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaNodeTypeDefinition.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.common; +package org.openo.commontosca.catalog.model.common; public enum EnumToscaNodeTypeDefinition { VNF{ 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 new file mode 100644 index 00000000..2aecf42c --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/EnumToscaRelationShipDefinition.java @@ -0,0 +1,46 @@ +/** + * 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/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/TemplateDataHelper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java similarity index 80% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/TemplateDataHelper.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java index eb7274b8..859ea522 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/TemplateDataHelper.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/common/TemplateDataHelper.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.common; +package org.openo.commontosca.catalog.model.common; import java.util.ArrayList; import java.util.Arrays; @@ -23,17 +23,17 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.model.entity.InputParameter; -import org.openo.orchestrator.nfv.catalog.model.entity.NodeTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.RelationShip; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateOperation; -import org.openo.orchestrator.nfv.catalog.model.entity.SubstitutionMapping; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.model.entity.ServiceTemplate; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; +import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; +import org.openo.commontosca.catalog.model.entity.InputParameter; +import org.openo.commontosca.catalog.model.entity.NodeTemplate; +import org.openo.commontosca.catalog.model.entity.RelationShip; import com.google.gson.Gson; import com.google.gson.JsonElement; @@ -52,7 +52,7 @@ public class TemplateDataHelper { * @return */ public static TemplateData convert2TemplateData(ServiceTemplate st, - String rawData, List ntList) { + String rawData, List ntList) { TemplateData td = new TemplateData(); td.setServiceTemplate(convert2ServiceTemplateData(st, rawData)); td.setNodeTemplates(convert2NodeTemplateDataList(ntList, diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/EnumDataType.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/EnumDataType.java new file mode 100644 index 00000000..3bafbbef --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/EnumDataType.java @@ -0,0 +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.model.entity; + +import lombok.AllArgsConstructor; + +/** + * @author 10090474 + * + */ +@AllArgsConstructor +public enum EnumDataType { + STRING("String"), INTEGER("Integer"), FLOAT("Float"), BOOLEAN("Boolean"); + + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java new file mode 100644 index 00000000..1f8a1b49 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/InputParameter.java @@ -0,0 +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.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author 10090474 + * + */ + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class InputParameter { + private String name; + private EnumDataType type = EnumDataType.STRING; + private String description; + private String defaultValue; + private boolean required; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java new file mode 100644 index 00000000..b582b876 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/KeyValuePair.java @@ -0,0 +1,28 @@ +/** + * 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.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class KeyValuePair { + private String key; + private String value; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java new file mode 100644 index 00000000..ab606621 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NfvTemplate.java @@ -0,0 +1,33 @@ +/** + * 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.entity; + +import java.util.List; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NfvTemplate { + private List vduNodes; + private List networkNodes; + private List vnfcNodes; + private List vnfNodes; + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java new file mode 100644 index 00000000..f2a8ca34 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/NodeTemplate.java @@ -0,0 +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.model.entity; + +import java.util.List; +import java.util.Map; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class NodeTemplate { + private String id; + private String name; + private String type; + private Map properties; + private List relationShips; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java new file mode 100644 index 00000000..6eff7437 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/QueryRawDataCondition.java @@ -0,0 +1,33 @@ +/** + * 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.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author 10090474 + * + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class QueryRawDataCondition { + private String csarId; + private KeyValuePair[] inputParameters; + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java new file mode 100644 index 00000000..a65e74d4 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/RelationShip.java @@ -0,0 +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.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RelationShip { + private String sourceNodeName; + private String targetNodeName; + private String sourceNodeId; + private String targetNodeId; + private String type; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java new file mode 100644 index 00000000..703103b3 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplate.java @@ -0,0 +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.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ServiceTemplate { + private String serviceTemplateId; + private String templateName; + private String vendor; + private String version; + private String csarid; + private String type; + private String downloadUri; + private InputParameter[] inputs; + private ServiceTemplateOperation[] operations; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java new file mode 100644 index 00000000..dab206c2 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateOperation.java @@ -0,0 +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.model.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ServiceTemplateOperation { + private String name; + private String description; + private String processId; + private InputParameter[] inputs; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java new file mode 100644 index 00000000..351f74e4 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/ServiceTemplateRawData.java @@ -0,0 +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.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ServiceTemplateRawData { + private String rawData; +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/SubstitutionMapping.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java similarity index 62% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/SubstitutionMapping.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java index 2218ac61..56223381 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/SubstitutionMapping.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/entity/SubstitutionMapping.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.entity; +package org.openo.commontosca.catalog.model.entity; import java.util.ArrayList; import java.util.HashMap; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerSelfServiceProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java similarity index 62% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerSelfServiceProvider.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java index 86aecb04..e6a6423c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerSelfServiceProvider.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerSelfServiceProvider.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.IOException; import java.io.InputStream; @@ -28,7 +28,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerSelfService; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerSelfService; /** diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java similarity index 86% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceConsumer.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java index c726c9a8..d6f70d0c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceConsumer.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.InputStream; import java.util.List; @@ -31,12 +31,12 @@ import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataMultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; -import org.openo.orchestrator.nfv.catalog.common.Config; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerSelfService; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerSelfServiceOption; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceTemplateList; +import org.openo.commontosca.catalog.common.Config; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerSelfServiceOption; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerSelfService; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServiceTemplateList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java similarity index 69% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java index d803b027..daf57c28 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceNodeTemplateProvider.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.IOException; import java.io.InputStream; @@ -29,7 +29,7 @@ import javax.xml.bind.Unmarshaller; import javax.xml.transform.Source; import javax.xml.transform.sax.SAXSource; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServicePackageProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java similarity index 63% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServicePackageProvider.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java index 0a0198a1..5cb25499 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServicePackageProvider.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServicePackageProvider.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.IOException; import java.io.InputStream; @@ -28,7 +28,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServicePackageList; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServicePackageList; /** * The opentosca container service returns data to the package entity diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java similarity index 63% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java index f8bc8d34..38a66ddd 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/ContainerServiceTemplateProvider.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.IOException; import java.io.InputStream; @@ -28,7 +28,7 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceTemplateList; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.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 new file mode 100644 index 00000000..e471ea16 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerExtPackageRest.java @@ -0,0 +1,48 @@ +/** + * 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 javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServicePackageList; + +/** + * The opentosca container interface for csar. + * @author 10189609 + * + */ +@Path("/csars") +public interface IContainerExtPackageRest { + @GET + @Produces(MediaType.APPLICATION_OCTET_STREAM) + public ContainerServicePackageList getToscaServicePackage(@QueryParam("csarName") String csarName); + + @POST + @Consumes(MediaType.TEXT_PLAIN) + public String uploadPackageByToscaService(@QueryParam("fileLocation") String fileLocation); + + @Path("/{csarId}") + @DELETE + public String deletePackageById(@PathParam("csarId") String csarId); +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java new file mode 100644 index 00000000..a12c0a1b --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerPortabilityRest.java @@ -0,0 +1,33 @@ +/** + * 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 javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; + +/** + * The opentosca container interface for policy. + * @author 10189609 + * + */ +@Path("/servicetemplates") +public interface IContainerPortabilityRest { + + @Path("/{templateid}/policys") + @GET + String getToscaPolicys(@PathParam("templateid") String serviceTemplateID); +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerSelfServiceRest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java similarity index 50% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerSelfServiceRest.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java index 9b05643d..29a59f99 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerSelfServiceRest.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerSelfServiceRest.java @@ -1,26 +1,26 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerSelfService; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.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 new file mode 100644 index 00000000..5573d996 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/IContainerTemplateRest.java @@ -0,0 +1,43 @@ +/** + * 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 javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; + +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; +import org.openo.commontosca.catalog.model.externalservice.entity.containerEntity.ContainerServiceTemplateList; + +/** + * The opentosca container interface for service template. + * @author 10189609 + * + */ +@Path("/servicetemplates") +public interface IContainerTemplateRest { + @GET + @Produces(MediaType.APPLICATION_OCTET_STREAM) + ContainerServiceTemplateList getToscaServiceTemplate(@QueryParam("templateid") String templateId); + + @Path("/{templateid}/nodetemplates") + @GET + @Produces(MediaType.APPLICATION_OCTET_STREAM) + ContainerServiceNodeTemplateList getToscaServiceNodeTemplates(@PathParam("templateid") String templateId); +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/NamespaceFilter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java similarity index 69% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/NamespaceFilter.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java index ba4bcbf6..4f71996e 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/NamespaceFilter.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/NamespaceFilter.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import org.xml.sax.Attributes; import org.xml.sax.SAXException; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/StringProvider.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java similarity index 56% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/StringProvider.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java index bb896280..6eb9b95c 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/StringProvider.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/container/StringProvider.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.container; +package org.openo.commontosca.catalog.model.externalservice.container; import java.io.IOException; import java.io.InputStream; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java similarity index 70% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java index d6ddaabb..c01dee6b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfService.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import java.util.List; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java similarity index 71% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java index 84ba5c25..ee5794df 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerSelfServiceOption.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java new file mode 100644 index 00000000..3be5de90 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java @@ -0,0 +1,45 @@ +/** + * 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.entity.containerEntity; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; + +@XmlAccessorType(XmlAccessType.FIELD) +public class ContainerServiceCommonParam { + @XmlElement + private String key; + + @XmlElement + private String value; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java similarity index 90% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java index c8955a0c..de4a6cd0 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplate.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import java.util.ArrayList; import java.util.List; @@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.common.ToolUtil; @XmlRootElement diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java new file mode 100644 index 00000000..096da0e6 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java @@ -0,0 +1,40 @@ +/** + * 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.entity.containerEntity; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name="nodetemplates") +public class ContainerServiceNodeTemplateList { + @XmlElement(name="nodetemplate") + private List nodeTemplate; + + public List getNodeTemplate() { + return nodeTemplate; + } + + public void setNodeTemplate(List nodeTemplate) { + this.nodeTemplate = nodeTemplate; + } + + +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java new file mode 100644 index 00000000..215b3ed5 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java @@ -0,0 +1,24 @@ +/** + * 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.entity.containerEntity; + +/** + * @author 10189609 + * + */ +public class ContainerServiceOperationParameter { + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java similarity index 50% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java index 7f1a8e39..c91b6e1e 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackage.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java new file mode 100644 index 00000000..c3b7dd73 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java @@ -0,0 +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.externalservice.entity.containerEntity; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlRootElement(name="packages") +public class ContainerServicePackageList { + public static final String NAMESPACE_OF_SELFSERVICE="http://www.eclipse.org/winery/model/selfservice"; + + @XmlElement(name="package") + private List packageList; + + public List getPackageList() { + return packageList; + } + + public void setPackageList(List packageList) { + this.packageList = packageList; + } + +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java similarity index 64% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java index 5ffd290d..08b238fc 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceRelationShip.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java similarity index 91% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java index d839e599..f7165c12 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplate.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import java.util.List; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java similarity index 51% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java index 5864afba..81021f52 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/containerEntity/ContainerServiceTemplateList.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity; import java.util.List; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java new file mode 100644 index 00000000..3d317c6d --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java @@ -0,0 +1,28 @@ +/** + * 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.entity.lifecycleEnity; + +public class InstanceEntity { + private String serviceTemplateId; + + public String getServiceTemplateId() { + return serviceTemplateId; + } + + public void setServiceTemplateId(String serviceTemplateId) { + this.serviceTemplateId = serviceTemplateId; + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java new file mode 100644 index 00000000..d98bb87c --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java @@ -0,0 +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.model.externalservice.entity.roEntity; + +import java.util.ArrayList; + +public class ResourceResponseEntity +{ + ArrayList data=new ArrayList(); + String operationResult; + + public String getOperationResult() + { + return operationResult; + } + + public void setOperationResult(String operationResult) + { + this.operationResult = operationResult; + } + public ArrayList getData() + { + return data; + } + public void setData(ArrayList data) + { + this.data = data; + } +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/VimEntity.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/VimEntity.java similarity index 53% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/VimEntity.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/VimEntity.java index 85c14a21..98f59200 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/VimEntity.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/entity/roEntity/VimEntity.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.entity.roEntity; +package org.openo.commontosca.catalog.model.externalservice.entity.roEntity; public class VimEntity { 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 new file mode 100644 index 00000000..df87a529 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java @@ -0,0 +1,33 @@ +/** + * 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/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java similarity index 52% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java index b0255ffd..f3bed0a0 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/lifecycle/LifeCycleServiceConsumer.java @@ -1,26 +1,26 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.lifecycle; +package org.openo.commontosca.catalog.model.externalservice.lifecycle; import java.lang.reflect.Type; import java.util.ArrayList; -import org.openo.orchestrator.nfv.catalog.common.MSBUtil; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.lifecycleEnity.InstanceEntity; +import org.openo.commontosca.catalog.common.MSBUtil; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.model.externalservice.entity.lifecycleEnity.InstanceEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 new file mode 100644 index 00000000..d4075abe --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/IResourceServiceRest.java @@ -0,0 +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.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/ResourceServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java similarity index 58% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/ResourceServiceConsumer.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java index c71117be..65431a2b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/ResourceServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/externalservice/ro/ResourceServiceConsumer.java @@ -1,24 +1,24 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.externalservice.ro; +package org.openo.commontosca.catalog.model.externalservice.ro; -import org.openo.orchestrator.nfv.catalog.common.MSBUtil; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.roEntity.ResourceResponseEntity; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.roEntity.VimEntity; +import org.openo.commontosca.catalog.common.MSBUtil; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.model.externalservice.entity.roEntity.ResourceResponseEntity; +import org.openo.commontosca.catalog.model.externalservice.entity.roEntity.VimEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 new file mode 100644 index 00000000..22780a31 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java @@ -0,0 +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.model.parser; + +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; + +public abstract class AbstractModelParser { + /** + * @param packageId + * @param fileLocation + * @return service template id + * @throws CatalogResourceException + */ + 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 new file mode 100644 index 00000000..10f60b99 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumPackageFormat.java @@ -0,0 +1,25 @@ +/** + * 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 new file mode 100644 index 00000000..e84bc871 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/EnumTemplateType.java @@ -0,0 +1,20 @@ +/** + * 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/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ModelParserFactory.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java similarity index 59% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ModelParserFactory.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java index cdc9977d..74c2e2c1 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ModelParserFactory.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ModelParserFactory.java @@ -1,24 +1,24 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.parser; +package org.openo.commontosca.catalog.model.parser; import java.util.HashMap; import java.util.Map; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; public class ModelParserFactory { private final static ModelParserFactory instance = new ModelParserFactory(); diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ToscaYamlModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ToscaYamlModelParser.java similarity index 76% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ToscaYamlModelParser.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ToscaYamlModelParser.java index 86f43f13..17932538 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/ToscaYamlModelParser.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/ToscaYamlModelParser.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.parser; +package org.openo.commontosca.catalog.model.parser; import java.io.BufferedInputStream; import java.io.BufferedReader; @@ -30,27 +30,23 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.resource.TemplateManager; -import org.openo.orchestrator.nfv.catalog.entity.response.CsarFileUriResponse; -import org.openo.orchestrator.nfv.catalog.model.common.TemplateDataHelper; -import org.openo.orchestrator.nfv.catalog.model.entity.EnumDataType; -import org.openo.orchestrator.nfv.catalog.model.entity.InputParameter; -import org.openo.orchestrator.nfv.catalog.model.entity.NodeTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.RelationShip; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateOperation; -import org.openo.orchestrator.nfv.catalog.model.entity.SubstitutionMapping; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.YamlParseServiceConsumer; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.EnumYamlServiceTemplateInfo; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult.Plan; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult.Plan.PlanValue.PlanInput; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult.TopologyTemplate.Input; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult.TopologyTemplate.NodeTemplate.Relationship; -import org.openo.orchestrator.nfv.catalog.wrapper.PackageWrapper; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.resource.TemplateManager; +import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; +import org.openo.commontosca.catalog.model.common.TemplateDataHelper; +import org.openo.commontosca.catalog.model.entity.InputParameter; +import org.openo.commontosca.catalog.model.entity.RelationShip; +import org.openo.commontosca.catalog.model.entity.ServiceTemplate; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; +import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; +import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlResult; +import org.openo.commontosca.catalog.wrapper.PackageWrapper; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.model.entity.EnumDataType; +import org.openo.commontosca.catalog.model.entity.NodeTemplate; +import org.openo.commontosca.catalog.model.parser.yaml.YamlParseServiceConsumer; +import org.openo.commontosca.catalog.model.parser.yaml.entity.EnumYamlServiceTemplateInfo; +import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; public class ToscaYamlModelParser extends AbstractModelParser{ @@ -168,7 +164,7 @@ public class ToscaYamlModelParser extends AbstractModelParser{ return null; } - org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult.TopologyTemplate.SubstitutionMapping stm = result + ParseYamlResult.TopologyTemplate.SubstitutionMapping stm = result .getTopologyTemplate().getSubstitutionMappings(); return new SubstitutionMapping(serviceTemplateId, type, stm.getRequirementList(), stm.getCapabilityList()); @@ -198,13 +194,13 @@ public class ToscaYamlModelParser extends AbstractModelParser{ * @param planList * @return */ - private ServiceTemplateOperation[] parseOperations(List planList) { + private ServiceTemplateOperation[] parseOperations(List planList) { if (planList == null || planList.isEmpty()) { return new ServiceTemplateOperation[0]; } List opList = new ArrayList<>(); - for (Plan plan : planList) { + for (ParseYamlResult.Plan plan : planList) { ServiceTemplateOperation op = new ServiceTemplateOperation(); op.setName(plan.getName()); op.setDescription(plan.getDescription()); @@ -223,13 +219,13 @@ public class ToscaYamlModelParser extends AbstractModelParser{ * @param inputList * @return */ - private InputParameter[] parsePlanInputs(List inputList) { + private InputParameter[] parsePlanInputs(List inputList) { if (inputList == null || inputList.isEmpty()) { return new InputParameter[0]; } List retList = new ArrayList<>(); - for (PlanInput input : inputList) { + for (ParseYamlResult.Plan.PlanValue.PlanInput input : inputList) { retList.add(new InputParameter(input.getName(), getEnumDataType(input.getType()), input.getDescription(), input.getDefault(), input.isRequired())); @@ -238,12 +234,12 @@ public class ToscaYamlModelParser extends AbstractModelParser{ } private InputParameter[] parseInputs(ParseYamlResult result) { - List inputList = result.getTopologyTemplate().getInputs(); + List inputList = result.getTopologyTemplate().getInputs(); if(inputList == null){ return null; } ArrayList retList = new ArrayList(); - for(Input input : inputList){ + for(ParseYamlResult.TopologyTemplate.Input input : inputList){ retList.add(new InputParameter(input.getName(), getEnumDataType(input.getType()), input.getDescription(), input.getDefault(), input.isRequired())); @@ -303,14 +299,14 @@ public class ToscaYamlModelParser extends AbstractModelParser{ private List parseNodeTemplateRelationShip( - List relationshipList) { + List relationshipList) { List retList = new ArrayList<>(); if (relationshipList == null) { return retList; } - for (Relationship relationship : relationshipList) { + for (ParseYamlResult.TopologyTemplate.NodeTemplate.Relationship relationship : relationshipList) { RelationShip ret = new RelationShip(); ret.setSourceNodeId(relationship.getSourceNodeName()); ret.setSourceNodeName(relationship.getSourceNodeName()); 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 new file mode 100644 index 00000000..8d24a606 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/IYamlParseRest.java @@ -0,0 +1,43 @@ +/** + * 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 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; + +import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; + +/** + * + * @author 10090474 + * + */ +@Path("/parse") +public interface IYamlParseRest { + /** + * @param request + * @return + * @throws Exception + */ + @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 new file mode 100644 index 00000000..5942a8bd --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/YamlParseServiceConsumer.java @@ -0,0 +1,55 @@ +/** + * 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.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.ParseYamlResult; +import org.openo.commontosca.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; + +import com.eclipsesource.jaxrs.consumer.ConsumerFactory; +import com.google.gson.Gson; + +/** + * + * @author 10090474 + * + */ +public class YamlParseServiceConsumer { + /** + * get service template by template id from container service. + * + * @param request + * @return + * @throws CatalogResourceException + */ + 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 e) { + throw new CatalogResourceException("Call parser api failed.", e); + } + + } +} 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 new file mode 100644 index 00000000..ea9fe998 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java @@ -0,0 +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(); +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/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 similarity index 57% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlRequestParemeter.java index 97eca652..49d6f4cb 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/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,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.parser.yaml.entity; +package org.openo.commontosca.catalog.model.parser.yaml.entity; import java.util.List; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/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 similarity index 94% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/entity/ParseYamlResult.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/entity/ParseYamlResult.java index 2b4f9f1f..fa9cdf7b 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/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,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.parser.yaml.entity; +package org.openo.commontosca.catalog.model.parser.yaml.entity; import java.util.ArrayList; import java.util.HashMap; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/IWSO2RestService.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/IWSO2RestService.java new file mode 100644 index 00000000..9f1706a3 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/IWSO2RestService.java @@ -0,0 +1,63 @@ +/** + * 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.plan.wso2; + +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.glassfish.jersey.media.multipart.FormDataMultiPart; +import org.openo.commontosca.catalog.model.plan.wso2.entity.DeletePackageResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.DeployPackageResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessRequest; + +/** + * + * @author 10090474 + * + */ +@Path("/openoapi/wso2bpel/v1") +public interface IWSO2RestService { + /** + * @param request + * @return + * @throws Exception + */ + @Path("/package") + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + DeployPackageResponse deployPackage(FormDataMultiPart request) throws Exception; + + @Path("/package/{packageName}") + @DELETE + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + DeletePackageResponse deletePackage( + @PathParam("packageName") String packageName) throws Exception; + + @Path("process/instance") + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + StartProcessResponse startProcess(StartProcessRequest request) + throws Exception; +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/WSO2ServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/WSO2ServiceConsumer.java similarity index 71% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/WSO2ServiceConsumer.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/WSO2ServiceConsumer.java index c7775f0d..114e9d21 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/WSO2ServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/WSO2ServiceConsumer.java @@ -1,28 +1,28 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.plan.wso2; +package org.openo.commontosca.catalog.model.plan.wso2; import java.util.Map; import org.glassfish.jersey.client.ClientConfig; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.DeletePackageResponse; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.DeployPackageResponse; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.StartProcessRequest; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.StartProcessResponse; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.model.plan.wso2.entity.DeletePackageResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.DeployPackageResponse; +import org.openo.commontosca.catalog.model.plan.wso2.entity.StartProcessRequest; import com.eclipsesource.jaxrs.consumer.ConsumerFactory; @@ -103,7 +103,7 @@ public class WSO2ServiceConsumer { * @throws CatalogResourceException */ StartProcessResponse startProcess(String processId, - Map params) throws CatalogResourceException { + Map params) throws CatalogResourceException { try { ClientConfig config = new ClientConfig(); IWSO2RestService wso2Proxy = ConsumerFactory.createConsumer( diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java new file mode 100644 index 00000000..b905ee61 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeletePackageResponse.java @@ -0,0 +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.model.plan.wso2.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author 10090474 + * + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class DeletePackageResponse { + private static final int STATUS_SUCCESS = 1; + + private int status; + private String message; + private String exception; + + public boolean isSuccess() { + return this.status == STATUS_SUCCESS; + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java new file mode 100644 index 00000000..3e171445 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/DeployPackageResponse.java @@ -0,0 +1,44 @@ +/** + * 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.plan.wso2.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author 10090474 + * + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class DeployPackageResponse { + private static final int STATUS_SUCCESS = 1; + + private int status; + private String message; + private String packageName; + private String processId; + private String exception; + + public boolean isSuccess() { + return this.status == STATUS_SUCCESS; + } +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java new file mode 100644 index 00000000..da9aefb5 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessRequest.java @@ -0,0 +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.plan.wso2.entity; + +import java.util.Map; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author 10090474 + * + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class StartProcessRequest { + private String processId; + private Map params; +} diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java new file mode 100644 index 00000000..73c9fad2 --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/plan/wso2/entity/StartProcessResponse.java @@ -0,0 +1,43 @@ +/** + * 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.plan.wso2.entity; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +/** + * @author 10090474 + * + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public class StartProcessResponse { + private static final int STATUS_SUCCESS = 1; + + private int status; + private String message; + private String response; + private String exception; + + public boolean isSuccess() { + return this.status == STATUS_SUCCESS; + } +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/wrapper/ServiceTemplateWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java similarity index 80% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/wrapper/ServiceTemplateWrapper.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java index 77bf2129..039d64b4 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/wrapper/ServiceTemplateWrapper.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/wrapper/ServiceTemplateWrapper.java @@ -1,41 +1,41 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.model.wrapper; +package org.openo.commontosca.catalog.model.wrapper; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.resource.TemplateManager; -import org.openo.orchestrator.nfv.catalog.model.common.TemplateDataHelper; -import org.openo.orchestrator.nfv.catalog.model.entity.InputParameter; -import org.openo.orchestrator.nfv.catalog.model.entity.NfvTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.NodeTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.QueryRawDataCondition; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateOperation; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateRawData; -import org.openo.orchestrator.nfv.catalog.model.entity.SubstitutionMapping; -import org.openo.orchestrator.nfv.catalog.resources.CatalogBadRequestException; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; +import org.openo.commontosca.catalog.resources.CatalogBadRequestException; +import org.openo.commontosca.catalog.common.ToolUtil; +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.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.resource.TemplateManager; +import org.openo.commontosca.catalog.model.common.TemplateDataHelper; +import org.openo.commontosca.catalog.model.entity.InputParameter; +import org.openo.commontosca.catalog.model.entity.NfvTemplate; +import org.openo.commontosca.catalog.model.entity.NodeTemplate; +import org.openo.commontosca.catalog.model.entity.QueryRawDataCondition; +import org.openo.commontosca.catalog.model.entity.ServiceTemplate; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateRawData; +import org.openo.commontosca.catalog.model.entity.SubstitutionMapping; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/CatalogBadRequestException.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java similarity index 63% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/CatalogBadRequestException.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java index 9934bfcb..17ec7cd6 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/CatalogBadRequestException.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/CatalogBadRequestException.java @@ -1,21 +1,21 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.resources; +package org.openo.commontosca.catalog.resources; -import org.openo.orchestrator.nfv.catalog.db.exception.ErrorCodeException; +import org.openo.commontosca.catalog.db.exception.ErrorCodeException; /** * diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/PackageResource.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java similarity index 89% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/PackageResource.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java index 3fbbfbc5..0fd61f77 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/PackageResource.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/PackageResource.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.resources; +package org.openo.commontosca.catalog.resources; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -40,13 +40,10 @@ import javax.ws.rs.core.Response; import org.eclipse.jetty.http.HttpStatus; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataParam; -import org.openo.orchestrator.nfv.catalog.entity.request.PackageBasicInfo; -import org.openo.orchestrator.nfv.catalog.entity.request.UploadPackageFromFtpRequest; -import org.openo.orchestrator.nfv.catalog.entity.response.CsarFileUriResponse; -import org.openo.orchestrator.nfv.catalog.entity.response.PackageMeta; -import org.openo.orchestrator.nfv.catalog.entity.response.UploadPackageResponse; -import org.openo.orchestrator.nfv.catalog.filemanage.entity.FileLink; -import org.openo.orchestrator.nfv.catalog.wrapper.PackageWrapper; +import org.openo.commontosca.catalog.entity.response.UploadPackageResponse; +import org.openo.commontosca.catalog.wrapper.PackageWrapper; +import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; +import org.openo.commontosca.catalog.entity.response.PackageMeta; import com.codahale.metrics.annotation.Timed; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java new file mode 100644 index 00000000..62335bca --- /dev/null +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/RestUtils.java @@ -0,0 +1,46 @@ +/** + * 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.resources; + +import javax.ws.rs.BadRequestException; +import javax.ws.rs.InternalServerErrorException; +import javax.ws.rs.core.Response; + +import org.openo.commontosca.catalog.common.CommonErrorResponse; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; + + +public class RestUtils { + /** + * @param e + * @return + */ + public static InternalServerErrorException newInternalServerErrorException( + CatalogResourceException e) { + return new InternalServerErrorException(Response + .status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(new CommonErrorResponse(e.getErrcode() + "", e.getMessage())).build(), e); + } + + /** + * @param e + * @return + */ + public static BadRequestException newBadRequestException(CatalogBadRequestException e) { + return new BadRequestException(Response.status(Response.Status.BAD_REQUEST) + .entity(new CommonErrorResponse(e.getErrcode() + "", e.getMessage())).build(), e); + } +} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/TemplateResource.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java similarity index 92% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/TemplateResource.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java index 31d06b87..ea1c21e4 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/TemplateResource.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/resources/TemplateResource.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.resources; +package org.openo.commontosca.catalog.resources; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -32,17 +32,17 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.eclipse.jetty.http.HttpStatus; -import org.openo.orchestrator.nfv.catalog.common.CommonErrorResponse; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.model.entity.InputParameter; -import org.openo.orchestrator.nfv.catalog.model.entity.NodeTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.QueryRawDataCondition; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplate; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateOperation; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplateRawData; -import org.openo.orchestrator.nfv.catalog.model.parser.ToscaYamlModelParser; -import org.openo.orchestrator.nfv.catalog.model.wrapper.ServiceTemplateWrapper; +import org.openo.commontosca.catalog.common.CommonErrorResponse; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateOperation; +import org.openo.commontosca.catalog.model.wrapper.ServiceTemplateWrapper; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.model.entity.InputParameter; +import org.openo.commontosca.catalog.model.entity.NodeTemplate; +import org.openo.commontosca.catalog.model.entity.QueryRawDataCondition; +import org.openo.commontosca.catalog.model.entity.ServiceTemplate; +import org.openo.commontosca.catalog.model.entity.ServiceTemplateRawData; +import org.openo.commontosca.catalog.model.parser.ToscaYamlModelParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java similarity index 88% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapper.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java index 2e557316..8ded7bba 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapper.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.wrapper; +package org.openo.commontosca.catalog.wrapper; import java.io.BufferedInputStream; import java.io.File; @@ -28,25 +28,25 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.openo.orchestrator.nfv.catalog.common.CommonConstant; -import org.openo.orchestrator.nfv.catalog.common.HttpServerPathConfig; -import org.openo.orchestrator.nfv.catalog.common.RestUtil; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.common.ZipCompressor; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.resource.PackageManager; -import org.openo.orchestrator.nfv.catalog.db.resource.TemplateManager; -import org.openo.orchestrator.nfv.catalog.entity.EnumType; -import org.openo.orchestrator.nfv.catalog.entity.request.PackageBasicInfo; -import org.openo.orchestrator.nfv.catalog.entity.request.UploadPackageFromFtpRequest; -import org.openo.orchestrator.nfv.catalog.entity.response.CsarFileUriResponse; -import org.openo.orchestrator.nfv.catalog.entity.response.PackageMeta; -import org.openo.orchestrator.nfv.catalog.entity.response.UploadPackageResponse; -import org.openo.orchestrator.nfv.catalog.filemanage.FileManagerFactory; -import org.openo.orchestrator.nfv.catalog.filemanage.entity.FileLink; -import org.openo.orchestrator.nfv.catalog.model.parser.EnumPackageFormat; -import org.openo.orchestrator.nfv.catalog.model.parser.ModelParserFactory; +import org.openo.commontosca.catalog.common.CommonConstant; +import org.openo.commontosca.catalog.common.HttpServerPathConfig; +import org.openo.commontosca.catalog.common.RestUtil; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.common.ZipCompressor; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.resource.PackageManager; +import org.openo.commontosca.catalog.db.resource.TemplateManager; +import org.openo.commontosca.catalog.entity.EnumType; +import org.openo.commontosca.catalog.entity.request.PackageBasicInfo; +import org.openo.commontosca.catalog.entity.request.UploadPackageFromFtpRequest; +import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; +import org.openo.commontosca.catalog.entity.response.PackageMeta; +import org.openo.commontosca.catalog.entity.response.UploadPackageResponse; +import org.openo.commontosca.catalog.filemanage.FileManagerFactory; +import org.openo.commontosca.catalog.filemanage.entity.FileLink; +import org.openo.commontosca.catalog.model.parser.EnumPackageFormat; +import org.openo.commontosca.catalog.model.parser.ModelParserFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperUtil.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java similarity index 85% rename from catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperUtil.java rename to catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java index 3fcc6260..7395ed16 100644 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperUtil.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapperUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.wrapper; +package org.openo.commontosca.catalog.wrapper; import java.io.BufferedReader; import java.io.File; @@ -27,26 +27,26 @@ import java.util.List; import javax.ws.rs.NotFoundException; -import org.openo.orchestrator.nfv.catalog.cometd.CometdException; -import org.openo.orchestrator.nfv.catalog.common.CommonConstant; -import org.openo.orchestrator.nfv.catalog.common.FileUtil; -import org.openo.orchestrator.nfv.catalog.common.MsbAddrConfig; -import org.openo.orchestrator.nfv.catalog.common.ToolUtil; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.resource.PackageManager; -import org.openo.orchestrator.nfv.catalog.entity.CSARPackage; -import org.openo.orchestrator.nfv.catalog.entity.EnumOperationalState; -import org.openo.orchestrator.nfv.catalog.entity.EnumProcessState; -import org.openo.orchestrator.nfv.catalog.entity.EnumType; -import org.openo.orchestrator.nfv.catalog.entity.EnumUsageState; -import org.openo.orchestrator.nfv.catalog.entity.request.PackageBasicInfo; -import org.openo.orchestrator.nfv.catalog.entity.response.PackageMeta; -import org.openo.orchestrator.nfv.catalog.ftp.Ftp; -import org.openo.orchestrator.nfv.catalog.ftp.FtpUtil; -import org.openo.orchestrator.nfv.catalog.model.entity.ServiceTemplate; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.lifecycleEnity.InstanceEntity; -import org.openo.orchestrator.nfv.catalog.model.externalservice.lifecycle.LifeCycleServiceConsumer; +import org.openo.commontosca.catalog.cometd.CometdException; +import org.openo.commontosca.catalog.common.CommonConstant; +import org.openo.commontosca.catalog.common.FileUtil; +import org.openo.commontosca.catalog.common.MsbAddrConfig; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.resource.PackageManager; +import org.openo.commontosca.catalog.entity.EnumProcessState; +import org.openo.commontosca.catalog.entity.EnumType; +import org.openo.commontosca.catalog.entity.request.PackageBasicInfo; +import org.openo.commontosca.catalog.ftp.Ftp; +import org.openo.commontosca.catalog.model.entity.ServiceTemplate; +import org.openo.commontosca.catalog.model.externalservice.lifecycle.LifeCycleServiceConsumer; +import org.openo.commontosca.catalog.common.ToolUtil; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.entity.CSARPackage; +import org.openo.commontosca.catalog.entity.EnumOperationalState; +import org.openo.commontosca.catalog.entity.EnumUsageState; +import org.openo.commontosca.catalog.entity.response.PackageMeta; +import org.openo.commontosca.catalog.ftp.FtpUtil; +import org.openo.commontosca.catalog.model.externalservice.entity.lifecycleEnity.InstanceEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/catalog/src/main/resources/api-doc/META-INF/MANIFEST.MF b/catalog-core/catalog-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF similarity index 100% rename from catalog/src/main/resources/api-doc/META-INF/MANIFEST.MF rename to catalog-core/catalog-mgr/src/main/resources/api-doc/META-INF/MANIFEST.MF diff --git a/catalog/src/main/resources/api-doc/WEB-INF/web.xml b/catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml similarity index 52% rename from catalog/src/main/resources/api-doc/WEB-INF/web.xml rename to catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml index 94fc2c90..2f57e7e8 100644 --- a/catalog/src/main/resources/api-doc/WEB-INF/web.xml +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/WEB-INF/web.xml @@ -1,19 +1,19 @@ */ .swagger-section pre code { diff --git a/catalog/src/main/resources/api-doc/css/typography.css b/catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css similarity index 69% rename from catalog/src/main/resources/api-doc/css/typography.css rename to catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css index ff5c9a1a..99d1ba1a 100644 --- a/catalog/src/main/resources/api-doc/css/typography.css +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/css/typography.css @@ -1,17 +1,17 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ /* droid-sans-regular - latin */ @font-face { diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff diff --git a/catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 b/catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 similarity index 100% rename from catalog/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 rename to catalog-core/catalog-mgr/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 diff --git a/catalog/src/main/resources/api-doc/images/explorer_icons.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/explorer_icons.png similarity index 100% rename from catalog/src/main/resources/api-doc/images/explorer_icons.png rename to catalog-core/catalog-mgr/src/main/resources/api-doc/images/explorer_icons.png diff --git a/catalog/src/main/resources/api-doc/images/logo_small.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/logo_small.png similarity index 100% rename from catalog/src/main/resources/api-doc/images/logo_small.png rename to catalog-core/catalog-mgr/src/main/resources/api-doc/images/logo_small.png diff --git a/catalog/src/main/resources/api-doc/images/pet_store_api.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/pet_store_api.png similarity index 100% rename from catalog/src/main/resources/api-doc/images/pet_store_api.png rename to catalog-core/catalog-mgr/src/main/resources/api-doc/images/pet_store_api.png diff --git a/catalog/src/main/resources/api-doc/images/throbber.gif b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/throbber.gif similarity index 100% rename from catalog/src/main/resources/api-doc/images/throbber.gif rename to catalog-core/catalog-mgr/src/main/resources/api-doc/images/throbber.gif diff --git a/catalog/src/main/resources/api-doc/images/wordnik_api.png b/catalog-core/catalog-mgr/src/main/resources/api-doc/images/wordnik_api.png similarity index 100% rename from catalog/src/main/resources/api-doc/images/wordnik_api.png rename to catalog-core/catalog-mgr/src/main/resources/api-doc/images/wordnik_api.png diff --git a/catalog/src/main/resources/api-doc/index.html b/catalog-core/catalog-mgr/src/main/resources/api-doc/index.html similarity index 82% rename from catalog/src/main/resources/api-doc/index.html rename to catalog-core/catalog-mgr/src/main/resources/api-doc/index.html index 1c092305..57a3f165 100644 --- a/catalog/src/main/resources/api-doc/index.html +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/index.html @@ -1,18 +1,18 @@ diff --git a/catalog/src/main/resources/api-doc/lib/backbone-min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js similarity index 96% rename from catalog/src/main/resources/api-doc/lib/backbone-min.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js index ac7d0a3b..0db8f7fc 100644 --- a/catalog/src/main/resources/api-doc/lib/backbone-min.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/backbone-min.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ // Backbone.js 1.1.2 diff --git a/catalog/src/main/resources/api-doc/lib/handlebars-2.0.0.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js similarity index 98% rename from catalog/src/main/resources/api-doc/lib/handlebars-2.0.0.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js index d0adff07..ada61542 100644 --- a/catalog/src/main/resources/api-doc/lib/handlebars-2.0.0.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/handlebars-2.0.0.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ /*! diff --git a/catalog/src/main/resources/api-doc/lib/highlight.7.3.pack.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js similarity index 91% rename from catalog/src/main/resources/api-doc/lib/highlight.7.3.pack.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js index 7e1ef111..db72e206 100644 --- a/catalog/src/main/resources/api-doc/lib/highlight.7.3.pack.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/highlight.7.3.pack.js @@ -1,16 +1,16 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(//gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("")}while(o!=u.node);r.splice(q,1);while(q'+L[0]+""}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return''+r.value+""}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+=""}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"
")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs); \ No newline at end of file diff --git a/catalog/src/main/resources/api-doc/lib/jquery-1.8.0.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js similarity index 99% rename from catalog/src/main/resources/api-doc/lib/jquery-1.8.0.min.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js index 9775e431..4aee7fbc 100644 --- a/catalog/src/main/resources/api-doc/lib/jquery-1.8.0.min.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery-1.8.0.min.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ /*! jQuery v@1.8.0 jquery.com | jquery.org/license */ (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
t
",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/catalog/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js similarity index 84% rename from catalog/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js index 0353c8c9..64e37d56 100644 --- a/catalog/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ (function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M + \ No newline at end of file diff --git a/catalog/src/main/resources/api-doc/swagger-ui.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js similarity index 99% rename from catalog/src/main/resources/api-doc/swagger-ui.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js index 50cd6b76..53ae58a5 100644 --- a/catalog/src/main/resources/api-doc/swagger-ui.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ /** * swagger-ui - Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API diff --git a/catalog/src/main/resources/api-doc/swagger-ui.min.js b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js similarity index 98% rename from catalog/src/main/resources/api-doc/swagger-ui.min.js rename to catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js index 8d5aa38b..aab5ec40 100644 --- a/catalog/src/main/resources/api-doc/swagger-ui.min.js +++ b/catalog-core/catalog-mgr/src/main/resources/api-doc/swagger-ui.min.js @@ -1,17 +1,17 @@ /* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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. */ function clippyCopiedCallback(){$("#api_key_copied").fadeIn().delay(1e3).fadeOut()}$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""==$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments)[0])},Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call);var Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});break;case 2:Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),a=n+"_content";Docs.expandOperation($("#"+a)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}};this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return"\n
\n
\n
"+l((s=null!=(s=t.keyName||(null!=e?e.keyName:e))?s:r,typeof s===i?s.call(e,{name:"keyName",hash:{},data:a}):s))+'
\n \n \n
\n
\n\n'},useData:!0});var SwaggerUi,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;SwaggerUi=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.dom_id="swagger_ui",t.prototype.options=null,t.prototype.api=null,t.prototype.headerView=null,t.prototype.mainView=null,t.prototype.initialize=function(e){return null==e&&(e={}),null!=e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),null==e.supportedSubmitMethods&&(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),null==$("#"+this.dom_id)&&$("body").append('
'),this.options=e,this.options.success=function(e){return function(){return e.render()}}(this),this.options.progress=function(e){return function(t){return e.showMessage(t)}}(this),this.options.failure=function(e){return function(t){return e.onLoadFailure(t)}}(this),this.headerView=new HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return function(t){return e.updateSwaggerUi(t)}}(this))},t.prototype.setOption=function(e,t){return this.options[e]=t},t.prototype.getOption=function(e){return this.options[e]},t.prototype.updateSwaggerUi=function(e){return this.options.url=e.url,this.load()},t.prototype.load=function(){var e,t;return null!=(t=this.mainView)&&t.clear(),e=this.options.url,e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},t.prototype.collapseAll=function(){return Docs.collapseEndpointListForResource("")},t.prototype.listAll=function(){return Docs.collapseOperationsForResource("")},t.prototype.expandAll=function(){return Docs.expandOperationsForResource("")},t.prototype.render=function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}return this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(function(){return function(){return Docs.shebang()}}(this),100)},t.prototype.buildUrl=function(e,t){var n,a;return 0===t.indexOf("/")?(a=e.split("/"),e=a[0]+"//"+a[2],e+t):(n=e.length,e.indexOf("?")>-1&&(n=Math.min(n,e.indexOf("?"))),e.indexOf("#")>-1&&(n=Math.min(n,e.indexOf("#"))),e=e.substring(0,n),-1!==e.indexOf("/",e.length-1)?e+t:e+"/"+t)},t.prototype.showMessage=function(e){return null==e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)},t.prototype.onLoadFailure=function(e){var t;return null==e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail"),t=$("#message-bar").html(e),null!=this.options.onFailure&&this.options.onFailure(e),t},t.prototype.renderGFM=function(e){return null==e&&(e=""),$(".markdown").each(function(){return $(this).html(marked($(this).html()))})},t}(Backbone.Router),window.SwaggerUi=SwaggerUi,this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(){return'
\n
\n
\n
Username
\n \n
Password
\n \n \n
\n
\n\n'},useData:!0}),Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/)<[^<]*)*<\/script>/gi,""),new Handlebars.SafeString(e)}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='\n\n"},useData:!0});var ApiKeyButton,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ApiKeyButton=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this},t.prototype.events={"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"},t.prototype.applyApiKey=function(){var e;return window.authorizations.add(this.model.name,new ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"])),window.swaggerUi.load(),e=$("#apikey_container").show()},t.prototype.toggleApiKeyContainer=function(){var e;return $("#apikey_container").length>0?(e=$("#apikey_container").first(),e.is(":visible")?e.hide():($(".auth_container").hide(),e.show())):void 0},t.prototype.template=function(){return Handlebars.templates.apikey_button_view},t}(Backbone.View),this.Handlebars.templates.main=Handlebars.template({1:function(e,t,n,a){var s,i=this.lambda,r=this.escapeExpression,l='
'+r(i(null!=(s=null!=e?e.info:e)?s.title:s,e))+'
\n
';return s=i(null!=(s=null!=e?e.info:e)?s.description:s,e),null!=s&&(l+=s),l+="
\n ",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.termsOfServiceUrl:s,{name:"if",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.name:s,{name:"if",hash:{},fn:this.program(4,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.url:s,{name:"if",hash:{},fn:this.program(6,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=(s=null!=e?e.info:e)?s.contact:s)?s.email:s,{name:"if",hash:{},fn:this.program(8,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+="\n ",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.license:s,{name:"if",hash:{},fn:this.program(10,a),inverse:this.noop,data:a}),null!=s&&(l+=s),l+"\n"},2:function(e){var t,n=this.lambda,a=this.escapeExpression;return''},4:function(e){var t,n=this.lambda,a=this.escapeExpression;return"
Created by "+a(n(null!=(t=null!=(t=null!=e?e.info:e)?t.contact:t)?t.name:t,e))+"
"},6:function(e){var t,n=this.lambda,a=this.escapeExpression;return""},8:function(e){var t,n=this.lambda,a=this.escapeExpression;return"'},10:function(e){var t,n=this.lambda,a=this.escapeExpression;return""},12:function(e){var t,n=this.lambda,a=this.escapeExpression;return' , api version: '+a(n(null!=(t=null!=e?e.info:e)?t.version:t,e))+"\n "},14:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' \n \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p="
\n";return s=t["if"].call(e,null!=e?e.info:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+="
\n
\n
    \n\n
    \n
    \n
    \n

    [ base url: "+o((i=null!=(i=t.basePath||(null!=e?e.basePath:e))?i:l,typeof i===r?i.call(e,{name:"basePath",hash:{},data:a}):i))+"\n",s=t["if"].call(e,null!=(s=null!=e?e.info:e)?s.version:s,{name:"if",hash:{},fn:this.program(12,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+="]\n",s=t["if"].call(e,null!=e?e.validatorUrl:e,{name:"if",hash:{},fn:this.program(14,a),inverse:this.noop,data:a}),null!=s&&(p+=s),p+"

    \n
    \n
    \n"},useData:!0});var BasicAuthButton,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;BasicAuthButton=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this},t.prototype.events={"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"},t.prototype.applyPassword=function(){var e,t,n;return n=$(".input_username").val(),t=$(".input_password").val(),window.authorizations.add(this.model.type,new PasswordAuthorization("basic",n,t)),window.swaggerUi.load(),e=$("#basic_auth_container").hide()},t.prototype.togglePasswordContainer=function(){var e;return $("#basic_auth_container").length>0?(e=$("#basic_auth_container").show(),e.is(":visible")?e.slideUp():($(".auth_container").hide(),e.show())):void 0},t.prototype.template=function(){return Handlebars.templates.basic_auth_button_view},t}(Backbone.View),this.Handlebars.templates.operation=Handlebars.template({1:function(){return"deprecated"},3:function(){return"

    Warning: Deprecated

    \n"},5:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o='

    Implementation Notes

    \n

    ';return i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(o+=s),o+"

    \n"},7:function(){return'
    \n '},9:function(e,t,n,a){var s,i=' \n"},10:function(e){var t,n=this.lambda,a=this.escapeExpression,s="
    "+a(n(null!=e?e.scope:e,e))+"
    \n"},12:function(){return"
    "},14:function(){return'
    \n \n
    \n'},16:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return"

    Response Class (Status "+l((s=null!=(s=t.successCode||(null!=e?e.successCode:e))?s:r,typeof s===i?s.call(e,{name:"successCode",hash:{},data:a}):s))+')

    \n

    \n
    \n
    \n'},18:function(){return'

    Parameters

    \n
    \n \n \n \n \n \n \n \n \n \n \n\n \n
    ParameterValueDescriptionParameter TypeData Type
    \n'},20:function(){return"
    \n

    Response Messages

    \n \n \n \n \n \n \n \n \n \n \n \n
    HTTP Status CodeReasonResponse Model
    \n"},22:function(){return""},24:function(){return"
    \n \n \n \n
    \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r,l="function",o=t.helperMissing,p=this.escapeExpression,u=t.blockHelperMissing,h="\n
      \n
    • \n \n \n
    • \n
    \n"},useData:!0});var ContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.content_type},t}(Backbone.View),this.Handlebars.templates.param=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i},2:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' \n
    \n'},4:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=s&&(i+=s),i},5:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n
    \n
    \n'},7:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n
    \n
    \n'},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(10,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(11,a),inverse:this.program(13,a),data:a}),null!=s&&(i+=s),i},11:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},13:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"\n\n\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=s&&(p+=s),p+='\n\n',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="\n",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n\n \n\n'},useData:!0});var HeaderView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;HeaderView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},t.prototype.initialize=function(){},t.prototype.showPetStore=function(){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},t.prototype.showWordnikDev=function(){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},t.prototype.showCustomOnKeyup=function(e){return 13===e.keyCode?this.showCustom():void 0},t.prototype.showCustom=function(e){return null!=e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},t.prototype.update=function(e,t,n){return null==n&&(n=!1),$("#input_baseUrl").val(e),n?this.trigger("update-swagger-ui",{url:e}):void 0},t}(Backbone.View),this.Handlebars.templates.param_list=Handlebars.template({1:function(){return" multiple='multiple'"},3:function(){return""},5:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(3,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},6:function(e,t,n,a){var s,i=t.helperMissing,r="";return s=(t.isArray||e&&e.isArray||i).call(e,e,{name:"isArray",hash:{},fn:this.program(3,a),inverse:this.program(7,a),data:a}),null!=s&&(r+=s),r},7:function(){return" \n"},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isDefault:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' \n"},12:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"\n\n \n\n',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="\n",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n'},useData:!0});var MainView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;MainView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}var n;return __extends(t,e),n={alpha:function(e,t){return e.path.localeCompare(t.path)},method:function(e,t){return e.method.localeCompare(t.method)}},t.prototype.initialize=function(e){var t,n,a,s;null==e&&(e={}),this.model.auths=[],s=this.model.securityDefinitions;for(n in s)a=s[n],t={name:n,type:a.type,value:a},this.model.auths.push(t);return"2.0"===this.model.swaggerVersion?this.model.validatorUrl="validatorUrl"in e.swaggerOptions?e.swaggerOptions.validatorUrl:this.model.url.indexOf("localhost")>0?null:"http://online.swagger.io/validator":void 0},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p;if(this.model.securityDefinitions)for(s in this.model.securityDefinitions)e=this.model.securityDefinitions[s],"apiKey"===e.type&&0===$("#apikey_button").length&&(t=new ApiKeyButton({model:e}).render().el,$(".auth_main_container").append(t)),"basicAuth"===e.type&&0===$("#basic_auth_button").length&&(t=new BasicAuthButton({model:e}).render().el,$(".auth_main_container").append(t));for($(this.el).html(Handlebars.templates.main(this.model)),r={},n=0,p=this.model.apisArray,l=0,o=p.length;o>l;l++){for(i=p[l],a=i.name;"undefined"!=typeof r[a];)a=a+"_"+n,n+=1; i.id=a,r[a]=i,this.addResource(i,this.model.auths)}return $(".propWrap").hover(function(){return $(".optionsWrapper",$(this)).show()},function(){return $(".optionsWrapper",$(this)).hide()}),this},t.prototype.addResource=function(e,t){var n;return e.id=e.id.replace(/\s/g,"_"),n=new ResourceView({model:e,tagName:"li",id:"resource_"+e.id,className:"resource",auths:t,swaggerOptions:this.options.swaggerOptions}),$("#resources").append(n.render().el)},t.prototype.clear=function(){return $(this.el).html("")},t}(Backbone.View),this.Handlebars.templates.param_readonly=Handlebars.template({1:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},3:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},4:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" "+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"\n\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=s&&(p+=s),p+='\n',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="\n",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n\n'},useData:!0}),this.Handlebars.templates.param_readonly_required=Handlebars.template({1:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},3:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(4,a),inverse:this.program(6,a),data:a}),null!=s&&(i+=s),i},4:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" "+l((s=null!=(s=t["default"]||(null!=e?e["default"]:e))?s:r,typeof s===i?s.call(e,{name:"default",hash:{},data:a}):s))+"\n"},6:function(){return" (empty)\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"\n\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(3,a),data:a}),null!=s&&(p+=s),p+='\n',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="\n",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n\n'},useData:!0});var OperationView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;OperationView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.invocationUrl=null,t.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"},t.prototype.initialize=function(e){return null==e&&(e={}),this.auths=e.auths,this.parentId=this.model.parentId,this.nickname=this.model.nickname,this},t.prototype.mouseEnter=function(e){var t,n,a,s,i,r,l,o,p,u;return t=$(this.el).find(".content"),p=e.pageX,u=e.pageY,r=$(window).scrollLeft(),l=$(window).scrollTop(),s=r+$(window).width(),i=l+$(window).height(),o=t.width(),n=t.height(),p+o>s&&(p=s-o),r>p&&(p=r),u+n>i&&(u=i-n),l>u&&(u=l),a={},a.top=u,a.left=p,t.css(a),$(e.currentTarget.parentNode).find("#api_information_panel").show()},t.prototype.mouseExit=function(e){return $(e.currentTarget.parentNode).find("#api_information_panel").hide()},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p,u,h,c,d,m,f,y,g,v,_,w,b,x,k,O,C,S,P,T,D,H,M,E,R,V,N,U,A;if(i=jQuery.inArray(this.model.method,this.model.supportedSubmitMethods())>=0,i||(this.model.isReadOnly=!0),this.model.description=this.model.description||this.model.notes,this.model.description&&(this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"
    ")),this.model.oauth=null,o=this.model.authorizations||this.model.security)if(Array.isArray(o))for(k=0,P=o.length;P>k;k++){n=o[k];for(l in n){t=n[l];for(e in this.auths)if(t=this.auths[e],"oauth2"===t.type){this.model.oauth={},this.model.oauth.scopes=[],R=t.value.scopes;for(r in R)b=R[r],y=n[l].indexOf(r),y>=0&&(p={scope:r,description:b},this.model.oauth.scopes.push(p))}}}else for(r in o)if(b=o[r],"oauth2"===r)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),O=0,T=b.length;T>O;O++)p=b[O],this.model.oauth.scopes.push(p);if("undefined"!=typeof this.model.responses){this.model.responseMessages=[],V=this.model.responses;for(a in V)x=V[a],m=null,f=this.model.responses[a].schema,f&&f.$ref&&(m=f.$ref,0===m.indexOf("#/definitions/")&&(m=m.substring("#/definitions/".length))),this.model.responseMessages.push({code:a,message:x.description,responseModel:m})}if("undefined"==typeof this.model.responseMessages&&(this.model.responseMessages=[]),g=null,this.model.successResponse){_=this.model.successResponse;for(l in _)x=_[l],this.model.successCode=l,"object"==typeof x&&"function"==typeof x.createJSONSample&&(g={sampleJSON:JSON.stringify(x.createJSONSample(),void 0,2),isParam:!1,signature:x.getMockSignature()})}else this.model.responseClassSignature&&"string"!==this.model.responseClassSignature&&(g={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature});for($(this.el).html(Handlebars.templates.operation(this.model)),g?(d=new SignatureView({model:g,tagName:"div"}),$(".model-signature",$(this.el)).append(d.render().el)):(this.model.responseClassSignature="string",$(".model-signature",$(this.el)).html(this.model.type)),s={isParam:!1},s.consumes=this.model.consumes,s.produces=this.model.produces,N=this.model.parameters,C=0,D=N.length;D>C;C++)u=N[C],w=u.type||u.dataType||"","undefined"==typeof w&&(m=u.schema,m&&m.$ref&&(h=m.$ref,w=0===h.indexOf("#/definitions/")?h.substring("#/definitions/".length):h)),w&&"file"===w.toLowerCase()&&(s.consumes||(s.consumes="multipart/form-data")),u.type=w;for(c=new ResponseContentTypeView({model:s}),$(".response-content-type",$(this.el)).append(c.render().el),U=this.model.parameters,S=0,H=U.length;H>S;S++)u=U[S],this.addParameter(u,s.consumes);for(A=this.model.responseMessages,E=0,M=A.length;M>E;E++)v=A[E],this.addStatusCode(v);return this},t.prototype.addParameter=function(e,t){var n;return e.consumes=t,n=new ParameterView({model:e,tagName:"tr",readOnly:this.model.isReadOnly}),$(".operation-params",$(this.el)).append(n.render().el)},t.prototype.addStatusCode=function(e){var t;return t=new StatusCodeView({model:e,tagName:"tr"}),$(".operation-status",$(this.el)).append(t.render().el)},t.prototype.submitOperation=function(e){var t,n,a,s,i,r,l,o,p,u,h,c,d,m,f,y;if(null!=e&&e.preventDefault(),n=$(".sandbox",$(this.el)),t=!0,n.find("input.required").each(function(){return $(this).removeClass("error"),""===jQuery.trim($(this).val())?($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1):void 0}),n.find("textarea.required").each(function(){return $(this).removeClass("error"),""===jQuery.trim($(this).val())?($(this).addClass("error"),$(this).wiggle({callback:function(e){return function(){return $(e).focus()}}(this)}),t=!1):void 0}),t){for(s={},r={parent:this},a=!1,m=n.find("input"),o=0,h=m.length;h>o;o++)i=m[o],null!=i.value&&jQuery.trim(i.value).length>0&&(s[i.name]=i.value),"file"===i.type&&(s[i.name]=i.files[0],a=!0);for(f=n.find("textarea"),p=0,c=f.length;c>p;p++)i=f[p],null!=i.value&&jQuery.trim(i.value).length>0&&(s[i.name]=i.value);for(y=n.find("select"),u=0,d=y.length;d>u;u++)i=y[u],l=this.getSelectedValue(i),null!=l&&jQuery.trim(l).length>0&&(s[i.name]=l);return r.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),r.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),a?this.handleFileUpload(s,n):this.model["do"](s,r,this.showCompleteStatus,this.showErrorStatus,this)}},t.prototype.success=function(e,t){return t.showCompleteStatus(e)},t.prototype.handleFileUpload=function(e,t){var n,a,s,i,r,l,o,p,u,h,c,d,m,f,y,g,v,_,w;for(g=t.serializeArray(),p=0,d=g.length;d>p;p++)i=g[p],null!=i.value&&jQuery.trim(i.value).length>0&&(e[i.name]=i.value);for(n=new FormData,o=0,v=this.model.parameters,u=0,m=v.length;m>u;u++)l=v[u],("form"===l.paramType||"formData"===l["in"])&&"file"!==l.type.toLowerCase()&&void 0!==e[l.name]&&n.append(l.name,e[l.name]);for(s={},_=this.model.parameters,h=0,f=_.length;f>h;h++)l=_[h],"header"===l.paramType&&(s[l.name]=e[l.name]);for(w=t.find('input[type~="file"]'),c=0,y=w.length;y>c;c++)a=w[c],"undefined"!=typeof a.files[0]&&(n.append($(a).attr("name"),a.files[0]),o+=1);return this.invocationUrl=this.model.supportHeaderParams()?(s=this.model.getHeaderParams(e),delete s["Content-Type"],this.model.urlify(e,!1)):this.model.urlify(e,!0),$(".request_url",$(this.el)).html("
    "),$(".request_url pre",$(this.el)).text(this.invocationUrl),r={type:this.model.method,url:this.invocationUrl,headers:s,data:n,dataType:"json",contentType:!1,processData:!1,error:function(e){return function(t){return e.showErrorStatus(e.wrap(t),e)}}(this),success:function(e){return function(t){return e.showResponse(t,e)}}(this),complete:function(e){return function(t){return e.showCompleteStatus(e.wrap(t),e)}}(this)},window.authorizations&&window.authorizations.apply(r),0===o&&r.data.append("fake","true"),jQuery.ajax(r),!1},t.prototype.wrap=function(e){var t,n,a,s,i,r,l;for(a={},n=e.getAllResponseHeaders().split("\r"),r=0,l=n.length;l>r;r++)s=n[r],t=s.match(/^([^:]*?):(.*)$/),t||(t=[]),t.shift(),void 0!==t[0]&&void 0!==t[1]&&(a[t[0].trim()]=t[1].trim());return i={},i.content={},i.content.data=e.responseText,i.headers=a,i.request={},i.request.url=this.invocationUrl,i.status=e.status,i},t.prototype.getSelectedValue=function(e){var t,n,a,s,i;if(e.multiple){for(n=[],i=e.options,a=0,s=i.length;s>a;a++)t=i[a],t.selected&&n.push(t.value);return n.length>0?n:null}return e.value},t.prototype.hideResponse=function(e){return null!=e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},t.prototype.showResponse=function(e){var t;return t=JSON.stringify(e,null,"	").replace(/\n/g,"
    "),$(".response_body",$(this.el)).html(escape(t))},t.prototype.showErrorStatus=function(e,t){return t.showStatus(e)},t.prototype.showCompleteStatus=function(e,t){return t.showStatus(e)},t.prototype.formatXml=function(e){var t,n,a,s,i,r,l,o,p,u,h,c,d;for(o=/(>)(<)(\/*)/g,u=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(o,"$1\n$2$3").replace(u,"$1\n").replace(t,"$1\n$2"),l=0,n="",i=e.split("\n"),a=0,s="other",p={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},h=function(e){var t,i,r,l,o,u,h;return u={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},o=function(){var e;e=[];for(r in u)h=u[r],h&&e.push(r);return e}()[0],o=void 0===o?"other":o,t=s+"->"+o,s=o,l="",a+=p[t],l=function(){var e,t,n;for(n=[],i=e=0,t=a;t>=0?t>e:e>t;i=t>=0?++e:--e)n.push(" ");return n}().join(""),"opening->closing"===t?n=n.substr(0,n.length-1)+e+"\n":n+=l+e+"\n"},c=0,d=i.length;d>c;c++)r=i[c],h(r);return n},t.prototype.showStatus=function(e){var t,n,a,s,i,r,l,o,p,u,h;if(void 0===e.content?(n=e.data,h=e.url):(n=e.content.data,h=e.request.url),i=e.headers,a=null,i&&(a=i["Content-Type"]||i["content-type"],a&&(a=a.split(";")[0].trim())),$(".response_body",$(this.el)).removeClass("json"),$(".response_body",$(this.el)).removeClass("xml"),n)if("application/json"===a||/\+json$/.test(a)){r=null;try{r=JSON.stringify(JSON.parse(n),null," ")}catch(c){s=c,r="can't parse JSON. Raw result:\n\n"+n}t=$("").text(r),o=$('
    ').append(t)}else"application/xml"===a||/\+xml$/.test(a)?(t=$("").text(this.formatXml(n)),o=$('
    ').append(t)):"text/html"===a?(t=$("").html(_.escape(n)),o=$('
    ').append(t)):/^image\//.test(a)?o=$("").attr("src",h):(t=$("").text(n),o=$('
    ').append(t));else t=$("").text("no content"),o=$('
    ').append(t);return p=o,$(".request_url",$(this.el)).html("
    "),$(".request_url pre",$(this.el)).text(h),$(".response_code",$(this.el)).html("
    "+e.status+"
    "),$(".response_body",$(this.el)).html(p),$(".response_headers",$(this.el)).html("
    "+_.escape(JSON.stringify(e.headers,null,"  ")).replace(/\n/g,"
    ")+"
    "),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide(),u=$(".response_body",$(this.el))[0],l=this.options.swaggerOptions,l.highlightSizeThreshold&&e.data.length>l.highlightSizeThreshold?u:hljs.highlightBlock(u)},t.prototype.toggleOperationContent=function(){var e;return e=$("#"+Docs.escapeResourceName(this.parentId+"_"+this.nickname+"_content")),e.is(":visible")?Docs.collapseOperation(e):Docs.expandOperation(e)},t}(Backbone.View);var ParameterContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ParameterContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:"),this},t.prototype.template=function(){return Handlebars.templates.parameter_content_type},t}(Backbone.View),this.Handlebars.templates.param_required=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(2,a),inverse:this.program(4,a),data:a}),null!=s&&(i+=s),i},2:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return' \n"},4:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(5,a),inverse:this.program(7,a),data:a}),null!=s&&(i+=s),i},5:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n
    \n
    \n'},7:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n
    \n
    \n'},9:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e.isFile:e,{name:"if",hash:{},fn:this.program(10,a),inverse:this.program(12,a),data:a}),null!=s&&(i+=s),i},10:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},12:function(e,t,n,a){var s,i="";return s=t["if"].call(e,null!=e?e["default"]:e,{name:"if",hash:{},fn:this.program(13,a),inverse:this.program(15,a),data:a}),null!=s&&(i+=s),i},13:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},15:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return" \n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.name||(null!=e?e.name:e))?i:l,typeof i===r?i.call(e,{name:"name",hash:{},data:a}):i))+"\n\n";return s=t["if"].call(e,null!=e?e.isBody:e,{name:"if",hash:{},fn:this.program(1,a),inverse:this.program(9,a),data:a}),null!=s&&(p+=s),p+='\n\n ',i=null!=(i=t.description||(null!=e?e.description:e))?i:l,s=typeof i===r?i.call(e,{name:"description",hash:{},data:a}):i,null!=s&&(p+=s),p+="\n\n",i=null!=(i=t.paramType||(null!=e?e.paramType:e))?i:l,s=typeof i===r?i.call(e,{name:"paramType",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n\n'},useData:!0}),this.Handlebars.templates.parameter_content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.consumes:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='\n\n"},useData:!0});var ParameterView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ParameterView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(e,t){return"array"===e.type.toLowerCase()||e.allowMultiple?t.fn(this):t.inverse(this)})},t.prototype.render=function(){var e,t,n,a,s,i,r,l,o,p;return p=this.model.type||this.model.dataType,"undefined"==typeof p&&(i=this.model.schema,i&&i.$ref&&(a=i.$ref,p=0===a.indexOf("#/definitions/")?a.substring("#/definitions/".length):a)),this.model.type=p,this.model.paramType=this.model["in"]||this.model.paramType,("body"===this.model.paramType||"body"===this.model["in"])&&(this.model.isBody=!0),p&&"file"===p.toLowerCase()&&(this.model.isFile=!0),this.model["default"]=this.model["default"]||this.model.defaultValue,this.model.allowableValues&&(this.model.isList=!0),o=this.template(),$(this.el).html(o(this.model)),r={sampleJSON:this.model.sampleJSON,isParam:!0,signature:this.model.signature},this.model.sampleJSON?(l=new SignatureView({model:r,tagName:"div"}),$(".model-signature",$(this.el)).append(l.render().el)):$(".model-signature",$(this.el)).html(this.model.signature),t=!1,this.model.isBody&&(t=!0),e={isParam:t},e.consumes=this.model.consumes,t?(n=new ParameterContentTypeView({model:e}),$(".parameter-content-type",$(this.el)).append(n.render().el)):(s=new ResponseContentTypeView({model:e}),$(".response-content-type",$(this.el)).append(s.render().el)),this},t.prototype.template=function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param},t}(Backbone.View);var ResourceView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ResourceView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(e){return null==e&&(e={}),this.auths=e.auths,""===this.model.description&&(this.model.description=null),null!=this.model.description?this.model.summary=this.model.description:void 0},t.prototype.render=function(){var e,t,n,a,s,i,r;for(n={},$(this.el).html(Handlebars.templates.resource(this.model)),r=this.model.operationsArray,s=0,i=r.length;i>s;s++){for(a=r[s],e=0,t=a.nickname;"undefined"!=typeof n[t];)t=t+"_"+e,e+=1;n[t]=a,a.nickname=t,a.parentId=this.model.id,this.addOperation(a)}return $(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource")),$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource")),$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource")),this},t.prototype.addOperation=function(e){var t;return e.number=this.number,t=new OperationView({model:e,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths}),$(".endpoints",$(this.el)).append(t.render().el),this.number++},t.prototype.callDocs=function(e,t){return t.preventDefault(),Docs[e](t.currentTarget.getAttribute("data-id"))},t}(Backbone.View),this.Handlebars.templates.resource=Handlebars.template({1:function(){return" : "},3:function(e,t,n,a){var s,i="function",r=t.helperMissing,l=this.escapeExpression;return"
  • \n Raw\n
  • "},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r,l="function",o=t.helperMissing,p=this.escapeExpression,u=t.blockHelperMissing,h="
    \n

    \n '+p((i=null!=(i=t.name||(null!=e?e.name:e))?i:o,typeof i===l?i.call(e,{name:"name",hash:{},data:a}):i))+" ";return i=null!=(i=t.summary||(null!=e?e.summary:e))?i:o,r={name:"summary",hash:{},fn:this.program(1,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.summary||(s=u.call(e,s,r)),null!=s&&(h+=s),i=null!=(i=t.summary||(null!=e?e.summary:e))?i:o,s=typeof i===l?i.call(e,{name:"summary",hash:{},data:a}):i,null!=s&&(h+=s),h+="\n

    \n
      \n
    • \n Show/Hide\n
    • \n
    • \n \n List Operations\n \n
    • \n
    • \n \n Expand Operations\n \n
    • \n ',i=null!=(i=t.url||(null!=e?e.url:e))?i:o,r={name:"url",hash:{},fn:this.program(3,a),inverse:this.noop,data:a},s=typeof i===l?i.call(e,r):i,t.url||(s=u.call(e,s,r)),null!=s&&(h+=s),h+"\n
    \n
    \n\n"},useData:!0});var ResponseContentTypeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;ResponseContentTypeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=responseContentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.response_content_type},t}(Backbone.View),this.Handlebars.templates.response_content_type=Handlebars.template({1:function(e,t,n,a){var s,i="";return s=t.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,a),inverse:this.noop,data:a}),null!=s&&(i+=s),i},2:function(e){var t,n=this.lambda,a=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i='\n\n"},useData:!0});var SignatureView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;SignatureView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"},t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this.switchToSnippet(),this.isParam=this.model.isParam,this.isParam&&$(".notice",$(this.el)).text("Click to set as parameter value"),this},t.prototype.template=function(){return Handlebars.templates.signature},t.prototype.switchToDescription=function(e){return null!=e&&e.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},t.prototype.switchToSnippet=function(e){return null!=e&&e.preventDefault(),$(".description",$(this.el)).hide(),$(".snippet",$(this.el)).show(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},t.prototype.snippetToTextArea=function(e){var t;return this.isParam&&(null!=e&&e.preventDefault(),t=$("textarea",$(this.el.parentNode.parentNode.parentNode)),""===$.trim(t.val()))?t.val(this.model.sampleJSON):void 0},t}(Backbone.View),this.Handlebars.templates.signature=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p='
    \n\n
    \n\n
    \n
    \n ';return i=null!=(i=t.signature||(null!=e?e.signature:e))?i:l,s=typeof i===r?i.call(e,{name:"signature",hash:{},data:a}):i,null!=s&&(p+=s),p+'\n
    \n\n
    \n
    '+o((i=null!=(i=t.sampleJSON||(null!=e?e.sampleJSON:e))?i:l,typeof i===r?i.call(e,{name:"sampleJSON",hash:{},data:a}):i))+'
    \n \n
    \n
    \n\n'},useData:!0});var StatusCodeView,__extends=function(e,t){function n(){this.constructor=e}for(var a in t)__hasProp.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},__hasProp={}.hasOwnProperty;StatusCodeView=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return __extends(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e,t,n;return n=this.template(),$(this.el).html(n(this.model)),swaggerUi.api.models.hasOwnProperty(this.model.responseModel)?(e={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:!1,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()},t=new SignatureView({model:e,tagName:"div"}),$(".model-signature",this.$el).append(t.render().el)):$(".model-signature",this.$el).html(""),this},t.prototype.template=function(){return Handlebars.templates.status_code},t}(Backbone.View),this.Handlebars.templates.status_code=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,a){var s,i,r="function",l=t.helperMissing,o=this.escapeExpression,p=""+o((i=null!=(i=t.code||(null!=e?e.code:e))?i:l,typeof i===r?i.call(e,{name:"code",hash:{},data:a}):i))+"\n";return i=null!=(i=t.message||(null!=e?e.message:e))?i:l,s=typeof i===r?i.call(e,{name:"message",hash:{},data:a}):i,null!=s&&(p+=s),p+"\n"},useData:!0}); \ No newline at end of file diff --git a/catalog/src/main/resources/migrations.xml b/catalog-core/catalog-mgr/src/main/resources/migrations.xml similarity index 50% rename from catalog/src/main/resources/migrations.xml rename to catalog-core/catalog-mgr/src/main/resources/migrations.xml index f6791098..41231d6e 100644 --- a/catalog/src/main/resources/migrations.xml +++ b/catalog-core/catalog-mgr/src/main/resources/migrations.xml @@ -1,12 +1,13 @@ + - - - - - + - - + + - - + + diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/IntegrationManager.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java similarity index 79% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/IntegrationManager.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java index 789aa225..8e212103 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/IntegrationManager.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/IntegrationManager.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import java.util.ArrayList; @@ -23,14 +23,14 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +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.TemplateData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; public class IntegrationManager { private static PackageManager packageManager; @@ -47,7 +47,8 @@ public class IntegrationManager { @AfterClass public static void tearDownAfterClass() throws Exception { try { - HibernateSession.destory(); + HibernateSession.destory(); + DaoManager.getInstance().setDaoNull(); H2DbServer.shutDown(); } catch (Exception e) { Assert.fail("Exception" + e.getMessage()); diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java similarity index 78% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManagerTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java index d811dd5f..52ec701f 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/PackageManagerTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/PackageManagerTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import static org.junit.Assert.assertTrue; @@ -27,12 +27,12 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; +import org.openo.commontosca.catalog.db.common.Parameters; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.dao.DaoManager; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; public class PackageManagerTest { private static PackageManager manager; @@ -48,6 +48,7 @@ public class PackageManagerTest { public static void tearDownAfterClass() throws Exception { try { HibernateSession.destory(); + DaoManager.getInstance().setPackageDao(null); H2DbServer.shutDown(); } catch (Exception e) { Assert.fail("Exception" + e.getMessage()); diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java similarity index 77% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManagerTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java index 44bc3ea0..66b25048 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateManagerTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateManagerTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import java.util.ArrayList; @@ -23,13 +23,13 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.dao.DaoManager; +import org.openo.commontosca.catalog.db.entity.NodeTemplateData; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; +import org.openo.commontosca.catalog.db.entity.TemplateData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; public class TemplateManagerTest { private static TemplateManager manager; @@ -45,6 +45,9 @@ public class TemplateManagerTest { public static void tearDownAfterClass() throws Exception { try { HibernateSession.destory(); + DaoManager.getInstance().setTemplateDao(null); + DaoManager.getInstance().setServiceTemplateDao(null); + DaoManager.getInstance().setNodeTemplateDao(null); H2DbServer.shutDown(); } catch (Exception e) { Assert.fail("Exception" + e.getMessage()); diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateMappingManagerTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java similarity index 78% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateMappingManagerTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java index 36045a02..4f952e47 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/TemplateMappingManagerTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/TemplateMappingManagerTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource; +package org.openo.commontosca.catalog.db.resource; import java.util.ArrayList; @@ -23,14 +23,11 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.openo.orchestrator.nfv.catalog.db.entity.TemplateData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.dao.DaoManager; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateMappingData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; public class TemplateMappingManagerTest { private static TemplateManager manager; @@ -46,6 +43,7 @@ public class TemplateMappingManagerTest { public static void tearDownAfterClass() throws Exception { try { HibernateSession.destory(); + DaoManager.getInstance().setTemplateDao(null); H2DbServer.shutDown(); } catch (Exception e) { Assert.fail("Exception" + e.getMessage()); diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/dao/PackageDaoTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java similarity index 74% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/dao/PackageDaoTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java index 6c2a3d23..b61fde9e 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/resource/dao/PackageDaoTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/resource/dao/PackageDaoTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.resource.dao; +package org.openo.commontosca.catalog.db.resource.dao; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -28,13 +28,13 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.common.Parameters; -import org.openo.orchestrator.nfv.catalog.db.dao.PackageDao; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; -import org.openo.orchestrator.nfv.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.common.Parameters; +import org.openo.commontosca.catalog.db.dao.PackageDao; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.util.HqlFactory; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; public class PackageDaoTest { diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtilTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java similarity index 59% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtilTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java index 51d70288..cd923160 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtilTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/CatalogDbUtilTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import static org.junit.Assert.*; diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServer.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java similarity index 56% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServer.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java index 5e55d918..ceb3c7c0 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServer.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServer.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import java.sql.SQLException; diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServerUtil.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java similarity index 65% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServerUtil.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java index 81e66bdf..033e49f2 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/H2DbServerUtil.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/H2DbServerUtil.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import java.io.File; import java.net.URISyntaxException; diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HibernateSession.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java similarity index 72% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HibernateSession.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java index e2a6e398..0b031a7a 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HibernateSession.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HibernateSession.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import java.io.File; import java.net.URISyntaxException; diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactoryTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java similarity index 80% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactoryTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java index ee69f762..d1070180 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/db/util/HqlFactoryTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/db/util/HqlFactoryTest.java @@ -1,25 +1,25 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.db.util; +package org.openo.commontosca.catalog.db.util; import static org.junit.Assert.*; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.entity.ServiceTemplateData; public class HqlFactoryTest { diff --git a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperTest.java b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java similarity index 82% rename from catalog/src/test/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperTest.java rename to catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java index 0f637328..066710c4 100644 --- a/catalog/src/test/java/org/openo/orchestrator/nfv/catalog/wrapper/PackageWrapperTest.java +++ b/catalog-core/catalog-mgr/src/test/java/org/openo/commontosca/catalog/wrapper/PackageWrapperTest.java @@ -1,19 +1,19 @@ /** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) + * 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 + * 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 + * 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. + * 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.orchestrator.nfv.catalog.wrapper; +package org.openo.commontosca.catalog.wrapper; import java.io.File; import java.io.FileInputStream; @@ -32,23 +32,23 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; -import org.openo.orchestrator.nfv.catalog.CatalogAppConfiguration; -import org.openo.orchestrator.nfv.catalog.common.Config; -import org.openo.orchestrator.nfv.catalog.common.HttpServerAddrConfig; -import org.openo.orchestrator.nfv.catalog.common.HttpServerPathConfig; -import org.openo.orchestrator.nfv.catalog.common.MsbAddrConfig; -import org.openo.orchestrator.nfv.catalog.db.dao.DaoManager; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.db.resource.PackageManager; -import org.openo.orchestrator.nfv.catalog.db.util.H2DbServer; -import org.openo.orchestrator.nfv.catalog.db.util.HibernateSession; -import org.openo.orchestrator.nfv.catalog.entity.EnumOperationalState; -import org.openo.orchestrator.nfv.catalog.entity.EnumProcessState; -import org.openo.orchestrator.nfv.catalog.entity.EnumUsageState; -import org.openo.orchestrator.nfv.catalog.entity.response.CsarFileUriResponse; -import org.openo.orchestrator.nfv.catalog.entity.response.PackageMeta; -import org.openo.orchestrator.nfv.catalog.filemanage.entity.FileLink; +import org.openo.commontosca.catalog.CatalogAppConfiguration; +import org.openo.commontosca.catalog.common.Config; +import org.openo.commontosca.catalog.common.MsbAddrConfig; +import org.openo.commontosca.catalog.db.exception.CatalogResourceException; +import org.openo.commontosca.catalog.db.resource.PackageManager; +import org.openo.commontosca.catalog.filemanage.entity.FileLink; +import org.openo.commontosca.catalog.common.HttpServerAddrConfig; +import org.openo.commontosca.catalog.common.HttpServerPathConfig; +import org.openo.commontosca.catalog.db.dao.DaoManager; +import org.openo.commontosca.catalog.db.entity.PackageData; +import org.openo.commontosca.catalog.db.util.H2DbServer; +import org.openo.commontosca.catalog.db.util.HibernateSession; +import org.openo.commontosca.catalog.entity.EnumOperationalState; +import org.openo.commontosca.catalog.entity.EnumProcessState; +import org.openo.commontosca.catalog.entity.EnumUsageState; +import org.openo.commontosca.catalog.entity.response.CsarFileUriResponse; +import org.openo.commontosca.catalog.entity.response.PackageMeta; import static org.junit.Assert.*; @@ -258,6 +258,7 @@ public class PackageWrapperTest { public static void tearDownAfterClass() { try { HibernateSession.destory(); + DaoManager.getInstance().setDaoNull(); H2DbServer.shutDown(); } catch (Exception e) { Assert.fail("Exception" + e.getMessage()); diff --git a/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml b/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml new file mode 100644 index 00000000..e0b13c51 --- /dev/null +++ b/catalog-core/catalog-mgr/src/test/resources/Hibernate.cfg.xml @@ -0,0 +1,37 @@ + + + + + + true + org.hibernate.dialect.H2Dialect + org.h2.Driver + jdbc:h2:tcp://localhost:8205/./db/catalog + catalog + catalog + update + thread + + + + + + \ No newline at end of file diff --git a/catalog/src/test/resources/NanocellGW.csar b/catalog-core/catalog-mgr/src/test/resources/NanocellGW.csar similarity index 100% rename from catalog/src/test/resources/NanocellGW.csar rename to catalog-core/catalog-mgr/src/test/resources/NanocellGW.csar diff --git a/catalog/src/test/resources/db/catalog.mv.db b/catalog-core/catalog-mgr/src/test/resources/db/catalog.mv.db similarity index 100% rename from catalog/src/test/resources/db/catalog.mv.db rename to catalog-core/catalog-mgr/src/test/resources/db/catalog.mv.db diff --git a/catalog/src/test/resources/sql/catalog-resource-createObj-mysql.sql b/catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql similarity index 79% rename from catalog/src/test/resources/sql/catalog-resource-createObj-mysql.sql rename to catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql index 66d8406a..3966c7dc 100644 --- a/catalog/src/test/resources/sql/catalog-resource-createObj-mysql.sql +++ b/catalog-core/catalog-mgr/src/test/resources/sql/catalog-resource-createObj-mysql.sql @@ -1,17 +1,17 @@ -- --- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) +-- 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 +-- 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 +-- 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. +-- 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. -- DROP TABLE IF EXISTS catalog_package_table; diff --git a/catalog-all/pom.xml b/catalog-core/distribution/catalog-all/pom.xml similarity index 66% rename from catalog-all/pom.xml rename to catalog-core/distribution/catalog-all/pom.xml index 4f397a21..3fa414af 100644 --- a/catalog-all/pom.xml +++ b/catalog-core/distribution/catalog-all/pom.xml @@ -1,40 +1,40 @@ - 4.0.0 - - catalog-parent - org.openo.orchestrator.nfv.catalog - 0.0.1-SNAPSHOT + + org.openo.commontosca.catalog + distribution + 1.0.0-SNAPSHOT + + 4.0.0 catalog-all - openo/catalog/catalog-all + openo/commontosca/catalog/distribution/catalog-all pom - - catalog-all - UTF-8 + + + openo-commontosca-catalog org.apache.maven.plugins maven-dependency-plugin - 2.8 unpack-catalog @@ -43,30 +43,30 @@ unpack-dependencies - org.openo.orchestrator.nfv.catalog + org.openo.commontosca.catalog catalog-standalone target/assembly/catalog - + unpack-httpserver package unpack-dependencies - org.openo.orchestrator.nfv.catalog - httpserver-standalone + org.openo.commontosca.catalog + httpserver target/assembly/ - - + + org.apache.maven.plugins maven-antrun-plugin @@ -77,8 +77,8 @@ run - - + + @@ -86,7 +86,7 @@ - + org.codehaus.mojo build-helper-maven-plugin @@ -106,21 +106,21 @@ - + - org.openo.orchestrator.nfv.catalog + org.openo.commontosca.catalog catalog-standalone ${project.version} - zip + zip - - org.openo.orchestrator.nfv.catalog - httpserver-standalone + + org.openo.commontosca.catalog + httpserver ${project.version} - zip + zip \ No newline at end of file diff --git a/catalog-standalone/pom.xml b/catalog-core/distribution/catalog-standalone/pom.xml similarity index 78% rename from catalog-standalone/pom.xml rename to catalog-core/distribution/catalog-standalone/pom.xml index 32249e72..d6e86117 100644 --- a/catalog-standalone/pom.xml +++ b/catalog-core/distribution/catalog-standalone/pom.xml @@ -1,29 +1,30 @@ - 4.0.0 - catalog-parent - org.openo.orchestrator.nfv.catalog - 0.0.1-SNAPSHOT + org.openo.commontosca.catalog + distribution + 1.0.0-SNAPSHOT + + 4.0.0 catalog-standalone - openo/catalog/catalog-standalone + openo/commontosca/catalog/distribution/catalog-standalone pom @@ -70,8 +71,8 @@ - org.openo.orchestrator.nfv.catalog - catalog + org.openo.commontosca.catalog + catalog-mgr jar true target/assembly/ @@ -128,8 +129,8 @@ - org.openo.orchestrator.nfv.catalog - catalog + org.openo.commontosca.catalog + catalog-mgr ${project.version} diff --git a/catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql similarity index 53% rename from catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql rename to catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql index 482d6cb5..9b7ed341 100644 --- a/catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-db-createdb-mysql.sql @@ -1,17 +1,17 @@ -- --- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) +-- 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 +-- 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 +-- 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. +-- 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. -- /******************drop old database and user***************************/ diff --git a/catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql similarity index 79% rename from catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql rename to catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql index 8039a715..d49e60ba 100644 --- a/catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-createObj-mysql.sql @@ -1,17 +1,17 @@ -- --- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) +-- 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 +-- 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 +-- 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. +-- 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. -- use catalog; diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql new file mode 100644 index 00000000..50b0c190 --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql @@ -0,0 +1,17 @@ +-- +-- 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. +-- + +-- \ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql new file mode 100644 index 00000000..d0bd6180 --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql @@ -0,0 +1,20 @@ +-- +-- 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. +-- + +SET autocommit = 0; + +COMMIT; +SET autocommit = 1; \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/conf/catalog.yml b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml similarity index 67% rename from catalog-standalone/src/main/assembly/conf/catalog.yml rename to catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml index 3785c38b..14deab79 100644 --- a/catalog-standalone/src/main/assembly/conf/catalog.yml +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/conf/catalog.yml @@ -1,17 +1,17 @@ # -# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) +# 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 +# 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 +# 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. +# 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. # template: Hello, %s! @@ -75,7 +75,7 @@ logging: loggers: # Sets the level for 'com.example.app' to DEBUG. - org.openo.orchestrator.nfv.catalog.CatalogApp: INFO + org.openo.commontosca.catalog.catalog.CatalogApp: INFO appenders: - type: console diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/find_kill_process.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/find_kill_process.bat new file mode 100644 index 00000000..e3644ddf --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/find_kill_process.bat @@ -0,0 +1,24 @@ +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +echo %1 | findstr %2 >NUL +echo ERRORLEVEL=%ERRORLEVEL% +IF ERRORLEVEL 1 goto findend +for /f "tokens=1" %%a in (%1) do ( + echo kill %1 + taskkill /F /pid %%a +) +:findend \ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat new file mode 100644 index 00000000..61a00e69 --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat @@ -0,0 +1,42 @@ +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +@echo off +title init catalog db + +set RUNHOME=%~dp0 +echo ### RUNHOME: %RUNHOME% + +echo ### init catalog db +rem cd /d %RUNHOME% + +set JAVA="%JAVA_HOME%\bin\java.exe" +set port=8777 +set jvm_opts=-Xms50m -Xmx128m +rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n +set class_path=%RUNHOME%;%RUNHOME%catalog-service.jar +echo ### jvm_opts: %jvm_opts% +echo ### class_path: %class_path% + +%JAVA% -classpath %class_path% %jvm_opts% org.openo.commontosca.catalog.CatalogApp db migrate %RUNHOME%conf\catalog.yml + +IF ERRORLEVEL 1 goto showerror +exit +:showerror +echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check! +echo After checking, press any key to close +pause +exit \ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh new file mode 100644 index 00000000..b950f88c --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh @@ -0,0 +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. +# + +DIRNAME=`dirname $0` +RUNHOME=`cd $DIRNAME/; pwd` +echo @RUNHOME@ $RUNHOME + +title catalog Database setup + +echo ### Starting catalog Database setup +echo @JAVA_HOME@ $JAVA_HOME +JAVA="$JAVA_HOME/bin/java" +echo @JAVA@ $JAVA + +class_path="$RUNHOME/:$RUNHOME/catalog-service.jar" +echo @class_path@ $class_path + +"$JAVA" -classpath "$class_path" org.openo.commontosca.catalog.CatalogApp db migrate "$RUNHOME/conf/catalog.yml" diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/run.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/run.bat new file mode 100644 index 00000000..7dbcab0e --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/run.bat @@ -0,0 +1,40 @@ +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +@echo off +title catalog-service + +set RUNHOME=%~dp0 +echo ### RUNHOME: %RUNHOME% +echo ### Starting catalog-service + +set JAVA="%JAVA_HOME%\bin\java.exe" +set port=8312 +set jvm_opts=-Xms50m -Xmx128m +rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n +set class_path=%RUNHOME%;%RUNHOME%catalog-service.jar +echo ### jvm_opts: %jvm_opts% +echo ### class_path: %class_path% + +%JAVA% -classpath %class_path% %jvm_opts% org.openo.commontosca.catalog.CatalogApp server %RUNHOME%conf/catalog.yml + +IF ERRORLEVEL 1 goto showerror +exit +:showerror +echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check! +echo After checking, press any key to close +pause +exit \ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/run.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/run.sh new file mode 100644 index 00000000..4eda12c4 --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/run.sh @@ -0,0 +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. +# + +DIRNAME=`dirname $0` +RUNHOME=`cd $DIRNAME/; pwd` +echo @RUNHOME@ $RUNHOME + +echo @JAVA_HOME@ $JAVA_HOME +JAVA="$JAVA_HOME/bin/java" +echo @JAVA@ $JAVA + +JAVA_OPTS="-Xms50m -Xmx128m" +port=8312 +#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" +echo @JAVA_OPTS@ $JAVA_OPTS + +class_path="$RUNHOME/:$RUNHOME/catalog-service.jar" +echo @class_path@ $class_path + +"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.commontosca.catalog.CatalogApp server "$RUNHOME/conf/catalog.yml" + diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.bat new file mode 100644 index 00000000..f3e7c08f --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.bat @@ -0,0 +1,34 @@ +@REM +@REM Copyright 2016 [ZTE] and others. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM + +@echo off +title stopping catalog-service + +set HOME=%~dp0 +set Main_Class="org.openo.commontosca.catalog.CatalogApp" + +echo ================== catalog-service info ============================================= +echo HOME=$HOME +echo Main_Class=%Main_Class% +echo =============================================================================== + +echo ### Stopping catalog-service +cd /d %HOME% + +for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do ( + call find_kill_process "%%i" %Main_Class% +) +exit \ No newline at end of file diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.sh new file mode 100644 index 00000000..40ae2dad --- /dev/null +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/stop.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# +# 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. +# + +DIRNAME=`dirname $0` +HOME=`cd $DIRNAME/; pwd` +Main_Class="org.openo.commontosca.catalog.CatalogApp" + +echo ================== catalog-service info ============================================= +echo HOME=$HOME +echo Main_Class=$Main_Class +echo =============================================================================== +cd $HOME; pwd + +echo @WORK_DIR@ $HOME + +function save_service_pid(){ + service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'` + echo @service_pid@ $service_pid +} + +function kill_service_process(){ + ps -p $service_pid + if [ $? == 0 ]; then + kill -9 $service_pid + fi +} + +save_service_pid; +echo @C_CMD@ kill -9 $service_pid +kill_service_process; \ No newline at end of file diff --git a/catalog-core/distribution/pom.xml b/catalog-core/distribution/pom.xml new file mode 100644 index 00000000..c7c22908 --- /dev/null +++ b/catalog-core/distribution/pom.xml @@ -0,0 +1,34 @@ + + + + org.openo.commontosca.catalog + catalog-core-parent + 1.0.0-SNAPSHOT + + + 4.0.0 + distribution + openo/commontosca/catalog/distribution + pom + + + catalog-standalone + catalog-all + + diff --git a/httpserver-standalone/pom.xml b/catalog-core/httpserver/pom.xml similarity index 68% rename from httpserver-standalone/pom.xml rename to catalog-core/httpserver/pom.xml index 251cf9ff..b1ead67a 100644 --- a/httpserver-standalone/pom.xml +++ b/catalog-core/httpserver/pom.xml @@ -1,41 +1,42 @@ - 4.0.0 - - catalog-parent - org.openo.orchestrator.nfv.catalog - 0.0.1-SNAPSHOT + + org.openo.commontosca.catalog + catalog-core-parent + 1.0.0-SNAPSHOT - httpserver-standalone - openo/catalog/httpserver-standalone + + 4.0.0 + httpserver + openo/commontosca/catalog/httpserver pom + 7.0.62 - http-server - UTF-8 + http-server + org.apache.maven.plugins maven-dependency-plugin - 2.8 unpack-tomcat @@ -52,8 +53,8 @@ - - + + org.apache.maven.plugins maven-antrun-plugin @@ -64,12 +65,12 @@ run - - - - - - + + + + + + @@ -77,7 +78,7 @@ - + org.codehaus.mojo build-helper-maven-plugin diff --git a/httpserver-standalone/src/main/assembly/tomcat/conf/web.xml b/catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml similarity index 99% rename from httpserver-standalone/src/main/assembly/tomcat/conf/web.xml rename to catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml index e1736353..af6dd7c9 100644 --- a/httpserver-standalone/src/main/assembly/tomcat/conf/web.xml +++ b/catalog-core/httpserver/src/main/assembly/tomcat/conf/web.xml @@ -1,19 +1,19 @@ + + + org.openo.commontosca.catalog + catalog-root + 1.0.0-SNAPSHOT + + + 4.0.0 + catalog-core-parent + openo/commontosca/catalog/catalog-core-parent + pom + + + catalog-mgr + httpserver + distribution + + diff --git a/catalog-parent/catalogparent-lite/pom.xml b/catalog-parent/catalogparent-lite/pom.xml new file mode 100644 index 00000000..01c023d4 --- /dev/null +++ b/catalog-parent/catalogparent-lite/pom.xml @@ -0,0 +1,115 @@ + + + + + 4.0.0 + org.openo.commontosca.catalog + catalogparent-lite + 1.0.0-SNAPSHOT + openo/commontosca/catalog/catalogparent-lite + pom + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + true + true + 1.7 + 1.7 + 1.7 + UTF-8 + true + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + false + + true + + + + org.apache.maven.plugins + maven-shade-plugin + 2.4 + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + UTF-8 + + pdf + swf + exe + png + gif + jpg + jpeg + bmp + eot + ttf + svg + woff + woff2 + mso + wmz + emz + otf + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + com.mycila + license-maven-plugin + 3.0.rc1 + + + + + diff --git a/catalog-parent/catalogparent/pom.xml b/catalog-parent/catalogparent/pom.xml new file mode 100644 index 00000000..8ae32bcf --- /dev/null +++ b/catalog-parent/catalogparent/pom.xml @@ -0,0 +1,231 @@ + + + + org.openo.commontosca.catalog + catalogparent-lite + 1.0.0-SNAPSHOT + ../catalogparent-lite + + + 4.0.0 + catalogparent + openo/commontosca/catalog/catalogparent + pom + + + 0.8.0 + 1.5.3 + 1.16.4 + 2.16 + 5.0 + 2.5.1 + 2.2.4 + 1.6 + 3.0.7 + 3.3 + 5.1.18 + 1.2.1 + 1.4 + 4.10 + 1.4.10 + 1.9.5 + 1.4.182 + 1.8.2 + 7.0.62 + + + + + + + io.dropwizard + dropwizard-core + ${dropwizard.version} + + + io.dropwizard + dropwizard-assets + ${dropwizard.version} + + + io.dropwizard + dropwizard-hibernate + ${dropwizard.version} + + + io.dropwizard + dropwizard-migrations + ${dropwizard.version} + + + + io.swagger + swagger-jersey2-jaxrs + ${swagger.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + org.glassfish.jersey.core + jersey-server + ${jersey.version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey.version} + + + org.glassfish.jersey.containers + jersey-container-servlet-core + ${jersey.version} + + + + com.eclipsesource.jaxrs + consumer + ${jaxrs.consumer.version} + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + + com.google.code.gson + gson + ${gson.version} + + + + dom4j + dom4j + ${dom4j.version} + + + + org.cometd.java + bayeux-api + ${cometd.version} + + + org.cometd.java + cometd-java-annotations + ${cometd.version} + + + org.cometd.java + cometd-java-client + ${cometd.version} + + + org.cometd.java + cometd-java-common + ${cometd.version} + + + org.cometd.java + cometd-java-oort + ${cometd.version} + + + org.cometd.java + cometd-java-server + ${cometd.version} + + + + commons-net + commons-net + ${commons-net.version} + + + + mysql + mysql-connector-java + ${mysql-connector-java.version} + + + + commons-fileupload + commons-fileupload + ${commons-fileupload.version} + + + commons-io + commons-io + ${commons-io.version} + + + + io.dropwizard + dropwizard-testing + ${dropwizard.version} + + + junit + junit + ${junit.version} + + + org.powermock + powermock-module-junit4 + ${org.powermock.version} + + + org.powermock + powermock-api-mockito + ${org.powermock.version} + + + org.mockito + mockito-all + ${org.mockito.version} + + + com.h2database + h2 + ${h2database.version} + + + org.apache.ant + ant + ${org.apache.ant.version} + + + + org.apache.tomcat + tomcat + ${tomcat.version} + + + + diff --git a/catalog-parent/pom.xml b/catalog-parent/pom.xml new file mode 100644 index 00000000..36a7adb5 --- /dev/null +++ b/catalog-parent/pom.xml @@ -0,0 +1,36 @@ + + + + org.openo.commontosca.catalog + catalogparent-lite + 1.0.0-SNAPSHOT + catalogparent-lite + + + 4.0.0 + org.openo.commontosca.catalog + catalogparent-aggregator + openo/commontosca/catalog/catalogparent-aggregator + pom + + + catalogparent + catalogparent-lite + + diff --git a/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql b/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql deleted file mode 100644 index e3d0522e..00000000 --- a/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-extend-mysql.sql +++ /dev/null @@ -1,17 +0,0 @@ --- --- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) --- --- 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. --- - --- \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql b/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql deleted file mode 100644 index 41fd7a18..00000000 --- a/catalog-standalone/src/main/assembly/conf/catalog-resource-insert-mysql.sql +++ /dev/null @@ -1,20 +0,0 @@ --- --- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) --- --- 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. --- - -SET autocommit = 0; - -COMMIT; -SET autocommit = 1; \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/find_kill_process.bat b/catalog-standalone/src/main/assembly/find_kill_process.bat deleted file mode 100644 index 728eec53..00000000 --- a/catalog-standalone/src/main/assembly/find_kill_process.bat +++ /dev/null @@ -1,24 +0,0 @@ -@REM -@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -@REM -@REM Licensed under the Apache License, Version 2.0 (the "License"); -@REM you may not use this file except in compliance with the License. -@REM You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. -@REM - -echo %1 | findstr %2 >NUL -echo ERRORLEVEL=%ERRORLEVEL% -IF ERRORLEVEL 1 goto findend -for /f "tokens=1" %%a in (%1) do ( - echo kill %1 - taskkill /F /pid %%a -) -:findend \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/initDB.bat b/catalog-standalone/src/main/assembly/initDB.bat deleted file mode 100644 index bafc036f..00000000 --- a/catalog-standalone/src/main/assembly/initDB.bat +++ /dev/null @@ -1,42 +0,0 @@ -@REM -@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -@REM -@REM Licensed under the Apache License, Version 2.0 (the "License"); -@REM you may not use this file except in compliance with the License. -@REM You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. -@REM - -@echo off -title init catalog db - -set RUNHOME=%~dp0 -echo ### RUNHOME: %RUNHOME% - -echo ### init catalog db -rem cd /d %RUNHOME% - -set JAVA="%JAVA_HOME%\bin\java.exe" -set port=8777 -set jvm_opts=-Xms50m -Xmx128m -rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n -set class_path=%RUNHOME%;%RUNHOME%catalog-service.jar -echo ### jvm_opts: %jvm_opts% -echo ### class_path: %class_path% - -%JAVA% -classpath %class_path% %jvm_opts% org.openo.orchestrator.nfv.catalog.CatalogApp db migrate %RUNHOME%conf\catalog.yml - -IF ERRORLEVEL 1 goto showerror -exit -:showerror -echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check! -echo After checking, press any key to close -pause -exit \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/initDB.sh b/catalog-standalone/src/main/assembly/initDB.sh deleted file mode 100644 index 109d119f..00000000 --- a/catalog-standalone/src/main/assembly/initDB.sh +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -# -# 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. -# - -DIRNAME=`dirname $0` -RUNHOME=`cd $DIRNAME/; pwd` -echo @RUNHOME@ $RUNHOME - -title catalog Database setup - -echo ### Starting catalog Database setup -echo @JAVA_HOME@ $JAVA_HOME -JAVA="$JAVA_HOME/bin/java" -echo @JAVA@ $JAVA - -class_path="$RUNHOME/:$RUNHOME/catalog-service.jar" -echo @class_path@ $class_path - -"$JAVA" -classpath "$class_path" org.openo.orchestrator.nfv.catalog.CatalogApp db migrate "$RUNHOME/conf/catalog.yml" diff --git a/catalog-standalone/src/main/assembly/run.bat b/catalog-standalone/src/main/assembly/run.bat deleted file mode 100644 index 4d389704..00000000 --- a/catalog-standalone/src/main/assembly/run.bat +++ /dev/null @@ -1,40 +0,0 @@ -@REM -@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -@REM -@REM Licensed under the Apache License, Version 2.0 (the "License"); -@REM you may not use this file except in compliance with the License. -@REM You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. -@REM - -@echo off -title catalog-service - -set RUNHOME=%~dp0 -echo ### RUNHOME: %RUNHOME% -echo ### Starting catalog-service - -set JAVA="%JAVA_HOME%\bin\java.exe" -set port=8312 -set jvm_opts=-Xms50m -Xmx128m -rem set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n -set class_path=%RUNHOME%;%RUNHOME%catalog-service.jar -echo ### jvm_opts: %jvm_opts% -echo ### class_path: %class_path% - -%JAVA% -classpath %class_path% %jvm_opts% org.openo.orchestrator.nfv.catalog.CatalogApp server %RUNHOME%conf/catalog.yml - -IF ERRORLEVEL 1 goto showerror -exit -:showerror -echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check! -echo After checking, press any key to close -pause -exit \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/run.sh b/catalog-standalone/src/main/assembly/run.sh deleted file mode 100644 index c3849fa0..00000000 --- a/catalog-standalone/src/main/assembly/run.sh +++ /dev/null @@ -1,34 +0,0 @@ -# -# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -# -# 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. -# - -DIRNAME=`dirname $0` -RUNHOME=`cd $DIRNAME/; pwd` -echo @RUNHOME@ $RUNHOME - -echo @JAVA_HOME@ $JAVA_HOME -JAVA="$JAVA_HOME/bin/java" -echo @JAVA@ $JAVA - -JAVA_OPTS="-Xms50m -Xmx128m" -port=8312 -#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n" -echo @JAVA_OPTS@ $JAVA_OPTS - -class_path="$RUNHOME/:$RUNHOME/catalog-service.jar" -echo @class_path@ $class_path - -"$JAVA" $JAVA_OPTS -classpath "$class_path" org.openo.orchestrator.nfv.catalog.CatalogApp server "$RUNHOME/conf/catalog.yml" - diff --git a/catalog-standalone/src/main/assembly/stop.bat b/catalog-standalone/src/main/assembly/stop.bat deleted file mode 100644 index 82f65a52..00000000 --- a/catalog-standalone/src/main/assembly/stop.bat +++ /dev/null @@ -1,34 +0,0 @@ -@REM -@REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -@REM -@REM Licensed under the Apache License, Version 2.0 (the "License"); -@REM you may not use this file except in compliance with the License. -@REM You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. -@REM - -@echo off -title stopping catalog-service - -set HOME=%~dp0 -set Main_Class="org.openo.orchestrator.nfv.catalog.CatalogApp" - -echo ================== catalog-service info ============================================= -echo HOME=$HOME -echo Main_Class=%Main_Class% -echo =============================================================================== - -echo ### Stopping catalog-service -cd /d %HOME% - -for /f "delims=" %%i in ('"%JAVA_HOME%\bin\jcmd"') do ( - call find_kill_process "%%i" %Main_Class% -) -exit \ No newline at end of file diff --git a/catalog-standalone/src/main/assembly/stop.sh b/catalog-standalone/src/main/assembly/stop.sh deleted file mode 100644 index f66e77b7..00000000 --- a/catalog-standalone/src/main/assembly/stop.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) -# -# 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. -# - -DIRNAME=`dirname $0` -HOME=`cd $DIRNAME/; pwd` -Main_Class="org.openo.orchestrator.nfv.catalog.CatalogApp" - -echo ================== catalog-service info ============================================= -echo HOME=$HOME -echo Main_Class=$Main_Class -echo =============================================================================== -cd $HOME; pwd - -echo @WORK_DIR@ $HOME - -function save_service_pid(){ - service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'` - echo @service_pid@ $service_pid -} - -function kill_service_process(){ - ps -p $service_pid - if [ $? == 0 ]; then - kill -9 $service_pid - fi -} - -save_service_pid; -echo @C_CMD@ kill -9 $service_pid -kill_service_process; \ No newline at end of file diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonErrorResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonErrorResponse.java deleted file mode 100644 index 96e6cdc3..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/CommonErrorResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author 00164331 - * - */ - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CommonErrorResponse { - - private String code; - - private String message; - - /** - * @param message2 - * @return - */ - public static Object failure(String message) { - return message; - } - - public CommonErrorResponse(String message) { - super(); - this.message = message; - } - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/Config.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/Config.java deleted file mode 100644 index a2cd9d3d..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/Config.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -import org.openo.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/common/DateTimeUtil.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/DateTimeUtil.java deleted file mode 100644 index 6838e3d3..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/DateTimeUtil.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -import java.text.SimpleDateFormat; -import java.util.Date; - -public class DateTimeUtil { - public static String getCurrentTime() { - return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()); - } - - public static String getFormatTime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(date); - } - - public static String getFormatTime(Date date, String format) { - return new SimpleDateFormat(format).format(date); - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/EnumUploadStatus.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/EnumUploadStatus.java deleted file mode 100644 index c0944d0f..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/EnumUploadStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -public enum EnumUploadStatus { - Create_Directory_Success, Create_Directory_Fail, File_Exist, Upload_From_Break_Success, Upload_From_Break_Failed, Upload_New_File_Success, Upload_New_File_Failed -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerAddrConfig.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerAddrConfig.java deleted file mode 100644 index ed5fcb71..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerAddrConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -/** - * @author 00164331 - * - */ -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/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerPathConfig.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerPathConfig.java deleted file mode 100644 index 2e791cf5..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/HttpServerPathConfig.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -/** - * @author 00164331 - * - */ -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/src/main/java/org/openo/orchestrator/nfv/catalog/common/MsbAddrConfig.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/MsbAddrConfig.java deleted file mode 100644 index 33428efa..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/MsbAddrConfig.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -/** - * @author 00164331 - * - */ -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/src/main/java/org/openo/orchestrator/nfv/catalog/common/RestUtil.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/RestUtil.java deleted file mode 100644 index f515d73e..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/common/RestUtil.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.common; - -import javax.ws.rs.core.Response; - -/** - * @author 00164331 - * - */ -public class RestUtil { - /** - * @param e - * @return - */ - 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/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/CatalogResuorceType.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/CatalogResuorceType.java deleted file mode 100644 index 2a351731..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/CatalogResuorceType.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.common; - -/** - ** @author 10159474 - */ -public enum CatalogResuorceType { - SERVICETEMPLATE, PACKAGE, NODETEMPLATE, TEMPLATE, SERVICETEMPLATEMAPPING; - - public static CatalogResuorceType getType(String type) { - return valueOf(type); - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/Parameters.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/Parameters.java deleted file mode 100644 index e75b46b4..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/common/Parameters.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.common; - -/** - * *@author 10159474 - * - */ -public enum Parameters { - oid, name, provider, version, deletionPending, type, status, csarId, vendor, serviceTemplateId, nodeTemplateId, mappingId, nodeType; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/NodeTemplateDao.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/NodeTemplateDao.java deleted file mode 100644 index 514dff0f..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/NodeTemplateDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.entity.NodeTemplateData; - - -/** - * host DAO class - * - * *@author 10159474 - * - */ -public class NodeTemplateDao extends BaseDao { - - public NodeTemplateDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/PackageDao.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/PackageDao.java deleted file mode 100644 index 90c4f5e1..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/PackageDao.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.entity.PackageData; - - -/** - * host DAO class - * - * *@author 10159474 - * - */ -public class PackageDao extends BaseDao { - - public PackageDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateDao.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateDao.java deleted file mode 100644 index 794ac9f0..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateDao.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * DAO class - * - * *@author 10159474 - * - */ -public class ServiceTemplateDao extends BaseDao { - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateDao.class); - - public ServiceTemplateDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateMappingDao.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateMappingDao.java deleted file mode 100644 index d2c28a42..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/dao/ServiceTemplateMappingDao.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.dao; - -import org.hibernate.SessionFactory; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateData; -import org.openo.orchestrator.nfv.catalog.db.entity.ServiceTemplateMappingData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * DAO class - * - * *@author 10159474 - * - */ -public class ServiceTemplateMappingDao extends BaseDao { - private static final Logger logger = LoggerFactory.getLogger(ServiceTemplateMappingDao.class); - - public ServiceTemplateMappingDao(SessionFactory sessionFactory) { - super(sessionFactory); - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/BaseData.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/BaseData.java deleted file mode 100644 index 07a64ea4..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/BaseData.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.entity; - -public class BaseData { - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/TemplateData.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/TemplateData.java deleted file mode 100644 index e1f72ab5..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/entity/TemplateData.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.entity; - -import java.util.ArrayList; - -public class TemplateData extends BaseData { - private ServiceTemplateData serviceTemplate; - private ArrayList nodeTemplates = new ArrayList(); - - public ServiceTemplateData getServiceTemplate() { - return serviceTemplate; - } - - public void setServiceTemplate(ServiceTemplateData serviceTemplate) { - this.serviceTemplate = serviceTemplate; - } - - public ArrayList getNodeTemplates() { - return nodeTemplates; - } - - public void setNodeTemplates(ArrayList nodeTemplates) { - this.nodeTemplates = nodeTemplates; - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtil.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtil.java deleted file mode 100644 index a792e925..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/db/util/CatalogDbUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.db.util; - -import java.util.UUID; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.gson.Gson; - -public class CatalogDbUtil { - private final static Logger logger = LoggerFactory.getLogger(CatalogDbUtil.class); - - public static String generateId() { - return UUID.randomUUID().toString(); - } - - public static boolean isNotEmpty(String s) { - return s != null && !"".equals(s) && s.length() > 0; - } - - public static String objectToString(Object obj) { - Gson gson = new Gson(); - if (obj != null) - return gson.toJson(obj); - else - return null; - } - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARQueryCondition.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARQueryCondition.java deleted file mode 100644 index 36972def..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/CSARQueryCondition.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumOperationalState.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumOperationalState.java deleted file mode 100644 index dafe7f8b..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumOperationalState.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity; - -public enum EnumOperationalState { - Enabled, Disabled -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumProcessState.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumProcessState.java deleted file mode 100644 index 9f2ab76b..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumProcessState.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity; - -/** - * @author 00164331 - * - */ -public enum EnumProcessState { - normal, onBoarding, onBoardFailed, deleting, deleteFailed -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumType.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumType.java deleted file mode 100644 index 23165f51..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumType.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity; - -public enum EnumType { - GSAR, SSAR, NSAR, NFAR -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumUsageState.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumUsageState.java deleted file mode 100644 index 966a264c..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/EnumUsageState.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity; - -public enum EnumUsageState { - InUse, NotInUse -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/PackageBasicInfo.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/PackageBasicInfo.java deleted file mode 100644 index ec16434d..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/PackageBasicInfo.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity.request; - -import org.openo.orchestrator.nfv.catalog.entity.EnumType; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class PackageBasicInfo { - - private String provider; - - private EnumType type; - - private String version; - - private String format; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/UploadPackageFromFtpRequest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/UploadPackageFromFtpRequest.java deleted file mode 100644 index 8bc45994..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/request/UploadPackageFromFtpRequest.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity.request; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import org.openo.orchestrator.nfv.catalog.entity.EnumType; - -/** - * @author 00164331 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class UploadPackageFromFtpRequest { - - private String provider; - - private EnumType type; - - private String version; - - private String ftpUrl; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/CsarFileUriResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/CsarFileUriResponse.java deleted file mode 100644 index 6ce9b3fe..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/CsarFileUriResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity.response; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - * @author 00164331 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CsarFileUriResponse { - - private String downloadUri; - - private String localPath; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/PackageMeta.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/PackageMeta.java deleted file mode 100644 index d9077684..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/PackageMeta.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.entity.response; - -import org.openo.orchestrator.nfv.catalog.entity.EnumOperationalState; -import org.openo.orchestrator.nfv.catalog.entity.EnumProcessState; -import org.openo.orchestrator.nfv.catalog.entity.EnumUsageState; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@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/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UpdatePackageResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UpdatePackageResponse.java deleted file mode 100644 index dba488bd..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UpdatePackageResponse.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UploadPackageResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UploadPackageResponse.java deleted file mode 100644 index 57add55f..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/entity/response/UploadPackageResponse.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManager.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManager.java deleted file mode 100644 index d9fdd2c9..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManager.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.filemanage; - -import java.util.ArrayList; - -import org.openo.orchestrator.nfv.catalog.filemanage.entity.FileLink; - -public interface FileManager { - /** - * @param srcPath - * @param dstPath/packageType/provider/packageName/version - * @return - */ - boolean upload(String srcPath, String dstPath); - - boolean download(String srcPath, String dstPath); - - boolean delete(String srcPath); - - ArrayList queryWorkFlow(String path); - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerType.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerType.java deleted file mode 100644 index ec65c189..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/FileManagerType.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.filemanage; - -public enum FileManagerType { - ftp, http; - public static FileManagerType getType(String type) { - return valueOf(type); - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/entity/FileLink.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/entity/FileLink.java deleted file mode 100644 index 9f70a623..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/filemanage/entity/FileLink.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.filemanage.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class FileLink { - private String fileName; - private String downloadUri; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/Ftp.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/Ftp.java deleted file mode 100644 index f4212408..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/ftp/Ftp.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.ftp; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - - -/** - * @author 00164331 - * - */ -@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/src/main/java/org/openo/orchestrator/nfv/catalog/health/ConsoleHealthCheck.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/health/ConsoleHealthCheck.java deleted file mode 100644 index bc1569c0..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/health/ConsoleHealthCheck.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaRelationShipDefinition.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaRelationShipDefinition.java deleted file mode 100644 index de19ba35..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/common/EnumToscaRelationShipDefinition.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/EnumDataType.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/EnumDataType.java deleted file mode 100644 index fb8f2b39..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/EnumDataType.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; - -/** - * @author 10090474 - * - */ -@AllArgsConstructor -public enum EnumDataType { - STRING("String"), INTEGER("Integer"), FLOAT("Float"), BOOLEAN("Boolean"); - - private String value; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public String toString() { - return value; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/InputParameter.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/InputParameter.java deleted file mode 100644 index 783fa1bb..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/InputParameter.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author 10090474 - * - */ - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class InputParameter { - private String name; - private EnumDataType type = EnumDataType.STRING; - private String description; - private String defaultValue; - private boolean required; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/KeyValuePair.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/KeyValuePair.java deleted file mode 100644 index 60548d33..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/KeyValuePair.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class KeyValuePair { - private String key; - private String value; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NfvTemplate.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NfvTemplate.java deleted file mode 100644 index ab038a90..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NfvTemplate.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import java.util.List; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class NfvTemplate { - private List vduNodes; - private List networkNodes; - private List vnfcNodes; - private List vnfNodes; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NodeTemplate.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NodeTemplate.java deleted file mode 100644 index 3ffd68f1..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/NodeTemplate.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import java.util.List; -import java.util.Map; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class NodeTemplate { - private String id; - private String name; - private String type; - private Map properties; - private List relationShips; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/QueryRawDataCondition.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/QueryRawDataCondition.java deleted file mode 100644 index 090c17e0..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/QueryRawDataCondition.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class QueryRawDataCondition { - private String csarId; - private KeyValuePair[] inputParameters; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/RelationShip.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/RelationShip.java deleted file mode 100644 index d8cbe8df..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/RelationShip.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class RelationShip { - private String sourceNodeName; - private String targetNodeName; - private String sourceNodeId; - private String targetNodeId; - private String type; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplate.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplate.java deleted file mode 100644 index 86efe196..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplate.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplate { - private String serviceTemplateId; - private String templateName; - private String vendor; - private String version; - private String csarid; - private String type; - private String downloadUri; - private InputParameter[] inputs; - private ServiceTemplateOperation[] operations; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateOperation.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateOperation.java deleted file mode 100644 index ba66b6ed..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateOperation.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplateOperation { - private String name; - private String description; - private String processId; - private InputParameter[] inputs; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateRawData.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateRawData.java deleted file mode 100644 index 37cfab4e..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/entity/ServiceTemplateRawData.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class ServiceTemplateRawData { - private String rawData; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerExtPackageRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerExtPackageRest.java deleted file mode 100644 index 692c13b0..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerExtPackageRest.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.container; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServicePackageList; - -/** - * The opentosca container interface for csar. - * @author 10189609 - * - */ -@Path("/csars") -public interface IContainerExtPackageRest { - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - public ContainerServicePackageList getToscaServicePackage(@QueryParam("csarName") String csarName); - - @POST - @Consumes(MediaType.TEXT_PLAIN) - public String uploadPackageByToscaService(@QueryParam("fileLocation") String fileLocation); - - @Path("/{csarId}") - @DELETE - public String deletePackageById(@PathParam("csarId") String csarId); -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerPortabilityRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerPortabilityRest.java deleted file mode 100644 index 5086684f..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerPortabilityRest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.container; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; - -/** - * The opentosca container interface for policy. - * @author 10189609 - * - */ -@Path("/servicetemplates") -public interface IContainerPortabilityRest { - - @Path("/{templateid}/policys") - @GET - String getToscaPolicys(@PathParam("templateid") String serviceTemplateID); -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerTemplateRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerTemplateRest.java deleted file mode 100644 index f2957101..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/container/IContainerTemplateRest.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.container; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceNodeTemplateList; -import org.openo.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity.ContainerServiceTemplateList; - -/** - * The opentosca container interface for service template. - * @author 10189609 - * - */ -@Path("/servicetemplates") -public interface IContainerTemplateRest { - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - ContainerServiceTemplateList getToscaServiceTemplate(@QueryParam("templateid") String templateId); - - @Path("/{templateid}/nodetemplates") - @GET - @Produces(MediaType.APPLICATION_OCTET_STREAM) - ContainerServiceNodeTemplateList getToscaServiceNodeTemplates(@PathParam("templateid") String templateId); -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java deleted file mode 100644 index 6ae91afc..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceCommonParam.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.FIELD) -public class ContainerServiceCommonParam { - @XmlElement - private String key; - - @XmlElement - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java deleted file mode 100644 index fdc8fd43..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceNodeTemplateList.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name="nodetemplates") -public class ContainerServiceNodeTemplateList { - @XmlElement(name="nodetemplate") - private List nodeTemplate; - - public List getNodeTemplate() { - return nodeTemplate; - } - - public void setNodeTemplate(List nodeTemplate) { - this.nodeTemplate = nodeTemplate; - } - - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java deleted file mode 100644 index 380d3fab..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServiceOperationParameter.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; - -/** - * @author 10189609 - * - */ -public class ContainerServiceOperationParameter { - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java deleted file mode 100644 index fd53d3dc..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/containerEntity/ContainerServicePackageList.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.containerEntity; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement(name="packages") -public class ContainerServicePackageList { - public static final String NAMESPACE_OF_SELFSERVICE="http://www.eclipse.org/winery/model/selfservice"; - - @XmlElement(name="package") - private List packageList; - - public List getPackageList() { - return packageList; - } - - public void setPackageList(List packageList) { - this.packageList = packageList; - } - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java deleted file mode 100644 index ad46d7df..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/lifecycleEnity/InstanceEntity.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.lifecycleEnity; - -public class InstanceEntity { - private String serviceTemplateId; - - public String getServiceTemplateId() { - return serviceTemplateId; - } - - public void setServiceTemplateId(String serviceTemplateId) { - this.serviceTemplateId = serviceTemplateId; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java deleted file mode 100644 index 834f8262..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/entity/roEntity/ResourceResponseEntity.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.externalservice.entity.roEntity; - -import java.util.ArrayList; - -public class ResourceResponseEntity -{ - ArrayList data=new ArrayList(); - String operationResult; - - public String getOperationResult() - { - return operationResult; - } - - public void setOperationResult(String operationResult) - { - this.operationResult = operationResult; - } - public ArrayList getData() - { - return data; - } - public void setData(ArrayList data) - { - this.data = data; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java deleted file mode 100644 index 0a3eb830..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/lifecycle/ILifeCycleServiceRest.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/IResourceServiceRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/IResourceServiceRest.java deleted file mode 100644 index 44ec792f..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/externalservice/ro/IResourceServiceRest.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/AbstractModelParser.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/AbstractModelParser.java deleted file mode 100644 index f1788c8b..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/AbstractModelParser.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.parser; - -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; - -public abstract class AbstractModelParser { - /** - * @param packageId - * @param fileLocation - * @return service template id - * @throws CatalogResourceException - */ - public abstract String parse(String packageId, String fileLocation) - throws CatalogResourceException; - -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumPackageFormat.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumPackageFormat.java deleted file mode 100644 index 3010c602..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumPackageFormat.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.parser; - -/** - * enum data. - * @author 10189609 - * - */ -public enum EnumPackageFormat { - TOSCA_XML, TOSCA_YAML -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumTemplateType.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumTemplateType.java deleted file mode 100644 index 9254faf3..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/EnumTemplateType.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.parser; - -public enum EnumTemplateType { - NS, VNF -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/IYamlParseRest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/IYamlParseRest.java deleted file mode 100644 index 20decb49..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/IYamlParseRest.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.parser.yaml; - -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; - -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; - -/** - * - * @author 10090474 - * - */ -@Path("/parse") -public interface IYamlParseRest { - /** - * @param request - * @return - * @throws Exception - */ - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - String parse(ParseYamlRequestParemeter request) - throws Exception; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/YamlParseServiceConsumer.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/YamlParseServiceConsumer.java deleted file mode 100644 index c1f758ef..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/YamlParseServiceConsumer.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.parser.yaml; - -import org.glassfish.jersey.client.ClientConfig; -import org.openo.orchestrator.nfv.catalog.common.MSBUtil; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlRequestParemeter; -import org.openo.orchestrator.nfv.catalog.model.parser.yaml.entity.ParseYamlResult; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; -import com.google.gson.Gson; - -/** - * - * @author 10090474 - * - */ -public class YamlParseServiceConsumer { - /** - * get service template by template id from container service. - * - * @param request - * @return - * @throws CatalogResourceException - */ - 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 e) { - throw new CatalogResourceException("Call parser api failed.", e); - } - - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java deleted file mode 100644 index 50149774..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/parser/yaml/entity/EnumYamlServiceTemplateInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.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/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/IWSO2RestService.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/IWSO2RestService.java deleted file mode 100644 index 83902cac..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/IWSO2RestService.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.plan.wso2; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.glassfish.jersey.media.multipart.FormDataMultiPart; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.DeletePackageResponse; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.DeployPackageResponse; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.StartProcessRequest; -import org.openo.orchestrator.nfv.catalog.model.plan.wso2.entity.StartProcessResponse; - -/** - * - * @author 10090474 - * - */ -@Path("/openoapi/wso2bpel/v1") -public interface IWSO2RestService { - /** - * @param request - * @return - * @throws Exception - */ - @Path("/package") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - DeployPackageResponse deployPackage(FormDataMultiPart request) throws Exception; - - @Path("/package/{packageName}") - @DELETE - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - DeletePackageResponse deletePackage( - @PathParam("packageName") String packageName) throws Exception; - - @Path("process/instance") - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - StartProcessResponse startProcess(StartProcessRequest request) - throws Exception; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeletePackageResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeletePackageResponse.java deleted file mode 100644 index 87ca8ea5..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeletePackageResponse.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.plan.wso2.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class DeletePackageResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeployPackageResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeployPackageResponse.java deleted file mode 100644 index d28b896a..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/DeployPackageResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.plan.wso2.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class DeployPackageResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String packageName; - private String processId; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessRequest.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessRequest.java deleted file mode 100644 index 7c914862..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessRequest.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.plan.wso2.entity; - -import java.util.Map; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class StartProcessRequest { - private String processId; - private Map params; -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessResponse.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessResponse.java deleted file mode 100644 index df6d057d..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/model/plan/wso2/entity/StartProcessResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.model.plan.wso2.entity; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -/** - * @author 10090474 - * - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class StartProcessResponse { - private static final int STATUS_SUCCESS = 1; - - private int status; - private String message; - private String response; - private String exception; - - public boolean isSuccess() { - return this.status == STATUS_SUCCESS; - } -} diff --git a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/RestUtils.java b/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/RestUtils.java deleted file mode 100644 index b361cce1..00000000 --- a/catalog/src/main/java/org/openo/orchestrator/nfv/catalog/resources/RestUtils.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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.orchestrator.nfv.catalog.resources; - -import javax.ws.rs.BadRequestException; -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.Response; - -import org.openo.orchestrator.nfv.catalog.common.CommonErrorResponse; -import org.openo.orchestrator.nfv.catalog.db.exception.CatalogResourceException; - - -public class RestUtils { - /** - * @param e - * @return - */ - public static InternalServerErrorException newInternalServerErrorException( - CatalogResourceException e) { - return new InternalServerErrorException(Response - .status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(new CommonErrorResponse(e.getErrcode() + "", e.getMessage())).build(), e); - } - - /** - * @param e - * @return - */ - public static BadRequestException newBadRequestException(CatalogBadRequestException e) { - return new BadRequestException(Response.status(Response.Status.BAD_REQUEST) - .entity(new CommonErrorResponse(e.getErrcode() + "", e.getMessage())).build(), e); - } -} diff --git a/catalog/src/main/resources/api-doc/lib/jquery.slideto.min.js b/catalog/src/main/resources/api-doc/lib/jquery.slideto.min.js deleted file mode 100644 index 188f4f06..00000000 --- a/catalog/src/main/resources/api-doc/lib/jquery.slideto.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE) - * - * 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. - */ -(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery); diff --git a/catalog/src/main/resources/api-doc/o2c.html b/catalog/src/main/resources/api-doc/o2c.html deleted file mode 100644 index 4f23dfb4..00000000 --- a/catalog/src/main/resources/api-doc/o2c.html +++ /dev/null @@ -1,37 +0,0 @@ - - \ No newline at end of file diff --git a/catalog/src/test/resources/Hibernate.cfg.xml b/catalog/src/test/resources/Hibernate.cfg.xml deleted file mode 100644 index 170d6b87..00000000 --- a/catalog/src/test/resources/Hibernate.cfg.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - true - org.hibernate.dialect.H2Dialect - org.h2.Driver - jdbc:h2:tcp://localhost:8205/./db/catalog - catalog - catalog - update - thread - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index bc86b287..58d8d495 100644 --- a/pom.xml +++ b/pom.xml @@ -1,38 +1,44 @@ - org.openo.orchestrator - openoparentpom - 0.0.1-SNAPSHOT + org.openo.commontosca.catalog + catalogparent + 1.0.0-SNAPSHOT + catalog-parent/catalogparent 4.0.0 - org.openo.orchestrator.nfv.catalog - catalog-parent - openo/catalog + catalog-root + openo/commontosca/catalog/catalog-root pom - - + - catalog - catalog-standalone - httpserver-standalone - catalog-all + catalog-parent + catalog-core + + + + + com.mycila + license-maven-plugin + + +