http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/CubeRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/CubeRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/CubeRequest.java
deleted file mode 100644
index fb9952b..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/CubeRequest.java
+++ /dev/null
@@ -1,133 +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.kylin.rest.request;
-
-public class CubeRequest {
-
-    private String uuid;
-    private String cubeName;
-    private String cubeDescData;
-    private String streamingData;
-    private String kafkaData;
-    private boolean successful;
-    private String message;
-    private String project;
-    private String streamingCube;
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    /**
-     * @return the message
-     */
-    public String getMessage() {
-        return message;
-    }
-
-    /**
-     * @param message
-     *            the message to set
-     */
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    /**
-     * @return the status
-     */
-    public boolean getSuccessful() {
-        return successful;
-    }
-
-    /**
-     * @param status
-     *            the status to set
-     */
-    public void setSuccessful(boolean status) {
-        this.successful = status;
-    }
-
-    public CubeRequest() {
-    }
-
-    public CubeRequest(String cubeName, String cubeDescData) {
-        this.cubeName = cubeName;
-        this.cubeDescData = cubeDescData;
-    }
-
-    public String getCubeDescData() {
-        return cubeDescData;
-    }
-
-    public void setCubeDescData(String cubeDescData) {
-        this.cubeDescData = cubeDescData;
-    }
-
-    /**
-     * @return the cubeDescName
-     */
-    public String getCubeName() {
-        return cubeName;
-    }
-
-    /**
-     * @param cubeName
-     *            the cubeDescName to set
-     */
-    public void setCubeName(String cubeName) {
-        this.cubeName = cubeName;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-    public String getStreamingCube() {
-        return streamingCube;
-    }
-
-    public void setStreamingCube(String streamingCube) {
-        this.streamingCube = streamingCube;
-    }
-
-    public String getStreamingData() {
-        return streamingData;
-    }
-
-    public void setStreamingData(String streamingData) {
-        this.streamingData = streamingData;
-    }
-
-    public String getKafkaData() {
-        return kafkaData;
-    }
-
-    public void setKafkaData(String kafkaData) {
-        this.kafkaData = kafkaData;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/CubeSegmentRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/CubeSegmentRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/CubeSegmentRequest.java
deleted file mode 100644
index 17122ad..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/CubeSegmentRequest.java
+++ /dev/null
@@ -1,107 +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.kylin.rest.request;
-
-public class CubeSegmentRequest {
-
-    private String uuid;
-    private String cubeName;
-    private String cubeSegmentData;
-    private boolean successful;
-    private String message;
-    private String project;
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    /**
-     * @return the message
-     */
-    public String getMessage() {
-        return message;
-    }
-
-    /**
-     * @param message
-     *            the message to set
-     */
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    /**
-     * @return the status
-     */
-    public boolean getSuccessful() {
-        return successful;
-    }
-
-    /**
-     * @param status
-     *            the status to set
-     */
-    public void setSuccessful(boolean status) {
-        this.successful = status;
-    }
-
-    public CubeSegmentRequest() {
-    }
-
-    public CubeSegmentRequest(String cubeName, String cubeDescData) {
-        this.cubeName = cubeName;
-        this.cubeSegmentData = cubeDescData;
-    }
-
-    public String getCubeSegmentData() {
-        return cubeSegmentData;
-    }
-
-    public void setCubeSegmentData(String cubeSegmentData) {
-        this.cubeSegmentData = cubeSegmentData;
-    }
-
-    /**
-     * @return the cubeDescName
-     */
-    public String getCubeName() {
-        return cubeName;
-    }
-
-    /**
-     * @param cubeName
-     *            the cubeDescName to set
-     */
-    public void setCubeName(String cubeName) {
-        this.cubeName = cubeName;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/ExternalFilterRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/ExternalFilterRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/ExternalFilterRequest.java
deleted file mode 100644
index 887e9ef..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/request/ExternalFilterRequest.java
+++ /dev/null
@@ -1,63 +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.kylin.rest.request;
-
-public class ExternalFilterRequest {
-
-    private String project;
-
-    private String extFilter;
-
-    private boolean successful;
-
-    private String message;
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-    public boolean isSuccessful() {
-        return successful;
-    }
-
-    public String getExtFilter() {
-        return extFilter;
-    }
-
-    public void setExtFilter(String extFilter) {
-        this.extFilter = extFilter;
-    }
-
-    public void setSuccessful(boolean successful) {
-        this.successful = successful;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/HiveTableRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/HiveTableRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/HiveTableRequest.java
deleted file mode 100644
index c529360..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/HiveTableRequest.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.apache.kylin.rest.request;
-
-/**
- * Created by kangkaisen on 16/5/21.
- */
-public class HiveTableRequest {
-
-    public HiveTableRequest() {
-
-    }
-
-    private boolean calculate = true;
-
-    public boolean isCalculate() {
-        return calculate;
-    }
-
-    public void setCalculate(boolean calculate) {
-        this.calculate = calculate;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest.java
deleted file mode 100644
index a8ffe5f..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest.java
+++ /dev/null
@@ -1,75 +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.kylin.rest.request;
-
-public class JobBuildRequest {
-
-    private long startTime;
-
-    private long endTime;
-
-    private String buildType;
-
-    private boolean force;
-
-    @Deprecated
-    private boolean forceMergeEmptySegment = false;
-
-    public long getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(long startTime) {
-        this.startTime = startTime;
-    }
-
-    public long getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(long endTime) {
-        this.endTime = endTime;
-    }
-
-    public String getBuildType() {
-        return buildType;
-    }
-
-    public void setBuildType(String buildType) {
-        this.buildType = buildType;
-    }
-
-    public boolean isForce() {
-        return force;
-    }
-
-    public void setForce(boolean force) {
-        this.force = force;
-    }
-
-    @Deprecated
-    public boolean isForceMergeEmptySegment() {
-        return forceMergeEmptySegment;
-    }
-
-    @Deprecated
-    public void setForceMergeEmptySegment(boolean forceMergeEmptySegment) {
-        this.forceMergeEmptySegment = forceMergeEmptySegment;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java 
b/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
deleted file mode 100644
index dc3b433..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/JobBuildRequest2.java
+++ /dev/null
@@ -1,63 +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.kylin.rest.request;
-
-public class JobBuildRequest2 {
-
-    private long startSourceOffset;
-
-    private long endSourceOffset;
-
-    private String buildType;
-
-    private boolean force;
-
-    public long getStartSourceOffset() {
-        return startSourceOffset;
-    }
-
-    public void setStartSourceOffset(long startSourceOffset) {
-        this.startSourceOffset = startSourceOffset;
-    }
-
-    public long getEndSourceOffset() {
-        return endSourceOffset;
-    }
-
-    public void setEndSourceOffset(long endSourceOffset) {
-        this.endSourceOffset = endSourceOffset;
-    }
-
-    public String getBuildType() {
-        return buildType;
-    }
-
-    public void setBuildType(String buildType) {
-        this.buildType = buildType;
-    }
-
-    public boolean isForce() {
-        return force;
-    }
-
-    public void setForce(boolean force) {
-        this.force = force;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/JobListRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/JobListRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/JobListRequest.java
deleted file mode 100644
index 51160d2..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/JobListRequest.java
+++ /dev/null
@@ -1,86 +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.kylin.rest.request;
-
-import java.util.List;
-
-/**
- * @author xduo
- * 
- */
-public class JobListRequest {
-
-    private List<Integer> status;
-    private String cubeName;
-    private String projectName;
-    private Integer offset;
-    private Integer limit;
-    private Integer timeFilter;
-
-    public JobListRequest() {
-    }
-
-    public List<Integer> getStatus() {
-        return status;
-    }
-
-    public void setStatus(List<Integer> status) {
-        this.status = status;
-    }
-
-    public String getCubeName() {
-        return cubeName;
-    }
-
-    public void setCubeName(String cubeName) {
-        this.cubeName = cubeName;
-    }
-
-    public String getProjectName() {
-        return projectName;
-    }
-
-    public void setProjectName(String projectName) {
-        this.projectName = projectName;
-    }
-
-    public Integer getOffset() {
-        return offset;
-    }
-
-    public void setOffset(Integer offset) {
-        this.offset = offset;
-    }
-
-    public Integer getLimit() {
-        return limit;
-    }
-
-    public void setLimit(Integer limit) {
-        this.limit = limit;
-    }
-
-    public Integer getTimeFilter() {
-        return timeFilter;
-    }
-
-    public void setTimeFilter(Integer timeFilter) {
-        this.timeFilter = timeFilter;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/MetaRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/MetaRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/MetaRequest.java
deleted file mode 100644
index 66e8ec0..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/MetaRequest.java
+++ /dev/null
@@ -1,41 +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.kylin.rest.request;
-
-/**
- */
-public class MetaRequest {
-
-    private String project;
-
-    public MetaRequest() {
-    }
-
-    public MetaRequest(String project) {
-        this.project = project;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/MetricsRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/MetricsRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/MetricsRequest.java
deleted file mode 100644
index daee8f0..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/MetricsRequest.java
+++ /dev/null
@@ -1,59 +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.kylin.rest.request;
-
-import java.util.Date;
-
-/**
- * @author xduo
- * 
- */
-public class MetricsRequest {
-
-    private Date startTime;
-
-    private Date endTime;
-
-    private String account;
-
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
-    }
-
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
-    }
-
-    public String getAccount() {
-        return account;
-    }
-
-    public void setAccount(String account) {
-        this.account = account;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/ModelRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/ModelRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/ModelRequest.java
deleted file mode 100644
index dc8e06e..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/ModelRequest.java
+++ /dev/null
@@ -1,107 +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.kylin.rest.request;
-
-public class ModelRequest {
-
-    private String uuid;
-    private String modelName;
-    private String modelDescData;
-    private boolean successful;
-    private String message;
-    private String project;
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    /**
-     * @return the message
-     */
-    public String getMessage() {
-        return message;
-    }
-
-    /**
-     * @param message
-     *            the message to set
-     */
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    /**
-     * @return the status
-     */
-    public boolean getSuccessful() {
-        return successful;
-    }
-
-    /**
-     * @param status
-     *            the status to set
-     */
-    public void setSuccessful(boolean status) {
-        this.successful = status;
-    }
-
-    public ModelRequest() {
-    }
-
-    public ModelRequest(String modelName, String modelDescData) {
-        this.modelName = modelName;
-        this.modelDescData = modelDescData;
-    }
-
-    public String getModelDescData() {
-        return modelDescData;
-    }
-
-    public void setModelDescData(String modelDescData) {
-        this.modelDescData = modelDescData;
-    }
-
-    /**
-     * @return the modelName
-     */
-    public String getModelName() {
-        return modelName;
-    }
-
-    /**
-     * @param modelName
-     *            the cubeName to set
-     */
-    public void setModelName(String modelName) {
-        this.modelName = modelName;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
deleted file mode 100644
index 95bc2f5..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/PrepareSqlRequest.java
+++ /dev/null
@@ -1,121 +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.kylin.rest.request;
-
-import java.util.Arrays;
-
-/**
- * @author xduo
- * 
- */
-public class PrepareSqlRequest extends SQLRequest {
-
-    public PrepareSqlRequest() {
-        super();
-    }
-
-    private StateParam[] params;
-
-    public StateParam[] getParams() {
-        return params;
-    }
-
-    public void setParams(StateParam[] params) {
-        this.params = params;
-    }
-
-    public static class StateParam {
-        private String className;
-        private String value;
-
-        public StateParam() {
-        }
-
-        public String getClassName() {
-            return className;
-        }
-
-        public void setClassName(String className) {
-            this.className = className;
-        }
-
-        public String getValue() {
-            return value;
-        }
-
-        public void setValue(String value) {
-            this.value = value;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((className == null) ? 0 : 
className.hashCode());
-            result = prime * result + ((value == null) ? 0 : value.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            StateParam other = (StateParam) obj;
-            if (className == null) {
-                if (other.className != null)
-                    return false;
-            } else if (!className.equals(other.className))
-                return false;
-            if (value == null) {
-                if (other.value != null)
-                    return false;
-            } else if (!value.equals(other.value))
-                return false;
-            return true;
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((params == null) ? 0 : 
Arrays.hashCode(params));
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        if (!super.equals(obj))
-            return false;
-        PrepareSqlRequest other = (PrepareSqlRequest) obj;
-        if (!Arrays.equals(params, other.params))
-            return false;
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/SQLRequest.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/request/SQLRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/SQLRequest.java
deleted file mode 100644
index 96f5faa..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/SQLRequest.java
+++ /dev/null
@@ -1,132 +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.kylin.rest.request;
-
-import java.io.Serializable;
-import java.util.Map;
-
-public class SQLRequest implements Serializable {
-    protected static final long serialVersionUID = 1L;
-
-    private String sql;
-    private String project;
-    private Integer offset = 0;
-    private Integer limit = 0;
-    private boolean acceptPartial = false;
-
-    private Map<String, String> backdoorToggles;
-
-    public SQLRequest() {
-    }
-
-    public Map<String, String> getBackdoorToggles() {
-        return backdoorToggles;
-    }
-
-    public void setBackdoorToggles(Map<String, String> backdoorToggles) {
-        this.backdoorToggles = backdoorToggles;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-    public String getSql() {
-        return sql;
-    }
-
-    public void setSql(String sql) {
-        this.sql = sql;
-    }
-
-    public Integer getOffset() {
-        return offset;
-    }
-
-    public void setOffset(Integer offset) {
-        this.offset = offset;
-    }
-
-    public Integer getLimit() {
-        return limit;
-    }
-
-    public void setLimit(Integer limit) {
-        this.limit = limit;
-    }
-
-    public boolean isAcceptPartial() {
-        return acceptPartial;
-    }
-
-    public void setAcceptPartial(boolean acceptPartial) {
-        this.acceptPartial = acceptPartial;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (acceptPartial ? 1231 : 1237);
-        result = prime * result + ((offset == null) ? 0 : offset.hashCode());
-        result = prime * result + ((limit == null) ? 0 : limit.hashCode());
-        result = prime * result + ((project == null) ? 0 : project.hashCode());
-        result = prime * result + ((sql == null) ? 0 : sql.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SQLRequest other = (SQLRequest) obj;
-        if (acceptPartial != other.acceptPartial)
-            return false;
-        if (offset == null) {
-            if (other.offset != null)
-                return false;
-        } else if (!offset.equals(other.offset))
-            return false;
-        if (limit == null) {
-            if (other.limit != null)
-                return false;
-        } else if (!limit.equals(other.limit))
-            return false;
-        if (project == null) {
-            if (other.project != null)
-                return false;
-        } else if (!project.equals(other.project))
-            return false;
-        if (sql == null) {
-            if (other.sql != null)
-                return false;
-        } else if (!sql.equals(other.sql))
-            return false;
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/SaveSqlRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/SaveSqlRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/SaveSqlRequest.java
deleted file mode 100644
index affab1c..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/SaveSqlRequest.java
+++ /dev/null
@@ -1,72 +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.kylin.rest.request;
-
-/**
- * @author xduo
- * 
- */
-public class SaveSqlRequest {
-    private long id;
-    private String name;
-    private String sql;
-    private String project;
-    private String description;
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getSql() {
-        return sql;
-    }
-
-    public void setSql(String sql) {
-        this.sql = sql;
-    }
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/StreamingRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/StreamingRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/StreamingRequest.java
deleted file mode 100644
index 96db4da..0000000
--- a/server/src/main/java/org/apache/kylin/rest/request/StreamingRequest.java
+++ /dev/null
@@ -1,83 +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.kylin.rest.request;
-
-public class StreamingRequest {
-
-    private String project;
-
-    private String tableData;
-
-    private String streamingConfig;
-
-    private String kafkaConfig;
-
-    private boolean successful;
-
-    private String message;
-
-    public String getProject() {
-        return project;
-    }
-
-    public void setProject(String project) {
-        this.project = project;
-    }
-
-    public String getTableData() {
-        return tableData;
-    }
-
-    public void setTableData(String tableData) {
-        this.tableData = tableData;
-    }
-
-    public boolean isSuccessful() {
-        return successful;
-    }
-
-    public void setSuccessful(boolean successful) {
-        this.successful = successful;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public String getStreamingConfig() {
-        return streamingConfig;
-    }
-
-    public void setStreamingConfig(String streamingConfig) {
-        this.streamingConfig = streamingConfig;
-    }
-
-    public String getKafkaConfig() {
-        return kafkaConfig;
-    }
-
-    public void setKafkaConfig(String kafkaConfig) {
-        this.kafkaConfig = kafkaConfig;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/UpdateConfigRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/UpdateConfigRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/UpdateConfigRequest.java
deleted file mode 100644
index 50f7f9b..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/request/UpdateConfigRequest.java
+++ /dev/null
@@ -1,46 +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.kylin.rest.request;
-
-/**
- * @author xduo
- * 
- */
-public class UpdateConfigRequest {
-    private String key;
-
-    private String value;
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/request/UpdateProjectRequest.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/request/UpdateProjectRequest.java 
b/server/src/main/java/org/apache/kylin/rest/request/UpdateProjectRequest.java
deleted file mode 100644
index 29ba162..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/request/UpdateProjectRequest.java
+++ /dev/null
@@ -1,55 +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.kylin.rest.request;
-
-/**
- */
-public class UpdateProjectRequest {
-    private String formerProjectName;
-    private String newProjectName;
-    private String newDescription;
-
-    public UpdateProjectRequest() {
-    }
-
-    public String getFormerProjectName() {
-        return formerProjectName;
-    }
-
-    public void setFormerProjectName(String formerProjectName) {
-
-        this.formerProjectName = formerProjectName;
-    }
-
-    public String getNewDescription() {
-        return newDescription;
-    }
-
-    public void setNewDescription(String newDescription) {
-        this.newDescription = newDescription;
-    }
-
-    public String getNewProjectName() {
-        return newProjectName;
-    }
-
-    public void setNewProjectName(String newProjectName) {
-        this.newProjectName = newProjectName;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/AccessEntryResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/AccessEntryResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/AccessEntryResponse.java
deleted file mode 100644
index 5c55d58..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/response/AccessEntryResponse.java
+++ /dev/null
@@ -1,70 +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.kylin.rest.response;
-
-import java.io.Serializable;
-
-import org.springframework.security.acls.model.Permission;
-import org.springframework.security.acls.model.Sid;
-import org.springframework.util.Assert;
-
-/**
- * @author xduo
- * 
- */
-public class AccessEntryResponse {
-
-    private Permission permission;
-    private Serializable id;
-    private Sid sid;
-    private boolean granting;
-
-    public AccessEntryResponse() {
-    }
-
-    public AccessEntryResponse(Serializable id, Sid sid, Permission 
permission, boolean granting) {
-        Assert.notNull(sid, "Sid required");
-        Assert.notNull(permission, "Permission required");
-        this.id = id;
-        this.sid = sid;
-        this.permission = permission;
-        this.granting = granting;
-    }
-
-    public Permission getPermission() {
-        return permission;
-    }
-
-    public void setPermission(Permission permission) {
-        this.permission = permission;
-    }
-
-    public Serializable getId() {
-        return id;
-    }
-
-    public Sid getSid() {
-        return sid;
-    }
-
-    public boolean isGranting() {
-        return granting;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
deleted file mode 100644
index 3327cc0..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/ErrorResponse.java
+++ /dev/null
@@ -1,38 +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.kylin.rest.response;
-
-/**
- * @author xduo
- * 
- */
-public class ErrorResponse {
-
-    public String url;
-    public String exception;
-
-    /**
-     * @param exception
-     */
-    public ErrorResponse(String url, Exception exception) {
-        this.url = url;
-        this.exception = exception.getLocalizedMessage();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/GeneralResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/GeneralResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/GeneralResponse.java
deleted file mode 100644
index bc7c081..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/GeneralResponse.java
+++ /dev/null
@@ -1,31 +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.kylin.rest.response;
-
-import java.util.Properties;
-
-/**
- * @author xduo
- * 
- */
-public class GeneralResponse extends Properties {
-
-    private static final long serialVersionUID = -6540990247122312493L;
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/HBaseResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/HBaseResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/HBaseResponse.java
deleted file mode 100644
index 607d61a..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/HBaseResponse.java
+++ /dev/null
@@ -1,108 +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.kylin.rest.response;
-
-import java.io.Serializable;
-
-public class HBaseResponse implements Serializable {
-    private static final long serialVersionUID = 7263557115683263492L;
-    private String tableName;
-    private long tableSize;
-    private int regionCount;
-    private long dateRangeStart;
-    private long dateRangeEnd;
-
-    public HBaseResponse() {
-    }
-
-    /**
-     * @return The hbase table name.
-     */
-    public String getTableName() {
-        return tableName;
-    }
-
-    /**
-     * @param tableName
-     *            The hbase table name.
-     */
-    public void setTableName(String tableName) {
-        this.tableName = tableName;
-    }
-
-    /**
-     * @return the tableSize
-     */
-    public long getTableSize() {
-        return tableSize;
-    }
-
-    /**
-     * @param tableSize
-     *            the tableSize to set
-     */
-    public void setTableSize(long tableSize) {
-        this.tableSize = tableSize;
-    }
-
-    /**
-     * @return the regionCount
-     */
-    public int getRegionCount() {
-        return regionCount;
-    }
-
-    /**
-     * @param regionCount
-     *            the regionCount to set
-     */
-    public void setRegionCount(int regionCount) {
-        this.regionCount = regionCount;
-    }
-
-    /**
-     * @return the segmentStartTime
-     */
-    public long getDateRangeStart() {
-        return dateRangeStart;
-    }
-
-    /**
-     * @param segmentStartTime
-     *            the segmentStartTime to set
-     */
-    public void setDateRangeStart(long dateRangeStart) {
-        this.dateRangeStart = dateRangeStart;
-    }
-
-    /**
-     * @return the segmentEndTime
-     */
-    public long getDateRangeEnd() {
-        return dateRangeEnd;
-    }
-
-    /**
-     * @param segmentEndTime
-     *            the segmentEndTime to set
-     */
-    public void setDateRangeEnd(long dateRangeEnd) {
-        this.dateRangeEnd = dateRangeEnd;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/MetricsResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/MetricsResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/MetricsResponse.java
deleted file mode 100644
index 34cdfcb..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/MetricsResponse.java
+++ /dev/null
@@ -1,55 +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.kylin.rest.response;
-
-import java.util.HashMap;
-
-/**
- * @author xduo
- * 
- */
-public class MetricsResponse extends HashMap<String, Float> {
-
-    private static final long serialVersionUID = 1L;
-
-    public void increase(String key) {
-        increase(key, (float) 1);
-    }
-
-    public void increase(String key, Float increased) {
-        if (this.containsKey(key)) {
-            this.put(key, (this.get(key) + increased));
-        } else {
-            this.put(key, increased);
-        }
-    }
-
-    public void decrease(String key) {
-        decrease(key, (float) 1);
-    }
-
-    public void decrease(String key, Float decreased) {
-        if (this.containsKey(key)) {
-            this.put(key, (this.get(key) - decreased));
-        } else {
-            this.put(key, decreased);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
deleted file mode 100644
index 9c4e9da..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/SQLResponse.java
+++ /dev/null
@@ -1,168 +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.kylin.rest.response;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.kylin.rest.model.SelectedColumnMeta;
-
-public class SQLResponse implements Serializable {
-    protected static final long serialVersionUID = 1L;
-
-    // private static final Logger logger =
-    // LoggerFactory.getLogger(SQLResponse.class);
-
-    // the data type for each column
-    protected List<SelectedColumnMeta> columnMetas;
-
-    // the results rows, each row contains several columns
-    protected List<List<String>> results;
-
-    /**
-     * for historical reasons it is named "cube", however it might also refer 
to any realizations like hybrid, II or etc.
-     */
-    protected String cube;
-
-    // if not select query, only return affected row count
-    protected int affectedRowCount;
-
-    // flag indicating whether an exception occurred
-    protected boolean isException;
-
-    // if isException, the detailed exception message
-    protected String exceptionMessage;
-
-    protected long duration;
-
-    protected boolean isPartial = false;
-
-    protected long totalScanCount;
-
-    protected boolean hitExceptionCache = false;
-
-    protected boolean storageCacheUsed = false;
-
-    public SQLResponse() {
-    }
-
-    public SQLResponse(List<SelectedColumnMeta> columnMetas, 
List<List<String>> results, int affectedRowCount, boolean isException, String 
exceptionMessage) {
-        this.columnMetas = columnMetas;
-        this.results = results;
-        this.affectedRowCount = affectedRowCount;
-        this.isException = isException;
-        this.exceptionMessage = exceptionMessage;
-    }
-
-    public SQLResponse(List<SelectedColumnMeta> columnMetas, 
List<List<String>> results, String cube, int affectedRowCount, boolean 
isException, String exceptionMessage) {
-        this.columnMetas = columnMetas;
-        this.results = results;
-        this.cube = cube;
-        this.affectedRowCount = affectedRowCount;
-        this.isException = isException;
-        this.exceptionMessage = exceptionMessage;
-    }
-
-    public SQLResponse(List<SelectedColumnMeta> columnMetas, 
List<List<String>> results, String cube, int affectedRowCount, boolean 
isException, String exceptionMessage, boolean isPartial) {
-        this.columnMetas = columnMetas;
-        this.results = results;
-        this.cube = cube;
-        this.affectedRowCount = affectedRowCount;
-        this.isException = isException;
-        this.exceptionMessage = exceptionMessage;
-        this.isPartial = isPartial;
-    }
-
-    public List<SelectedColumnMeta> getColumnMetas() {
-        return columnMetas;
-    }
-
-    public List<List<String>> getResults() {
-        return results;
-    }
-
-    public void setResults(List<List<String>> results) {
-        this.results = results;
-    }
-
-    public String getCube() {
-        return cube;
-    }
-
-    public void setCube(String cube) {
-        this.cube = cube;
-    }
-
-    public int getAffectedRowCount() {
-        return affectedRowCount;
-    }
-
-    public boolean getIsException() {
-        return isException;
-    }
-
-    public void setIsException(boolean v) {
-        isException = v;
-    }
-
-    public String getExceptionMessage() {
-        return exceptionMessage;
-    }
-
-    public void setExceptionMessage(String msg) {
-        exceptionMessage = msg;
-    }
-
-    public long getDuration() {
-        return duration;
-    }
-
-    public void setDuration(long duration) {
-        this.duration = duration;
-    }
-
-    public boolean isPartial() {
-
-        return isPartial;
-    }
-
-    public long getTotalScanCount() {
-        return totalScanCount;
-    }
-
-    public void setTotalScanCount(long totalScanCount) {
-        this.totalScanCount = totalScanCount;
-    }
-
-    public boolean isHitExceptionCache() {
-        return hitExceptionCache;
-    }
-
-    public void setHitExceptionCache(boolean hitExceptionCache) {
-        this.hitExceptionCache = hitExceptionCache;
-    }
-
-    public boolean isStorageCacheUsed() {
-        return storageCacheUsed;
-    }
-
-    public void setStorageCacheUsed(boolean storageCacheUsed) {
-        this.storageCacheUsed = storageCacheUsed;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/response/TableDescResponse.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/response/TableDescResponse.java 
b/server/src/main/java/org/apache/kylin/rest/response/TableDescResponse.java
deleted file mode 100644
index 5dede2a..0000000
--- a/server/src/main/java/org/apache/kylin/rest/response/TableDescResponse.java
+++ /dev/null
@@ -1,81 +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.kylin.rest.response;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.kylin.metadata.model.TableDesc;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/**
- * A response class to wrap TableDesc
- * 
- * @author jianliu
- * 
- */
-public class TableDescResponse extends TableDesc {
-    @JsonProperty("exd")
-    Map<String, String> descExd = new HashMap<String, String>();
-    @JsonProperty("cardinality")
-    Map<String, Long> cardinality = new HashMap<String, Long>();
-
-    /**
-     * @return the cardinality
-     */
-    public Map<String, Long> getCardinality() {
-        return cardinality;
-    }
-
-    /**
-     * @param cardinality
-     *            the cardinality to set
-     */
-    public void setCardinality(Map<String, Long> cardinality) {
-        this.cardinality = cardinality;
-    }
-
-    /**
-     * @return the descExd
-     */
-    public Map<String, String> getDescExd() {
-        return descExd;
-    }
-
-    /**
-     * @param descExd
-     *            the descExd to set
-     */
-    public void setDescExd(Map<String, String> descExd) {
-        this.descExd = descExd;
-    }
-
-    /**
-     * @param table
-     */
-    public TableDescResponse(TableDesc table) {
-        this.setColumns(table.getColumns());
-        this.setDatabase(table.getDatabase());
-        this.setName(table.getName());
-        this.setSourceType(table.getSourceType());
-        this.setUuid(table.getUuid());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/AclEntityFactory.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/AclEntityFactory.java 
b/server/src/main/java/org/apache/kylin/rest/security/AclEntityFactory.java
deleted file mode 100644
index 621fbe4..0000000
--- a/server/src/main/java/org/apache/kylin/rest/security/AclEntityFactory.java
+++ /dev/null
@@ -1,64 +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.kylin.rest.security;
-
-import org.apache.kylin.common.persistence.RootPersistentEntity;
-import org.apache.kylin.cube.CubeInstance;
-import org.apache.kylin.job.JobInstance;
-import org.apache.kylin.metadata.model.DataModelDesc;
-import org.apache.kylin.metadata.project.ProjectInstance;
-
-/**
- * @author xduo
- * 
- */
-public class AclEntityFactory {
-
-    public static RootPersistentEntity createAclEntity(String entityType, 
String uuid) {
-        if ("CubeInstance".equals(entityType)) {
-            CubeInstance cubeInstance = new CubeInstance();
-            cubeInstance.setUuid(uuid);
-
-            return cubeInstance;
-        }
-
-        if ("DataModelDesc".equals(entityType)) {
-            DataModelDesc modelInstance = new DataModelDesc();
-            modelInstance.setUuid(uuid);
-
-            return modelInstance;
-        }
-
-        if ("JobInstance".equals(entityType)) {
-            JobInstance jobInstance = new JobInstance();
-            jobInstance.setUuid(uuid);
-
-            return jobInstance;
-        }
-
-        if ("ProjectInstance".equals(entityType)) {
-            ProjectInstance projectInstance = new ProjectInstance();
-            projectInstance.setUuid(uuid);
-
-            return projectInstance;
-        }
-
-        throw new RuntimeException("Unsupported entity type!");
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java 
b/server/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
deleted file mode 100644
index 38f299e..0000000
--- a/server/src/main/java/org/apache/kylin/rest/security/AclHBaseStorage.java
+++ /dev/null
@@ -1,42 +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.kylin.rest.security;
-
-import java.io.IOException;
-
-import org.apache.hadoop.hbase.client.HTableInterface;
-
-/**
- */
-public interface AclHBaseStorage {
-    String DEFAULT_TABLE_PREFIX = "kylin_metadata";
-
-    String ACL_INFO_FAMILY = "i";
-    String ACL_ACES_FAMILY = "a";
-    String ACL_TABLE_NAME = "_acl";
-
-    String USER_AUTHORITY_FAMILY = "a";
-    String USER_TABLE_NAME = "_user";
-    String USER_AUTHORITY_COLUMN = "c";
-
-    String prepareHBaseTable(Class<?> clazz) throws IOException;
-
-    HTableInterface getTable(String tableName) throws IOException;
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/AclPermission.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/AclPermission.java 
b/server/src/main/java/org/apache/kylin/rest/security/AclPermission.java
deleted file mode 100644
index 4e2e182..0000000
--- a/server/src/main/java/org/apache/kylin/rest/security/AclPermission.java
+++ /dev/null
@@ -1,42 +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.kylin.rest.security;
-
-import org.springframework.security.acls.domain.BasePermission;
-import org.springframework.security.acls.model.Permission;
-
-/**
- * @author xduo
- * 
- */
-public class AclPermission extends BasePermission {
-
-    private static final long serialVersionUID = 6121785617686149123L;
-
-    public static final Permission MANAGEMENT = new AclPermission(1 << 5, 
'M'); // 32
-    public static final Permission OPERATION = new AclPermission(1 << 6, 'O'); 
// 64
-
-    protected AclPermission(int mask) {
-        super(mask);
-    }
-
-    protected AclPermission(int mask, char code) {
-        super(mask, code);
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/AclPermissionFactory.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/AclPermissionFactory.java 
b/server/src/main/java/org/apache/kylin/rest/security/AclPermissionFactory.java
deleted file mode 100644
index d662403..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/security/AclPermissionFactory.java
+++ /dev/null
@@ -1,79 +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.kylin.rest.security;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.security.acls.domain.DefaultPermissionFactory;
-import org.springframework.security.acls.model.Permission;
-
-/**
- * @author xduo
- * 
- */
-public class AclPermissionFactory extends DefaultPermissionFactory {
-
-    public AclPermissionFactory() {
-        super();
-        registerPublicPermissions(AclPermission.class);
-    }
-
-    public static List<Permission> getPermissions() {
-        List<Permission> permissions = new ArrayList<Permission>();
-        Field[] fields = AclPermission.class.getFields();
-
-        for (Field field : fields) {
-            try {
-                Object fieldValue = field.get(null);
-
-                if (Permission.class.isAssignableFrom(fieldValue.getClass())) {
-                    // Found a Permission static field
-                    permissions.add((Permission) fieldValue);
-                }
-            } catch (Exception ignore) {
-                //ignore on purpose
-            }
-        }
-
-        return permissions;
-    }
-
-    public static Permission getPermission(String perName) {
-        Field[] fields = AclPermission.class.getFields();
-
-        for (Field field : fields) {
-            try {
-                Object fieldValue = field.get(null);
-
-                if (Permission.class.isAssignableFrom(fieldValue.getClass())) {
-                    // Found a Permission static field
-                    if (perName.equals(field.getName())) {
-                        return (Permission) fieldValue;
-                    }
-                }
-            } catch (Exception ignore) {
-                //ignore on purpose
-            }
-        }
-
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java 
b/server/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
deleted file mode 100644
index 7983fc0..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/security/AuthoritiesPopulator.java
+++ /dev/null
@@ -1,75 +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.kylin.rest.security;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.kylin.rest.constant.Constant;
-import org.springframework.ldap.core.ContextSource;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
-import 
org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator;
-
-/**
- * @author xduo
- * 
- */
-public class AuthoritiesPopulator extends DefaultLdapAuthoritiesPopulator {
-
-    String adminRole;
-    SimpleGrantedAuthority adminRoleAsAuthority;
-
-    SimpleGrantedAuthority adminAuthority = new 
SimpleGrantedAuthority(Constant.ROLE_ADMIN);
-    SimpleGrantedAuthority modelerAuthority = new 
SimpleGrantedAuthority(Constant.ROLE_MODELER);
-    SimpleGrantedAuthority analystAuthority = new 
SimpleGrantedAuthority(Constant.ROLE_ANALYST);
-
-    Set<GrantedAuthority> defaultAuthorities = new HashSet<GrantedAuthority>();
-
-    /**
-     * @param contextSource
-     * @param groupSearchBase
-     */
-    public AuthoritiesPopulator(ContextSource contextSource, String 
groupSearchBase, String adminRole, String defaultRole) {
-        super(contextSource, groupSearchBase);
-        this.adminRole = adminRole;
-        this.adminRoleAsAuthority = new SimpleGrantedAuthority(adminRole);
-
-        if (defaultRole.contains(Constant.ROLE_MODELER))
-            this.defaultAuthorities.add(modelerAuthority);
-        if (defaultRole.contains(Constant.ROLE_ANALYST))
-            this.defaultAuthorities.add(analystAuthority);
-    }
-
-    @Override
-    public Set<GrantedAuthority> getGroupMembershipRoles(String userDn, String 
username) {
-        Set<GrantedAuthority> authorities = 
super.getGroupMembershipRoles(userDn, username);
-
-        if (authorities.contains(adminRoleAsAuthority)) {
-            authorities.add(adminAuthority);
-            authorities.add(modelerAuthority);
-            authorities.add(analystAuthority);
-        }
-
-        authorities.addAll(defaultAuthorities);
-
-        return authorities;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java 
b/server/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
deleted file mode 100644
index 7d9d9ac..0000000
--- a/server/src/main/java/org/apache/kylin/rest/security/CrossDomainFilter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.rest.security;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.kylin.common.KylinConfig;
-
-/**
- * @author xduo
- * 
- */
-public class CrossDomainFilter implements Filter {
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
-     */
-    @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
-     * javax.servlet.ServletResponse, javax.servlet.FilterChain)
-     */
-    @Override
-    public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain) throws IOException, ServletException {
-        if (KylinConfig.getInstanceFromEnv().isWebCrossDomainEnabled()) {
-            ((HttpServletResponse) 
response).addHeader("Access-Control-Allow-Origin", "*");
-            ((HttpServletResponse) 
response).addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, 
OPTIONS");
-            ((HttpServletResponse) 
response).addHeader("Access-Control-Allow-Headers", "Origin, No-Cache, 
X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, 
Expires, Content-Type, X-E4M-With, Accept, Authorization");
-        }
-
-        chain.doFilter(request, response);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see javax.servlet.Filter#destroy()
-     */
-    @Override
-    public void destroy() {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
 
b/server/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
deleted file mode 100644
index d0dd06a..0000000
--- 
a/server/src/main/java/org/apache/kylin/rest/security/KylinAuthenticationProvider.java
+++ /dev/null
@@ -1,132 +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.kylin.rest.security;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-
-import org.apache.kylin.rest.service.UserService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.AuthenticationProvider;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.core.userdetails.User;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.util.Assert;
-
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Element;
-
-/**
- * A wrapper class for the authentication provider; Will do something more for 
Kylin.
- */
-public class KylinAuthenticationProvider implements AuthenticationProvider {
-
-    private static final Logger logger = 
LoggerFactory.getLogger(KylinAuthenticationProvider.class);
-
-    @Autowired
-    UserService userService;
-
-    @Autowired
-    private CacheManager cacheManager;
-
-    //Embedded authentication provider
-    private AuthenticationProvider authenticationProvider;
-
-    MessageDigest md = null;
-
-    public KylinAuthenticationProvider(AuthenticationProvider 
authenticationProvider) {
-        super();
-        Assert.notNull(authenticationProvider, "The embedded 
authenticationProvider should not be null.");
-        this.authenticationProvider = authenticationProvider;
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException("Failed to init Message Digest ", e);
-        }
-    }
-
-    @Override
-    public Authentication authenticate(Authentication authentication) throws 
AuthenticationException {
-        Authentication authed = null;
-        Cache userCache = cacheManager.getCache("UserCache");
-        md.reset();
-        byte[] hashKey = md.digest((authentication.getName() + 
authentication.getCredentials()).getBytes());
-        String userKey = Arrays.toString(hashKey);
-
-        Element authedUser = userCache.get(userKey);
-        if (null != authedUser) {
-            authed = (Authentication) authedUser.getObjectValue();
-            SecurityContextHolder.getContext().setAuthentication(authed);
-        } else {
-            try {
-                authed = authenticationProvider.authenticate(authentication);
-                userCache.put(new Element(userKey, authed));
-            } catch (AuthenticationException e) {
-                logger.error("Failed to auth user: " + 
authentication.getName(), e);
-                throw e;
-            }
-
-            logger.debug("Authenticated user " + authed.toString());
-
-            UserDetails user;
-
-            if (authed.getDetails() == null) {
-                //authed.setAuthenticated(false);
-                throw new UsernameNotFoundException("User not found in LDAP, 
check whether he/she has been added to the groups.");
-            }
-
-            if (authed.getDetails() instanceof UserDetails) {
-                user = (UserDetails) authed.getDetails();
-            } else {
-                user = new User(authentication.getName(), "skippped-ldap", 
authed.getAuthorities());
-            }
-            Assert.notNull(user, "The UserDetail is null.");
-
-            logger.debug("User authorities :" + user.getAuthorities());
-            if (!userService.userExists(user.getUsername())) {
-                userService.createUser(user);
-            } else {
-                userService.updateUser(user);
-            }
-        }
-
-        return authed;
-    }
-
-    @Override
-    public boolean supports(Class<?> authentication) {
-        return authenticationProvider.supports(authentication);
-    }
-
-    public AuthenticationProvider getAuthenticationProvider() {
-        return authenticationProvider;
-    }
-
-    public void setAuthenticationProvider(AuthenticationProvider 
authenticationProvider) {
-        this.authenticationProvider = authenticationProvider;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/kylin/blob/1a124e68/server/src/main/java/org/apache/kylin/rest/security/LdapProvider.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/kylin/rest/security/LdapProvider.java 
b/server/src/main/java/org/apache/kylin/rest/security/LdapProvider.java
deleted file mode 100644
index 2c5fe50..0000000
--- a/server/src/main/java/org/apache/kylin/rest/security/LdapProvider.java
+++ /dev/null
@@ -1,105 +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.kylin.rest.security;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
-
-import org.apache.kylin.rest.service.UserService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.AuthenticationException;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.core.userdetails.User;
-import org.springframework.security.core.userdetails.UserDetails;
-import 
org.springframework.security.ldap.authentication.LdapAuthenticationProvider;
-import org.springframework.security.ldap.authentication.LdapAuthenticator;
-import org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator;
-
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Element;
-
-/**
- * @author xduo
- * @deprecated replaced by KylinAuthenticationProvider
- * 
- */
-public class LdapProvider extends LdapAuthenticationProvider {
-
-    private static final Logger logger = 
LoggerFactory.getLogger(LdapProvider.class);
-
-    @Autowired
-    UserService userService;
-
-    @Autowired
-    private CacheManager cacheManager;
-
-    MessageDigest md = null;
-
-    /**
-     * @param authenticator
-     * @param authoritiesPopulator
-     */
-    public LdapProvider(LdapAuthenticator authenticator, 
LdapAuthoritiesPopulator authoritiesPopulator) {
-        super(authenticator, authoritiesPopulator);
-
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException("Failed to init Message Digest ", e);
-        }
-    }
-
-    @Override
-    public Authentication authenticate(Authentication authentication) throws 
AuthenticationException {
-        Authentication authed = null;
-        Cache userCache = cacheManager.getCache("UserCache");
-        md.reset();
-        byte[] hashKey = md.digest((authentication.getName() + 
authentication.getCredentials()).getBytes());
-        String userKey = Arrays.toString(hashKey);
-
-        Element authedUser = userCache.get(userKey);
-        if (null != authedUser) {
-            authed = (Authentication) authedUser.getObjectValue();
-            SecurityContextHolder.getContext().setAuthentication(authed);
-        } else {
-            try {
-                authed = super.authenticate(authentication);
-                userCache.put(new Element(userKey, authed));
-            } catch (AuthenticationException e) {
-                logger.error("Failed to auth user: " + 
authentication.getName(), e);
-                throw e;
-            }
-
-            UserDetails user = new User(authentication.getName(), 
"skippped-ldap", authed.getAuthorities());
-
-            if (!userService.userExists(authentication.getName())) {
-                userService.createUser(user);
-            } else {
-                userService.updateUser(user);
-            }
-        }
-
-        return authed;
-    }
-}

Reply via email to