SENTRY-1289: Move exception to sentry-core-common module (Colin Ma, reviewed by Dapeng Sun)
Project: http://git-wip-us.apache.org/repos/asf/sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/f6f730c3 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/f6f730c3 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/f6f730c3 Branch: refs/heads/master Commit: f6f730c32874dd70062c283eeb80632c7fe5282b Parents: 6c453a0 Author: Colin Ma <[email protected]> Authored: Mon May 23 16:21:21 2016 +0800 Committer: Colin Ma <[email protected]> Committed: Mon May 23 16:21:21 2016 +0800 ---------------------------------------------------------------------- .../hive/SentryIniPolicyFileFormatter.java | 2 +- .../binding/hive/authz/HiveAuthzBinding.java | 2 +- .../binding/hive/authz/SentryConfigTool.java | 2 +- .../SentryMetastorePostEventListenerBase.java | 2 +- .../hive/ql/exec/SentryGrantRevokeTask.java | 4 +- .../metastore/MetastoreAuthzBinding.java | 2 +- .../SentryMetastorePostEventListener.java | 2 +- .../binding/hive/TestHiveAuthzBindings.java | 2 +- .../sentry/kafka/binding/KafkaAuthBinding.java | 2 +- .../binding/solr/authz/SolrAuthzBinding.java | 2 +- .../binding/solr/TestSolrAuthzBinding.java | 2 +- .../sentry/sqoop/binding/SqoopAuthBinding.java | 2 +- .../org/apache/sentry/SentryUserException.java | 38 ----------- .../common/SentryConfigurationException.java | 68 -------------------- .../exception/ConnectionDeniedException.java | 36 +++++++++++ .../exception/SentryAccessDeniedException.java | 28 ++++++++ .../exception/SentryAlreadyExistsException.java | 28 ++++++++ .../exception/SentryConfigurationException.java | 68 ++++++++++++++++++++ .../exception/SentryGrantDeniedException.java | 25 +++++++ .../exception/SentryGroupNotFoundException.java | 61 ++++++++++++++++++ .../exception/SentryInvalidInputException.java | 28 ++++++++ .../exception/SentryNoSuchObjectException.java | 28 ++++++++ .../SentrySiteConfigurationException.java | 28 ++++++++ .../SentryThriftAPIMismatchException.java | 28 ++++++++ .../common/exception/SentryUserException.java | 38 +++++++++++ .../validator/IndexerRequiredInPrivilege.java | 2 +- .../CollectionRequiredInPrivilege.java | 2 +- .../sentry/policy/common/PolicyEngine.java | 2 +- .../engine/common/CommonPolicyEngine.java | 2 +- .../indexer/SimpleIndexerPolicyEngine.java | 2 +- .../cache/SimpleCacheProviderBackend.java | 2 +- .../provider/common/AuthorizationProvider.java | 2 +- .../common/HadoopGroupMappingService.java | 1 + .../common/NoAuthorizationProvider.java | 2 +- .../sentry/provider/common/ProviderBackend.java | 2 +- .../common/ResourceAuthorizationProvider.java | 2 +- .../common/SentryGroupNotFoundException.java | 61 ------------------ .../provider/common/TestGetGroupMapping.java | 2 +- .../db/SentryAccessDeniedException.java | 30 --------- .../db/SentryAlreadyExistsException.java | 30 --------- .../provider/db/SentryGrantDeniedException.java | 25 ------- .../db/SentryInvalidInputException.java | 30 --------- .../db/SentryNoSuchObjectException.java | 30 --------- .../provider/db/SentryPolicyStorePlugin.java | 2 +- .../db/SentryThriftAPIMismatchException.java | 30 --------- .../provider/db/SimpleDBProviderBackend.java | 2 +- .../generic/SentryGenericProviderBackend.java | 4 +- .../service/persistent/DelegateSentryStore.java | 16 ++--- .../persistent/PrivilegeOperatePersistence.java | 2 +- .../service/persistent/SentryStoreLayer.java | 6 +- .../thrift/SentryGenericPolicyProcessor.java | 24 +++---- .../thrift/SentryGenericServiceClient.java | 2 +- .../SentryGenericServiceClientDefaultImpl.java | 2 +- .../db/generic/tools/SentryConfigToolSolr.java | 2 +- .../db/service/persistent/SentryStore.java | 18 +++--- .../persistent/SentryStoreSchemaInfo.java | 2 +- .../thrift/SentryConfigurationException.java | 30 --------- .../thrift/SentryPolicyServiceClient.java | 2 +- .../SentryPolicyServiceClientDefaultImpl.java | 2 +- .../thrift/SentryPolicyStoreProcessor.java | 23 +++---- .../provider/db/tools/SentrySchemaTool.java | 6 +- .../thrift/ConnectionDeniedException.java | 36 ----------- .../sentry/service/thrift/GSSCallback.java | 1 + .../thrift/HAClientInvocationHandler.java | 2 +- .../thrift/PoolClientInvocationHandler.java | 2 +- .../apache/sentry/service/thrift/Status.java | 12 ++-- .../persistent/TestDelegateSentryStore.java | 4 +- .../TestPrivilegeOperatePersistence.java | 4 +- .../TestSentryGenericPolicyProcessor.java | 14 ++-- .../TestSentryGenericServiceIntegration.java | 2 +- .../generic/tools/TestSentryConfigToolSolr.java | 2 +- .../db/generic/tools/TestSentryShellKafka.java | 2 +- .../db/generic/tools/TestSentryShellSolr.java | 2 +- .../db/service/persistent/TestSentryStore.java | 6 +- .../service/persistent/TestSentryVersion.java | 2 +- .../thrift/TestSentryPolicyStoreProcessor.java | 9 +-- .../thrift/TestSentryServiceClientPool.java | 2 +- .../thrift/TestSentryServiceIntegration.java | 2 +- .../TestSentryServiceWithInvalidMsgSize.java | 2 +- .../provider/db/tools/TestSentrySchemaTool.java | 2 +- .../provider/db/tools/TestSentryShellHive.java | 2 +- .../provider/file/LocalGroupMappingService.java | 2 +- .../file/SimpleFileProviderBackend.java | 2 +- .../provider/file/TestLocalGroupMapping.java | 2 +- .../SentryIndexAuthorizationSingletonTest.java | 2 +- .../e2e/dbprovider/TestColumnEndToEnd.java | 2 +- .../e2e/dbprovider/TestDatabaseProvider.java | 9 +-- .../tests/e2e/dbprovider/TestDbConnections.java | 4 +- .../tests/e2e/dbprovider/TestDbEndToEnd.java | 2 +- .../TestDbSentryOnFailureHookLoading.java | 2 +- .../TestPrivilegeWithGrantOption.java | 2 +- .../TestPrivilegeWithHAGrantOption.java | 2 +- .../sentry/tests/e2e/ha/TestHaEnd2End.java | 2 +- .../tests/e2e/hdfs/TestHDFSIntegration.java | 2 +- .../sentry/tests/e2e/hive/TestConfigTool.java | 2 +- .../metastore/SentryPolicyProviderForDb.java | 2 +- .../AbstractSolrSentryTestWithDbProvider.java | 2 +- 97 files changed, 536 insertions(+), 547 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/SentryIniPolicyFileFormatter.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/SentryIniPolicyFileFormatter.java b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/SentryIniPolicyFileFormatter.java index 34ccdc7..29b3192 100644 --- a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/SentryIniPolicyFileFormatter.java +++ b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/SentryIniPolicyFileFormatter.java @@ -27,7 +27,7 @@ import com.google.common.collect.Sets; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.common.utils.SentryConstants; import org.apache.sentry.core.common.utils.PolicyFileConstants; import org.apache.sentry.provider.file.PolicyFiles; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java index b2b3be8..8ce7a02 100644 --- a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java +++ b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/HiveAuthzBinding.java @@ -29,7 +29,7 @@ import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.ql.metadata.AuthorizationException; import org.apache.hadoop.hive.ql.plan.HiveOperation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.hive.conf.HiveAuthzConf; import org.apache.sentry.binding.hive.conf.HiveAuthzConf.AuthzConfVars; import org.apache.sentry.binding.hive.conf.InvalidConfigurationException; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java index 694974e..a3140f2 100644 --- a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java +++ b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/hive/authz/SentryConfigTool.java @@ -49,7 +49,7 @@ import org.apache.sentry.binding.hive.SentryPolicyFileFormatFactory; import org.apache.sentry.binding.hive.SentryPolicyFileFormatter; import org.apache.sentry.binding.hive.conf.HiveAuthzConf; import org.apache.sentry.binding.hive.conf.HiveAuthzConf.AuthzConfVars; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.common.Subject; import org.apache.sentry.core.model.db.Server; import org.apache.sentry.provider.common.AuthorizationProvider; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListenerBase.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListenerBase.java b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListenerBase.java index d1197a4..46363a5 100644 --- a/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListenerBase.java +++ b/sentry-binding/sentry-binding-hive-common/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListenerBase.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hive.metastore.events.DropDatabaseEvent; import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.hive.conf.HiveAuthzConf; import org.apache.sentry.binding.hive.conf.HiveAuthzConf.AuthzConfVars; import org.apache.sentry.core.common.Authorizable; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java index dacf839..da587d0 100644 --- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java +++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java @@ -54,7 +54,7 @@ import org.apache.hadoop.hive.ql.plan.api.StageType; import org.apache.hadoop.hive.ql.security.authorization.PrivilegeType; import org.apache.hadoop.hive.ql.session.SessionState; import org.apache.hadoop.hive.ql.session.SessionState.LogHelper; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.hive.HiveAuthzBindingHookBase; import org.apache.sentry.binding.hive.SentryOnFailureHookContext; import org.apache.sentry.binding.hive.SentryOnFailureHookContextImpl; @@ -71,7 +71,7 @@ import org.apache.sentry.core.model.db.Column; 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.db.SentryAccessDeniedException; +import org.apache.sentry.core.common.exception.SentryAccessDeniedException; import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient; import org.apache.sentry.provider.db.service.thrift.TSentryGrantOption; import org.apache.sentry.provider.db.service.thrift.TSentryPrivilege; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/MetastoreAuthzBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/MetastoreAuthzBinding.java b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/MetastoreAuthzBinding.java index 9805635..5beda9f 100644 --- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/MetastoreAuthzBinding.java +++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/MetastoreAuthzBinding.java @@ -26,7 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.metastore.api.InvalidOperationException; import org.apache.hadoop.hive.ql.metadata.AuthorizationException; import org.apache.hadoop.hive.ql.plan.HiveOperation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.hive.authz.HiveAuthzPrivilegesMap; import org.apache.sentry.core.common.Subject; import org.apache.sentry.core.model.db.DBModelAuthorizable; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java index 452757e..d12ac15 100644 --- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java +++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/metastore/SentryMetastorePostEventListener.java @@ -35,7 +35,7 @@ import org.apache.hadoop.hive.metastore.events.DropDatabaseEvent; import org.apache.hadoop.hive.metastore.events.DropPartitionEvent; import org.apache.hadoop.hive.metastore.events.DropTableEvent; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.hive.conf.HiveAuthzConf; import org.apache.sentry.binding.hive.conf.HiveAuthzConf.AuthzConfVars; import org.apache.sentry.core.common.Authorizable; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/TestHiveAuthzBindings.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/TestHiveAuthzBindings.java b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/TestHiveAuthzBindings.java index 24fddf8..2ad7dc4 100644 --- a/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/TestHiveAuthzBindings.java +++ b/sentry-binding/sentry-binding-hive/src/test/java/org/apache/sentry/binding/hive/TestHiveAuthzBindings.java @@ -42,7 +42,7 @@ import org.apache.sentry.core.model.db.DBModelAuthorizable; 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.common.SentryGroupNotFoundException; +import org.apache.sentry.core.common.exception.SentryGroupNotFoundException; import org.apache.sentry.provider.file.PolicyFiles; import org.junit.After; import org.junit.Before; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java b/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java index 15f7359..cc5194b 100644 --- a/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java +++ b/sentry-binding/sentry-binding-kafka/src/main/java/org/apache/sentry/kafka/binding/KafkaAuthBinding.java @@ -39,7 +39,7 @@ import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.UserGroupInformation; import org.apache.kafka.common.KafkaException; import org.apache.kafka.common.security.auth.KafkaPrincipal; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; import org.apache.sentry.core.common.Model; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java b/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java index 7280bad..2400673 100644 --- a/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java +++ b/sentry-binding/sentry-binding-solr/src/main/java/org/apache/sentry/binding/solr/authz/SolrAuthzBinding.java @@ -31,7 +31,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.binding.solr.conf.SolrAuthzConf; import org.apache.sentry.binding.solr.conf.SolrAuthzConf.AuthzConfVars; import org.apache.sentry.core.common.Action; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/binding/solr/TestSolrAuthzBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/binding/solr/TestSolrAuthzBinding.java b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/binding/solr/TestSolrAuthzBinding.java index 182aa39..c88ac94 100644 --- a/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/binding/solr/TestSolrAuthzBinding.java +++ b/sentry-binding/sentry-binding-solr/src/test/java/org/apache/sentry/binding/solr/TestSolrAuthzBinding.java @@ -43,7 +43,7 @@ import org.apache.sentry.binding.solr.conf.SolrAuthzConf.AuthzConfVars; import org.apache.sentry.core.common.Subject; import org.apache.sentry.core.model.search.Collection; import org.apache.sentry.core.model.search.SearchModelAction; -import org.apache.sentry.provider.common.SentryGroupNotFoundException; +import org.apache.sentry.core.common.exception.SentryGroupNotFoundException; import org.apache.sentry.provider.file.PolicyFiles; import org.junit.After; import org.junit.Before; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java ---------------------------------------------------------------------- diff --git a/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java b/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java index 731541d..84a61cc 100644 --- a/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java +++ b/sentry-binding/sentry-binding-sqoop/src/main/java/org/apache/sentry/sqoop/binding/SqoopAuthBinding.java @@ -22,7 +22,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; import org.apache.sentry.core.common.Model; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryUserException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryUserException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryUserException.java deleted file mode 100644 index 3745f11..0000000 --- a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryUserException.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.sentry; - -public class SentryUserException extends Exception{ - private static final long serialVersionUID = 2329620558380655835L; - private String reason; - public SentryUserException(String msg) { - super(msg); - } - public SentryUserException(String msg, String reason) { - super(msg); - this.reason = reason; - } - public SentryUserException(String msg, Throwable t) { - super(msg, t); - reason = t.getMessage(); - } - public String getReason() { - return reason; - } - -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/SentryConfigurationException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/SentryConfigurationException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/SentryConfigurationException.java deleted file mode 100644 index 10d66f5..0000000 --- a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/SentryConfigurationException.java +++ /dev/null @@ -1,68 +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.common; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.shiro.config.ConfigurationException; - -public class SentryConfigurationException extends ConfigurationException { - private static final long serialVersionUID = -116202866086371884L; - private List<String> configErrors = new ArrayList<String>(); - private List<String> configWarnings = new ArrayList<String>(); - - public boolean hasWarnings() { - return !configWarnings.isEmpty(); - } - - public boolean hasErrors() { - return !configErrors.isEmpty(); - } - - public SentryConfigurationException() { - super(); - } - - public SentryConfigurationException(String message, Throwable cause) { - super(message, cause); - } - - public SentryConfigurationException(String message) { - super(message); - } - - public SentryConfigurationException(Throwable cause) { - super(cause); - } - - public List<String> getConfigErrors() { - return configErrors; - } - - public void setConfigErrors(List<String> configErrors) { - this.configErrors = configErrors; - } - - public List<String> getConfigWarnings() { - return configWarnings; - } - - public void setConfigWarnings(List<String> configWarnings) { - this.configWarnings = configWarnings; - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/ConnectionDeniedException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/ConnectionDeniedException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/ConnectionDeniedException.java new file mode 100644 index 0000000..e2b8a37 --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/ConnectionDeniedException.java @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sentry.core.common.exception; + +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.UnsupportedCallbackException; + +public class ConnectionDeniedException extends UnsupportedCallbackException { + + private static final long serialVersionUID = 653174214903923178L; + private String connectionPrincipal; + + public ConnectionDeniedException(Callback callback, String message, String connectionPrincipal) { + super(callback, message); + this.connectionPrincipal = connectionPrincipal; + } + + public String getConnectionPrincipal() { + return connectionPrincipal; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAccessDeniedException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAccessDeniedException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAccessDeniedException.java new file mode 100644 index 0000000..73420ff --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAccessDeniedException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentryAccessDeniedException extends SentryUserException { + private static final long serialVersionUID = 2962080655835L; + public SentryAccessDeniedException(String msg) { + super(msg); + } + public SentryAccessDeniedException(String msg, String reason) { + super(msg, reason); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAlreadyExistsException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAlreadyExistsException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAlreadyExistsException.java new file mode 100644 index 0000000..f29c42f --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryAlreadyExistsException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentryAlreadyExistsException extends SentryUserException { + private static final long serialVersionUID = 1298632655835L; + public SentryAlreadyExistsException(String msg) { + super(msg); + } + public SentryAlreadyExistsException(String msg, String reason) { + super(msg, reason); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryConfigurationException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryConfigurationException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryConfigurationException.java new file mode 100644 index 0000000..a2156bb --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryConfigurationException.java @@ -0,0 +1,68 @@ +/* + * 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.common.exception; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.shiro.config.ConfigurationException; + +public class SentryConfigurationException extends ConfigurationException { + private static final long serialVersionUID = -116202866086371884L; + private List<String> configErrors = new ArrayList<String>(); + private List<String> configWarnings = new ArrayList<String>(); + + public boolean hasWarnings() { + return !configWarnings.isEmpty(); + } + + public boolean hasErrors() { + return !configErrors.isEmpty(); + } + + public SentryConfigurationException() { + super(); + } + + public SentryConfigurationException(String message, Throwable cause) { + super(message, cause); + } + + public SentryConfigurationException(String message) { + super(message); + } + + public SentryConfigurationException(Throwable cause) { + super(cause); + } + + public List<String> getConfigErrors() { + return configErrors; + } + + public void setConfigErrors(List<String> configErrors) { + this.configErrors = configErrors; + } + + public List<String> getConfigWarnings() { + return configWarnings; + } + + public void setConfigWarnings(List<String> configWarnings) { + this.configWarnings = configWarnings; + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGrantDeniedException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGrantDeniedException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGrantDeniedException.java new file mode 100644 index 0000000..02bd555 --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGrantDeniedException.java @@ -0,0 +1,25 @@ +/** + * 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.common.exception; + +public class SentryGrantDeniedException extends SentryAccessDeniedException { + private static final long serialVersionUID = 1962330785835L; + public SentryGrantDeniedException(String msg) { + super(msg); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGroupNotFoundException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGroupNotFoundException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGroupNotFoundException.java new file mode 100644 index 0000000..b978df6 --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryGroupNotFoundException.java @@ -0,0 +1,61 @@ +/* + * 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.common.exception; + +public class SentryGroupNotFoundException extends RuntimeException { + private static final long serialVersionUID = -116202866086371881L; + + /** + * Creates a new SentryGroupNotFoundException. + */ + public SentryGroupNotFoundException() { + super(); + } + + /** + * Constructs a new SentryGroupNotFoundException. + * + * @param message + * the reason for the exception + */ + public SentryGroupNotFoundException(String message) { + super(message); + } + + /** + * Constructs a new SentryGroupNotFoundException. + * + * @param cause + * the underlying Throwable that caused this exception to be thrown. + */ + public SentryGroupNotFoundException(Throwable cause) { + super(cause); + } + + /** + * Constructs a new SentryGroupNotFoundException. + * + * @param message + * the reason for the exception + * @param cause + * the underlying Throwable that caused this exception to be thrown. + */ + public SentryGroupNotFoundException(String message, Throwable cause) { + super(message, cause); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryInvalidInputException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryInvalidInputException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryInvalidInputException.java new file mode 100644 index 0000000..903eddc --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryInvalidInputException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentryInvalidInputException extends SentryUserException { + private static final long serialVersionUID = 2962080655835L; + public SentryInvalidInputException(String msg) { + super(msg); + } + public SentryInvalidInputException(String msg, String reason) { + super(msg, reason); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryNoSuchObjectException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryNoSuchObjectException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryNoSuchObjectException.java new file mode 100644 index 0000000..70719e4 --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryNoSuchObjectException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentryNoSuchObjectException extends SentryUserException { + private static final long serialVersionUID = 2962080655835L; + public SentryNoSuchObjectException(String msg) { + super(msg); + } + public SentryNoSuchObjectException(String msg, String reason) { + super(msg, reason); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentrySiteConfigurationException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentrySiteConfigurationException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentrySiteConfigurationException.java new file mode 100644 index 0000000..6f731cb --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentrySiteConfigurationException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentrySiteConfigurationException extends SentryUserException { + private static final long serialVersionUID = 1298632655835L; + public SentrySiteConfigurationException(String msg) { + super(msg); + } + public SentrySiteConfigurationException(String msg, Throwable t) { + super(msg, t); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryThriftAPIMismatchException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryThriftAPIMismatchException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryThriftAPIMismatchException.java new file mode 100644 index 0000000..1f9e659 --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryThriftAPIMismatchException.java @@ -0,0 +1,28 @@ +/** + * 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.common.exception; + +public class SentryThriftAPIMismatchException extends SentryUserException { + private static final long serialVersionUID = 7535410604425511738L; + public SentryThriftAPIMismatchException(String msg) { + super(msg); + } + public SentryThriftAPIMismatchException(String msg, String reason) { + super(msg, reason); + } +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryUserException.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryUserException.java b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryUserException.java new file mode 100644 index 0000000..3b5beda --- /dev/null +++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/core/common/exception/SentryUserException.java @@ -0,0 +1,38 @@ +/** + * 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.common.exception; + +public class SentryUserException extends Exception{ + private static final long serialVersionUID = 2329620558380655835L; + private String reason; + public SentryUserException(String msg) { + super(msg); + } + public SentryUserException(String msg, String reason) { + super(msg); + this.reason = reason; + } + public SentryUserException(String msg, Throwable t) { + super(msg, t); + reason = t.getMessage(); + } + public String getReason() { + return reason; + } + +} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/validator/IndexerRequiredInPrivilege.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/validator/IndexerRequiredInPrivilege.java b/sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/validator/IndexerRequiredInPrivilege.java index 82bc25d..013c572 100644 --- a/sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/validator/IndexerRequiredInPrivilege.java +++ b/sentry-core/sentry-core-model-indexer/src/main/java/org/apache/sentry/core/model/indexer/validator/IndexerRequiredInPrivilege.java @@ -16,7 +16,7 @@ */ package org.apache.sentry.core.model.indexer.validator; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.model.indexer.Indexer; import org.apache.sentry.core.model.indexer.IndexerModelAuthorizable; import org.apache.sentry.core.common.validator.PrivilegeValidatorContext; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/validator/CollectionRequiredInPrivilege.java ---------------------------------------------------------------------- diff --git a/sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/validator/CollectionRequiredInPrivilege.java b/sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/validator/CollectionRequiredInPrivilege.java index 17b87df..93b3861 100644 --- a/sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/validator/CollectionRequiredInPrivilege.java +++ b/sentry-core/sentry-core-model-search/src/main/java/org/apache/sentry/core/model/search/validator/CollectionRequiredInPrivilege.java @@ -16,7 +16,7 @@ */ package org.apache.sentry.core.model.search.validator; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.model.search.Collection; import org.apache.sentry.core.model.search.SearchModelAuthorizable; import org.apache.sentry.core.common.validator.PrivilegeValidatorContext; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyEngine.java ---------------------------------------------------------------------- diff --git a/sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyEngine.java b/sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyEngine.java index b7d8c32..2396c97 100644 --- a/sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyEngine.java +++ b/sentry-policy/sentry-policy-common/src/main/java/org/apache/sentry/policy/common/PolicyEngine.java @@ -23,7 +23,7 @@ import javax.annotation.concurrent.ThreadSafe; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import com.google.common.collect.ImmutableSet; /** http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-policy/sentry-policy-engine/src/main/java/org/apache/sentry/policy/engine/common/CommonPolicyEngine.java ---------------------------------------------------------------------- diff --git a/sentry-policy/sentry-policy-engine/src/main/java/org/apache/sentry/policy/engine/common/CommonPolicyEngine.java b/sentry-policy/sentry-policy-engine/src/main/java/org/apache/sentry/policy/engine/common/CommonPolicyEngine.java index 16e1ba2..ee25427 100644 --- a/sentry-policy/sentry-policy-engine/src/main/java/org/apache/sentry/policy/engine/common/CommonPolicyEngine.java +++ b/sentry-policy/sentry-policy-engine/src/main/java/org/apache/sentry/policy/engine/common/CommonPolicyEngine.java @@ -19,7 +19,7 @@ package org.apache.sentry.policy.engine.common; import com.google.common.collect.ImmutableSet; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.policy.common.PolicyEngine; import org.apache.sentry.policy.common.PrivilegeFactory; import org.apache.sentry.provider.common.ProviderBackend; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-policy/sentry-policy-indexer/src/main/java/org/apache/sentry/policy/indexer/SimpleIndexerPolicyEngine.java ---------------------------------------------------------------------- diff --git a/sentry-policy/sentry-policy-indexer/src/main/java/org/apache/sentry/policy/indexer/SimpleIndexerPolicyEngine.java b/sentry-policy/sentry-policy-indexer/src/main/java/org/apache/sentry/policy/indexer/SimpleIndexerPolicyEngine.java index 7b1536a..932690c 100644 --- a/sentry-policy/sentry-policy-indexer/src/main/java/org/apache/sentry/policy/indexer/SimpleIndexerPolicyEngine.java +++ b/sentry-policy/sentry-policy-indexer/src/main/java/org/apache/sentry/policy/indexer/SimpleIndexerPolicyEngine.java @@ -20,7 +20,7 @@ import java.util.Set; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.policy.common.PrivilegeFactory; import org.apache.sentry.policy.common.PolicyEngine; import org.apache.sentry.provider.common.ProviderBackend; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java b/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java index d8b9063..b3db752 100644 --- a/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java +++ b/sentry-provider/sentry-provider-cache/src/main/java/org/apache/sentry/provider/cache/SimpleCacheProviderBackend.java @@ -22,7 +22,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.provider.common.ProviderBackend; import org.apache.sentry.provider.common.ProviderBackendContext; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java index 7141e81..2d82bcf 100644 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java +++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/AuthorizationProvider.java @@ -24,7 +24,7 @@ import javax.annotation.concurrent.ThreadSafe; import org.apache.sentry.core.common.Action; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.common.Subject; import org.apache.sentry.policy.common.PolicyEngine; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java index f599dbb..bde53d5 100644 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java +++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/HadoopGroupMappingService.java @@ -26,6 +26,7 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.Groups; import com.google.common.collect.Lists; +import org.apache.sentry.core.common.exception.SentryGroupNotFoundException; public class HadoopGroupMappingService implements GroupMappingService { http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java index 82b215c..be0830d 100644 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java +++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/NoAuthorizationProvider.java @@ -24,7 +24,7 @@ import java.util.Set; import org.apache.sentry.core.common.Action; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.common.Subject; import org.apache.sentry.policy.common.PolicyEngine; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ProviderBackend.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ProviderBackend.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ProviderBackend.java index c78718c..761fb52 100644 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ProviderBackend.java +++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ProviderBackend.java @@ -22,7 +22,7 @@ import javax.annotation.concurrent.ThreadSafe; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import com.google.common.collect.ImmutableSet; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java index 95b4b98..afead3f 100644 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java +++ b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/ResourceAuthorizationProvider.java @@ -30,7 +30,7 @@ import org.apache.sentry.core.common.Action; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; import org.apache.sentry.core.common.Model; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.core.common.Subject; import org.apache.sentry.policy.common.PolicyEngine; import org.apache.sentry.policy.common.Privilege; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/SentryGroupNotFoundException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/SentryGroupNotFoundException.java b/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/SentryGroupNotFoundException.java deleted file mode 100644 index 2609bd3..0000000 --- a/sentry-provider/sentry-provider-common/src/main/java/org/apache/sentry/provider/common/SentryGroupNotFoundException.java +++ /dev/null @@ -1,61 +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.common; - -public class SentryGroupNotFoundException extends RuntimeException { - private static final long serialVersionUID = -116202866086371881L; - - /** - * Creates a new SentryGroupNotFoundException. - */ - public SentryGroupNotFoundException() { - super(); - } - - /** - * Constructs a new SentryGroupNotFoundException. - * - * @param message - * the reason for the exception - */ - public SentryGroupNotFoundException(String message) { - super(message); - } - - /** - * Constructs a new SentryGroupNotFoundException. - * - * @param cause - * the underlying Throwable that caused this exception to be thrown. - */ - public SentryGroupNotFoundException(Throwable cause) { - super(cause); - } - - /** - * Constructs a new SentryGroupNotFoundException. - * - * @param message - * the reason for the exception - * @param cause - * the underlying Throwable that caused this exception to be thrown. - */ - public SentryGroupNotFoundException(String message, Throwable cause) { - super(message, cause); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java index 2b402a0..ccc505f 100644 --- a/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java +++ b/sentry-provider/sentry-provider-common/src/test/java/org/apache/sentry/provider/common/TestGetGroupMapping.java @@ -22,7 +22,7 @@ import java.util.Set; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.policy.common.PolicyEngine; import org.apache.sentry.policy.common.PrivilegeFactory; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAccessDeniedException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAccessDeniedException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAccessDeniedException.java deleted file mode 100644 index 824ab2f..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAccessDeniedException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.sentry.provider.db; - -import org.apache.sentry.SentryUserException; - -public class SentryAccessDeniedException extends SentryUserException { - private static final long serialVersionUID = 2962080655835L; - public SentryAccessDeniedException(String msg) { - super(msg); - } - public SentryAccessDeniedException(String msg, String reason) { - super(msg, reason); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAlreadyExistsException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAlreadyExistsException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAlreadyExistsException.java deleted file mode 100644 index e9df988..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryAlreadyExistsException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.sentry.provider.db; - -import org.apache.sentry.SentryUserException; - -public class SentryAlreadyExistsException extends SentryUserException { - private static final long serialVersionUID = 1298632655835L; - public SentryAlreadyExistsException(String msg) { - super(msg); - } - public SentryAlreadyExistsException(String msg, String reason) { - super(msg, reason); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryGrantDeniedException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryGrantDeniedException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryGrantDeniedException.java deleted file mode 100644 index a470b99..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryGrantDeniedException.java +++ /dev/null @@ -1,25 +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; - -public class SentryGrantDeniedException extends SentryAccessDeniedException { - private static final long serialVersionUID = 1962330785835L; - public SentryGrantDeniedException(String msg) { - super(msg); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryInvalidInputException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryInvalidInputException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryInvalidInputException.java deleted file mode 100644 index 32d0b5e..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryInvalidInputException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.sentry.provider.db; - -import org.apache.sentry.SentryUserException; - -public class SentryInvalidInputException extends SentryUserException { - private static final long serialVersionUID = 2962080655835L; - public SentryInvalidInputException(String msg) { - super(msg); - } - public SentryInvalidInputException(String msg, String reason) { - super(msg, reason); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryNoSuchObjectException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryNoSuchObjectException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryNoSuchObjectException.java deleted file mode 100644 index 3b507cb..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryNoSuchObjectException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.sentry.provider.db; - -import org.apache.sentry.SentryUserException; - -public class SentryNoSuchObjectException extends SentryUserException { - private static final long serialVersionUID = 2962080655835L; - public SentryNoSuchObjectException(String msg) { - super(msg); - } - public SentryNoSuchObjectException(String msg, String reason) { - super(msg, reason); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java index fe1ea1f..2ff715f 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryPolicyStorePlugin.java @@ -19,7 +19,7 @@ package org.apache.sentry.provider.db; import org.apache.hadoop.conf.Configuration; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.provider.db.service.persistent.SentryStore; import org.apache.sentry.provider.db.service.thrift.TAlterSentryRoleAddGroupsRequest; import org.apache.sentry.provider.db.service.thrift.TAlterSentryRoleDeleteGroupsRequest; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryThriftAPIMismatchException.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryThriftAPIMismatchException.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryThriftAPIMismatchException.java deleted file mode 100644 index 1046160..0000000 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SentryThriftAPIMismatchException.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.sentry.provider.db; - -import org.apache.sentry.SentryUserException; - -public class SentryThriftAPIMismatchException extends SentryUserException { - private static final long serialVersionUID = 7535410604425511738L; - public SentryThriftAPIMismatchException(String msg) { - super(msg); - } - public SentryThriftAPIMismatchException(String msg, String reason) { - super(msg, reason); - } -} http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SimpleDBProviderBackend.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SimpleDBProviderBackend.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SimpleDBProviderBackend.java index 2f5aa9d..75d2993 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SimpleDBProviderBackend.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/SimpleDBProviderBackend.java @@ -21,7 +21,7 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.provider.common.ProviderBackend; import org.apache.sentry.provider.common.ProviderBackendContext; import org.apache.sentry.provider.db.service.thrift.SentryPolicyServiceClient; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/SentryGenericProviderBackend.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/SentryGenericProviderBackend.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/SentryGenericProviderBackend.java index 39878e9..1d1da5e 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/SentryGenericProviderBackend.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/SentryGenericProviderBackend.java @@ -24,10 +24,10 @@ import java.util.Set; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.UserGroupInformation; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.ActiveRoleSet; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.core.common.SentryConfigurationException; +import org.apache.sentry.core.common.exception.SentryConfigurationException; import org.apache.sentry.provider.common.CacheProvider; import org.apache.sentry.provider.common.ProviderBackend; import org.apache.sentry.provider.common.ProviderBackendContext; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java index e1737c2..e960dcd 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/DelegateSentryStore.java @@ -28,19 +28,19 @@ import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.hadoop.conf.Configuration; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.provider.db.SentryAccessDeniedException; -import org.apache.sentry.provider.db.SentryAlreadyExistsException; -import org.apache.sentry.provider.db.SentryGrantDeniedException; -import org.apache.sentry.provider.db.SentryInvalidInputException; -import org.apache.sentry.provider.db.SentryNoSuchObjectException; +import org.apache.sentry.core.common.exception.SentryAccessDeniedException; +import org.apache.sentry.core.common.exception.SentryAlreadyExistsException; +import org.apache.sentry.core.common.exception.SentryGrantDeniedException; +import org.apache.sentry.core.common.exception.SentryInvalidInputException; +import org.apache.sentry.core.common.exception.SentryNoSuchObjectException; +import org.apache.sentry.core.common.exception.SentrySiteConfigurationException; import org.apache.sentry.provider.db.service.model.MSentryGMPrivilege; import org.apache.sentry.provider.db.service.model.MSentryGroup; import org.apache.sentry.provider.db.service.model.MSentryRole; import org.apache.sentry.provider.db.service.persistent.CommitContext; import org.apache.sentry.provider.db.service.persistent.SentryStore; -import org.apache.sentry.provider.db.service.thrift.SentryConfigurationException; import org.apache.sentry.provider.db.service.thrift.SentryPolicyStoreProcessor; import org.apache.sentry.provider.db.service.thrift.TSentryGroup; import org.apache.sentry.provider.db.service.thrift.TSentryRole; @@ -67,7 +67,7 @@ public class DelegateSentryStore implements SentryStoreLayer { private PrivilegeOperatePersistence privilegeOperator; public DelegateSentryStore(Configuration conf) throws SentryNoSuchObjectException, - SentryAccessDeniedException, SentryConfigurationException, IOException { + SentryAccessDeniedException, SentrySiteConfigurationException, IOException { this.privilegeOperator = new PrivilegeOperatePersistence(conf); // The generic model doesn't turn on the thread that cleans hive privileges conf.set(ServerConfig.SENTRY_STORE_ORPHANED_PRIVILEGE_REMOVAL,"false"); http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java index c76f22e..fa9dadf 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/PrivilegeOperatePersistence.java @@ -28,7 +28,7 @@ import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.apache.hadoop.conf.Configuration; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.Action; import org.apache.sentry.core.common.Authorizable; import org.apache.sentry.core.common.BitFieldAction; http://git-wip-us.apache.org/repos/asf/sentry/blob/f6f730c3/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java index 49a78ef..c003965 100644 --- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java +++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/generic/service/persistent/SentryStoreLayer.java @@ -20,10 +20,10 @@ package org.apache.sentry.provider.db.generic.service.persistent; import java.util.List; import java.util.Set; -import org.apache.sentry.SentryUserException; +import org.apache.sentry.core.common.exception.SentryUserException; import org.apache.sentry.core.common.Authorizable; -import org.apache.sentry.provider.db.SentryAlreadyExistsException; -import org.apache.sentry.provider.db.SentryNoSuchObjectException; +import org.apache.sentry.core.common.exception.SentryAlreadyExistsException; +import org.apache.sentry.core.common.exception.SentryNoSuchObjectException; import org.apache.sentry.provider.db.service.model.MSentryGMPrivilege; import org.apache.sentry.provider.db.service.persistent.CommitContext;
