Repository: stratos Updated Branches: refs/heads/4.0.0-grouping db7aeff90 -> ee8e5fd71
renaming some classes properly Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/ee8e5fd7 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/ee8e5fd7 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/ee8e5fd7 Branch: refs/heads/4.0.0-grouping Commit: ee8e5fd710ae232448e42f34b505d4e49bd28cf8 Parents: db7aeff Author: Isuru Haththotuwa <[email protected]> Authored: Sun Sep 21 15:53:36 2014 +0530 Committer: Isuru Haththotuwa <[email protected]> Committed: Sun Sep 21 15:53:36 2014 +0530 ---------------------------------------------------------------------- .../client/data/extractor/DataExtractor.java | 36 --------------- .../data/extractor/MetaDataExtractor.java | 36 +++++++++++++++ .../exception/DataExtractorException.java | 47 -------------------- .../exception/MetaDataExtractorException.java | 47 ++++++++++++++++++++ .../factory/MetaDataExtractorFactory.java | 7 ++- .../client/sample/DefaultDataExtractor.java | 45 ------------------- .../client/sample/DefaultMetaDataExtractor.java | 45 +++++++++++++++++++ .../sample/MetaDataServiceClientSample.java | 18 ++++---- 8 files changed, 140 insertions(+), 141 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/DataExtractor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/DataExtractor.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/DataExtractor.java deleted file mode 100644 index e5280e7..0000000 --- a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/DataExtractor.java +++ /dev/null @@ -1,36 +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.client.data.extractor; - -import org.apache.stratos.metadata.client.exception.DataExtractorException; -import org.apache.stratos.metadata.client.pojo.DataContext; - -import java.util.Collection; - -public interface DataExtractor { - - public void initialize (); - - public Collection<DataContext> getAllData (Object object) throws DataExtractorException; - - public DataContext getData (Object object) throws DataExtractorException; - - public void terminate () throws DataExtractorException; -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/MetaDataExtractor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/MetaDataExtractor.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/MetaDataExtractor.java new file mode 100644 index 0000000..13bc725 --- /dev/null +++ b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/data/extractor/MetaDataExtractor.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.stratos.metadata.client.data.extractor; + +import org.apache.stratos.metadata.client.exception.MetaDataExtractorException; +import org.apache.stratos.metadata.client.pojo.DataContext; + +import java.util.Collection; + +public interface MetaDataExtractor { + + public void initialize (); + + public Collection<DataContext> getAllData (Object object) throws MetaDataExtractorException; + + public DataContext getData (Object object) throws MetaDataExtractorException; + + public void terminate () throws MetaDataExtractorException; +} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/DataExtractorException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/DataExtractorException.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/DataExtractorException.java deleted file mode 100644 index 835d71d..0000000 --- a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/DataExtractorException.java +++ /dev/null @@ -1,47 +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.client.exception; - -public class DataExtractorException extends Exception { - - private String message; - - public DataExtractorException() { - super(); - } - - public DataExtractorException(String message, Throwable cause) { - super(message, cause); - this.message = message; - } - - public DataExtractorException(String message) { - super(message); - this.message = message; - } - - public DataExtractorException(Throwable cause) { - super(cause); - } - - public String getMessage() { - return message; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/MetaDataExtractorException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/MetaDataExtractorException.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/MetaDataExtractorException.java new file mode 100644 index 0000000..c1273f5 --- /dev/null +++ b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/exception/MetaDataExtractorException.java @@ -0,0 +1,47 @@ +/* + * 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.client.exception; + +public class MetaDataExtractorException extends Exception { + + private String message; + + public MetaDataExtractorException() { + super(); + } + + public MetaDataExtractorException(String message, Throwable cause) { + super(message, cause); + this.message = message; + } + + public MetaDataExtractorException(String message) { + super(message); + this.message = message; + } + + public MetaDataExtractorException(Throwable cause) { + super(cause); + } + + public String getMessage() { + return message; + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/factory/MetaDataExtractorFactory.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/factory/MetaDataExtractorFactory.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/factory/MetaDataExtractorFactory.java index c9d5fc8..90d39d1 100644 --- a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/factory/MetaDataExtractorFactory.java +++ b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/factory/MetaDataExtractorFactory.java @@ -21,17 +21,16 @@ package org.apache.stratos.metadata.client.factory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.stratos.metadata.client.data.extractor.DataExtractor; -import org.apache.stratos.metadata.client.exception.MetaDataServiceClientExeption; +import org.apache.stratos.metadata.client.data.extractor.MetaDataExtractor; public class MetaDataExtractorFactory { private static final Log log = LogFactory.getLog(MetaDataExtractorFactory.class); - public static DataExtractor getMetaDataServiceClient (String clazzName) throws RuntimeException { + public static MetaDataExtractor getMetaDataServiceClient (String clazzName) throws RuntimeException { try { - return (DataExtractor) DataExtractor.class.getClassLoader().loadClass(clazzName).newInstance(); + return (MetaDataExtractor) MetaDataExtractor.class.getClassLoader().loadClass(clazzName).newInstance(); } catch (InstantiationException e) { String errorMsg = "Unable to instatiate class " + clazzName; http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultDataExtractor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultDataExtractor.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultDataExtractor.java deleted file mode 100644 index d2878d2..0000000 --- a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultDataExtractor.java +++ /dev/null @@ -1,45 +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.client.sample; - -import org.apache.stratos.metadata.client.data.extractor.DataExtractor; -import org.apache.stratos.metadata.client.exception.DataExtractorException; -import org.apache.stratos.metadata.client.pojo.DataContext; - -import java.util.Collection; - -public class DefaultDataExtractor implements DataExtractor { - - public void initialize() { - //To change body of implemented methods use File | Settings | File Templates. - } - - public Collection<DataContext> getAllData(Object object) throws DataExtractorException { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - public DataContext getData(Object object) throws DataExtractorException { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - public void terminate() throws DataExtractorException { - //To change body of implemented methods use File | Settings | File Templates. - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultMetaDataExtractor.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultMetaDataExtractor.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultMetaDataExtractor.java new file mode 100644 index 0000000..1594601 --- /dev/null +++ b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/DefaultMetaDataExtractor.java @@ -0,0 +1,45 @@ +/* + * 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.client.sample; + +import org.apache.stratos.metadata.client.data.extractor.MetaDataExtractor; +import org.apache.stratos.metadata.client.exception.MetaDataExtractorException; +import org.apache.stratos.metadata.client.pojo.DataContext; + +import java.util.Collection; + +public class DefaultMetaDataExtractor implements MetaDataExtractor { + + public void initialize() { + //To change body of implemented methods use File | Settings | File Templates. + } + + public Collection<DataContext> getAllData(Object object) throws MetaDataExtractorException { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public DataContext getData(Object object) throws MetaDataExtractorException { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + public void terminate() throws MetaDataExtractorException { + //To change body of implemented methods use File | Settings | File Templates. + } +} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee8e5fd7/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/MetaDataServiceClientSample.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/MetaDataServiceClientSample.java b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/MetaDataServiceClientSample.java index a34adc7..ad7eb2f 100644 --- a/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/MetaDataServiceClientSample.java +++ b/components/org.apache.stratos.metadata.client/src/main/java/org/apache/stratos/metadata/client/sample/MetaDataServiceClientSample.java @@ -24,8 +24,8 @@ import org.apache.commons.logging.LogFactory; import org.apache.stratos.metadata.client.DefaultMetaDataServiceClient; import org.apache.stratos.metadata.client.MetaDataServiceClient; import org.apache.stratos.metadata.client.config.MetaDataClientConfig; -import org.apache.stratos.metadata.client.data.extractor.DataExtractor; -import org.apache.stratos.metadata.client.exception.DataExtractorException; +import org.apache.stratos.metadata.client.data.extractor.MetaDataExtractor; +import org.apache.stratos.metadata.client.exception.MetaDataExtractorException; import org.apache.stratos.metadata.client.factory.MetaDataExtractorFactory; import org.apache.stratos.metadata.client.pojo.DataContext; @@ -37,7 +37,7 @@ public class MetaDataServiceClientSample { private MetaDataServiceClient metaDataServiceClient; - private DataExtractor dataExtractor; + private MetaDataExtractor metaDataExtractor; private MetaDataClientConfig metaDataClientConfig; @@ -54,9 +54,9 @@ public class MetaDataServiceClientSample { metaDataServiceClient.initialize(); if (MetaDataClientConfig.getInstance().getDataExtractorClass() != null) { - dataExtractor = MetaDataExtractorFactory.getMetaDataServiceClient(metaDataClientConfig. + metaDataExtractor = MetaDataExtractorFactory.getMetaDataServiceClient(metaDataClientConfig. getDataExtractorClass()); - dataExtractor.initialize(); + metaDataExtractor.initialize(); } } @@ -65,9 +65,9 @@ public class MetaDataServiceClientSample { Collection<DataContext> dataContexts = null; try { - dataContexts = dataExtractor.getAllData(someObj); + dataContexts = metaDataExtractor.getAllData(someObj); - } catch (DataExtractorException e) { + } catch (MetaDataExtractorException e) { log.error("Unable to get extracted data", e); } @@ -79,9 +79,9 @@ public class MetaDataServiceClientSample { DataContext dataContext = null; try { - dataContext = dataExtractor.getData(someObj); + dataContext = metaDataExtractor.getData(someObj); - } catch (DataExtractorException e) { + } catch (MetaDataExtractorException e) { log.error("Unable to get extracted data", e); }
