sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject [1/2] SENTRY-26: Separate sentry-core to hive specific and non-specific packages (Gregory Chanan via Brock Noland)
Date Fri, 04 Oct 2013 19:40:42 GMT
Updated Branches:
  refs/heads/master d7cbc64b5 -> ef54e1327


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/AuthorizationProvider.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/AuthorizationProvider.java b/sentry-core/src/main/java/org/apache/sentry/core/AuthorizationProvider.java
deleted file mode 100644
index c026fce..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/AuthorizationProvider.java
+++ /dev/null
@@ -1,51 +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.sentry.core;
-
-import java.util.EnumSet;
-import java.util.List;
-
-
-public interface AuthorizationProvider {
-
-  /**
-   * Returns true if the user has the requested privileges on the server, database, and table.
-   */
-  @Deprecated
-  public boolean hasAccess(Subject subject, Server server, Database database, Table table, EnumSet<Action> actions);
-
-  /**
-   * Returns true if the subject has the requested privileges on the server i.e. the
-   * subject has this privilege server wide.
-   */
-  @Deprecated
-  public boolean hasAccess(Subject subject, Server server, ServerResource serverResource, EnumSet<Action> actions);
-
-  /***
-   * Returns validate subject privileges on given Authorizable object
-   *
-   * @param subject: UserID to validate privileges
-   * @param authorizableHierarchy : List of object accroding to namespace hierarchy.
-   *        eg. Server->Db->Table or Server->Function
-   *        The privileges will be validated from the higher to lower scope
-   * @param actions : Privileges to validate
-   * @return
-   *        True if the subject is authorized to perform requested action on the given object
-   */
-  public boolean hasAccess(Subject subject, List<Authorizable> authorizableHierarchy, EnumSet<Action> actions);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/Database.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/Database.java b/sentry-core/src/main/java/org/apache/sentry/core/Database.java
deleted file mode 100644
index 169057d..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/Database.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.sentry.core;
-
-public class Database implements Authorizable {
-
-  /**
-   * Represents all databases
-   */
-  public static final Database ALL = new Database(AccessConstants.ALL);
-
-  private final String name;
-
-  public Database(String name) {
-    this.name = name;
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public String toString() {
-    return "Database [name=" + name + "]";
-  }
-
-  @Override
-  public AuthorizableType getAuthzType() {
-    return AuthorizableType.Db;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/NoAuthorizationProvider.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/NoAuthorizationProvider.java b/sentry-core/src/main/java/org/apache/sentry/core/NoAuthorizationProvider.java
deleted file mode 100644
index a0a6201..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/NoAuthorizationProvider.java
+++ /dev/null
@@ -1,44 +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.sentry.core;
-
-import java.util.EnumSet;
-import java.util.List;
-
-public class NoAuthorizationProvider implements AuthorizationProvider {
-
-  @Override
-  @Deprecated
-  public boolean hasAccess(Subject subject, Server server, Database database, Table table,
-      EnumSet<Action> actions) {
-    return false;
-  }
-
-  @Override
-  @Deprecated
-  public boolean hasAccess(Subject subject, Server server, ServerResource serverResource,
-      EnumSet<Action> actions) {
-    return false;
-  }
-
-  @Override
-  public boolean hasAccess(Subject subject, List<Authorizable> authorizableHierarchy,
-      EnumSet<Action> actions) {
-    return false;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/Server.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/Server.java b/sentry-core/src/main/java/org/apache/sentry/core/Server.java
deleted file mode 100644
index caed9a9..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/Server.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.sentry.core;
-
-public class Server implements Authorizable {
-
-  /**
-   * Represents all servers
-   */
-  public static final Server ALL = new Server(AccessConstants.ALL);
-
-  private final String name;
-
-  public Server(String name) {
-    this.name = name;
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public String toString() {
-    return "Server [name=" + name + "]";
-  }
-
-  @Override
-  public AuthorizableType getAuthzType() {
-    return AuthorizableType.Server;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/ServerResource.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/ServerResource.java b/sentry-core/src/main/java/org/apache/sentry/core/ServerResource.java
deleted file mode 100644
index 91334dc..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/ServerResource.java
+++ /dev/null
@@ -1,21 +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.sentry.core;
-
-public enum ServerResource {
-  UDFS();
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/Subject.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/Subject.java b/sentry-core/src/main/java/org/apache/sentry/core/Subject.java
deleted file mode 100644
index fa5cd6e..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/Subject.java
+++ /dev/null
@@ -1,35 +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.sentry.core;
-
-public class Subject {
-
-  private final String name;
-
-  public Subject(String name) {
-    this.name = name;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public String toString() {
-    return "Subject [name=" + name + "]";
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/Table.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/Table.java b/sentry-core/src/main/java/org/apache/sentry/core/Table.java
deleted file mode 100644
index 9053d9a..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/Table.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.sentry.core;
-
-public class Table implements TableOrView {
-
-  /**
-   * Represents all tables
-   */
-  public static final Table ALL = new Table(AccessConstants.ALL);
-
-  private final String name;
-
-  public Table(String name) {
-    this.name = name;
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public String toString() {
-    return "Table [name=" + name + "]";
-  }
-
-  @Override
-  public AuthorizableType getAuthzType() {
-    return AuthorizableType.Table;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/TableOrView.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/TableOrView.java b/sentry-core/src/main/java/org/apache/sentry/core/TableOrView.java
deleted file mode 100644
index d6f8837..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/TableOrView.java
+++ /dev/null
@@ -1,21 +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.sentry.core;
-
-public interface TableOrView extends Authorizable {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/main/java/org/apache/sentry/core/View.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/main/java/org/apache/sentry/core/View.java b/sentry-core/src/main/java/org/apache/sentry/core/View.java
deleted file mode 100644
index 471a09c..0000000
--- a/sentry-core/src/main/java/org/apache/sentry/core/View.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.sentry.core;
-
-public class View implements TableOrView {
-
-  /**
-   * Represents all views
-   */
-  public static final View ALL = new View(AccessConstants.ALL);
-
-  private final String name;
-
-  public View(String name) {
-    this.name = name;
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
-
-  @Override
-  public String toString() {
-    return "View [name=" + name + "]";
-  }
-
-  @Override
-  public AuthorizableType getAuthzType() {
-    return AuthorizableType.View;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-core/src/test/java/org/apache/sentry/core/TestURI.java
----------------------------------------------------------------------
diff --git a/sentry-core/src/test/java/org/apache/sentry/core/TestURI.java b/sentry-core/src/test/java/org/apache/sentry/core/TestURI.java
deleted file mode 100644
index 5507285..0000000
--- a/sentry-core/src/test/java/org/apache/sentry/core/TestURI.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.apache.sentry.core;
-/*
- * 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.
- */
-
-
-import org.apache.sentry.core.AccessURI;
-import org.junit.Test;
-
-public class TestURI {
-
-  @Test(expected=IllegalArgumentException.class)
-  public void testBadUriEmpty() {
-    new AccessURI("");
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testBadUriNull() {
-    new AccessURI(null);
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testBadUriNoFilePrefix() {
-    new AccessURI("/");
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testBadUriIncorrectFilePrefix() {
-    new AccessURI("file:/some/path");
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testBadUriIncorrectHdfsPrefix() {
-    new AccessURI("hdfs:/some/path");
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-dist/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-dist/pom.xml b/sentry-dist/pom.xml
index 8fc489b..b8207f7 100644
--- a/sentry-dist/pom.xml
+++ b/sentry-dist/pom.xml
@@ -28,7 +28,11 @@ limitations under the License.
   <dependencies>
     <dependency>
       <groupId>org.apache.sentry</groupId>
-      <artifactId>sentry-core</artifactId>
+      <artifactId>sentry-core-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-core-model-db</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-dist/src/main/assembly/src.xml
----------------------------------------------------------------------
diff --git a/sentry-dist/src/main/assembly/src.xml b/sentry-dist/src/main/assembly/src.xml
index af6dfa8..bf78976 100644
--- a/sentry-dist/src/main/assembly/src.xml
+++ b/sentry-dist/src/main/assembly/src.xml
@@ -39,6 +39,8 @@
         <include>org.apache.sentry:sentry-binding</include>
         <include>org.apache.sentry:sentry-binding-hive</include>
         <include>org.apache.sentry:sentry-core</include>
+        <include>org.apache.sentry:sentry-core-common</include>
+        <include>org.apache.sentry:sentry-core-model-db</include>
         <include>org.apache.sentry:sentry-provider</include>
         <include>org.apache.sentry:sentry-provider-file</include>
         <include>org.apache.sentry:sentry-provider-policy-db</include>

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-file/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-file/pom.xml b/sentry-provider/sentry-provider-file/pom.xml
index 85bb23b..a3d010a 100644
--- a/sentry-provider/sentry-provider-file/pom.xml
+++ b/sentry-provider/sentry-provider-file/pom.xml
@@ -59,7 +59,11 @@ limitations under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>
-      <artifactId>sentry-core</artifactId>
+      <artifactId>sentry-core-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-core-model-db</artifactId>
     </dependency>
   </dependencies>
 

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyEngine.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyEngine.java b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyEngine.java
index 954e1d5..ecf954e 100644
--- a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyEngine.java
+++ b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/PolicyEngine.java
@@ -19,7 +19,7 @@ package org.apache.sentry.provider.file;
 
 import java.util.List;
 
-import org.apache.sentry.core.Authorizable;
+import org.apache.sentry.core.common.Authorizable;
 
 import com.google.common.collect.ImmutableSetMultimap;
 
@@ -34,6 +34,6 @@ public interface PolicyEngine {
    * @param group name
    * @return non-null immutable set of permissions
    */
-  public ImmutableSetMultimap<String, String> getPermissions(List<Authorizable> authorizables, List<String> groups);
+  public ImmutableSetMultimap<String, String> getPermissions(List<? extends Authorizable> authorizables, List<String> groups);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/ResourceAuthorizationProvider.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/ResourceAuthorizationProvider.java b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/ResourceAuthorizationProvider.java
index f22fccd..dd63b85 100644
--- a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/ResourceAuthorizationProvider.java
+++ b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/ResourceAuthorizationProvider.java
@@ -21,17 +21,17 @@ import static org.apache.sentry.provider.file.PolicyFileConstants.KV_JOINER;
 import static org.apache.sentry.provider.file.PolicyFileConstants.PRIVILEGE_NAME;
 
 import java.util.ArrayList;
-import java.util.EnumSet;
 import java.util.List;
+import java.util.Set;
 
-import org.apache.sentry.core.Action;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.AuthorizationProvider;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
-import org.apache.sentry.core.ServerResource;
-import org.apache.sentry.core.Subject;
-import org.apache.sentry.core.Table;
+import org.apache.sentry.core.common.Action;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.common.AuthorizationProvider;
+import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
+import org.apache.sentry.core.model.db.ServerResource;
+import org.apache.sentry.core.model.db.Table;
 import org.apache.shiro.authz.Permission;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -56,22 +56,6 @@ public abstract class ResourceAuthorizationProvider implements AuthorizationProv
     this.permissionFactory = permissionFactory;
   }
 
-  @Override
-  public boolean hasAccess(Subject subject, Server server, Database database,
-      Table table, EnumSet<Action> actions) {
-    List<Authorizable> authorizables = Lists.newArrayList();
-    authorizables.add(server);
-    authorizables.add(database);
-    authorizables.add(table);
-    return hasAccess(subject, authorizables, actions);
-  }
-
-  @Override
-  public boolean hasAccess(Subject subject, Server server,
-      ServerResource serverResource, EnumSet<Action> actions) {
-    throw new UnsupportedOperationException("Deprecated");
-  }
-
   /***
    * @param subject: UserID to validate privileges
    * @param authorizableHierarchy : List of object according to namespace hierarchy.
@@ -82,8 +66,8 @@ public abstract class ResourceAuthorizationProvider implements AuthorizationProv
    *        True if the subject is authorized to perform requested action on the given object
    */
   @Override
-  public boolean hasAccess(Subject subject, List<Authorizable> authorizableHierarchy,
-      EnumSet<Action> actions) {
+  public boolean hasAccess(Subject subject, List<? extends Authorizable> authorizableHierarchy,
+      Set<? extends Action> actions) {
     if(LOGGER.isDebugEnabled()) {
       LOGGER.debug("Authorization Request for " + subject + " " +
           authorizableHierarchy + " and " + actions);
@@ -97,11 +81,11 @@ public abstract class ResourceAuthorizationProvider implements AuthorizationProv
   }
 
   private boolean doHasAccess(Subject subject,
-      List<Authorizable> authorizables, EnumSet<Action> actions) {
+      List<? extends Authorizable> authorizables, Set<? extends Action> actions) {
     List<String> groups = groupService.getGroups(subject.getName());
     List<String> hierarchy = new ArrayList<String>();
     for (Authorizable authorizable : authorizables) {
-      hierarchy.add(KV_JOINER.join(authorizable.getAuthzType().name(), authorizable.getName()));
+      hierarchy.add(KV_JOINER.join(authorizable.getTypeName(), authorizable.getName()));
     }
     Iterable<Permission> permissions = getPermissions(authorizables, groups);
     for (Action action : actions) {
@@ -125,7 +109,7 @@ public abstract class ResourceAuthorizationProvider implements AuthorizationProv
     return false;
   }
 
-  private Iterable<Permission> getPermissions(List<Authorizable> authorizables, List<String> groups) {
+  private Iterable<Permission> getPermissions(List<? extends Authorizable> authorizables, List<String> groups) {
     return Iterables.transform(policy.getPermissions(authorizables, groups).values(),
         new Function<String, Permission>() {
       @Override

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/SimplePolicyParser.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/SimplePolicyParser.java b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/SimplePolicyParser.java
index f6b87e0..46acf4a 100644
--- a/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/SimplePolicyParser.java
+++ b/sentry-provider/sentry-provider-file/src/main/java/org/apache/sentry/provider/file/SimplePolicyParser.java
@@ -36,9 +36,9 @@ import javax.annotation.Nullable;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.Database;
 import org.apache.shiro.config.ConfigurationException;
 import org.apache.shiro.config.Ini;
 import org.apache.shiro.util.PermissionUtils;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-file/src/test/java/org/apache/sentry/provider/file/AbstractTestSimplePolicyEngine.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-file/src/test/java/org/apache/sentry/provider/file/AbstractTestSimplePolicyEngine.java b/sentry-provider/sentry-provider-file/src/test/java/org/apache/sentry/provider/file/AbstractTestSimplePolicyEngine.java
index 5388b0f..aa28bb2 100644
--- a/sentry-provider/sentry-provider-file/src/test/java/org/apache/sentry/provider/file/AbstractTestSimplePolicyEngine.java
+++ b/sentry-provider/sentry-provider-file/src/test/java/org/apache/sentry/provider/file/AbstractTestSimplePolicyEngine.java
@@ -25,8 +25,8 @@ import java.util.TreeSet;
 import junit.framework.Assert;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.model.db.Database;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/pom.xml b/sentry-provider/sentry-provider-policy-db/pom.xml
index ca6f6f9..412c13e 100644
--- a/sentry-provider/sentry-provider-policy-db/pom.xml
+++ b/sentry-provider/sentry-provider-policy-db/pom.xml
@@ -66,7 +66,11 @@ limitations under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>
-      <artifactId>sentry-core</artifactId>
+      <artifactId>sentry-core-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sentry</groupId>
+      <artifactId>sentry-core-model-db</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.sentry</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/AbstractDBRoleValidator.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/AbstractDBRoleValidator.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/AbstractDBRoleValidator.java
index d386d59..19769eb 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/AbstractDBRoleValidator.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/AbstractDBRoleValidator.java
@@ -21,8 +21,8 @@ import static org.apache.sentry.provider.file.PolicyFileConstants.PRIVILEGE_PREF
 
 import java.util.List;
 
-import org.apache.sentry.core.Authorizable;
 import org.apache.sentry.provider.file.RoleValidator;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
 import org.apache.shiro.config.ConfigurationException;
 
 import com.google.common.annotations.VisibleForTesting;
@@ -31,12 +31,12 @@ import com.google.common.collect.Lists;
 public abstract class AbstractDBRoleValidator implements RoleValidator {
 
   @VisibleForTesting
-  public static Iterable<Authorizable> parseRole(String string) {
-    List<Authorizable> result = Lists.newArrayList();
+  public static Iterable<DBModelAuthorizable> parseRole(String string) {
+    List<DBModelAuthorizable> result = Lists.newArrayList();
     for(String section : AUTHORIZABLE_SPLITTER.split(string)) {
       // XXX this ugly hack is because action is not an authorizeable
       if(!section.toLowerCase().startsWith(PRIVILEGE_PREFIX)) {
-        Authorizable authorizable = DBAuthorizables.from(section);
+        DBModelAuthorizable authorizable = DBModelAuthorizables.from(section);
         if(authorizable == null) {
           String msg = "No authorizable found for " + section;
           throw new ConfigurationException(msg);

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBAuthorizables.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBAuthorizables.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBAuthorizables.java
deleted file mode 100644
index 089e6de..0000000
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBAuthorizables.java
+++ /dev/null
@@ -1,60 +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.sentry.provider.db;
-
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
-import org.apache.sentry.core.Table;
-import org.apache.sentry.core.View;
-import org.apache.sentry.core.Authorizable.AuthorizableType;
-import org.apache.sentry.provider.file.KeyValue;
-
-public class DBAuthorizables {
-
-  public static Authorizable from(KeyValue keyValue) {
-    String prefix = keyValue.getKey().toLowerCase();
-    String name = keyValue.getValue().toLowerCase();
-    for(AuthorizableType type : AuthorizableType.values()) {
-      if(prefix.equalsIgnoreCase(type.name())) {
-        return from(type, name);
-      }
-    }
-    return null;
-  }
-  public static Authorizable from(String s) {
-    return from(new KeyValue(s));
-  }
-
-  private static Authorizable from(AuthorizableType type, String name) {
-    switch (type) {
-    case Server:
-      return new Server(name);
-    case Db:
-      return new Database(name);
-    case Table:
-      return new Table(name);
-    case View:
-      return new View(name);
-    case URI:
-      return new AccessURI(name);
-    default:
-      return null;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBModelAuthorizables.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBModelAuthorizables.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBModelAuthorizables.java
new file mode 100644
index 0000000..c454831
--- /dev/null
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBModelAuthorizables.java
@@ -0,0 +1,60 @@
+/*
+ * 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.sentry.provider.db;
+
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
+import org.apache.sentry.core.model.db.DBModelAuthorizable.AuthorizableType;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
+import org.apache.sentry.core.model.db.Table;
+import org.apache.sentry.core.model.db.View;
+import org.apache.sentry.provider.file.KeyValue;
+
+public class DBModelAuthorizables {
+
+  public static DBModelAuthorizable from(KeyValue keyValue) {
+    String prefix = keyValue.getKey().toLowerCase();
+    String name = keyValue.getValue().toLowerCase();
+    for(AuthorizableType type : AuthorizableType.values()) {
+      if(prefix.equalsIgnoreCase(type.name())) {
+        return from(type, name);
+      }
+    }
+    return null;
+  }
+  public static DBModelAuthorizable from(String s) {
+    return from(new KeyValue(s));
+  }
+
+  private static DBModelAuthorizable from(AuthorizableType type, String name) {
+    switch (type) {
+    case Server:
+      return new Server(name);
+    case Db:
+      return new Database(name);
+    case Table:
+      return new Table(name);
+    case View:
+      return new View(name);
+    case URI:
+      return new AccessURI(name);
+    default:
+      return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBRoles.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBRoles.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBRoles.java
index 499d988..fcd946d 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBRoles.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBRoles.java
@@ -20,7 +20,7 @@ import java.util.Map.Entry;
 
 import javax.annotation.Nullable;
 
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.model.db.Database;
 import org.apache.sentry.provider.file.Roles;
 import org.apache.sentry.provider.file.RolesFactory;
 import org.slf4j.Logger;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBWildcardPermission.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBWildcardPermission.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBWildcardPermission.java
index 17f5a76..b49dd6a 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBWildcardPermission.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DBWildcardPermission.java
@@ -31,8 +31,8 @@ import java.net.URISyntaxException;
 import java.util.List;
 
 import org.apache.commons.lang.text.StrSubstitutor;
-import org.apache.sentry.core.AccessConstants;
-import org.apache.sentry.core.Authorizable.AuthorizableType;
+import org.apache.sentry.core.model.db.AccessConstants;
+import org.apache.sentry.core.model.db.DBModelAuthorizable.AuthorizableType;
 import org.apache.sentry.provider.file.KeyValue;
 import org.apache.sentry.provider.file.PermissionFactory;
 import org.apache.sentry.provider.file.PolicyFileConstants;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseMustMatch.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseMustMatch.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseMustMatch.java
index db9d60c..adfd2a3 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseMustMatch.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseMustMatch.java
@@ -16,8 +16,8 @@
  */
 package org.apache.sentry.provider.db;
 
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
+import org.apache.sentry.core.model.db.Database;
 import org.apache.shiro.config.ConfigurationException;
 
 public class DatabaseMustMatch extends AbstractDBRoleValidator {
@@ -28,8 +28,8 @@ public class DatabaseMustMatch extends AbstractDBRoleValidator {
      *  Rule only applies to rules in per database policy file
      */
     if(database != null) {
-      Iterable<Authorizable> authorizables = parseRole(role);
-      for(Authorizable authorizable : authorizables) {
+      Iterable<DBModelAuthorizable> authorizables = parseRole(role);
+      for(DBModelAuthorizable authorizable : authorizables) {
         if(authorizable instanceof Database &&
             !database.equalsIgnoreCase(authorizable.getName())) {
           String msg = "Role " + role + " references db " +

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseRequiredInRole.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseRequiredInRole.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseRequiredInRole.java
index f8ab954..c85807d 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseRequiredInRole.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/DatabaseRequiredInRole.java
@@ -18,9 +18,9 @@ package org.apache.sentry.provider.db;
 
 import javax.annotation.Nullable;
 
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
 import org.apache.shiro.config.ConfigurationException;
 
 public class DatabaseRequiredInRole extends AbstractDBRoleValidator {
@@ -31,7 +31,7 @@ public class DatabaseRequiredInRole extends AbstractDBRoleValidator {
      *  Rule only applies to rules in per database policy file
      */
     if(database != null) {
-      Iterable<Authorizable> authorizables = parseRole(role);
+      Iterable<DBModelAuthorizable> authorizables = parseRole(role);
       /*
        * Each permission in a non-global file must have a database
        * object except for URIs.
@@ -49,7 +49,7 @@ public class DatabaseRequiredInRole extends AbstractDBRoleValidator {
         allowURIInAuthorizables = true;
       }
 
-      for(Authorizable authorizable : authorizables) {
+      for(DBModelAuthorizable authorizable : authorizables) {
         if(authorizable instanceof Database) {
           foundDatabaseInAuthorizables = true;
         }

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServerNameMustMatch.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServerNameMustMatch.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServerNameMustMatch.java
index ab26266..577f71f 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServerNameMustMatch.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServerNameMustMatch.java
@@ -18,8 +18,8 @@ package org.apache.sentry.provider.db;
 
 import javax.annotation.Nullable;
 
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Server;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
+import org.apache.sentry.core.model.db.Server;
 import org.apache.shiro.config.ConfigurationException;
 
 public class ServerNameMustMatch extends AbstractDBRoleValidator {
@@ -30,8 +30,8 @@ public class ServerNameMustMatch extends AbstractDBRoleValidator {
   }
   @Override
   public void validate(@Nullable String database, String role) throws ConfigurationException {
-    Iterable<Authorizable> authorizables = parseRole(role);
-    for(Authorizable authorizable : authorizables) {
+    Iterable<DBModelAuthorizable> authorizables = parseRole(role);
+    for(DBModelAuthorizable authorizable : authorizables) {
       if(authorizable instanceof Server && !serverName.equalsIgnoreCase(authorizable.getName())) {
         String msg = "Server name " + authorizable.getName() + " in "
       + role + " is invalid. Expected " + serverName;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServersAllIsInvalid.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServersAllIsInvalid.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServersAllIsInvalid.java
index 7b56324..be33830 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServersAllIsInvalid.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/ServersAllIsInvalid.java
@@ -18,16 +18,16 @@ package org.apache.sentry.provider.db;
 
 import javax.annotation.Nullable;
 
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Server;
+import org.apache.sentry.core.model.db.DBModelAuthorizable;
+import org.apache.sentry.core.model.db.Server;
 import org.apache.shiro.config.ConfigurationException;
 
 public class ServersAllIsInvalid extends AbstractDBRoleValidator {
 
   @Override
   public void validate(@Nullable String database, String role) throws ConfigurationException {
-    Iterable<Authorizable> authorizables = parseRole(role);
-    for(Authorizable authorizable : authorizables) {
+    Iterable<DBModelAuthorizable> authorizables = parseRole(role);
+    for(DBModelAuthorizable authorizable : authorizables) {
       if(authorizable instanceof Server &&
           authorizable.getName().equals(Server.ALL.getName())) {
         String msg = "Invalid value for " + authorizable.getAuthzType() + " in " + role;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/SimpleDBPolicyEngine.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/SimpleDBPolicyEngine.java b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/SimpleDBPolicyEngine.java
index 7224f60..6607d02 100644
--- a/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/SimpleDBPolicyEngine.java
+++ b/sentry-provider/sentry-provider-policy-db/src/main/java/org/apache/sentry/provider/db/SimpleDBPolicyEngine.java
@@ -20,9 +20,9 @@ import java.io.IOException;
 import java.util.List;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.Database;
 import org.apache.sentry.provider.file.PolicyEngine;
 import org.apache.sentry.provider.file.SimplePolicyParser;
 import org.apache.sentry.provider.file.Roles;
@@ -60,7 +60,7 @@ public class SimpleDBPolicyEngine implements PolicyEngine {
    * {@inheritDoc}
    */
   @Override
-  public ImmutableSetMultimap<String, String> getPermissions(List<Authorizable> authorizables, List<String> groups) {
+  public ImmutableSetMultimap<String, String> getPermissions(List<? extends Authorizable> authorizables, List<String> groups) {
     String database = null;
     Boolean isURI = false;
     for(Authorizable authorizable : authorizables) {

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBAuthorizables.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBAuthorizables.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBAuthorizables.java
deleted file mode 100644
index 347a2c2..0000000
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBAuthorizables.java
+++ /dev/null
@@ -1,80 +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.sentry.provider.db;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNull;
-
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
-import org.apache.sentry.core.Table;
-import org.apache.sentry.core.View;
-import org.apache.sentry.provider.db.DBAuthorizables;
-import org.junit.Test;
-
-public class TestDBAuthorizables {
-
-  @Test
-  public void testServer() throws Exception {
-    Server server = (Server)DBAuthorizables.from("SeRvEr=server1");
-    assertEquals("server1", server.getName());
-  }
-  @Test
-  public void testDb() throws Exception {
-    Database db = (Database)DBAuthorizables.from("dB=db1");
-    assertEquals("db1", db.getName());
-  }
-  @Test
-  public void testTable() throws Exception {
-    Table table = (Table)DBAuthorizables.from("tAbLe=t1");
-    assertEquals("t1", table.getName());
-  }
-  @Test
-  public void testView() throws Exception {
-    View view = (View)DBAuthorizables.from("vIeW=v1");
-    assertEquals("v1", view.getName());
-  }
-  @Test
-  public void testURI() throws Exception {
-    AccessURI uri = (AccessURI)DBAuthorizables.from("UrI=hdfs://uri1:8200/blah");
-    assertEquals("hdfs://uri1:8200/blah", uri.getName());
-  }
-
-  @Test(expected=IllegalArgumentException.class)
-  public void testNoKV() throws Exception {
-    System.out.println(DBAuthorizables.from("nonsense"));
-  }
-
-  @Test(expected=IllegalArgumentException.class)
-  public void testTooManyKV() throws Exception {
-    System.out.println(DBAuthorizables.from("k=v1=v2"));
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testEmptyKey() throws Exception {
-    System.out.println(DBAuthorizables.from("=v"));
-  }
-  @Test(expected=IllegalArgumentException.class)
-  public void testEmptyValue() throws Exception {
-    System.out.println(DBAuthorizables.from("k="));
-  }
-  @Test
-  public void testNotAuthorizable() throws Exception {
-    assertNull(DBAuthorizables.from("k=v"));
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBModelAuthorizables.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBModelAuthorizables.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBModelAuthorizables.java
new file mode 100644
index 0000000..0058d71
--- /dev/null
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBModelAuthorizables.java
@@ -0,0 +1,81 @@
+/*
+ * 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.sentry.provider.db;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertNull;
+
+
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
+import org.apache.sentry.core.model.db.Table;
+import org.apache.sentry.core.model.db.View;
+import org.apache.sentry.provider.db.DBModelAuthorizables;
+import org.junit.Test;
+
+public class TestDBModelAuthorizables {
+
+  @Test
+  public void testServer() throws Exception {
+    Server server = (Server)DBModelAuthorizables.from("SeRvEr=server1");
+    assertEquals("server1", server.getName());
+  }
+  @Test
+  public void testDb() throws Exception {
+    Database db = (Database)DBModelAuthorizables.from("dB=db1");
+    assertEquals("db1", db.getName());
+  }
+  @Test
+  public void testTable() throws Exception {
+    Table table = (Table)DBModelAuthorizables.from("tAbLe=t1");
+    assertEquals("t1", table.getName());
+  }
+  @Test
+  public void testView() throws Exception {
+    View view = (View)DBModelAuthorizables.from("vIeW=v1");
+    assertEquals("v1", view.getName());
+  }
+  @Test
+  public void testURI() throws Exception {
+    AccessURI uri = (AccessURI)DBModelAuthorizables.from("UrI=hdfs://uri1:8200/blah");
+    assertEquals("hdfs://uri1:8200/blah", uri.getName());
+  }
+
+  @Test(expected=IllegalArgumentException.class)
+  public void testNoKV() throws Exception {
+    System.out.println(DBModelAuthorizables.from("nonsense"));
+  }
+
+  @Test(expected=IllegalArgumentException.class)
+  public void testTooManyKV() throws Exception {
+    System.out.println(DBModelAuthorizables.from("k=v1=v2"));
+  }
+  @Test(expected=IllegalArgumentException.class)
+  public void testEmptyKey() throws Exception {
+    System.out.println(DBModelAuthorizables.from("=v"));
+  }
+  @Test(expected=IllegalArgumentException.class)
+  public void testEmptyValue() throws Exception {
+    System.out.println(DBModelAuthorizables.from("k="));
+  }
+  @Test
+  public void testNotAuthorizable() throws Exception {
+    assertNull(DBModelAuthorizables.from("k=v"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBWildcardPermission.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBWildcardPermission.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBWildcardPermission.java
index 71474b3..10b93de 100644
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBWildcardPermission.java
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestDBWildcardPermission.java
@@ -24,7 +24,7 @@ import static org.apache.sentry.provider.file.PolicyFileConstants.AUTHORIZABLE_J
 import static org.apache.sentry.provider.file.PolicyFileConstants.KV_JOINER;
 import static org.apache.sentry.provider.file.PolicyFileConstants.KV_SEPARATOR;
 
-import org.apache.sentry.core.AccessConstants;
+import org.apache.sentry.core.model.db.AccessConstants;
 import org.apache.sentry.provider.file.KeyValue;
 import org.apache.shiro.authz.Permission;
 import org.junit.Test;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestPolicyParsingNegative.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestPolicyParsingNegative.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestPolicyParsingNegative.java
index edb715e..e17eab0 100644
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestPolicyParsingNegative.java
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestPolicyParsingNegative.java
@@ -23,9 +23,9 @@ import java.util.Arrays;
 import junit.framework.Assert;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
 import org.apache.sentry.provider.file.PolicyEngine;
 import org.apache.sentry.provider.file.PolicyFile;
 import org.junit.After;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderGeneralCases.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderGeneralCases.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderGeneralCases.java
index 32ade2b..be36fe8 100644
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderGeneralCases.java
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderGeneralCases.java
@@ -21,17 +21,19 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.List;
+import java.util.Set;
 
 import junit.framework.Assert;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.sentry.core.AccessConstants;
-import org.apache.sentry.core.Action;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
-import org.apache.sentry.core.Subject;
-import org.apache.sentry.core.Table;
+import org.apache.sentry.core.common.Action;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.model.db.AccessConstants;
+import org.apache.sentry.core.model.db.DBModelAction;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
+import org.apache.sentry.core.model.db.Table;
 import org.apache.sentry.provider.file.PolicyFiles;
 import org.apache.sentry.provider.file.MockGroupMappingServiceProvider;
 import org.apache.sentry.provider.file.ResourceAuthorizationProvider;
@@ -68,9 +70,9 @@ public class TestResourceAuthorizationProviderGeneralCases {
 
   private static final Table TBL_PURCHASES = new Table("purchases");
 
-  private static final EnumSet<Action> ALL = EnumSet.of(Action.ALL);
-  private static final EnumSet<Action> SELECT = EnumSet.of(Action.SELECT);
-  private static final EnumSet<Action> INSERT = EnumSet.of(Action.INSERT);
+  private static final Set<? extends Action> ALL = EnumSet.of(DBModelAction.ALL);
+  private static final Set<? extends Action> SELECT = EnumSet.of(DBModelAction.SELECT);
+  private static final Set<? extends Action> INSERT = EnumSet.of(DBModelAction.INSERT);
 
   static {
     USER_TO_GROUP_MAP.putAll(SUB_ADMIN.getName(), Arrays.asList("admin"));
@@ -100,7 +102,7 @@ public class TestResourceAuthorizationProviderGeneralCases {
   }
 
   private void doTestAuthorizables(
-      Subject subject, EnumSet<Action> privileges, boolean expected,
+      Subject subject, Set<? extends Action> privileges, boolean expected,
       Authorizable... authorizables) throws Exception {
     List<Authorizable> authzHierarchy = Arrays.asList(authorizables);
     Objects.ToStringHelper helper = Objects.toStringHelper("TestParameters");
@@ -113,7 +115,7 @@ public class TestResourceAuthorizationProviderGeneralCases {
 
   private void doTestResourceAuthorizationProvider(Subject subject,
       Server server, Database database, Table table,
-      EnumSet<Action> privileges, boolean expected) throws Exception {
+      Set<? extends Action> privileges, boolean expected) throws Exception {
     List<Authorizable> authzHierarchy = Arrays.asList(new Authorizable[] {
         server, database, table
     });

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderSpecialCases.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderSpecialCases.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderSpecialCases.java
index 161067b..508a566 100644
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderSpecialCases.java
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestResourceAuthorizationProviderSpecialCases.java
@@ -1,4 +1,4 @@
-/*
+ /*
  * 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.
@@ -20,16 +20,18 @@ import java.io.File;
 import java.io.IOException;
 import java.util.EnumSet;
 import java.util.List;
+import java.util.Set;
 
 import junit.framework.Assert;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.sentry.core.AccessURI;
-import org.apache.sentry.core.Action;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.AuthorizationProvider;
-import org.apache.sentry.core.Server;
-import org.apache.sentry.core.Subject;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.common.AuthorizationProvider;
+import org.apache.sentry.core.common.Action;
+import org.apache.sentry.core.common.Subject;
+import org.apache.sentry.core.model.db.AccessURI;
+import org.apache.sentry.core.model.db.DBModelAction;
+import org.apache.sentry.core.model.db.Server;
 import org.apache.sentry.provider.db.LocalGroupResourceAuthorizationProvider;
 import org.apache.sentry.provider.file.PolicyFile;
 import org.junit.After;
@@ -65,14 +67,14 @@ public class TestResourceAuthorizationProviderSpecialCases {
     Subject user1 = new Subject("user1");
     Server server1 = new Server("server1");
     AccessURI uri = new AccessURI("file:///path/to/");
-    EnumSet<Action> actions = EnumSet.of(Action.ALL, Action.SELECT, Action.INSERT);
+    Set<? extends Action> actions = EnumSet.of(DBModelAction.ALL, DBModelAction.SELECT, DBModelAction.INSERT);
     policyFile.addGroupsToUser(user1.getName(), true, "group1", "group1")
       .addRolesToGroup("group1",  true, "role1", "role1")
       .addPermissionsToRole("role1", true, "server=" + server1.getName() + "->uri=" + uri.getName(),
           "server=" + server1.getName() + "->uri=" + uri.getName());
     policyFile.write(iniFile);
     authzProvider = new LocalGroupResourceAuthorizationProvider(initResource, server1.getName());
-    List<Authorizable> authorizableHierarchy = ImmutableList.of(server1, uri);
+    List<? extends Authorizable> authorizableHierarchy = ImmutableList.of(server1, uri);
     Assert.assertTrue(authorizableHierarchy.toString(),
         authzProvider.hasAccess(user1, authorizableHierarchy, actions));
   }
@@ -81,14 +83,14 @@ public class TestResourceAuthorizationProviderSpecialCases {
     Subject user1 = new Subject("user1");
     Server server1 = new Server("server1");
     AccessURI uri = new AccessURI("file:///path/to/");
-    EnumSet<Action> actions = EnumSet.of(Action.ALL, Action.SELECT, Action.INSERT);
+    Set<? extends Action> actions = EnumSet.of(DBModelAction.ALL, DBModelAction.SELECT, DBModelAction.INSERT);
     policyFile.addGroupsToUser(user1.getName(), "group1")
       .addRolesToGroup("group1", "role1")
       .addPermissionsToRole("role1", "server=" + server1.getName() + "->uri=" + uri.getName());
     policyFile.write(iniFile);
     authzProvider = new LocalGroupResourceAuthorizationProvider(initResource, server1.getName());
     // positive test
-    List<Authorizable> authorizableHierarchy = ImmutableList.of(server1, uri);
+    List<? extends Authorizable> authorizableHierarchy = ImmutableList.of(server1, uri);
     Assert.assertTrue(authorizableHierarchy.toString(),
         authzProvider.hasAccess(user1, authorizableHierarchy, actions));
     // negative tests

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestSimpleDBPolicyEngineDFS.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestSimpleDBPolicyEngineDFS.java b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestSimpleDBPolicyEngineDFS.java
index faf4131..52860b6 100644
--- a/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestSimpleDBPolicyEngineDFS.java
+++ b/sentry-provider/sentry-provider-policy-db/src/test/java/org/apache/sentry/provider/db/TestSimpleDBPolicyEngineDFS.java
@@ -26,9 +26,9 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.sentry.core.Authorizable;
-import org.apache.sentry.core.Database;
-import org.apache.sentry.core.Server;
+import org.apache.sentry.core.common.Authorizable;
+import org.apache.sentry.core.model.db.Database;
+import org.apache.sentry.core.model.db.Server;
 import org.apache.sentry.provider.file.AbstractTestSimplePolicyEngine;
 import org.apache.sentry.provider.file.PolicyFile;
 import org.apache.sentry.provider.file.PolicyFiles;

http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef54e132/sentry-tests/sentry-tests-hive/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-hive/pom.xml b/sentry-tests/sentry-tests-hive/pom.xml
index a9d913f..0941cf7 100644
--- a/sentry-tests/sentry-tests-hive/pom.xml
+++ b/sentry-tests/sentry-tests-hive/pom.xml
@@ -48,10 +48,6 @@ limitations under the License.
       <artifactId>derby</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.sentry</groupId>
-      <artifactId>sentry-core</artifactId>
-    </dependency>
-    <dependency>
       <groupId>org.apache.hive</groupId>
       <artifactId>hive-service</artifactId>
       <scope>test</scope>


Mime
View raw message