http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ConditionalSampling.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ConditionalSampling.java b/app/models/metadata/ConditionalSampling.java deleted file mode 100644 index d8ef86c..0000000 --- a/app/models/metadata/ConditionalSampling.java +++ /dev/null @@ -1,225 +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 models.metadata; - -import java.util.ArrayList; - -public class ConditionalSampling { - private String dataSourceP = ""; - private String variableNameP = ""; - private String pressureRangeP = ""; - private String dataSourceE = ""; - private String variableNameE = ""; - private String pressureRangeE = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String X; - private String Y; - private String Z; - private String bin_min; - private String bin_max; - private String bin_n; - private String customized; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getBin_min() { - return bin_min; - } - public void setBin_min(String bin_min) { - this.bin_min = bin_min; - } - public String getBin_max() { - return bin_max; - } - public void setBin_max(String bin_max) { - this.bin_max = bin_max; - } - public String getBin_n() { - return bin_n; - } - public void setBin_n(String bin_n) { - this.bin_n = bin_n; - } - public String getVariableNameP() { - return variableNameP; - } - public void setVariableNameP(String variableNameP) { - this.variableNameP = variableNameP; - } - public String getPressureRangeP() { - return pressureRangeP; - } - public void setPressureRangeP(String pressureRangeP) { - this.pressureRangeP = pressureRangeP; - } - public String getDataSourceE() { - return dataSourceE; - } - public void setDataSourceE(String dataSourceE) { - this.dataSourceE = dataSourceE; - } - public String getPressureRangeE() { - return pressureRangeE; - } - public void setPressureRangeE(String pressureRangeE) { - this.pressureRangeE = pressureRangeE; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getX() { - return X; - } - public void setX(String x) { - X = x; - } - public String getY() { - return Y; - } - public void setY(String y) { - Y = y; - } - public String getZ() { - return Z; - } - public void setZ(String z) { - Z = z; - } - public String getCustomized() { - return customized; - } - public void setCustomized(String customized) { - this.customized = customized; - } - public String getDataSourceP() { - return dataSourceP; - } - public void setDataSourceP(String dataSource) { - this.dataSourceP = dataSource; - } - public String getVariableNameE() { - return variableNameE; - } - public void setVariableNameE(String variableName) { - this.variableNameE = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } -}
http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ConditionalSampling2Var.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ConditionalSampling2Var.java b/app/models/metadata/ConditionalSampling2Var.java deleted file mode 100644 index 30a9e24..0000000 --- a/app/models/metadata/ConditionalSampling2Var.java +++ /dev/null @@ -1,285 +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 models.metadata; - -import java.util.ArrayList; - -public class ConditionalSampling2Var { - // Physical Variable - private String dataSourceP = ""; - private String variableNameP = ""; - private String pressureRange1 = ""; - private String pressureRange2 = ""; - - // Environmental Variable 1 - private String dataSourceE1 = ""; - private String variableNameE1 = ""; - private String bin_min1; - private String bin_max1; - private String bin_n1; - private String customized1; - private String enableVarPlev1 = ""; - - // Environmental Variable 2 - private String dataSourceE2 = ""; - private String variableNameE2 = ""; - private String bin_min2; - private String bin_max2; - private String bin_n2; - private String customized2; - private String enableVarPlev2 = ""; - - - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String X; - private String Y; - private String Z; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getDataSourceP() { - return dataSourceP; - } - public void setDataSourceP(String dataSourceP) { - this.dataSourceP = dataSourceP; - } - public String getVariableNameP() { - return variableNameP; - } - public void setVariableNameP(String variableNameP) { - this.variableNameP = variableNameP; - } - public String getPressureRange1() { - return pressureRange1; - } - public void setPressureRange1(String pressureRange1) { - this.pressureRange1 = pressureRange1; - } - public String getDataSourceE1() { - return dataSourceE1; - } - public void setDataSourceE1(String dataSourceE1) { - this.dataSourceE1 = dataSourceE1; - } - public String getVariableNameE1() { - return variableNameE1; - } - public void setVariableNameE1(String variableNameE1) { - this.variableNameE1 = variableNameE1; - } - public String getPressureRange2() { - return pressureRange2; - } - public void setPressureRange2(String pressureRange2) { - this.pressureRange2 = pressureRange2; - } - public String getBin_min1() { - return bin_min1; - } - public void setBin_min1(String bin_min1) { - this.bin_min1 = bin_min1; - } - public String getBin_max1() { - return bin_max1; - } - public void setBin_max1(String bin_max1) { - this.bin_max1 = bin_max1; - } - public String getBin_n1() { - return bin_n1; - } - public void setBin_n1(String bin_n1) { - this.bin_n1 = bin_n1; - } - public String getCustomized1() { - return customized1; - } - public void setCustomized1(String customized1) { - this.customized1 = customized1; - } - public String getDataSourceE2() { - return dataSourceE2; - } - public void setDataSourceE2(String dataSourceE2) { - this.dataSourceE2 = dataSourceE2; - } - public String getVariableNameE2() { - return variableNameE2; - } - public void setVariableNameE2(String variableNameE2) { - this.variableNameE2 = variableNameE2; - } - public String getBin_min2() { - return bin_min2; - } - public void setBin_min2(String bin_min2) { - this.bin_min2 = bin_min2; - } - public String getBin_max2() { - return bin_max2; - } - public void setBin_max2(String bin_max2) { - this.bin_max2 = bin_max2; - } - public String getBin_n2() { - return bin_n2; - } - public void setBin_n2(String bin_n2) { - this.bin_n2 = bin_n2; - } - public String getCustomized2() { - return customized2; - } - public void setCustomized2(String customized2) { - this.customized2 = customized2; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getX() { - return X; - } - public void setX(String x) { - X = x; - } - public String getY() { - return Y; - } - public void setY(String y) { - Y = y; - } - public String getZ() { - return Z; - } - public void setZ(String z) { - Z = z; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - public String getEnableVarPlev1() { - return enableVarPlev1; - } - public void setEnableVarPlev1(String enableVarPlev1) { - this.enableVarPlev1 = enableVarPlev1; - } - public String getEnableVarPlev2() { - return enableVarPlev2; - } - public void setEnableVarPlev2(String enableVarPlev2) { - this.enableVarPlev2 = enableVarPlev2; - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/CorrelationMap.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/CorrelationMap.java b/app/models/metadata/CorrelationMap.java deleted file mode 100644 index f2c0061..0000000 --- a/app/models/metadata/CorrelationMap.java +++ /dev/null @@ -1,147 +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 models.metadata; - -public class CorrelationMap { - - // Source 1 - String source1; - String variableName1; - String pressureLevel1; - String startYear; - String startLat; - String startLon; - - // Source 2 - String source2; - String variableName2; - String pressureLevel2; - String endYear; - String endLat; - String endLon; - - String laggedTime; - String executionPurpose; - String image; - String dataUrl; - String serviceResponse; - - - public String getSource1() { - return source1; - } - public void setSource1(String source1) { - this.source1 = source1; - } - public String getVariableName1() { - return variableName1; - } - public void setVariableName1(String variableName1) { - this.variableName1 = variableName1; - } - public String getPressureLevel1() { - return pressureLevel1; - } - public void setPressureLevel1(String pressureLevel1) { - this.pressureLevel1 = pressureLevel1; - } - public String getStartYear() { - return startYear; - } - public void setStartYear(String startYear) { - this.startYear = startYear; - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getSource2() { - return source2; - } - public void setSource2(String source2) { - this.source2 = source2; - } - public String getVariableName2() { - return variableName2; - } - public void setVariableName2(String variableName2) { - this.variableName2 = variableName2; - } - public String getPressureLevel2() { - return pressureLevel2; - } - public void setPressureLevel2(String pressureLevel2) { - this.pressureLevel2 = pressureLevel2; - } - public String getEndYear() { - return endYear; - } - public void setEndYear(String endYear) { - this.endYear = endYear; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getLaggedTime() { - return laggedTime; - } - public void setLaggedTime(String laggedTime) { - this.laggedTime = laggedTime; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataUrl; - } - public void setDataURL(String dataUrl) { - this.dataUrl = dataUrl; - } - public String getServiceResponseText() { - return serviceResponse; - } - public void setServiceResponseText(String serviceResponse) { - this.serviceResponse = serviceResponse; - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/DiffPlotTwoTimeAveragedVar.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/DiffPlotTwoTimeAveragedVar.java b/app/models/metadata/DiffPlotTwoTimeAveragedVar.java deleted file mode 100644 index f6ef290..0000000 --- a/app/models/metadata/DiffPlotTwoTimeAveragedVar.java +++ /dev/null @@ -1,138 +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 models.metadata; - -public class DiffPlotTwoTimeAveragedVar { - String source1; - String varibaleName1; - String pressureLevel1; - String startYear; - String startLat; - String startLon; - - String source2; - String varibaleName2; - String pressureLevel2; - String endYear; - String endLat; - String endLon; - - String executionPurpose; - String image; - String dataUrl; - String serviceResponse; - - - public String getEndYear() { - return endYear; - } - public void setEndYear(String endYear) { - this.endYear = endYear; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getSource1() { - return source1; - } - public void setSource1(String source1) { - this.source1 = source1; - } - public String getVaribaleName1() { - return varibaleName1; - } - public void setVaribaleName1(String varibaleName1) { - this.varibaleName1 = varibaleName1; - } - public String getPressureLevel1() { - return pressureLevel1; - } - public void setPressureLevel1(String pressureLevel1) { - this.pressureLevel1 = pressureLevel1; - } - public String getStartYear() { - return startYear; - } - public void setStartYear(String startYear) { - this.startYear = startYear; - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getSource2() { - return source2; - } - public void setSource2(String source2) { - this.source2 = source2; - } - public String getVaribaleName2() { - return varibaleName2; - } - public void setVaribaleName2(String varibaleName2) { - this.varibaleName2 = varibaleName2; - } - public String getPressureLevel2() { - return pressureLevel2; - } - public void setPressureLevel2(String pressureLevel2) { - this.pressureLevel2 = pressureLevel2; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataUrl() { - return dataUrl; - } - public void setDataUrl(String dataUrl) { - this.dataUrl = dataUrl; - } - public String getServiceResponse() { - return serviceResponse; - } - public void setServiceResponse(String serviceResponse) { - this.serviceResponse = serviceResponse; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/RegridAndDownload.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/RegridAndDownload.java b/app/models/metadata/RegridAndDownload.java deleted file mode 100644 index 935d8a6..0000000 --- a/app/models/metadata/RegridAndDownload.java +++ /dev/null @@ -1,124 +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 models.metadata; - -public class RegridAndDownload { - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String startLat = ""; - private String endLat = ""; - private String deltaLat = ""; - private String startLon = ""; - private String endLon = ""; - private String deltaLon = ""; - private String pressureLevel = ""; - private String executionPurpose = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getDeltaLat() { - return deltaLat; - } - public void setDeltaLat(String deltaLat) { - this.deltaLat = deltaLat; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getDeltaLon() { - return deltaLon; - } - public void setDeltaLon(String deltaLon) { - this.deltaLon = deltaLon; - } - public String getPressureLevel() { - return pressureLevel; - } - public void setPressureLevel(String pressureLevel) { - this.pressureLevel = pressureLevel; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - - - - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ScatterHistogramTwoVar.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ScatterHistogramTwoVar.java b/app/models/metadata/ScatterHistogramTwoVar.java deleted file mode 100644 index abcbcd3..0000000 --- a/app/models/metadata/ScatterHistogramTwoVar.java +++ /dev/null @@ -1,147 +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 models.metadata; - -public class ScatterHistogramTwoVar { - - String source1; - String varibaleName1; - String pressureLevel1; - String startYear; - String startLat; - String startLon; - - String source2; - String varibaleName2; - String pressureLevel2; - String endYear; - String endLat; - String endLon; - - String samples; - String executionPurpose; - String image; - String dataUrl; - String serviceResponse; - - - public String getEndYear() { - return endYear; - } - public void setEndYear(String endYear) { - this.endYear = endYear; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getSource1() { - return source1; - } - public void setSource1(String source1) { - this.source1 = source1; - } - public String getVaribaleName1() { - return varibaleName1; - } - public void setVaribaleName1(String varibaleName1) { - this.varibaleName1 = varibaleName1; - } - public String getPressureLevel1() { - return pressureLevel1; - } - public void setPressureLevel1(String pressureLevel1) { - this.pressureLevel1 = pressureLevel1; - } - public String getStartYear() { - return startYear; - } - public void setStartYear(String startYear) { - this.startYear = startYear; - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getSource2() { - return source2; - } - public void setSource2(String source2) { - this.source2 = source2; - } - public String getVaribaleName2() { - return varibaleName2; - } - public void setVaribaleName2(String varibaleName2) { - this.varibaleName2 = varibaleName2; - } - public String getPressureLevel2() { - return pressureLevel2; - } - public void setPressureLevel2(String pressureLevel2) { - this.pressureLevel2 = pressureLevel2; - } - public String getSamples() { - return samples; - } - public void setSamples(String samples) { - this.samples = samples; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataUrl() { - return dataUrl; - } - public void setDataUrl(String dataUrl) { - this.dataUrl = dataUrl; - } - public String getServiceResponse() { - return serviceResponse; - } - public void setServiceResponse(String serviceResponse) { - this.serviceResponse = serviceResponse; - } - - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ServiceLog.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ServiceLog.java b/app/models/metadata/ServiceLog.java deleted file mode 100644 index 830362e..0000000 --- a/app/models/metadata/ServiceLog.java +++ /dev/null @@ -1,504 +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 models.metadata; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import play.Logger; -import util.APICall; -import util.Constants; -import java.io.UnsupportedEncodingException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; - -public class ServiceLog { - - private String serviceExecutionLogId; - private String serviceId; - private String serviceName; - private String userId; - private String purpose; - private String serviceConfigurationId; - private String datasetLogId; - private String executionStartTime; - private String executionEndTime; - private String dataSetStartTime; - private String dataSetEndTime; - - - public String getServiceExecutionLogId() { - return serviceExecutionLogId; - } - - public void setServiceExecutionLogId(String serviceExecutionLogId) { - this.serviceExecutionLogId = serviceExecutionLogId; - } - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getPurpose() { - return purpose; - } - - public void setPurpose(String purpose) { - this.purpose = purpose; - } - - public String getServiceConfigurationId() { - return serviceConfigurationId; - } - - public void setServiceConfigurationId(String serviceConfigurationId) { - this.serviceConfigurationId = serviceConfigurationId; - } - - public String getDatasetLogId() { - return datasetLogId; - } - - public void setDatasetLogId(String datasetLogId) { - this.datasetLogId = datasetLogId; - } - - public String getExecutionStartTime() { - return executionStartTime; - } - - public void setExecutionStartTime(String executionStartTime) { - this.executionStartTime = executionStartTime; - } - - public String getExecutionEndTime() { - return executionEndTime; - } - - public void setExecutionEndTime(String executionEndTime) { - this.executionEndTime = executionEndTime; - } - - public String getDataSetStartTime() { - return dataSetStartTime; - } - - public void setDataSetStartTime(String dataSetStartTime) { - this.dataSetStartTime = dataSetStartTime; - } - - public String getDataSetEndTime() { - return dataSetEndTime; - } - - public void setDataSetEndTime(String dataSetEndTime) { - this.dataSetEndTime = dataSetEndTime; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - private static final String GET_ALL_SERVICE_LOG = Constants.NEW_BACKEND + Constants.SERVICE_EXECUTION_LOG - + util.Constants.NEW_GET_ALL_SERVICE_LOG; - - private static final String GET_A_SERVICE_LOG = Constants.NEW_BACKEND - + Constants.NEW_GET_A_SERVICE_LOG; - - private static final String EXECUTION_LOG_QUERY = Constants.NEW_BACKEND + Constants.SERVICE_EXECUTION_LOG + Constants.SERVICE_EXECUTION_LOG_QUERY; - - /** - * Generate the list of all service log - * - * @return a list of all the service log - */ - public static List<ServiceLog> all() { - - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI(GET_ALL_SERVICE_LOG); - - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - private static ServiceLog deserializeJsonToServiceLog(JsonNode json) { - ServiceLog newServiceLog = new ServiceLog(); - newServiceLog.setServiceExecutionLogId(json.get( - "id").asText()); - newServiceLog.setServiceId(json.get( - "climateService").get("id").asText()); - newServiceLog.setServiceName(json.get("climateService").get("name").asText()); - newServiceLog.setPurpose(json.get("purpose").asText()); - newServiceLog.setUserId(json.get("user").get("firstName").asText()+" "+json.get("user").get("lastName").asText()); - newServiceLog.setServiceConfigurationId(json.get("serviceConfiguration").get("id").asText()); - String executionStartTime = json.findPath("executionStartTime").asText(); - String executionEndTime = json.findPath("executionEndTime").asText(); - String datasetStudyStartTime = json.findPath("datasetStudyStartTime").asText(); - String datasetStudyEndTime = json.findPath("datasetStudyEndTime").asText(); - Date tmpTime = null; - - try { - tmpTime = (new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a")).parse(executionStartTime); - if (tmpTime != null) { - newServiceLog.setExecutionStartTime(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(tmpTime)); - } - } catch (ParseException e) { - } - - try { - tmpTime = (new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a")).parse(executionEndTime); - if (tmpTime != null) { - newServiceLog.setExecutionEndTime(new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(tmpTime)); - } - } catch (ParseException e) { - } - - try { - tmpTime = (new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a")).parse(datasetStudyStartTime); - - if (tmpTime != null) { - newServiceLog.setDataSetStartTime(new SimpleDateFormat("YYYYMM").format(tmpTime)); - } - } catch (ParseException e){ - - } - - try { - tmpTime = (new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a")).parse(datasetStudyEndTime); - - if (tmpTime != null) { - newServiceLog.setDataSetEndTime(new SimpleDateFormat("YYYYMM").format(tmpTime)); - } - } catch (ParseException e){ - - } - - newServiceLog.setDatasetLogId(json.findPath("datasetLogId").asText()); - - return newServiceLog; - } - - - /** - * Generate a new list of all service log which sync userId according to the porpose - * - * @return a list of all the service log - */ - public static List<ServiceLog> syncDataByPurpose() { - APICall.callAPI(Constants.NEW_BACKEND+Constants.SERVICE_EXECUTION_LOG+"replaceUser"); - - return all(); - } - public static List<ServiceLog> searchDataSource(String dataSource){ - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithParameter/model/"+dataSource+"/json"); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchVariableName(String variableName) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithParameter/var/"+variableName+"/json"); - - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchExecutionPurpose(String purpose) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPIParameter("http://localhost:9008/getExecutionLogByPurpose", "purpose", purpose); - - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchUserId(String userId) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithParameter/" + userId + "/json"); - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchTime(String start, String end) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithParameterRange/startT/"+start+"/endT/"+end+"/json"); - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchLatitude(String start, String end) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithParameterRange/start%20lat%20(deg)/" + start + "/end%20lat%20(deg)/" + end + "/json"); - - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> searchMultiDimension(String dataSource, String variableName, String executionPurpose, String userId, String startTime, String endTime) { - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - if (dataSource.equals("")) { - dataSource = "null"; - } - if (variableName.equals("")) { - variableName = "null"; - } - if (executionPurpose.equals("")) { - executionPurpose = "null"; - } - if (userId.equals("")) { - userId = "null"; - } - if (startTime.equals("")) { - startTime = "null"; - } - if (endTime.equals("")) { - endTime = "null"; - } - JsonNode serviceLogNode = APICall - .callAPI("http://localhost:9008/searchServiceLogsWithMultipleParameter/userid/" + userId + "/datasource/" + dataSource + "/variablename/" + variableName + "/startyearmonth/" + startTime + "/endyearmonth/" + endTime + "/executionpurpose/" + executionPurpose + "/json"); - - Logger.info(serviceLogNode.toString()); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - public static List<ServiceLog> search(String userId, long startTime, long endTime) { - - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - - startTime = startTime / 1000; - endTime = endTime / 1000; - - JsonNode serviceLogNode = APICall - .callAPI(GET_A_SERVICE_LOG + userId + "/" + startTime + "" + "/" + endTime + "" + "/" + util.Constants.FORMAT); - - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - - /** - * Delete a service log - * - * @return - */ - public static JsonNode deleteServiceLog(String confId) throws UnsupportedEncodingException { - return APICall.deleteAPI(Constants.NEW_BACKEND + "serviceExecutionLog/deleteServiceExecutionLogs/"+confId); - } - - /** - * Generate a list of climate service names - * - * @return a list of climate service names - */ - public static List<String> allServiceId() { - List<ServiceLog> allList = all(); - List<String> resultList = new ArrayList<String>(); - for (ServiceLog element : allList) { - String elementName = element.getServiceId(); - if (elementName != null) - resultList.add(elementName); - } - return resultList; - } - - /** - * Search Service Execution Logs in the backend. All parameters are optional - * Actually used in the search page - * - * @param userId - * @param startTime - * @param endTime - * @param executionPurpose - * @param parameters A key-value pair list of all parameters that hosted by service configuration item including data source , variable name, dataset start/end time - * @return - */ - - - public static List<ServiceLog> queryExecutionLogs(String userId, Date startTime, Date endTime, String executionPurpose, String dataSetStartTime, String dataSetEndTime, Map<String, String> parameters) { - - List<ServiceLog> serviceLog = new ArrayList<ServiceLog>(); - ObjectMapper mapper = new ObjectMapper(); - ObjectNode queryJson = mapper.createObjectNode(); - if (userId != null && !userId.isEmpty()) { - queryJson.put("userId", userId); - } - if (startTime != null ) { - queryJson.put("executionStartTime", startTime.getTime()); - } - if (endTime != null) { - queryJson.put("executionEndTime", endTime.getTime()); - } - if (dataSetStartTime != null) { - queryJson.put("dataSetStartTime", dataSetStartTime); - } - if (dataSetEndTime != null) { - queryJson.put("dataSetEndTime", dataSetEndTime); - } - if (executionPurpose != null && !executionPurpose.isEmpty()) { - queryJson.put("purpose", executionPurpose); - } - - if (parameters != null) { - ObjectNode paramsNode = mapper.createObjectNode(); - for (String paramName : parameters.keySet()) { - String paramValue = parameters.get(paramName); - if (paramValue != null && !paramValue.isEmpty()) - paramsNode.put(paramName, paramValue); - } - if (paramsNode.size() > 0) { - queryJson.set("parameters", paramsNode); - } - } - - JsonNode serviceLogNode = APICall.postAPI(EXECUTION_LOG_QUERY, queryJson); - if (serviceLogNode == null || serviceLogNode.has("error") - || !serviceLogNode.isArray()) { - return serviceLog; - } - - for (int i = 0; i < serviceLogNode.size(); i++) { - JsonNode json = serviceLogNode.path(i); - ServiceLog newServiceLog = deserializeJsonToServiceLog(json); - serviceLog.add(newServiceLog); - } - return serviceLog; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ThreeDVar2DSlice.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ThreeDVar2DSlice.java b/app/models/metadata/ThreeDVar2DSlice.java deleted file mode 100644 index 66d24ab..0000000 --- a/app/models/metadata/ThreeDVar2DSlice.java +++ /dev/null @@ -1,162 +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 models.metadata; - -import java.util.ArrayList; - -public class ThreeDVar2DSlice { - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private String pressureLevel = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String colorScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getPressureLevel() { - return pressureLevel; - } - public void setPressureLevel(String pressureLevel) { - this.pressureLevel = pressureLevel; - } - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getColorScale() { - return colorScale; - } - public void setColorScale(String colorScale) { - this.colorScale = colorScale; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ThreeDVarAvgVertical4Profile.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ThreeDVarAvgVertical4Profile.java b/app/models/metadata/ThreeDVarAvgVertical4Profile.java deleted file mode 100644 index c3b6ecf..0000000 --- a/app/models/metadata/ThreeDVarAvgVertical4Profile.java +++ /dev/null @@ -1,163 +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 models.metadata; - -import java.util.ArrayList; - -public class ThreeDVarAvgVertical4Profile { - - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String pressureLevelScale = ""; - private String variableScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getPressureLevelScale() { - return pressureLevelScale; - } - public void setPressureLevelScale(String pressureLevelScale) { - this.pressureLevelScale = pressureLevelScale; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getVariableScale() { - return variableScale; - } - public void setVariableScale(String variableScale) { - this.variableScale = variableScale; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/ThreeDVarZonalMean.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/ThreeDVarZonalMean.java b/app/models/metadata/ThreeDVarZonalMean.java deleted file mode 100644 index 98eb959..0000000 --- a/app/models/metadata/ThreeDVarZonalMean.java +++ /dev/null @@ -1,155 +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 models.metadata; - -import java.util.ArrayList; - -public class ThreeDVarZonalMean { - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String pressureRange = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String pressureScale = ""; - private String colorScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - - public String getPressureRange() { - return pressureRange; - } - public void setPressureRange(String pressureRange) { - this.pressureRange = pressureRange; - } - public String getPressureScale() { - return pressureScale; - } - public void setPressureScale(String pressureScale) { - this.pressureScale = pressureScale; - } - public String getColorScale() { - return colorScale; - } - public void setColorScale(String colorScale) { - this.colorScale = colorScale; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/TwoDVarMap.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/TwoDVarMap.java b/app/models/metadata/TwoDVarMap.java deleted file mode 100644 index 4fc0803..0000000 --- a/app/models/metadata/TwoDVarMap.java +++ /dev/null @@ -1,156 +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 models.metadata; - -import java.util.ArrayList; - -public class TwoDVarMap { - - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String variableScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getVariableScale() { - return variableScale; - } - public void setVariableScale(String variableScale) { - this.variableScale = variableScale; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/TwoDVarTimeSeries.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/TwoDVarTimeSeries.java b/app/models/metadata/TwoDVarTimeSeries.java deleted file mode 100644 index 97c6f42..0000000 --- a/app/models/metadata/TwoDVarTimeSeries.java +++ /dev/null @@ -1,115 +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 models.metadata; - -public class TwoDVarTimeSeries { - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String startLat = ""; - private String endLat = ""; - private String startLon = ""; - private String endLon = ""; - private String variableScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getStartLon() { - return startLon; - } - public void setStartLon(String startLon) { - this.startLon = startLon; - } - public String getEndLon() { - return endLon; - } - public void setEndLon(String endLon) { - this.endLon = endLon; - } - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getVariableScale() { - return variableScale; - } - public void setVariableScale(String variableScale) { - this.variableScale = variableScale; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/models/metadata/TwoDVarZonalMean.java ---------------------------------------------------------------------- diff --git a/app/models/metadata/TwoDVarZonalMean.java b/app/models/metadata/TwoDVarZonalMean.java deleted file mode 100644 index 3b57d69..0000000 --- a/app/models/metadata/TwoDVarZonalMean.java +++ /dev/null @@ -1,142 +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 models.metadata; - -import java.util.ArrayList; - -public class TwoDVarZonalMean { - - private String dataSource = ""; - private String variableName = ""; - private String startYearMonth = ""; - private String endYearMonth = ""; - private String selectMonths = ""; - private ArrayList<String> month = new ArrayList<String>(); - private String startLat = ""; - private String endLat = ""; - private String variableScale = ""; - private String executionPurpose = ""; - private String image = ""; - private String dataURL = ""; - private String serviceResponseText = ""; - - public String getDataSource() { - return dataSource; - } - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - public String getVariableName() { - return variableName; - } - public void setVariableName(String variableName) { - this.variableName = variableName; - } - public String getStartYearMonth() { - return startYearMonth; - } - public void setStartYearMonth(String startYearMonth) { - this.startYearMonth = startYearMonth; - } - public String getEndYearMonth() { - return endYearMonth; - } - public void setEndYearMonth(String endYearMonth) { - this.endYearMonth = endYearMonth; - } - public String getSelectMonths() { - return selectMonths; - } - public void setSelectMonths(String selectMonths) { - this.selectMonths = selectMonths; - } - public void changeSelectMonths(){ - - if(month.contains("1")&&month.contains("2")&&month.contains("3")&&month.contains("4")&&month.contains("5")&&month.contains("6")&&month.contains("7")&&month.contains("8")&&month.contains("9")&&month.contains("10")&&month.contains("11")&&month.contains("12")){ - this.selectMonths = "select all"; - } - else if(month.contains("6") && month.contains("7") && month.contains("8")){ - this.selectMonths = "Summer:Jun-Jul-Aug"; - } - else if(month.contains("9") && month.contains("10") && month.contains("11")){ - this.selectMonths = "Autumn:Sep-Oct-Nov"; - } - else if(month.contains("12") && month.contains("1") && month.contains("2")){ - this.selectMonths = "Winter:Dec-Jan-Feb"; - } - else if(month.contains("3") && month.contains("4") && month.contains("5")){ - this.selectMonths = "Spring:Mar-Apr-May"; - } - else{ - this.selectMonths = "select none"; - } - - } - public String getMonth() { - return month.toString().replace("[", "").replace("]", ""); - } - public void setMonth(ArrayList<String> month) { - this.month = month; - } - public void addMonth(String oneMonth){ - month.add(oneMonth); - } - public String getStartLat() { - return startLat; - } - public void setStartLat(String startLat) { - this.startLat = startLat; - } - public String getEndLat() { - return endLat; - } - public void setEndLat(String endLat) { - this.endLat = endLat; - } - public String getVariableScale() { - return variableScale; - } - public void setVariableScale(String variableScale) { - this.variableScale = variableScale; - } - public String getExecutionPurpose() { - return executionPurpose; - } - public void setExecutionPurpose(String executionPurpose) { - this.executionPurpose = executionPurpose; - } - public String getImage() { - return image; - } - public void setImage(String image) { - this.image = image; - } - public String getDataURL() { - return dataURL; - } - public void setDataURL(String dataURL) { - this.dataURL = dataURL; - } - public String getServiceResponseText() { - return serviceResponseText; - } - public void setServiceResponseText(String serviceResponseText) { - this.serviceResponseText = serviceResponseText; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/util/APICall.java ---------------------------------------------------------------------- diff --git a/app/util/APICall.java b/app/util/APICall.java deleted file mode 100644 index 4b182c1..0000000 --- a/app/util/APICall.java +++ /dev/null @@ -1,192 +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 util; - -import play.Logger; -import play.libs.Json; -import play.libs.WS; -import play.libs.F.Function; -import play.libs.F.Promise; -import scala.Console; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.databind.node.ObjectNode; - -public class APICall { - public static enum ResponseType { - SUCCESS, GETERROR, SAVEERROR, DELETEERROR, RESOLVEERROR, TIMEOUT, CONVERSIONERROR, UNKNOWN - } - - public static JsonNode callAPI(String apiString) { - Logger.info(apiString); - Promise<WS.Response> responsePromise = WS - .url(apiString).get(); - final Promise<JsonNode> bodyPromise = responsePromise - .map(new Function<WS.Response, JsonNode>() { - @Override - public JsonNode apply(WS.Response response) - throws Throwable { - if (response.getStatus() == 200 - || response.getStatus() == 201) { - return response.asJson(); - } else { - Logger.info(""+response.getStatus()); - return createResponse(ResponseType.GETERROR); - } - } - }); - - try { - return bodyPromise.get(10000L); - } catch (Exception e) { - return createResponse(ResponseType.TIMEOUT); - } - - } - - public static JsonNode callAPIParameter(String apiString, String paraName, String para) { - Promise<WS.Response> responsePromise = WS - .url(apiString).setQueryParameter(paraName, para).get(); - Console.print(responsePromise.get()); - final Promise<JsonNode> bodyPromise = responsePromise - .map(new Function<WS.Response, JsonNode>() { - @Override - public JsonNode apply(WS.Response response) - throws Throwable { - if (response.getStatus() == 200 - || response.getStatus() == 201) { - return response.asJson(); - } else { - Logger.info(""+response.getStatus()); - return createResponse(ResponseType.GETERROR); - } - } - }); - - try { - return bodyPromise.get(10000L); - } catch (Exception e) { - return createResponse(ResponseType.TIMEOUT); - } - - } - - public static JsonNode postAPI(String apiString, JsonNode jsonData) { - Promise<WS.Response> responsePromise = WS.url(apiString).post(jsonData); - final Promise<JsonNode> bodyPromise = responsePromise - .map(new Function<WS.Response, JsonNode>() { - @Override - public JsonNode apply(WS.Response response) - throws Throwable { - if ((response.getStatus() == 201 || response - .getStatus() == 200)) { - try { - return response.asJson(); - } - catch (Exception e){ - return createResponse(ResponseType.SUCCESS); - } - } else { - return createResponse(ResponseType.SAVEERROR); - } - } - }); - try { - return bodyPromise.get(10000L); - } catch (Exception e) { - return createResponse(ResponseType.TIMEOUT); - } - } - - public static JsonNode putAPI(String apiString, JsonNode jsonData) { - Promise<WS.Response> responsePromise = WS.url(apiString).put(jsonData); - final Promise<JsonNode> bodyPromise = responsePromise - .map(new Function<WS.Response, JsonNode>() { - @Override - public JsonNode apply(WS.Response response) - throws Throwable { - if ((response.getStatus() == 201 || response - .getStatus() == 200) - && !response.getBody().contains("not")) { - return createResponse(ResponseType.SUCCESS); - } else { - return createResponse(ResponseType.SAVEERROR); - } - } - }); - try { - return bodyPromise.get(10000L); - } catch (Exception e) { - return createResponse(ResponseType.TIMEOUT); - } - } - - public static JsonNode deleteAPI(String apiString) { - Promise<WS.Response> responsePromise = WS.url(apiString.replace("+", "%20")).setContentType("text/html").delete(); - final Promise<JsonNode> bodyPromise = responsePromise - .map(new Function<WS.Response, JsonNode>() { - @Override - public JsonNode apply(WS.Response response) - throws Throwable { - if ((response.getStatus() == 200 || response - .getStatus() == 201) - && !response.getBody().contains("not")) { - return createResponse(ResponseType.SUCCESS); - } else { - return createResponse(ResponseType.DELETEERROR); - } - } - }); - try { - return bodyPromise.get(10000L); - } catch (Exception e) { - return createResponse(ResponseType.TIMEOUT); - } - - } - - public static JsonNode createResponse(ResponseType type) { - ObjectNode jsonData = Json.newObject(); - switch (type) { - case SUCCESS: - jsonData.put("success", "Success!"); - break; - case GETERROR: - jsonData.put("error", "Cannot get data from server"); - break; - case SAVEERROR: - jsonData.put("error", "Cannot be saved. The data must be invalid!"); - break; - case DELETEERROR: - jsonData.put("error", "Cannot be deleted on server"); - break; - case RESOLVEERROR: - jsonData.put("error", "Cannot be resolved on server"); - break; - case TIMEOUT: - jsonData.put("error", "No response/Timeout from server"); - break; - case CONVERSIONERROR: - jsonData.put("error", "Conversion error"); - break; - default: - jsonData.put("error", "Unknown errors"); - break; - } - return jsonData; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/util/Constants.java ---------------------------------------------------------------------- diff --git a/app/util/Constants.java b/app/util/Constants.java deleted file mode 100644 index c287cfe..0000000 --- a/app/util/Constants.java +++ /dev/null @@ -1,53 +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 util; - -public class Constants { - - // API 1.3 URL - public static final String NEW_API_URL = "http://localhost:9033/"; - - // API Call format - public static final String FORMAT = "json"; - - // climate service - public static final String NEW_GET_CLIMATE_SERVICE = "getAllClimateServices/"; - public static final String NEW_ADD_CLIMATE_SERVICE = "addClimateService"; - public static final String NEW_DELETE_CLIMATE_SERVICE = "climateService/deleteClimateService/id/"; - public static final String NEW_EDIT_CLIMATE_SERVICE = "updateClimateService"; - - //service log - public static final String NEW_GET_A_SERVICE_LOG = "getServiceExecutionLogs/"; - - public static final String GET_DATASETLIST ="getDatasetList/"; - - //New backend API (MySQL database) - public static final String NEW_BACKEND = "http://einstein.sv.cmu.edu:9034/"; - //New service execution log stuff - public static final String SERVICE_EXECUTION_LOG = "serviceExecutionLog/"; - public static final String SERVICE_EXECUTION_LOG_QUERY = "queryServiceExecutionLogs"; - public static final String SERVICE_EXECUTION_LOG_GET= "getServiceExecutionLog/"; - public static final String NEW_GET_ALL_SERVICE_LOG = "getAllServiceExecutionLog"; - - //ServiceConfigItem - public static final String CONFIG_ITEM = "serviceConfigurationItem/"; - public static final String GET_CONFIG_ITEMS_BY_CONFIG= "serviceConfigurationItemByServiceConfig/"; - - - -} http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/util/DBHandler.java ---------------------------------------------------------------------- diff --git a/app/util/DBHandler.java b/app/util/DBHandler.java deleted file mode 100644 index 7528df2..0000000 --- a/app/util/DBHandler.java +++ /dev/null @@ -1,30 +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 util; - -public class DBHandler{ - static final String JDBC_DRIVER = "org.h2.Driver"; //org.h2.Driver - static final String DB_URL = "jdbc:h2:~/mytest"; - - static final String USER = "sa"; - static final String PASS = ""; - - public DBHandler(){ - - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cmda/blob/a8965336/app/util/TimeConvert.java ---------------------------------------------------------------------- diff --git a/app/util/TimeConvert.java b/app/util/TimeConvert.java deleted file mode 100644 index dad6438..0000000 --- a/app/util/TimeConvert.java +++ /dev/null @@ -1,48 +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 util; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; - -public class TimeConvert { - - public static final String timeStamptoDate (String timeStamp) { - if(timeStamp == ""){ - return ""; - } - Date date = new Date(Long.parseLong(timeStamp)*1000); - DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm"); - String time = dateFormat.format(date); - return time; - } - - public static final long datetoTimeStamp (String time) throws ParseException{ - if(time == null || time.equals("")){ - return 0; - } - SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS"); - String temptime = time + ":00.000"; - Date parsedDate = dateFormat.parse(temptime); - long timeStamp = parsedDate.getTime(); - return timeStamp; - - } -}