Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4BF0F200CCA for ; Wed, 19 Jul 2017 08:42:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4A61B16847B; Wed, 19 Jul 2017 06:42:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 68D6D168472 for ; Wed, 19 Jul 2017 08:42:44 +0200 (CEST) Received: (qmail 2454 invoked by uid 500); 19 Jul 2017 06:42:43 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 2445 invoked by uid 99); 19 Jul 2017 06:42:43 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2017 06:42:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8382DF324C; Wed, 19 Jul 2017 06:42:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jluniya@apache.org To: commits@ambari.apache.org Date: Wed, 19 Jul 2017 06:42:42 -0000 Message-Id: <6908a245226e4b23afe5884d547b8342@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ambari git commit: AMBARI-21467: Json Software Registry Implementation (jluniya) archived-at: Wed, 19 Jul 2017 06:42:45 -0000 Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-14714 c01ff0b2b -> 4450fd7ef http://git-wip-us.apache.org/repos/asf/ambari/blob/4450fd7e/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryMpackVersion.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryMpackVersion.java b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryMpackVersion.java new file mode 100644 index 0000000..39ebf17 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryMpackVersion.java @@ -0,0 +1,80 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this 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.apache.ambari.server.registry.json; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.ambari.server.registry.RegistryMpackCompatiblity; +import org.apache.ambari.server.registry.RegistryMpackService; +import org.apache.ambari.server.registry.RegistryMpackVersion; + +import com.google.gson.annotations.SerializedName; + +/** + * JSON implemenation of {@link RegistryMpackVersion} + */ +public class JsonRegistryMpackVersion implements RegistryMpackVersion { + @SerializedName("version") + private String version; + + @SerializedName("buildNumber") + private String buildNumber; + + @SerializedName("mpackUrl") + private String mpackUrl; + + @SerializedName("docUrl") + private String docUrl; + + @SerializedName("services") + private ArrayList services; + + @SerializedName("compatibleMpacks") + private ArrayList compatibleMpacks; + + @Override + public String getMpackVersion() { + return version; + } + + @Override + public String getMpackBuildNumber() { + return buildNumber; + } + + @Override + public String getMpackUrl() { + return mpackUrl; + } + + @Override + public String getMpackDocUrl() { + return docUrl; + } + + @Override + public List getMpackServices() { + return services; + } + + @Override + public List getCompatibleMpacks() { + return compatibleMpacks; + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/4450fd7e/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenario.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenario.java b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenario.java new file mode 100644 index 0000000..0452939 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenario.java @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this 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.apache.ambari.server.registry.json; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.ambari.server.registry.RegistryScenario; +import org.apache.ambari.server.registry.RegistryScenarioMpack; + +import com.google.gson.annotations.SerializedName; + + +/** + * JSON implementation of a {@link RegistryScenario} + */ +public class JsonRegistryScenario implements RegistryScenario { + @SerializedName("name") + private String name; + + @SerializedName("description") + private String description; + + @SerializedName("scenarioMpacks") + private ArrayList scenarioMpacks; + + @Override + public String getScenarioName() { + return name; + } + + @Override + public String getScenarioDescription() { + return description; + } + + @Override + public List getScenarioMpacks() { + return scenarioMpacks; + } +} http://git-wip-us.apache.org/repos/asf/ambari/blob/4450fd7e/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenarioMpack.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenarioMpack.java b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenarioMpack.java new file mode 100644 index 0000000..29ea929 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/registry/json/JsonRegistryScenarioMpack.java @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this 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.apache.ambari.server.registry.json; + +import org.apache.ambari.server.registry.RegistryScenarioMpack; + +import com.google.gson.annotations.SerializedName; + +/** + * JSON implementation of {@link RegistryScenarioMpack} + */ +public class JsonRegistryScenarioMpack implements RegistryScenarioMpack { + + @SerializedName("name") + private String name; + + @Override + public String getName() { + return name; + } +}