You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/04/10 14:22:09 UTC
[26/34] incubator-ignite git commit: sp-3 renaming
sp-3 renaming
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/26b5c285
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/26b5c285
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/26b5c285
Branch: refs/heads/ignite-692
Commit: 26b5c2856cd0d7db950589b13ba3a0928ba340de
Parents: ace5ef6
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Apr 10 14:15:54 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Apr 10 14:15:54 2015 +0300
----------------------------------------------------------------------
.../internal/ComputeTaskInternalFuture.java | 2 +-
.../client/GridClientConfiguration.java | 6 +-
.../router/GridTcpRouterConfiguration.java | 6 +-
.../eventstorage/GridEventStorageManager.java | 4 +-
.../processors/cache/GridCacheAdapter.java | 12 ++--
.../processors/cache/GridCacheContext.java | 6 +-
.../dht/atomic/GridDhtAtomicCache.java | 6 +-
.../dht/colocated/GridDhtColocatedCache.java | 3 +-
.../distributed/near/GridNearAtomicCache.java | 2 +-
.../near/GridNearTransactionalCache.java | 2 +-
.../local/atomic/GridLocalAtomicCache.java | 6 +-
.../cache/query/GridCacheQueryAdapter.java | 2 +-
.../continuous/CacheContinuousQueryManager.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 6 +-
.../processors/rest/GridRestProcessor.java | 19 +++---
.../security/GridSecurityProcessor.java | 7 +-
.../processors/security/SecurityContext.java | 6 +-
.../security/os/GridOsSecurityProcessor.java | 5 +-
.../processors/task/GridTaskProcessor.java | 3 +-
.../GridSecurityCredentialsProvider.java | 44 -------------
.../plugin/security/GridSecurityException.java | 58 ----------------
.../plugin/security/GridSecurityPermission.java | 69 --------------------
.../plugin/security/SecurityCredentials.java | 6 +-
.../SecurityCredentialsBasicProvider.java | 4 +-
.../security/SecurityCredentialsProvider.java | 44 +++++++++++++
.../plugin/security/SecurityException.java | 61 +++++++++++++++++
.../plugin/security/SecurityPermission.java | 69 ++++++++++++++++++++
.../plugin/security/SecurityPermissionSet.java | 6 +-
.../ignite/plugin/security/SecuritySubject.java | 4 +-
.../junits/spi/GridSpiAbstractTest.java | 7 +-
30 files changed, 240 insertions(+), 237 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
index 219cf1b..a76c17b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/ComputeTaskInternalFuture.java
@@ -218,7 +218,7 @@ public class ComputeTaskInternalFuture<R> extends GridFutureAdapter<R> {
/** {@inheritDoc} */
@Override public boolean cancel() throws IgniteCheckedException {
- ctx.security().authorize(ses.getTaskName(), GridSecurityPermission.TASK_CANCEL, null);
+ ctx.security().authorize(ses.getTaskName(), SecurityPermission.TASK_CANCEL, null);
if (onCancelled()) {
ctx.task().onCancelled(ses.getId());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index 1b2389a..3d01afa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -104,7 +104,7 @@ public class GridClientConfiguration {
private Map<String, GridClientDataConfiguration> dataCfgs = Collections.emptyMap();
/** Credentials. */
- private GridSecurityCredentialsProvider credProvider;
+ private SecurityCredentialsProvider credProvider;
/** Executor. */
private ExecutorService executor;
@@ -347,7 +347,7 @@ public class GridClientConfiguration {
*
* @return Credentials provider.
*/
- public GridSecurityCredentialsProvider getSecurityCredentialsProvider() {
+ public SecurityCredentialsProvider getSecurityCredentialsProvider() {
return credProvider;
}
@@ -356,7 +356,7 @@ public class GridClientConfiguration {
*
* @param credProvider Client credentials provider.
*/
- public void setSecurityCredentialsProvider(GridSecurityCredentialsProvider credProvider) {
+ public void setSecurityCredentialsProvider(SecurityCredentialsProvider credProvider) {
this.credProvider = credProvider;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/client/router/GridTcpRouterConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/router/GridTcpRouterConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/router/GridTcpRouterConfiguration.java
index 9e3c22a..711333c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/router/GridTcpRouterConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/router/GridTcpRouterConfiguration.java
@@ -83,7 +83,7 @@ public class GridTcpRouterConfiguration {
private IgniteLogger log;
/** Credentials. */
- private GridSecurityCredentialsProvider credsProvider;
+ private SecurityCredentialsProvider credsProvider;
/**
* Gets TCP host or IP address for router to bind to.
@@ -197,7 +197,7 @@ public class GridTcpRouterConfiguration {
*
* @return Credentials.
*/
- @Nullable public GridSecurityCredentialsProvider getSecurityCredentialsProvider() {
+ @Nullable public SecurityCredentialsProvider getSecurityCredentialsProvider() {
return credsProvider;
}
@@ -295,7 +295,7 @@ public class GridTcpRouterConfiguration {
*
* @param credsProvider Credentials provider.
*/
- public void setSecurityCredentialsProvider(GridSecurityCredentialsProvider credsProvider) {
+ public void setSecurityCredentialsProvider(SecurityCredentialsProvider credsProvider) {
this.credsProvider = credsProvider;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index e8c9396..3e41a6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -303,7 +303,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
public synchronized void enableEvents(int[] types) {
assert types != null;
- ctx.security().authorize(null, GridSecurityPermission.EVENTS_ENABLE, null);
+ ctx.security().authorize(null, SecurityPermission.EVENTS_ENABLE, null);
boolean[] userRecordableEvts0 = userRecordableEvts;
boolean[] recordableEvts0 = recordableEvts;
@@ -346,7 +346,7 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
public synchronized void disableEvents(int[] types) {
assert types != null;
- ctx.security().authorize(null, GridSecurityPermission.EVENTS_DISABLE, null);
+ ctx.security().authorize(null, SecurityPermission.EVENTS_DISABLE, null);
boolean[] userRecordableEvts0 = userRecordableEvts;
boolean[] recordableEvts0 = recordableEvts;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 45c449b..30e3bc7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -624,7 +624,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
@Override public Iterable<Cache.Entry<K, V>> localEntries(CachePeekMode[] peekModes) throws IgniteCheckedException {
assert peekModes != null;
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
PeekModes modes = parsePeekModes(peekModes, false);
@@ -685,7 +685,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (keyCheck)
validateCacheKey(key);
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
PeekModes modes = parsePeekModes(peekModes, false);
@@ -1073,7 +1073,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
/** {@inheritDoc} */
@Override public void clearLocally() {
- ctx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
List<GridCacheClearAllRunnable<K, V>> jobs = splitClearLocally();
@@ -1741,7 +1741,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
@Nullable IgniteCacheExpiryPolicy expiry,
final boolean skipVals
) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (keyCheck)
validateCacheKeys(keys);
@@ -4466,7 +4466,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
*/
public void clearLocally0(Collection<? extends K> keys,
@Nullable CacheEntryPredicate... filter) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
if (F.isEmpty(keys))
return;
@@ -4491,7 +4491,7 @@ public abstract class GridCacheAdapter<K, V> implements GridCache<K, V>,
if (keyCheck)
validateCacheKey(key);
- ctx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
return clearLocally(ctx.versions().next(), key, filter);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 9076fc2..952ece2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -55,6 +55,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.*;
import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.plugin.security.SecurityException;
import org.jetbrains.annotations.*;
import javax.cache.*;
@@ -68,7 +69,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
import static org.apache.ignite.cache.CacheMemoryMode.*;
import static org.apache.ignite.cache.CacheRebalanceMode.*;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.internal.managers.communication.GridIoPolicy.*;
/**
* Cache context.
@@ -670,9 +670,9 @@ public class GridCacheContext<K, V> implements Externalizable {
/**
* @param op Operation to check.
- * @throws GridSecurityException If security check failed.
+ * @throws SecurityException If security check failed.
*/
- public void checkSecurity(GridSecurityPermission op) throws GridSecurityException {
+ public void checkSecurity(SecurityPermission op) throws SecurityException {
if (CU.isSystemCache(name()))
return;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index be9a963..026d2c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -270,7 +270,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
final boolean deserializePortable,
final boolean skipVals
) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (F.isEmpty(keys))
return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
@@ -781,7 +781,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (map != null && keyCheck)
validateCacheKeys(map.keySet());
- ctx.checkSecurity(GridSecurityPermission.CACHE_PUT);
+ ctx.checkSecurity(SecurityPermission.CACHE_PUT);
GridCacheProjectionImpl<K, V> prj = ctx.projectionPerCall();
@@ -842,7 +842,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
if (keyCheck)
validateCacheKeys(keys);
- ctx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
GridCacheProjectionImpl<K, V> prj = ctx.projectionPerCall();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index a9026b0..b246442 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache.distributed.dht.colocated;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
@@ -156,7 +155,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
final boolean deserializePortable,
final boolean skipVals
) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (F.isEmpty(keys))
return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 6069849..429dee3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -364,7 +364,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
boolean deserializePortable,
boolean skipVals
) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (F.isEmpty(keys))
return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index 44ff756..bfd0177 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -103,7 +103,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
final boolean deserializePortable,
final boolean skipVals
) {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (F.isEmpty(keys))
return new GridFinishedFuture<>(Collections.<K, V>emptyMap());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index 204baf0..1911300 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -519,7 +519,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
boolean deserializePortable,
boolean skipVals
) throws IgniteCheckedException {
- ctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ ctx.checkSecurity(SecurityPermission.CACHE_READ);
if (F.isEmpty(keys))
return Collections.emptyMap();
@@ -853,9 +853,9 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
validateCacheKeys(keys);
if (op == DELETE)
- ctx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ ctx.checkSecurity(SecurityPermission.CACHE_REMOVE);
else
- ctx.checkSecurity(GridSecurityPermission.CACHE_PUT);
+ ctx.checkSecurity(SecurityPermission.CACHE_PUT);
String taskName = ctx.kernalContext().job().currentTaskName();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index d4af0b4..4b1fc87 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@ -395,7 +395,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
@Nullable IgniteClosure<T, R> rmtTransform, @Nullable Object... args) {
Collection<ClusterNode> nodes = nodes();
- cctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ cctx.checkSecurity(SecurityPermission.CACHE_READ);
if (nodes.isEmpty())
return new GridCacheQueryErrorFuture<>(cctx.kernalContext(), new ClusterGroupEmptyCheckedException());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
index 13d29bf..759a949 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryManager.java
@@ -360,7 +360,7 @@ public class CacheContinuousQueryManager extends GridCacheManagerAdapter {
private UUID executeQuery0(CacheEntryUpdatedListener locLsnr, final CacheEntryEventSerializableFilter rmtFilter,
int bufSize, long timeInterval, boolean autoUnsubscribe, boolean internal, boolean notifyExisting,
boolean oldValRequired, boolean sync, boolean ignoreExpired, ClusterGroup grp) throws IgniteCheckedException {
- cctx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ cctx.checkSecurity(SecurityPermission.CACHE_READ);
if (grp == null)
grp = cctx.kernalContext().grid().cluster();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 3aa2f4b..29eabf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -1136,7 +1136,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
assert keysCnt == keys.size();
assert cached == null || F.first(keys).equals(cached.key());
- cacheCtx.checkSecurity(GridSecurityPermission.CACHE_READ);
+ cacheCtx.checkSecurity(SecurityPermission.CACHE_READ);
groupLockSanityCheck(cacheCtx, keys);
@@ -2524,7 +2524,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
) {
assert filter == null || invokeMap == null;
- cacheCtx.checkSecurity(GridSecurityPermission.CACHE_PUT);
+ cacheCtx.checkSecurity(SecurityPermission.CACHE_PUT);
if (retval)
needReturnValue(true);
@@ -2744,7 +2744,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
@Nullable GridCacheEntryEx cached,
final boolean retval,
@Nullable final CacheEntryPredicate[] filter) {
- cacheCtx.checkSecurity(GridSecurityPermission.CACHE_REMOVE);
+ cacheCtx.checkSecurity(SecurityPermission.CACHE_REMOVE);
if (retval)
needReturnValue(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index 8562b8e..917a8e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -38,6 +38,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.internal.util.worker.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.plugin.security.SecurityException;
import org.jsr166.*;
import java.lang.reflect.*;
@@ -175,7 +176,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
authorize(req, subjCtx);
}
- catch (GridSecurityException e) {
+ catch (SecurityException e) {
assert subjCtx != null;
GridRestResponse res = new GridRestResponse(STATUS_SECURITY_CHECK_FAILED, e.getMessage());
@@ -514,16 +515,16 @@ public class GridRestProcessor extends GridProcessorAdapter {
/**
* @param req REST request.
* @param sCtx Security context.
- * @throws GridSecurityException If authorization failed.
+ * @throws SecurityException If authorization failed.
*/
- private void authorize(GridRestRequest req, SecurityContext sCtx) throws GridSecurityException {
- GridSecurityPermission perm = null;
+ private void authorize(GridRestRequest req, SecurityContext sCtx) throws SecurityException {
+ SecurityPermission perm = null;
String name = null;
switch (req.command()) {
case CACHE_GET:
case CACHE_GET_ALL:
- perm = GridSecurityPermission.CACHE_READ;
+ perm = SecurityPermission.CACHE_READ;
name = ((GridRestCacheRequest)req).cacheName();
break;
@@ -531,7 +532,7 @@ public class GridRestProcessor extends GridProcessorAdapter {
case CACHE_QUERY_EXECUTE:
case CACHE_QUERY_FETCH:
case CACHE_QUERY_REBUILD_INDEXES:
- perm = GridSecurityPermission.CACHE_READ;
+ perm = SecurityPermission.CACHE_READ;
name = ((GridRestCacheQueryRequest)req).cacheName();
break;
@@ -543,21 +544,21 @@ public class GridRestProcessor extends GridProcessorAdapter {
case CACHE_CAS:
case CACHE_APPEND:
case CACHE_PREPEND:
- perm = GridSecurityPermission.CACHE_PUT;
+ perm = SecurityPermission.CACHE_PUT;
name = ((GridRestCacheRequest)req).cacheName();
break;
case CACHE_REMOVE:
case CACHE_REMOVE_ALL:
- perm = GridSecurityPermission.CACHE_REMOVE;
+ perm = SecurityPermission.CACHE_REMOVE;
name = ((GridRestCacheRequest)req).cacheName();
break;
case EXE:
case RESULT:
- perm = GridSecurityPermission.TASK_EXECUTE;
+ perm = SecurityPermission.TASK_EXECUTE;
name = ((GridRestTaskRequest)req).taskName();
break;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
index 1a94562..1a32f56 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/GridSecurityProcessor.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.processors.*;
import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.plugin.security.SecurityException;
import org.jetbrains.annotations.*;
import java.util.*;
@@ -78,10 +79,10 @@ public interface GridSecurityProcessor extends GridProcessor {
* @param name Cache name or task class name.
* @param perm Permission to authorize.
* @param securityCtx Optional security context.
- * @throws GridSecurityException If security check failed.
+ * @throws SecurityException If security check failed.
*/
- public void authorize(String name, GridSecurityPermission perm, @Nullable SecurityContext securityCtx)
- throws GridSecurityException;
+ public void authorize(String name, SecurityPermission perm, @Nullable SecurityContext securityCtx)
+ throws SecurityException;
/**
* Callback invoked when subject session got expired.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityContext.java
index 6ad4874..3151f68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/SecurityContext.java
@@ -35,7 +35,7 @@ public interface SecurityContext {
* @param perm Permission to check.
* @return {@code True} if task operation is allowed.
*/
- public boolean taskOperationAllowed(String taskClsName, GridSecurityPermission perm);
+ public boolean taskOperationAllowed(String taskClsName, SecurityPermission perm);
/**
* Checks whether cache operation is allowed.
@@ -44,7 +44,7 @@ public interface SecurityContext {
* @param perm Permission to check.
* @return {@code True} if cache operation is allowed.
*/
- public boolean cacheOperationAllowed(String cacheName, GridSecurityPermission perm);
+ public boolean cacheOperationAllowed(String cacheName, SecurityPermission perm);
/**
* Checks whether system-wide permission is allowed (excluding Visor task operations).
@@ -52,5 +52,5 @@ public interface SecurityContext {
* @param perm Permission to check.
* @return {@code True} if system operation is allowed.
*/
- public boolean systemOperationAllowed(GridSecurityPermission perm);
+ public boolean systemOperationAllowed(SecurityPermission perm);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
index 15cffa0..4b81041 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/security/os/GridOsSecurityProcessor.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.*;
import org.apache.ignite.internal.processors.security.*;
import org.apache.ignite.plugin.security.*;
+import org.apache.ignite.plugin.security.SecurityException;
import org.jetbrains.annotations.*;
import java.util.*;
@@ -65,8 +66,8 @@ public class GridOsSecurityProcessor extends GridProcessorAdapter implements Gri
}
/** {@inheritDoc} */
- @Override public void authorize(String name, GridSecurityPermission perm, @Nullable SecurityContext securityCtx)
- throws GridSecurityException {
+ @Override public void authorize(String name, SecurityPermission perm, @Nullable SecurityContext securityCtx)
+ throws SecurityException {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index 0dce4ad..8b531a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.task;
import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.compute.*;
import org.apache.ignite.events.*;
@@ -419,7 +418,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
else
taskClsName = taskCls != null ? taskCls.getName() : taskName;
- ctx.security().authorize(taskClsName, GridSecurityPermission.TASK_EXECUTE, null);
+ ctx.security().authorize(taskClsName, SecurityPermission.TASK_EXECUTE, null);
// Get values from thread-local context.
Map<GridTaskThreadContextKey, Object> map = thCtx.get();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentialsProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentialsProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentialsProvider.java
deleted file mode 100644
index 499fab6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityCredentialsProvider.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.ignite.plugin.security;
-
-import org.apache.ignite.*;
-
-/**
- * Security credentials provider for specifying security credentials.
- * Security credentials used for client or node authentication.
- * <p>
- * Getting credentials through {@link GridSecurityCredentialsProvider} abstraction allows
- * users to provide custom implementations for storing user names and passwords in their
- * environment, possibly in encrypted format. Ignite comes with
- * {@link SecurityCredentialsBasicProvider} which simply provides
- * the passed in {@code login} and {@code password} when encryption or custom logic is not required.
- * <p>
- * In addition to {@code login} and {@code password}, security credentials allow for
- * specifying {@link SecurityCredentials#setUserObject(Object) userObject} as well, which can be used
- * to pass in any additional information required for authentication.
- */
-public interface GridSecurityCredentialsProvider {
- /**
- * Gets security credentials.
- *
- * @return Security credentials.
- * @throws IgniteCheckedException If failed.
- */
- public SecurityCredentials credentials() throws IgniteCheckedException;
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityException.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityException.java
deleted file mode 100644
index ffd9c85..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityException.java
+++ /dev/null
@@ -1,58 +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.ignite.plugin.security;
-
-import org.apache.ignite.*;
-import org.jetbrains.annotations.*;
-
-/**
- * Common security exception for the grid.
- */
-public class GridSecurityException extends IgniteException {
- /** */
- private static final long serialVersionUID = 0L;
-
- /**
- * Constructs security grid exception with given message and cause.
- *
- * @param msg Exception message.
- * @param cause Exception cause.
- */
- public GridSecurityException(String msg, @Nullable Throwable cause) {
- super(msg, cause);
- }
-
- /**
- * Creates new security grid exception given throwable as a cause and
- * source of error message.
- *
- * @param cause Non-null throwable cause.
- */
- public GridSecurityException(Throwable cause) {
- this(cause.getMessage(), cause);
- }
-
- /**
- * Constructs security grid exception with given message.
- *
- * @param msg Exception message.
- */
- public GridSecurityException(String msg) {
- super(msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermission.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermission.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermission.java
deleted file mode 100644
index 6662093..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermission.java
+++ /dev/null
@@ -1,69 +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.ignite.plugin.security;
-
-import org.jetbrains.annotations.*;
-
-/**
- * Supported security permissions within grid. Permissions
- * are specified on per-cache or per-task level.
- */
-public enum GridSecurityPermission {
- /** Cache {@code read} permission. */
- CACHE_READ,
-
- /** Cache {@code put} permission. */
- CACHE_PUT,
-
- /** Cache {@code remove} permission. */
- CACHE_REMOVE,
-
- /** Task {@code execute} permission. */
- TASK_EXECUTE,
-
- /** Task {@code cancel} permission. */
- TASK_CANCEL,
-
- /** Events {@code enable} permission. */
- EVENTS_ENABLE,
-
- /** Events {@code disable} permission. */
- EVENTS_DISABLE,
-
- /** Common visor tasks permission. */
- ADMIN_VIEW,
-
- /** Visor cache read (query) permission. */
- ADMIN_QUERY,
-
- /** Visor cache load permission. */
- ADMIN_CACHE;
-
- /** Enumerated values. */
- private static final GridSecurityPermission[] VALS = values();
-
- /**
- * Efficiently gets enumerated value from its ordinal.
- *
- * @param ord Ordinal value.
- * @return Enumerated value or {@code null} if ordinal out of range.
- */
- @Nullable public static GridSecurityPermission fromOrdinal(int ord) {
- return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentials.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentials.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentials.java
index 58a09ad..f3b0e24 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentials.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentials.java
@@ -26,10 +26,10 @@ import java.io.*;
/**
* Security credentials used for node authentication. Security credentials
- * are provided by {@link GridSecurityCredentialsProvider} which is specified on
- * client or node startup in configuration.
+ * are provided by {@link SecurityCredentialsProvider} which is specified on
+ * node startup in configuration.
* <p>
- * Getting credentials through {@link GridSecurityCredentialsProvider} abstraction allows
+ * Getting credentials through {@link SecurityCredentialsProvider} abstraction allows
* users to provide custom implementations for storing user names and passwords in their
* environment, possibly in encrypted format. Ignite comes with
* {@link SecurityCredentialsBasicProvider} which simply provides
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsBasicProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsBasicProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsBasicProvider.java
index 5491a5e..90b3352 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsBasicProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsBasicProvider.java
@@ -20,11 +20,11 @@ package org.apache.ignite.plugin.security;
import org.apache.ignite.*;
/**
- * Basic implementation for {@link GridSecurityCredentialsProvider}. Use it
+ * Basic implementation for {@link SecurityCredentialsProvider}. Use it
* when custom logic for storing security credentials is not required and it
* is OK to specify credentials directly in configuration.
*/
-public class SecurityCredentialsBasicProvider implements GridSecurityCredentialsProvider {
+public class SecurityCredentialsBasicProvider implements SecurityCredentialsProvider {
/** */
private SecurityCredentials cred;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsProvider.java
new file mode 100644
index 0000000..4f65437
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityCredentialsProvider.java
@@ -0,0 +1,44 @@
+/*
+ * 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.ignite.plugin.security;
+
+import org.apache.ignite.*;
+
+/**
+ * Security credentials provider for specifying security credentials.
+ * Security credentials used for node authentication.
+ * <p>
+ * Getting credentials through {@link SecurityCredentialsProvider} abstraction allows
+ * users to provide custom implementations for storing user names and passwords in their
+ * environment, possibly in encrypted format. Ignite comes with
+ * {@link SecurityCredentialsBasicProvider} which simply provides
+ * the passed in {@code login} and {@code password} when encryption or custom logic is not required.
+ * <p>
+ * In addition to {@code login} and {@code password}, security credentials allow for
+ * specifying {@link SecurityCredentials#setUserObject(Object) userObject} as well, which can be used
+ * to pass in any additional information required for authentication.
+ */
+public interface SecurityCredentialsProvider {
+ /**
+ * Gets security credentials.
+ *
+ * @return Security credentials.
+ * @throws IgniteCheckedException If failed.
+ */
+ public SecurityCredentials credentials() throws IgniteCheckedException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityException.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityException.java
new file mode 100644
index 0000000..84fa5a4
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityException.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.ignite.plugin.security;
+
+import org.apache.ignite.*;
+import org.jetbrains.annotations.*;
+
+/**
+ * Common security exception for the grid.
+ */
+public class SecurityException extends IgniteException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /**
+ * Constructs security grid exception with given message and cause.
+ *
+ * @param msg Exception message.
+ * @param cause Exception cause.
+ */
+ public SecurityException(
+ String msg,
+ @Nullable Throwable cause
+ ) {
+ super(msg, cause);
+ }
+
+ /**
+ * Creates new security grid exception given throwable as a cause and
+ * source of error message.
+ *
+ * @param cause Non-null throwable cause.
+ */
+ public SecurityException(Throwable cause) {
+ this(cause.getMessage(), cause);
+ }
+
+ /**
+ * Constructs security grid exception with given message.
+ *
+ * @param msg Exception message.
+ */
+ public SecurityException(String msg) {
+ super(msg);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
new file mode 100644
index 0000000..3cab511
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermission.java
@@ -0,0 +1,69 @@
+/*
+ * 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.ignite.plugin.security;
+
+import org.jetbrains.annotations.*;
+
+/**
+ * Supported security permissions within grid. Permissions
+ * are specified on per-cache or per-task level.
+ */
+public enum SecurityPermission {
+ /** Cache {@code read} permission. */
+ CACHE_READ,
+
+ /** Cache {@code put} permission. */
+ CACHE_PUT,
+
+ /** Cache {@code remove} permission. */
+ CACHE_REMOVE,
+
+ /** Task {@code execute} permission. */
+ TASK_EXECUTE,
+
+ /** Task {@code cancel} permission. */
+ TASK_CANCEL,
+
+ /** Events {@code enable} permission. */
+ EVENTS_ENABLE,
+
+ /** Events {@code disable} permission. */
+ EVENTS_DISABLE,
+
+ /** Common visor tasks permission. */
+ ADMIN_VIEW,
+
+ /** Visor cache read (query) permission. */
+ ADMIN_QUERY,
+
+ /** Visor cache load permission. */
+ ADMIN_CACHE;
+
+ /** Enumerated values. */
+ private static final SecurityPermission[] VALS = values();
+
+ /**
+ * Efficiently gets enumerated value from its ordinal.
+ *
+ * @param ord Ordinal value.
+ * @return Enumerated value or {@code null} if ordinal out of range.
+ */
+ @Nullable public static SecurityPermission fromOrdinal(int ord) {
+ return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java
index 2a84778..aa5a139 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java
@@ -47,7 +47,7 @@ public interface SecurityPermissionSet extends Serializable {
*
* @return Map of task names to task permissions.
*/
- public Map<String, Collection<GridSecurityPermission>> taskPermissions();
+ public Map<String, Collection<SecurityPermission>> taskPermissions();
/**
* Map of cache names to cache permissions. Wildcards are allowed at the
@@ -55,12 +55,12 @@ public interface SecurityPermissionSet extends Serializable {
*
* @return Map of cache names to cache permissions.
*/
- public Map<String, Collection<GridSecurityPermission>> cachePermissions();
+ public Map<String, Collection<SecurityPermission>> cachePermissions();
/**
* Collection of system-wide permissions (events enable/disable, Visor task execution).
*
* @return Collection of system-wide permissions.
*/
- @Nullable public Collection<GridSecurityPermission> systemPermissions();
+ @Nullable public Collection<SecurityPermission> systemPermissions();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java
index f8c2cdb..d14666f 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java
@@ -22,7 +22,7 @@ import java.net.*;
import java.util.*;
/**
- * Security subject representing authenticated node or client with a set of permissions.
+ * Security subject representing authenticated node with a set of permissions.
*/
public interface SecuritySubject extends Serializable {
/**
@@ -33,7 +33,7 @@ public interface SecuritySubject extends Serializable {
public UUID id();
/**
- * Gets subject type, either node or client.
+ * Gets subject type for node.
*
* @return Subject type.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26b5c285/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
index eafd62a..bc6b4cb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
@@ -39,7 +39,6 @@ import org.jetbrains.annotations.*;
import java.io.*;
import java.lang.reflect.*;
-import java.net.*;
import java.util.*;
import java.util.concurrent.*;
@@ -699,17 +698,17 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends GridAbstr
}
/** {@inheritDoc} */
- @Override public Map<String, Collection<GridSecurityPermission>> taskPermissions() {
+ @Override public Map<String, Collection<SecurityPermission>> taskPermissions() {
return Collections.emptyMap();
}
/** {@inheritDoc} */
- @Override public Map<String, Collection<GridSecurityPermission>> cachePermissions() {
+ @Override public Map<String, Collection<SecurityPermission>> cachePermissions() {
return Collections.emptyMap();
}
/** {@inheritDoc} */
- @Nullable @Override public Collection<GridSecurityPermission> systemPermissions() {
+ @Nullable @Override public Collection<SecurityPermission> systemPermissions() {
return null;
}
}