sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject sqoop git commit: SQOOP-2248: Sqoop2: ErrorCodes: Move ServerError to server module
Date Mon, 23 Mar 2015 22:22:54 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 04f374b50 -> 205cf2c02


SQOOP-2248: Sqoop2: ErrorCodes: Move ServerError to server module

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/sqoop2
Commit: 205cf2c02ae496d2e7e230084a19a9857ac5551b
Parents: 04f374b
Author: Abraham Elmahrek <abe@apache.org>
Authored: Mon Mar 23 15:22:27 2015 -0700
Committer: Abraham Elmahrek <abe@apache.org>
Committed: Mon Mar 23 15:22:27 2015 -0700

----------------------------------------------------------------------
 .../apache/sqoop/error/code/ServerError.java    | 57 --------------------
 .../handler/AuthorizationRequestHandler.java    |  2 +-
 .../sqoop/handler/ConnectorRequestHandler.java  |  2 +-
 .../sqoop/handler/DriverRequestHandler.java     |  2 +-
 .../org/apache/sqoop/handler/HandlerUtils.java  |  2 +-
 .../apache/sqoop/handler/JobRequestHandler.java |  3 +-
 .../sqoop/handler/LinkRequestHandler.java       |  2 +-
 .../sqoop/handler/SubmissionRequestHandler.java |  2 +-
 .../sqoop/handler/VersionRequestHandler.java    |  2 +-
 .../org/apache/sqoop/server/RequestContext.java |  2 +-
 .../apache/sqoop/server/common/ServerError.java | 57 ++++++++++++++++++++
 11 files changed, 66 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/error/code/ServerError.java b/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
deleted file mode 100644
index 86cca7d..0000000
--- a/common/src/main/java/org/apache/sqoop/error/code/ServerError.java
+++ /dev/null
@@ -1,57 +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.sqoop.error.code;
-
-import org.apache.sqoop.common.ErrorCode;
-
-/**
- *
- */
-public enum ServerError implements ErrorCode {
-
-  /** Unknown error on server side. */
-  SERVER_0001("Unknown server error"),
-
-  /** Unknown error on server side. */
-  SERVER_0002("Unsupported HTTP method"),
-
-  /** We've received invalid HTTP request */
-  SERVER_0003("Invalid HTTP request"),
-
-  /** Invalid argument in HTTP request */
-  SERVER_0004("Invalid argument in HTTP request"),
-
-  /** Invalid entity requested */
-  SERVER_0005("Invalid entity requested"),
-
-  ;
-
-  private final String message;
-
-  private ServerError(String message) {
-    this.message = message;
-  }
-
-  public String getCode() {
-    return name();
-  }
-
-  public String getMessage() {
-    return message;
-  }
-}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/AuthorizationRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/AuthorizationRequestHandler.java
b/server/src/main/java/org/apache/sqoop/handler/AuthorizationRequestHandler.java
index d5e6555..1d2af8d 100644
--- a/server/src/main/java/org/apache/sqoop/handler/AuthorizationRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/AuthorizationRequestHandler.java
@@ -20,7 +20,7 @@ package org.apache.sqoop.handler;
 import org.apache.log4j.Logger;
 import org.apache.sqoop.audit.AuditLoggerManager;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 import org.apache.sqoop.json.*;
 import org.apache.sqoop.model.MPrincipal;
 import org.apache.sqoop.model.MPrivilege;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
index e469c09..2305a51 100644
--- a/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/ConnectorRequestHandler.java
@@ -37,7 +37,7 @@ import org.apache.sqoop.security.Authorization.AuthorizationEngine;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestContext.Method;
 import org.apache.sqoop.server.RequestHandler;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 
 public class ConnectorRequestHandler implements RequestHandler {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java
index 2409df4..81efb89 100644
--- a/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/DriverRequestHandler.java
@@ -26,7 +26,7 @@ import org.apache.sqoop.json.JsonBean;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestHandler;
 import org.apache.sqoop.server.RequestContext.Method;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 
 public class DriverRequestHandler implements RequestHandler {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
index 7579b44..93ff60b 100644
--- a/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
+++ b/server/src/main/java/org/apache/sqoop/handler/HandlerUtils.java
@@ -20,7 +20,7 @@ package org.apache.sqoop.handler;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.connector.ConnectorManager;
 import org.apache.sqoop.repository.Repository;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 
 public class HandlerUtils {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
index 551d5fe..70108f6 100644
--- a/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/JobRequestHandler.java
@@ -19,7 +19,6 @@ package org.apache.sqoop.handler;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 
@@ -52,7 +51,7 @@ import org.apache.sqoop.security.Authorization.AuthorizationEngine;
 import org.apache.sqoop.security.AuthorizationManager;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestHandler;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 import org.apache.sqoop.validation.ConfigValidationResult;
 import org.apache.sqoop.validation.Status;
 import org.json.simple.JSONObject;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
index 24b1754..3187bcf 100644
--- a/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/LinkRequestHandler.java
@@ -43,7 +43,7 @@ import org.apache.sqoop.security.Authorization.AuthorizationEngine;
 import org.apache.sqoop.security.AuthorizationManager;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestHandler;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 import org.apache.sqoop.validation.ConfigValidationResult;
 import org.json.simple.JSONObject;
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java
index 8b9aae4..d2275e4 100644
--- a/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/SubmissionRequestHandler.java
@@ -31,7 +31,7 @@ import org.apache.sqoop.security.Authorization.AuthorizationEngine;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestContext.Method;
 import org.apache.sqoop.server.RequestHandler;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 
 public class SubmissionRequestHandler implements RequestHandler {
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java b/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java
index f78d7a5..2eaa0ac 100644
--- a/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java
+++ b/server/src/main/java/org/apache/sqoop/handler/VersionRequestHandler.java
@@ -26,7 +26,7 @@ import org.apache.sqoop.json.VersionBean;
 import org.apache.sqoop.server.RequestContext;
 import org.apache.sqoop.server.RequestContext.Method;
 import org.apache.sqoop.server.RequestHandler;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 /**
  * Version request handler is supporting following resources:
  *

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/server/RequestContext.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/RequestContext.java b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
index fe738fc..01aed41 100644
--- a/server/src/main/java/org/apache/sqoop/server/RequestContext.java
+++ b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
@@ -21,7 +21,7 @@ import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
 import org.apache.hadoop.security.token.delegation.web.HttpUserGroupInformation;
 import org.apache.sqoop.common.SqoopException;
 import org.apache.sqoop.security.AuthenticationManager;
-import org.apache.sqoop.error.code.ServerError;
+import org.apache.sqoop.server.common.ServerError;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/205cf2c0/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/common/ServerError.java b/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
new file mode 100644
index 0000000..c68ab57
--- /dev/null
+++ b/server/src/main/java/org/apache/sqoop/server/common/ServerError.java
@@ -0,0 +1,57 @@
+/**
+ * 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.sqoop.server.common;
+
+import org.apache.sqoop.common.ErrorCode;
+
+/**
+ *
+ */
+public enum ServerError implements ErrorCode {
+
+  /** Unknown error on server side. */
+  SERVER_0001("Unknown server error"),
+
+  /** Unknown error on server side. */
+  SERVER_0002("Unsupported HTTP method"),
+
+  /** We've received invalid HTTP request */
+  SERVER_0003("Invalid HTTP request"),
+
+  /** Invalid argument in HTTP request */
+  SERVER_0004("Invalid argument in HTTP request"),
+
+  /** Invalid entity requested */
+  SERVER_0005("Invalid entity requested"),
+
+  ;
+
+  private final String message;
+
+  private ServerError(String message) {
+    this.message = message;
+  }
+
+  public String getCode() {
+    return name();
+  }
+
+  public String getMessage() {
+    return message;
+  }
+}


Mime
View raw message