removing metadataservice.xml and its references

Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/e13e202b
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/e13e202b
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/e13e202b

Branch: refs/heads/master
Commit: e13e202b26d0466879b69011f628204ae6cff1c1
Parents: fa139b0
Author: Udara Liyanage <[email protected]>
Authored: Thu May 14 13:44:05 2015 +0530
Committer: Udara Liyanage <[email protected]>
Committed: Thu May 14 20:01:48 2015 +0530

----------------------------------------------------------------------
 .../service/registry/DataRegistryFactory.java   | 33 ---------
 .../service/services/MetaDataAdmin.java         |  9 +--
 .../stratos/metadata/service/util/ConfUtil.java | 74 --------------------
 .../modules/distribution/src/assembly/bin.xml   |  6 --
 .../modules/distribution/src/bin/stratos.sh     |  1 -
 .../src/main/conf/metadataservice.xml           | 43 ------------
 6 files changed, 2 insertions(+), 164 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/registry/DataRegistryFactory.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/registry/DataRegistryFactory.java
 
b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/registry/DataRegistryFactory.java
deleted file mode 100644
index 298fffd..0000000
--- 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/registry/DataRegistryFactory.java
+++ /dev/null
@@ -1,33 +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.metadata.service.registry;
-
-/*
- * Factory for the Data Registry
- */
-public class DataRegistryFactory {
-
-    public static DataStore getDataStore(String registryName) {
-        if (registryName.equals("carbon")) {
-            return new CarbonRegistry();
-        } else {
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/services/MetaDataAdmin.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/services/MetaDataAdmin.java
 
b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/services/MetaDataAdmin.java
index 68b960c..4813679 100644
--- 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/services/MetaDataAdmin.java
+++ 
b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/services/MetaDataAdmin.java
@@ -18,15 +18,13 @@
  */
 package org.apache.stratos.metadata.service.services;
 
-import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.stratos.metadata.service.annotation.AuthorizationAction;
 import org.apache.stratos.metadata.service.definition.Property;
 import org.apache.stratos.metadata.service.exception.RestAPIException;
-import org.apache.stratos.metadata.service.registry.DataRegistryFactory;
+import org.apache.stratos.metadata.service.registry.CarbonRegistry;
 import org.apache.stratos.metadata.service.registry.DataStore;
-import org.apache.stratos.metadata.service.util.ConfUtil;
 import org.wso2.carbon.registry.api.RegistryException;
 
 import javax.ws.rs.*;
@@ -47,10 +45,7 @@ public class MetaDataAdmin {
      * Meta data admin configuration loading
      */
     public MetaDataAdmin() {
-        XMLConfiguration conf = ConfUtil.getInstance(null).getConfiguration();
-        String DEFAULT_REG_TYPE = "carbon";
-        String registryType = 
conf.getString("metadataservice.govenanceregistrytype", DEFAULT_REG_TYPE);
-        registry = DataRegistryFactory.getDataStore(registryType);
+        registry = new CarbonRegistry();
     }
 
     @GET

http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/util/ConfUtil.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/util/ConfUtil.java
 
b/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/util/ConfUtil.java
deleted file mode 100644
index fcf12f9..0000000
--- 
a/components/org.apache.stratos.metadata.service/src/main/java/org/apache/stratos/metadata/service/util/ConfUtil.java
+++ /dev/null
@@ -1,74 +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.metadata.service.util;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.stratos.metadata.service.Constants;
-import org.wso2.carbon.utils.CarbonUtils;
-
-import java.io.File;
-
-/**
- * This class contains utility methods for read metadata configuration file.
- */
-public class ConfUtil {
-
-    private static Log log = LogFactory.getLog(ConfUtil.class);
-    private static ConfUtil instance = null;
-    private XMLConfiguration config;
-
-    private ConfUtil(String configFilePath) {
-        log.debug("Loading configuration.....");
-
-        try {
-
-            File confFile;
-            if (StringUtils.isNotEmpty(configFilePath)) {
-                confFile = new File(configFilePath);
-
-            } else {
-                confFile =
-                        new File(CarbonUtils.getCarbonConfigDirPath(),
-                                Constants.METADATASERVICE_CONFIG_FILE_NAME);
-            }
-
-            config = new XMLConfiguration(confFile);
-        } catch (ConfigurationException e) {
-            log.error("Unable to load autoscaler configuration file", e);
-            config = new XMLConfiguration(); // continue with default values
-        }
-    }
-
-    public static ConfUtil getInstance(String configFilePath) {
-        if (instance == null) {
-            instance = new ConfUtil(configFilePath);
-        }
-        return instance;
-    }
-
-    public XMLConfiguration getConfiguration() {
-        return config;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/products/stratos/modules/distribution/src/assembly/bin.xml
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/assembly/bin.xml 
b/products/stratos/modules/distribution/src/assembly/bin.xml
index 0a02e62..f74794a 100755
--- a/products/stratos/modules/distribution/src/assembly/bin.xml
+++ b/products/stratos/modules/distribution/src/assembly/bin.xml
@@ -694,12 +694,6 @@
             <fileMode>600</fileMode>
         </file>
         <file>
-            <source>src/main/conf/metadataservice.xml</source>
-            
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf</outputDirectory>
-            <filtered>true</filtered>
-            <fileMode>600</fileMode>
-        </file>
-        <file>
             <source>src/main/conf/drools/mincheck.drl</source>
             
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/drools</outputDirectory>
             <filtered>true</filtered>

http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/products/stratos/modules/distribution/src/bin/stratos.sh
----------------------------------------------------------------------
diff --git a/products/stratos/modules/distribution/src/bin/stratos.sh 
b/products/stratos/modules/distribution/src/bin/stratos.sh
index 1935794..e88cc15 100755
--- a/products/stratos/modules/distribution/src/bin/stratos.sh
+++ b/products/stratos/modules/distribution/src/bin/stratos.sh
@@ -301,7 +301,6 @@ do
     -Ddisable.cassandra.server.startup=true \
     -Djndi.properties.dir="$CARBON_HOME/repository/conf" \
     
-Dthrift.client.config.file.path="$CARBON_HOME/repository/conf/thrift-client-config.xml"
 \
-    
-DMETADATA_CLIENT_CONFIG_FILE="$CARBON_HOME/repository/conf/metadataservice.xml"
 \
     -Dstratos.component.startup.synchronizer.enabled=true \
     org.wso2.carbon.bootstrap.Bootstrap $*
     status=$?

http://git-wip-us.apache.org/repos/asf/stratos/blob/e13e202b/products/stratos/modules/distribution/src/main/conf/metadataservice.xml
----------------------------------------------------------------------
diff --git 
a/products/stratos/modules/distribution/src/main/conf/metadataservice.xml 
b/products/stratos/modules/distribution/src/main/conf/metadataservice.xml
deleted file mode 100644
index 3f2d217..0000000
--- a/products/stratos/modules/distribution/src/main/conf/metadataservice.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 
-       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.
--->
-<configuration>
-       <!--
-       <metadataservice>
-           <govenanceregistrytype>carbon</govenanceregistrytype>
-           <serverurl>https://localhost:9445/services/</serverurl>
-               <username>admin</username>
-               <password>admin</password>
-               
-               <mainResource>stratos</mainResource>
-               <axis2Repo>repository/deployment/client</axis2Repo>
-               <axis2Conf>repository/conf/axis2/axis2_client.xml</axis2Conf>
-               
<trustStore>repository/resources/security/wso2carbon.jks</trustStore>
-               <trustStorePassword>wso2carbon</trustStorePassword>
-               <trustStoreType>JKS</trustStoreType>
-       </metadataservice>
-       -->
-     <metadataService>
-         <baseUrl>https://localhost:9443/metadata/api/</baseUrl>
-         <username>admin</username>
-         <password>admin</password>
-     </metadataService>
-     <metadataClient>
-     </metadataClient>
-</configuration>

Reply via email to