Repository: stratos Updated Branches: refs/heads/master 1539df8cb -> 24df9f470
Removing GRegRegistry from metadata service as it is not implemented/used Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/24df9f47 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/24df9f47 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/24df9f47 Branch: refs/heads/master Commit: 24df9f4706d3248562d2e2582be8a8841141f44b Parents: 1539df8 Author: Imesh Gunaratne <[email protected]> Authored: Fri Jan 16 17:01:45 2015 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Fri Jan 16 17:01:45 2015 +0530 ---------------------------------------------------------------------- .../org.apache.stratos.metadataservice/pom.xml | 34 +++--- .../registry/CarbonRegistry.java | 2 - .../registry/DataRegistryFactory.java | 5 +- .../metadataservice/registry/DataStore.java | 1 + .../metadataservice/registry/GRegRegistry.java | 109 ------------------- 5 files changed, 17 insertions(+), 134 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/24df9f47/components/org.apache.stratos.metadataservice/pom.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadataservice/pom.xml b/components/org.apache.stratos.metadataservice/pom.xml index 18115e5..0ee9a0d 100644 --- a/components/org.apache.stratos.metadataservice/pom.xml +++ b/components/org.apache.stratos.metadataservice/pom.xml @@ -16,7 +16,8 @@ # specific language governing permissions and limitations # under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>org.apache.stratos</groupId> <artifactId>stratos-components-parent</artifactId> @@ -55,7 +56,7 @@ <build> <plugins> - <plugin> + <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> @@ -72,11 +73,11 @@ <!-- this is relative to the pom.xml directory --> <directory>src/main/webapp/${appName}</directory> </resource> - </webResources> + </webResources> <warName>metadata</warName> </configuration> </plugin> - + </plugins> </build> @@ -123,7 +124,6 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> <groupId>org.apache.stratos</groupId> <artifactId>org.apache.stratos.cloud.controller.service.stub</artifactId> @@ -135,32 +135,28 @@ <artifactId>org.apache.stratos.autoscaler.service.stub</artifactId> <version>${project.version}</version> <scope>provided</scope> - </dependency> - <dependency> + </dependency> + <dependency> <groupId>org.apache.stratos</groupId> <artifactId>org.apache.stratos.messaging</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.registry.ws.client</artifactId> - <version>${wso2carbon.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> + <dependency> + <groupId>org.wso2.carbon</groupId> + <artifactId>org.wso2.carbon.ntask.core</artifactId> + <version>${wso2carbon.version}</version> + </dependency> + <dependency> <groupId>org.wso2.carbon</groupId> <artifactId>org.wso2.carbon.registry.ws.stub</artifactId> <version>${wso2carbon.version}</version> - <scope>provided</scope> + <scope>provided</scope> </dependency> - <dependency> + <dependency> <groupId>com.nimbusds.wso2</groupId> <artifactId>nimbus-jose-jwt</artifactId> <version>2.26.1.wso2v2</version> </dependency> - - </dependencies> </project> http://git-wip-us.apache.org/repos/asf/stratos/blob/24df9f47/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/CarbonRegistry.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/CarbonRegistry.java b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/CarbonRegistry.java index eb9b888..aef2441 100644 --- a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/CarbonRegistry.java +++ b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/CarbonRegistry.java @@ -45,9 +45,7 @@ public class CarbonRegistry implements DataStore { private static final String mainResource = "/stratos/"; - public CarbonRegistry() { - } http://git-wip-us.apache.org/repos/asf/stratos/blob/24df9f47/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataRegistryFactory.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataRegistryFactory.java b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataRegistryFactory.java index 71de98c..cb43111 100644 --- a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataRegistryFactory.java +++ b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataRegistryFactory.java @@ -24,13 +24,10 @@ package org.apache.stratos.metadataservice.registry; public class DataRegistryFactory { public static DataStore getDataStore(String registryName) { - if (registryName.equals("greg")) { - return new GRegRegistry(); - } else if (registryName.equals("carbon")) { + if (registryName.equals("carbon")) { return new CarbonRegistry(); } else { return null; } } - } http://git-wip-us.apache.org/repos/asf/stratos/blob/24df9f47/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataStore.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataStore.java b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataStore.java index 33f3229..230d5ae 100644 --- a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataStore.java +++ b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/DataStore.java @@ -31,6 +31,7 @@ public interface DataStore { public void addPropertiesToCluster(String applicationName, String clusterId, NewProperty[] properties) throws RegistryException; + public List<NewProperty> getPropertiesOfCluster(String applicationName, String clusterId) throws RegistryException; http://git-wip-us.apache.org/repos/asf/stratos/blob/24df9f47/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/GRegRegistry.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/GRegRegistry.java b/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/GRegRegistry.java deleted file mode 100644 index c2ba22e..0000000 --- a/components/org.apache.stratos.metadataservice/src/main/java/org/apache/stratos/metadataservice/registry/GRegRegistry.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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.stratos.metadataservice.registry; - -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.ConfigurationContextFactory; -import org.apache.commons.configuration.XMLConfiguration; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.apache.stratos.metadataservice.definition.NewProperty; -import org.apache.stratos.metadataservice.util.ConfUtil; -import org.wso2.carbon.registry.api.RegistryException; -import org.wso2.carbon.registry.ws.client.registry.WSRegistryServiceClient; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Context; -import java.io.File; -import java.util.List; - -/** - * Governance registry implementation for the registry factory - */ -public class GRegRegistry implements DataStore { - - - private static Log log = LogFactory.getLog(GRegRegistry.class); - @Context - HttpServletRequest httpServletRequest; - - private static ConfigurationContext configContext; - - static { - configContext = null; - } - - private static final String defaultUsername = "[email protected]"; - private static final String defaultPassword = "admin123"; - private static final String serverURL = "https://localhost:9445/services/"; - private static final String mainResource = "/startos/"; - private static final int defaultRank = 3; - - /* - * Registry initiation - */ - private static WSRegistryServiceClient setRegistry() throws Exception { - - XMLConfiguration conf = ConfUtil.getInstance(null).getConfiguration(); - - String gregUsername = conf.getString("metadataservice.username", defaultUsername); - String gregPassword = conf.getString("metadataservice.password", defaultPassword); - String gregServerURL = conf.getString("metadataservice.serverurl", serverURL); - String defaultAxis2Repo = "repository/deployment/client"; - String axis2Repo = conf.getString("metadataservice.axis2Repo", defaultAxis2Repo); - String defaultAxis2Conf = "repository/conf/axis2/axis2_client.xml"; - String axis2Conf = conf.getString("metadataservice.axis2Conf", defaultAxis2Conf); - String defaultTrustStore = - "repository" + File.separator + "resources" + File.separator + - "security" + File.separator + "wso2carbon.jks"; - String trustStorePath = conf.getString("metadataservice.trustStore", defaultTrustStore); - String trustStorePassword = - conf.getString("metadataservice.trustStorePassword", - "wso2carbon"); - String trustStoreType = conf.getString("metadataservice.trustStoreType", "JKS"); - - System.setProperty("javax.net.ssl.trustStore", trustStorePath); - System.setProperty("javax.net.ssl.trustStorePassword", trustStorePassword);// "wso2carbon" - System.setProperty("javax.net.ssl.trustStoreType", trustStoreType);// "JKS" - System.setProperty("carbon.repo.write.mode", "true"); - configContext = - ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Repo, - axis2Conf); - return new WSRegistryServiceClient(gregServerURL, gregUsername, gregPassword, configContext); - } - - - public void addPropertiesToCluster(String applicationName, String clusterId, NewProperty[] properties) throws RegistryException { - - } - - public List<NewProperty> getPropertiesOfCluster(String applicationName, String clusterId) throws RegistryException { - return null; - } - - public void addPropertyToCluster(String applicationId, String clusterId, NewProperty property) throws RegistryException { - - } - - public boolean deleteApplication(String applicationId) { - return false; - } - -}
