ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject [1/3] ambari git commit: AMBARI-21467: Json Software Registry Implementation (jluniya)
Date Wed, 19 Jul 2017 06:42:42 GMT
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<JsonRegistryMpackService> services;
+
+  @SerializedName("compatibleMpacks")
+  private ArrayList<JsonRegistryMpackCompatibility> 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<? extends RegistryMpackService> getMpackServices() {
+    return services;
+  }
+
+  @Override
+  public List<? extends RegistryMpackCompatiblity> 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<JsonRegistryScenarioMpack> scenarioMpacks;
+
+  @Override
+  public String getScenarioName() {
+    return name;
+  }
+
+  @Override
+  public String getScenarioDescription() {
+    return description;
+  }
+
+  @Override
+  public List<? extends RegistryScenarioMpack> 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;
+  }
+}


Mime
View raw message