ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [41/50] incubator-ignite git commit: sp-3 renaming
Date Fri, 10 Apr 2015 13:07:20 GMT
 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/ace5ef68
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ace5ef68
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ace5ef68

Branch: refs/heads/ignite-gg-9998
Commit: ace5ef688a94d5fb9b38c85a84b2d1970af4e641
Parents: 219a2ee
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Fri Apr 10 14:05:04 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Fri Apr 10 14:05:04 2015 +0300

----------------------------------------------------------------------
 .../internal/managers/GridManagerAdapter.java   |  4 +-
 .../processors/rest/GridRestProcessor.java      |  2 +-
 .../security/GridSecurityProcessor.java         |  4 +-
 .../processors/security/SecurityContext.java    |  2 +-
 .../security/os/GridOsSecurityProcessor.java    |  4 +-
 .../plugin/security/AuthenticationContext.java  |  6 +-
 .../security/GridSecurityPermissionSet.java     | 66 --------------------
 .../plugin/security/GridSecuritySubject.java    | 62 ------------------
 .../security/GridSecuritySubjectType.java       | 48 --------------
 .../plugin/security/SecurityPermissionSet.java  | 66 ++++++++++++++++++++
 .../ignite/plugin/security/SecuritySubject.java | 62 ++++++++++++++++++
 .../plugin/security/SecuritySubjectType.java    | 48 ++++++++++++++
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  4 +-
 .../org/apache/ignite/spi/IgniteSpiContext.java |  4 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  4 +-
 .../testframework/GridSpiTestContext.java       |  4 +-
 .../junits/spi/GridSpiAbstractTest.java         | 59 +----------------
 17 files changed, 198 insertions(+), 251 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index c478d28..a0521c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -490,7 +490,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements
GridMan
                         return null;
                     }
 
-                    @Override public Collection<GridSecuritySubject> authenticatedSubjects()
{
+                    @Override public Collection<SecuritySubject> authenticatedSubjects()
{
                         try {
                             return ctx.security().authenticatedSubjects();
                         }
@@ -499,7 +499,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements
GridMan
                         }
                     }
 
-                    @Override public GridSecuritySubject authenticatedSubject(UUID subjId)
{
+                    @Override public SecuritySubject authenticatedSubject(UUID subjId) {
                         try {
                             return ctx.security().authenticatedSubject(subjId);
                         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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 ab5ef78..8562b8e 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
@@ -45,7 +45,7 @@ import java.util.*;
 import java.util.concurrent.*;
 
 import static org.apache.ignite.internal.processors.rest.GridRestResponse.*;
-import static org.apache.ignite.plugin.security.GridSecuritySubjectType.*;
+import static org.apache.ignite.plugin.security.SecuritySubjectType.*;
 
 /**
  * Rest processor implementation.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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 bd36828..1a94562 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
@@ -61,7 +61,7 @@ public interface GridSecurityProcessor extends GridProcessor {
      * @return Collection of authenticated nodes.
      * @throws IgniteCheckedException If error occurred.
      */
-    public Collection<GridSecuritySubject> authenticatedSubjects() throws IgniteCheckedException;
+    public Collection<SecuritySubject> authenticatedSubjects() throws IgniteCheckedException;
 
     /**
      * Gets authenticated node subject.
@@ -70,7 +70,7 @@ public interface GridSecurityProcessor extends GridProcessor {
      * @return Security subject.
      * @throws IgniteCheckedException If error occurred.
      */
-    public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteCheckedException;
+    public SecuritySubject authenticatedSubject(UUID subjId) throws IgniteCheckedException;
 
     /**
      * Authorizes grid operation.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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 7bb5c70..6ad4874 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
@@ -26,7 +26,7 @@ public interface SecurityContext {
     /**
      * @return Security subject.
      */
-    public GridSecuritySubject subject();
+    public SecuritySubject subject();
 
     /**
      * Checks whether task operation is allowed.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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 783c981..15cffa0 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
@@ -55,12 +55,12 @@ public class GridOsSecurityProcessor extends GridProcessorAdapter implements
Gri
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<GridSecuritySubject> authenticatedSubjects() {
+    @Override public Collection<SecuritySubject> authenticatedSubjects() {
         return Collections.emptyList();
     }
 
     /** {@inheritDoc} */
-    @Override public GridSecuritySubject authenticatedSubject(UUID nodeId) {
+    @Override public SecuritySubject authenticatedSubject(UUID nodeId) {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
b/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
index 4885134..a10a96d 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/AuthenticationContext.java
@@ -25,7 +25,7 @@ import java.util.*;
  */
 public class AuthenticationContext {
     /** Subject type. */
-    private GridSecuritySubjectType subjType;
+    private SecuritySubjectType subjType;
 
     /** Subject ID.w */
     private UUID subjId;
@@ -41,7 +41,7 @@ public class AuthenticationContext {
      *
      * @return Subject type.
      */
-    public GridSecuritySubjectType subjectType() {
+    public SecuritySubjectType subjectType() {
         return subjType;
     }
 
@@ -50,7 +50,7 @@ public class AuthenticationContext {
      *
      * @param subjType Subject type.
      */
-    public void subjectType(GridSecuritySubjectType subjType) {
+    public void subjectType(SecuritySubjectType subjType) {
         this.subjType = subjType;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermissionSet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermissionSet.java
b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermissionSet.java
deleted file mode 100644
index df7b48d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecurityPermissionSet.java
+++ /dev/null
@@ -1,66 +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.*;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Security permission set for authorized security subjects. Permission set
- * allows to specify task permissions for every task and cache permissions
- * for every cache. While cards are supported at the end of task or
- * cache name.
- * <p>
- * Property {@link #defaultAllowAll()} specifies whether to allow or deny
- * cache and task operations if they were not explicitly specified.
- */
-public interface GridSecurityPermissionSet extends Serializable {
-    /**
-     * Flag indicating whether to allow or deny cache and task operations
-     * if they were not explicitly specified.
-     *
-     * @return {@code True} to allow all cache task operations if they were
-     *      not explicitly specified, {@code false} otherwise.
-     */
-    public boolean defaultAllowAll();
-
-    /**
-     * Map of task names to task permissions. Wildcards are allowed at the
-     * end of task names.
-     *
-     * @return Map of task names to task permissions.
-     */
-    public Map<String, Collection<GridSecurityPermission>> taskPermissions();
-
-    /**
-     * Map of cache names to cache permissions. Wildcards are allowed at the
-     * end of cache names.
-     *
-     * @return Map of cache names to cache permissions.
-     */
-    public Map<String, Collection<GridSecurityPermission>> cachePermissions();
-
-    /**
-     * Collection of system-wide permissions (events enable/disable, Visor task execution).
-     *
-     * @return Collection of system-wide permissions.
-     */
-    @Nullable public Collection<GridSecurityPermission> systemPermissions();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubject.java
b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubject.java
deleted file mode 100644
index b55e282..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubject.java
+++ /dev/null
@@ -1,62 +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 java.io.*;
-import java.net.*;
-import java.util.*;
-
-/**
- * Security subject representing authenticated node or client with a set of permissions.
- */
-public interface GridSecuritySubject extends Serializable {
-    /**
-     * Gets subject ID.
-     *
-     * @return Subject ID.
-     */
-    public UUID id();
-
-    /**
-     * Gets subject type, either node or client.
-     *
-     * @return Subject type.
-     */
-    public GridSecuritySubjectType type();
-
-    /**
-     * Login provided via subject security credentials.
-     *
-     * @return Login object.
-     */
-    public Object login();
-
-    /**
-     * Gets subject connection address. Usually {@link InetSocketAddress} representing connection
IP and port.
-     *
-     * @return Subject connection address.
-     */
-    public InetSocketAddress address();
-
-    /**
-     * Authorized permission set for the subject.
-     *
-     * @return Authorized permission set for the subject.
-     */
-    public GridSecurityPermissionSet permissions();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubjectType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubjectType.java
b/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubjectType.java
deleted file mode 100644
index fc8d320..0000000
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/GridSecuritySubjectType.java
+++ /dev/null
@@ -1,48 +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 subject types. Subject type can be retrieved form {@link GridSecuritySubject#type()}
method.
- */
-public enum GridSecuritySubjectType {
-    /**
-     * Subject type for a remote {@link org.apache.ignite.cluster.ClusterNode}.
-     */
-    REMOTE_NODE,
-
-    /**
-     * Subject type for remote client.
-     */
-    REMOTE_CLIENT;
-
-    /** Enumerated values. */
-    private static final GridSecuritySubjectType[] VALS = values();
-
-    /**
-     * Efficiently gets enumerated value from its ordinal.
-     *
-     * @param ord Ordinal value.
-     * @return Enumerated value.
-     */
-    @Nullable public static GridSecuritySubjectType fromOrdinal(byte ord) {
-        return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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
new file mode 100644
index 0000000..2a84778
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityPermissionSet.java
@@ -0,0 +1,66 @@
+/*
+ * 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.*;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Security permission set for authorized security subjects. Permission set
+ * allows to specify task permissions for every task and cache permissions
+ * for every cache. While cards are supported at the end of task or
+ * cache name.
+ * <p>
+ * Property {@link #defaultAllowAll()} specifies whether to allow or deny
+ * cache and task operations if they were not explicitly specified.
+ */
+public interface SecurityPermissionSet extends Serializable {
+    /**
+     * Flag indicating whether to allow or deny cache and task operations
+     * if they were not explicitly specified.
+     *
+     * @return {@code True} to allow all cache task operations if they were
+     *      not explicitly specified, {@code false} otherwise.
+     */
+    public boolean defaultAllowAll();
+
+    /**
+     * Map of task names to task permissions. Wildcards are allowed at the
+     * end of task names.
+     *
+     * @return Map of task names to task permissions.
+     */
+    public Map<String, Collection<GridSecurityPermission>> taskPermissions();
+
+    /**
+     * Map of cache names to cache permissions. Wildcards are allowed at the
+     * end of cache names.
+     *
+     * @return Map of cache names to cache permissions.
+     */
+    public Map<String, Collection<GridSecurityPermission>> cachePermissions();
+
+    /**
+     * Collection of system-wide permissions (events enable/disable, Visor task execution).
+     *
+     * @return Collection of system-wide permissions.
+     */
+    @Nullable public Collection<GridSecurityPermission> systemPermissions();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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
new file mode 100644
index 0000000..f8c2cdb
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubject.java
@@ -0,0 +1,62 @@
+/*
+ * 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 java.io.*;
+import java.net.*;
+import java.util.*;
+
+/**
+ * Security subject representing authenticated node or client with a set of permissions.
+ */
+public interface SecuritySubject extends Serializable {
+    /**
+     * Gets subject ID.
+     *
+     * @return Subject ID.
+     */
+    public UUID id();
+
+    /**
+     * Gets subject type, either node or client.
+     *
+     * @return Subject type.
+     */
+    public SecuritySubjectType type();
+
+    /**
+     * Login provided via subject security credentials.
+     *
+     * @return Login object.
+     */
+    public Object login();
+
+    /**
+     * Gets subject connection address. Usually {@link InetSocketAddress} representing connection
IP and port.
+     *
+     * @return Subject connection address.
+     */
+    public InetSocketAddress address();
+
+    /**
+     * Authorized permission set for the subject.
+     *
+     * @return Authorized permission set for the subject.
+     */
+    public SecurityPermissionSet permissions();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
new file mode 100644
index 0000000..2170807
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
@@ -0,0 +1,48 @@
+/*
+ * 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 subject types. Subject type can be retrieved form {@link SecuritySubject#type()}
method.
+ */
+public enum SecuritySubjectType {
+    /**
+     * Subject type for a remote {@link org.apache.ignite.cluster.ClusterNode}.
+     */
+    REMOTE_NODE,
+
+    /**
+     * Subject type for remote client.
+     */
+    REMOTE_CLIENT;
+
+    /** Enumerated values. */
+    private static final SecuritySubjectType[] VALS = values();
+
+    /**
+     * Efficiently gets enumerated value from its ordinal.
+     *
+     * @param ord Ordinal value.
+     * @return Enumerated value.
+     */
+    @Nullable public static SecuritySubjectType fromOrdinal(byte ord) {
+        return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index f198210..28040ba 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -694,12 +694,12 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
         }
 
         /** {@inheritDoc} */
-        @Override public Collection<GridSecuritySubject> authenticatedSubjects() {
+        @Override public Collection<SecuritySubject> authenticatedSubjects() {
             return Collections.emptyList();
         }
 
         /** {@inheritDoc} */
-        @Override public GridSecuritySubject authenticatedSubject(UUID subjId) {
+        @Override public SecuritySubject authenticatedSubject(UUID subjId) {
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
index 5eef37a..aac8ae6 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiContext.java
@@ -310,7 +310,7 @@ public interface IgniteSpiContext {
      * @return Collection of authenticated subjects.
      * @throws IgniteException If any exception occurs.
      */
-    public Collection<GridSecuritySubject> authenticatedSubjects() throws IgniteException;
+    public Collection<SecuritySubject> authenticatedSubjects() throws IgniteException;
 
     /**
      * Gets security subject based on subject ID.
@@ -319,7 +319,7 @@ public interface IgniteSpiContext {
      * @return Authorized security subject.
      * @throws IgniteException If any exception occurs.
      */
-    public GridSecuritySubject authenticatedSubject(UUID subjId) throws IgniteException;
+    public SecuritySubject authenticatedSubject(UUID subjId) throws IgniteException;
 
     /**
      * Reads swapped cache value from off-heap and swap.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 9b38cad..4b43fec 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -2176,14 +2176,14 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
     }
 
     /**
-     * Checks if two given {@link GridSecurityPermissionSet} objects contain the same permissions.
+     * Checks if two given {@link SecurityPermissionSet} objects contain the same permissions.
      * Each permission belongs to one of three groups : cache, task or system.
      *
      * @param locPerms The first set of permissions.
      * @param rmtPerms The second set of permissions.
      * @return {@code True} if given parameters contain the same permissions, {@code False}
otherwise.
      */
-    private boolean permissionsEqual(GridSecurityPermissionSet locPerms, GridSecurityPermissionSet
rmtPerms) {
+    private boolean permissionsEqual(SecurityPermissionSet locPerms, SecurityPermissionSet
rmtPerms) {
         boolean dfltAllowMatch = !(locPerms.defaultAllowAll() ^ rmtPerms.defaultAllowAll());
 
         boolean bothHaveSamePerms = F.eqNotOrdered(rmtPerms.systemPermissions(), locPerms.systemPermissions())
&&

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
index a4e011a..549c3fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
@@ -474,12 +474,12 @@ public class GridSpiTestContext implements IgniteSpiContext {
     }
 
     /** {@inheritDoc} */
-    @Override public Collection<GridSecuritySubject> authenticatedSubjects() {
+    @Override public Collection<SecuritySubject> authenticatedSubjects() {
         return Collections.emptyList();
     }
 
     /** {@inheritDoc} */
-    @Override public GridSecuritySubject authenticatedSubject(UUID subjId) {
+    @Override public SecuritySubject authenticatedSubject(UUID subjId) {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ace5ef68/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 e0acde9..eafd62a 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
@@ -100,15 +100,8 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi>
extends GridAbstr
     /**
      * @return Allow all permission security set.
      */
-    private static GridSecurityPermissionSet getAllPermissionSet() {
-        return new GridSecurityPermissionSetImpl();
-    }
-
-    /**
-     * @return Grid allow all security subject.
-     */
-    protected GridSecuritySubject getGridSecuritySubject(final GridSecuritySubjectType type,
final UUID id) {
-        return new GridSecuritySubjectImpl(id, type);
+    private static SecurityPermissionSet getAllPermissionSet() {
+        return new SecurityPermissionSetImpl();
     }
 
     /**
@@ -696,7 +689,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends
GridAbstr
         }
     }
 
-    private static class GridSecurityPermissionSetImpl implements GridSecurityPermissionSet
{
+    private static class SecurityPermissionSetImpl implements SecurityPermissionSet {
         /** Serial version uid. */
         private static final long serialVersionUID = 0L;
 
@@ -720,50 +713,4 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi>
extends GridAbstr
             return null;
         }
     }
-
-    private static class GridSecuritySubjectImpl implements GridSecuritySubject {
-        /** Node Id. */
-        private UUID id;
-
-        /** Grid security type. */
-        private GridSecuritySubjectType type;
-
-        private GridSecurityPermissionSet permission;
-
-        public GridSecuritySubjectImpl() {
-        }
-
-        public GridSecuritySubjectImpl(UUID id, GridSecuritySubjectType type) {
-            this.id = id;
-
-            this.type = type;
-
-            permission = getAllPermissionSet();
-        }
-
-        /** {@inheritDoc} */
-        @Override public UUID id() {
-            return id;
-        }
-
-        /** {@inheritDoc} */
-        @Override public GridSecuritySubjectType type() {
-            return type;
-        }
-
-        /** {@inheritDoc} */
-        @Override public Object login() {
-            return null;
-        }
-
-        /** {@inheritDoc} */
-        @Override public InetSocketAddress address() {
-            return null;
-        }
-
-        /** {@inheritDoc} */
-        @Override public GridSecurityPermissionSet permissions() {
-            return permission;
-        }
-    }
 }


Mime
View raw message