ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/2] incubator-ignite git commit: #ignite-189: wip.
Date Tue, 10 Feb 2015 17:09:26 GMT
#ignite-189: wip.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/98e41f15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/98e41f15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/98e41f15

Branch: refs/heads/ignite-189
Commit: 98e41f1554f78cd8f06425259574241f814acc92
Parents: d42453e
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Tue Feb 10 20:08:19 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Tue Feb 10 20:08:19 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      |  26 ----
 .../ignite/internal/GridKernalContextImpl.java  |   6 +-
 .../apache/ignite/internal/IgniteKernal.java    |  40 +----
 .../org/apache/ignite/internal/IgnitionEx.java  |   8 -
 .../security/GridSecurityProcessor.java         |   4 +-
 .../visor/node/VisorSpisConfiguration.java      |   1 -
 .../org/apache/ignite/mxbean/IgniteMXBean.java  |   7 -
 .../org/apache/ignite/spi/IgniteSpiAdapter.java | 145 +------------------
 .../spi/authentication/AuthenticationSpi.java   |  90 ------------
 .../noop/NoopAuthenticationSpi.java             | 127 ----------------
 10 files changed, 11 insertions(+), 443 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 31a4fb0..a223903 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -28,7 +28,6 @@ import org.apache.ignite.lifecycle.*;
 import org.apache.ignite.services.*;
 import org.apache.ignite.marshaller.*;
 import org.apache.ignite.plugin.*;
-import org.apache.ignite.spi.authentication.*;
 import org.apache.ignite.spi.indexing.*;
 import org.apache.ignite.streamer.*;
 import org.apache.ignite.plugin.security.*;
@@ -320,9 +319,6 @@ public class IgniteConfiguration {
     /** Collision SPI. */
     private CollisionSpi colSpi;
 
-    /** Authentication SPI. */
-    private AuthenticationSpi authSpi;
-
     /** Secure session SPI. */
     private SecureSessionSpi sesSpi;
 
@@ -514,7 +510,6 @@ public class IgniteConfiguration {
         cpSpi = cfg.getCheckpointSpi();
         colSpi = cfg.getCollisionSpi();
         failSpi = cfg.getFailoverSpi();
-        authSpi = cfg.getAuthenticationSpi();
         sesSpi = cfg.getSecureSessionSpi();
         loadBalancingSpi = cfg.getLoadBalancingSpi();
         swapSpaceSpi = cfg.getSwapSpaceSpi();
@@ -1789,27 +1784,6 @@ public class IgniteConfiguration {
     }
 
     /**
-     * Should return fully configured authentication SPI implementation. If not provided,
-     * {@link org.apache.ignite.spi.authentication.noop.NoopAuthenticationSpi} will be used.
-     *
-     * @return Grid authentication SPI implementation or {@code null} to use default implementation.
-     */
-    public AuthenticationSpi getAuthenticationSpi() {
-        return authSpi;
-    }
-
-    /**
-     * Sets fully configured instance of {@link org.apache.ignite.spi.authentication.AuthenticationSpi}.
-     *
-     * @param authSpi Fully configured instance of {@link org.apache.ignite.spi.authentication.AuthenticationSpi}
or
-     * {@code null} if no SPI provided.
-     * @see IgniteConfiguration#getAuthenticationSpi()
-     */
-    public void setAuthenticationSpi(AuthenticationSpi authSpi) {
-        this.authSpi = authSpi;
-    }
-
-    /**
      * Should return fully configured secure session SPI implementation. If not provided,
      * {@link org.apache.ignite.spi.securesession.noop.NoopSecureSessionSpi} will be used.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 8e5b65c..d870e1f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -131,7 +131,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** */
     @GridToStringExclude
-    private GridSecureSessionProcessor sesMgr;
+    private GridSecureSessionProcessor secProc;
 
     /** */
     @GridToStringExclude
@@ -419,7 +419,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
         else if (comp instanceof GridSecurityProcessor)
             authProc = (GridSecurityProcessor)comp;
         else if (comp instanceof GridSecureSessionProcessor)
-            sesMgr = (GridSecureSessionProcessor)comp;
+            secProc = (GridSecureSessionProcessor)comp;
         else if (comp instanceof GridLoadBalancerManager)
             loadMgr = (GridLoadBalancerManager)comp;
         else if (comp instanceof GridSwapSpaceManager)
@@ -658,7 +658,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
 
     /** {@inheritDoc} */
     @Override public GridSecureSessionProcessor secureSession() {
-        return sesMgr;
+        return secProc;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 5616806..35f47d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -77,8 +77,6 @@ import org.apache.ignite.mxbean.*;
 import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.security.*;
 import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.authentication.*;
-import org.apache.ignite.spi.authentication.noop.*;
 import org.apache.ignite.spi.securesession.noop.*;
 import org.jetbrains.annotations.*;
 
@@ -387,13 +385,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
     }
 
     /** {@inheritDoc} */
-    @Override public String getAuthenticationSpiFormatted() {
-        assert cfg != null;
-
-        return cfg.getAuthenticationSpi().toString();
-    }
-
-    /** {@inheritDoc} */
     @Override public String getSecureSessionSpiFormatted() {
         assert cfg != null;
 
@@ -1135,7 +1126,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         A.notNull(cfg.getDeploymentSpi(), "cfg.getDeploymentSpi()");
         A.notNull(cfg.getDiscoverySpi(), "cfg.getDiscoverySpi()");
         A.notNull(cfg.getEventStorageSpi(), "cfg.getEventStorageSpi()");
-        A.notNull(cfg.getAuthenticationSpi(), "cfg.getAuthenticationSpi()");
         A.notNull(cfg.getSecureSessionSpi(), "cfg.getSecureSessionSpi()");
         A.notNull(cfg.getCollisionSpi(), "cfg.getCollisionSpi()");
         A.notNull(cfg.getFailoverSpi(), "cfg.getFailoverSpi()");
@@ -1221,9 +1211,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         if (cfg.getSecureSessionSpi() != null && !(cfg.getSecureSessionSpi() instanceof
NoopSecureSessionSpi))
             msgs.add("Secure session SPI.");
 
-        if (cfg.getAuthenticationSpi() != null && !(cfg.getAuthenticationSpi() instanceof
NoopAuthenticationSpi))
-            msgs.add("Authentication SPI.");
-
         if (!F.isEmpty(msgs)) {
             U.quietAndInfo(log, "The following features are not supported in open source
edition, " +
                 "related configuration settings will be ignored " +
@@ -1369,30 +1356,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         if (cfg.getClientConnectionConfiguration() != null)
             add(attrs, ATTR_REST_PORT_RANGE, cfg.getClientConnectionConfiguration().getRestPortRange());
 
-        try {
-            AuthenticationSpi authSpi = cfg.getAuthenticationSpi();
-
-            boolean securityEnabled = authSpi != null && !U.hasAnnotation(authSpi.getClass(),
IgniteSpiNoop.class);
-
-            GridSecurityCredentialsProvider provider = cfg.getSecurityCredentialsProvider();
-
-            if (provider != null) {
-                GridSecurityCredentials cred = provider.credentials();
-
-                if (cred != null)
-                    add(attrs, ATTR_SECURITY_CREDENTIALS, cred);
-                else if (securityEnabled)
-                    throw new IgniteCheckedException("Failed to start node (authentication
SPI is configured, " +
-                        "by security credentials provider returned null).");
-            }
-            else if (securityEnabled)
-                throw new IgniteCheckedException("Failed to start node (authentication SPI
is configured, " +
-                    "but security credentials provider is not set. Fix the configuration
and restart the node).");
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteCheckedException("Failed to create node security credentials",
e);
-        }
-
         // Stick in SPI versions and classes attributes.
         addAttributes(attrs, cfg.getCollisionSpi());
         addAttributes(attrs, cfg.getSwapSpaceSpi());
@@ -1406,6 +1369,8 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
         addAttributes(attrs, cfg.getSecureSessionSpi());
         addAttributes(attrs, cfg.getDeploymentSpi());
 
+
+
         // Set user attributes for this node.
         if (cfg.getUserAttributes() != null) {
             for (Map.Entry<String, ?> e : cfg.getUserAttributes().entrySet()) {
@@ -2282,7 +2247,6 @@ public class IgniteKernal extends ClusterGroupAdapter implements IgniteEx,
Ignit
             log.debug("Grid event storage SPI  : " + cfg.getEventStorageSpi());
             log.debug("Grid failover SPI       : " + Arrays.toString(cfg.getFailoverSpi()));
             log.debug("Grid load balancing SPI : " + Arrays.toString(cfg.getLoadBalancingSpi()));
-            log.debug("Grid authentication SPI : " + cfg.getAuthenticationSpi());
             log.debug("Grid secure session SPI : " + cfg.getSecureSessionSpi());
             log.debug("Grid swap space SPI     : " + cfg.getSwapSpaceSpi());
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 8040f2c..5a21769 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -34,8 +34,6 @@ import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.mxbean.*;
 import org.apache.ignite.plugin.segmentation.*;
 import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.authentication.*;
-import org.apache.ignite.spi.authentication.noop.*;
 import org.apache.ignite.spi.checkpoint.*;
 import org.apache.ignite.spi.checkpoint.noop.*;
 import org.apache.ignite.spi.collision.*;
@@ -1449,7 +1447,6 @@ public class IgnitionEx {
             DiscoverySpi discoSpi = cfg.getDiscoverySpi();
             EventStorageSpi evtSpi = cfg.getEventStorageSpi();
             CollisionSpi colSpi = cfg.getCollisionSpi();
-            AuthenticationSpi authSpi = cfg.getAuthenticationSpi();
             SecureSessionSpi sesSpi = cfg.getSecureSessionSpi();
             DeploymentSpi deploySpi = cfg.getDeploymentSpi();
             CheckpointSpi[] cpSpi = cfg.getCheckpointSpi();
@@ -1612,9 +1609,6 @@ public class IgnitionEx {
             if (colSpi == null)
                 colSpi = new NoopCollisionSpi();
 
-            if (authSpi == null)
-                authSpi = new NoopAuthenticationSpi();
-
             if (sesSpi == null)
                 sesSpi = new NoopSecureSessionSpi();
 
@@ -1655,7 +1649,6 @@ public class IgnitionEx {
             myCfg.setDiscoverySpi(discoSpi);
             myCfg.setCheckpointSpi(cpSpi);
             myCfg.setEventStorageSpi(evtSpi);
-            myCfg.setAuthenticationSpi(authSpi);
             myCfg.setSecureSessionSpi(sesSpi);
             myCfg.setDeploymentSpi(deploySpi);
             myCfg.setFailoverSpi(failSpi);
@@ -1829,7 +1822,6 @@ public class IgnitionEx {
                 ensureMultiInstanceSupport(evtSpi);
                 ensureMultiInstanceSupport(colSpi);
                 ensureMultiInstanceSupport(failSpi);
-                ensureMultiInstanceSupport(authSpi);
                 ensureMultiInstanceSupport(sesSpi);
                 ensureMultiInstanceSupport(loadBalancingSpi);
                 ensureMultiInstanceSupport(swapspaceSpi);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
index 8a91c05..a9e5df6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/security/GridSecurityProcessor.java
@@ -31,7 +31,7 @@ import java.util.*;
  */
 public interface GridSecurityProcessor extends GridProcessor {
     /**
-     * Authenticates grid node with it's attributes via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
+     * Authenticates grid node with it's attributes via underlying AuthenticationSpi.
      *
      * @param node Node id to authenticate.
      * @param cred Security credentials.
@@ -48,7 +48,7 @@ public interface GridSecurityProcessor extends GridProcessor {
     public boolean isGlobalNodeAuthentication();
 
     /**
-     * Authenticates subject via underlying {@link org.apache.ignite.spi.authentication.AuthenticationSpi}s.
+     * Authenticates subject via underlying AuthenticationSpi.
      *
      * @param ctx Authentication context.
      * @return {@code True} if succeeded, {@code false} otherwise.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSpisConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSpisConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSpisConfiguration.java
index a0da10d..d9525bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSpisConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorSpisConfiguration.java
@@ -147,7 +147,6 @@ public class VisorSpisConfiguration implements Serializable {
         cfg.communicationSpi(collectSpiInfo(c.getCommunicationSpi()));
         cfg.eventStorageSpi(collectSpiInfo(c.getEventStorageSpi()));
         cfg.collisionSpi(collectSpiInfo(c.getCollisionSpi()));
-        cfg.authenticationSpi(collectSpiInfo(c.getAuthenticationSpi()));
         cfg.secureSessionSpi(collectSpiInfo(c.getSecureSessionSpi()));
         cfg.deploymentSpi(collectSpiInfo(c.getDeploymentSpi()));
         cfg.checkpointSpis(collectSpiInfo(c.getCheckpointSpi()));

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
index 9c9f973..10eb021 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
@@ -328,13 +328,6 @@ public interface IgniteMXBean {
     @MXBeanDescription("Formatted instance of fully configured load balancing SPI implementations.")
     public String getLoadBalancingSpiFormatted();
 
-    /**
-     * Gets a formatted instance of fully configured authentication SPI implementation.
-     *
-     * @return Grid authentication SPI implementation.
-     */
-    @MXBeanDescription("Formatted instance of fully configured authentication SPI implementation.")
-    public String getAuthenticationSpiFormatted();
 
     /**
      * Gets a formatted instance of fully configured secure session SPI implementation.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/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 c4518e6..a57b319 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
@@ -28,8 +28,6 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.plugin.security.*;
 import org.apache.ignite.resources.*;
-import org.apache.ignite.spi.authentication.*;
-import org.apache.ignite.spi.securesession.*;
 import org.apache.ignite.spi.swapspace.*;
 import org.jetbrains.annotations.*;
 
@@ -135,13 +133,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
         this.spiCtx = spiCtx;
 
-        // Always run consistency check for security SPIs.
-        final boolean secSpi = AuthenticationSpi.class.isAssignableFrom(getClass()) ||
-            SecureSessionSpi.class.isAssignableFrom(getClass());
-
-        final boolean check = secSpi || !Boolean.getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
-
-        if (check) {
+        if (!Boolean.getBoolean(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK)) {
             spiCtx.addLocalEventListener(paramsLsnr = new GridLocalEventListener() {
                 @Override public void onEvent(Event evt) {
                     assert evt instanceof DiscoveryEvent : "Invalid event [expected=" + EVT_NODE_JOINED
+
@@ -151,7 +143,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
                     if (node != null)
                         try {
-                            checkConfigurationConsistency(spiCtx, node, false, !secSpi);
+                            checkConfigurationConsistency(spiCtx, node, false);
                             checkConfigurationConsistency0(spiCtx, node, false);
                         }
                         catch (IgniteSpiException e) {
@@ -164,7 +156,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
             final Collection<ClusterNode> remotes = F.concat(false, spiCtx.remoteNodes(),
spiCtx.remoteDaemonNodes());
 
             for (ClusterNode node : remotes) {
-                checkConfigurationConsistency(spiCtx, node, true, !secSpi);
+                checkConfigurationConsistency(spiCtx, node, true);
                 checkConfigurationConsistency0(spiCtx, node, true);
             }
         }
@@ -280,27 +272,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
         return "Using parameter [" + name + '=' + val + ']';
     }
 
-    /**
-     * @param msg Error message.
-     * @param locVal Local node value.
-     * @return Error text.
-     */
-    private static String format(String msg, Object locVal) {
-        return msg + U.nl() +
-            ">>> => Local node:  " + locVal + U.nl();
-    }
 
-    /**
-     * @param msg Error message.
-     * @param locVal Local node value.
-     * @param rmtVal Remote node value.
-     * @return Error text.
-     */
-    private static String format(String msg, Object locVal, Object rmtVal) {
-        return msg + U.nl() +
-            ">>> => Local node:  " + locVal + U.nl() +
-            ">>> => Remote node: " + rmtVal + U.nl();
-    }
 
     /**
      * Registers SPI MBean. Note that SPI can only register one MBean.
@@ -354,14 +326,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
         }
     }
 
-    /**
-     * @return {@code true} if this check is optional.
-     */
-    private boolean checkOptional() {
-        IgniteSpiConsistencyChecked ann = U.getAnnotation(getClass(), IgniteSpiConsistencyChecked.class);
 
-        return ann != null && ann.optional();
-    }
 
     /**
      * @return {@code true} if this check is optional.
@@ -373,13 +338,6 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
     }
 
     /**
-     * @return {@code true} if this check is enabled.
-     */
-    private boolean checkEnabled() {
-        return U.getAnnotation(getClass(), IgniteSpiConsistencyChecked.class) != null;
-    }
-
-    /**
      * Method which is called in the end of checkConfigurationConsistency() method. May be
overriden in SPIs.
      *
      * @param spiCtx SPI context.
@@ -401,7 +359,7 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
      * @throws IgniteSpiException If check fatally failed.
      */
     @SuppressWarnings("IfMayBeConditional")
-    private void checkConfigurationConsistency(IgniteSpiContext spiCtx, ClusterNode node,
boolean starting, boolean tip)
+    private void checkConfigurationConsistency(IgniteSpiContext spiCtx, ClusterNode node,
boolean starting)
         throws IgniteSpiException {
         assert spiCtx != null;
         assert node != null;
@@ -412,101 +370,6 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
 
             return;
         }
-
-        /*
-         * Optional SPI means that we should not print warning if SPIs are different but
-         * still need to compare attributes if SPIs are the same.
-         */
-        boolean optional = checkOptional();
-        boolean enabled = checkEnabled();
-
-        if (!enabled)
-            return;
-
-        String clsAttr = createSpiAttributeName(IgniteNodeAttributes.ATTR_SPI_CLASS);
-
-        String name = getName();
-
-        SB sb = new SB();
-
-        /*
-         * If there are any attributes do compare class and version
-         * (do not print warning for the optional SPIs).
-         */
-
-        /* Check SPI class and version. */
-        String locCls = spiCtx.localNode().attribute(clsAttr);
-        String rmtCls = node.attribute(clsAttr);
-
-        assert locCls != null : "Local SPI class name attribute not found: " + clsAttr;
-
-        boolean isSpiConsistent = false;
-
-        String tipStr = tip ? " (fix configuration or set " +
-            "-D" + IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK + "=true system property)"
: "";
-
-        if (rmtCls == null) {
-            if (!optional && starting)
-                throw new IgniteSpiException("Remote SPI with the same name is not configured"
+ tipStr + " [name=" + name +
-                    ", loc=" + locCls + ']');
-
-            sb.a(format(">>> Remote SPI with the same name is not configured: "
+ name, locCls));
-        }
-        else if (!locCls.equals(rmtCls)) {
-            if (!optional && starting)
-                throw new IgniteSpiException("Remote SPI with the same name is of different
type" + tipStr + " [name=" + name +
-                    ", loc=" + locCls + ", rmt=" + rmtCls + ']');
-
-            sb.a(format(">>> Remote SPI with the same name is of different type:
" + name, locCls, rmtCls));
-        }
-        else
-            isSpiConsistent = true;
-
-        if (optional && !isSpiConsistent)
-            return;
-
-        // It makes no sense to compare inconsistent SPIs attributes.
-        if (isSpiConsistent) {
-            List<String> attrs = getConsistentAttributeNames();
-
-            // Process all SPI specific attributes.
-            for (String attr : attrs) {
-                // Ignore class and version attributes processed above.
-                if (!attr.equals(clsAttr)) {
-                    // This check is considered as optional if no attributes
-                    Object rmtVal = node.attribute(attr);
-                    Object locVal = spiCtx.localNode().attribute(attr);
-
-                    if (locVal == null && rmtVal == null)
-                        continue;
-
-                    if (locVal == null || rmtVal == null || !locVal.equals(rmtVal))
-                        sb.a(format(">>> Remote node has different " + getName()
+ " SPI attribute " +
-                            attr, locVal, rmtVal));
-                }
-            }
-        }
-
-        if (sb.length() > 0) {
-            String msg;
-
-            if (starting)
-                msg = U.nl() + U.nl() +
-                    ">>> +--------------------------------------------------------------------+"
+ U.nl() +
-                    ">>> + Courtesy notice that starting node has inconsistent configuration.
+" + U.nl() +
-                    ">>> + Ignore this message if you are sure that this is done
on purpose.  +" + U.nl() +
-                    ">>> +--------------------------------------------------------------------+"
+ U.nl() +
-                    ">>> Remote Node ID: " + node.id().toString().toUpperCase()
+ U.nl() + sb;
-            else
-                msg = U.nl() + U.nl() +
-                    ">>> +-------------------------------------------------------------------+"
+ U.nl() +
-                    ">>> + Courtesy notice that joining node has inconsistent configuration.
+" + U.nl() +
-                    ">>> + Ignore this message if you are sure that this is done
on purpose. +" + U.nl() +
-                    ">>> +-------------------------------------------------------------------+"
+ U.nl() +
-                    ">>> Remote Node ID: " + node.id().toString().toUpperCase()
+ U.nl() + sb;
-
-            U.courtesy(log, msg);
-        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/spi/authentication/AuthenticationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/authentication/AuthenticationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/authentication/AuthenticationSpi.java
deleted file mode 100644
index ec71d84..0000000
--- a/modules/core/src/main/java/org/apache/ignite/spi/authentication/AuthenticationSpi.java
+++ /dev/null
@@ -1,90 +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.spi.authentication;
-
-import org.apache.ignite.plugin.security.*;
-import org.apache.ignite.spi.*;
-
-/**
- * Authentication SPI used for authenticating grid nodes and remote clients. This SPI
- * supports only {@code authentication} and does not provide any {@code authorization}
- * functionality.
- * <p>
- * The default authentication SPI is {@link org.apache.ignite.spi.authentication.noop.NoopAuthenticationSpi}
- * which permits any request.
- * <p>
- * Ignite provides the following {@code GridAuthenticationSpi} implementations:
- * <ul>
- * <li>
- *     {@link org.apache.ignite.spi.authentication.noop.NoopAuthenticationSpi} - permits
any request.
- * </li>
- * <li>
- *     {@code GridPasscodeAuthenticationSpi} -
- *     validates authentication with passcode phrase.
- * </li>
- * <li>
- *     {@code GridJaasAuthenticationSpi} -
- *     validates authentication with JAAS Java extension.
- * </li>
- * </ul>
- * <p>
- * <b>NOTE:</b> multiple authentication SPIs may be started on the same grid
node. In this case
- * Ignite will differentiate between them based on {@link #supported(GridSecuritySubjectType)}
- * value. The first SPI which returns {@code true} for a given subject type will be used
for
- * authentication.
- * <p>
- * <b>NOTE:</b> this SPI (i.e. methods in this interface) should never be used
directly. SPIs provide
- * internal view on the subsystem and is used internally by Ignite kernal. In rare use cases
when
- * access to a specific implementation of this SPI is required - an instance of this SPI
can be obtained
- * via {@link org.apache.ignite.Ignite#configuration()} method to check its configuration
properties or call other non-SPI
- * methods. Note again that calling methods from this interface on the obtained instance
can lead
- * to undefined behavior and explicitly not supported.
- */
-@IgniteSpiConsistencyChecked(optional = false, checkDaemon = true)
-public interface AuthenticationSpi extends IgniteSpi {
-    /**
-     * Checks if given subject is supported by this SPI. If not, then next authentication
SPI
-     * in the list will be checked.
-     *
-     * @param subjType Subject type.
-     * @return {@code True} if subject type is supported, {@code false} otherwise.
-     */
-    public boolean supported(GridSecuritySubjectType subjType);
-
-    /**
-     * Authenticates a given subject (either node or remote client).
-     *
-     * @param authCtx Authentication context. Contains all necessary information required
to authenticate
-     *      the subject.
-     * @return Authenticated subject context or {@code null} if authentication did not pass.
-     * @throws org.apache.ignite.spi.IgniteSpiException If authentication resulted in system
error.
-     *      Note that bad credentials should not cause this exception.
-     */
-    public GridSecuritySubject authenticate(AuthenticationContext authCtx) throws IgniteSpiException;
-
-    /**
-     * Flag indicating whether node authentication should be run on coordinator only or on
all nodes
-     * in current topology.
-     *
-     * @return {@code True} if all nodes in topology should authenticate joining node. In
this case security
-     *      permissions will be validated to be the same on all nodes. In case if permissions
differ, node will
-     *      not be able to join the topology. If this method returns {@code false}, only
coordinator node will
-     *      authenticate joining node.
-     */
-    public boolean isGlobalNodeAuthentication();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/98e41f15/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpi.java
deleted file mode 100644
index eacc26a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/spi/authentication/noop/NoopAuthenticationSpi.java
+++ /dev/null
@@ -1,127 +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.spi.authentication.noop;
-
-import org.apache.ignite.*;
-import org.apache.ignite.internal.managers.security.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.security.*;
-import org.apache.ignite.resources.*;
-import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.authentication.*;
-
-/**
- * Default implementation of the authentication SPI which permits any request.
- * <p>
- * <h1 class="header">Configuration</h1>
- * <h2 class="header">Mandatory</h2>
- * This SPI has no mandatory configuration parameters.
- * <h2 class="header">Optional</h2>
- * This SPI has no optional configuration parameters.
- * <h2 class="header">Java Example</h2>
- * GridNoopAuthenticationSpi is used by default and has no parameters to be explicitly configured.
- * <pre name="code" class="java">
- * GridNoopAuthenticationSpi authSpi = new GridNoopAuthenticationSpi();
- *
- * GridConfiguration cfg = new GridConfiguration();
- *
- * // Override default authentication SPI.
- * cfg.setAuthenticationSpi(authSpi);
- *
- * // Start grid.
- * Ignition.start(cfg);
- * </pre>
- * <h2 class="header">Spring Example</h2>
- * GridNoopAuthenticationSpi can be configured from Spring XML configuration file:
- * <pre name="code" class="xml">
- * &lt;bean id="grid.custom.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"
singleton="true"&gt;
- *         ...
- *         &lt;property name="authenticationSpi"&gt;
- *             &lt;bean class="org.apache.ignite.spi.authentication.noop.NoopAuthenticationSpi"/&gt;
- *         &lt;/property&gt;
- *         ...
- * &lt;/bean&gt;
- * </pre>
- * <p>
- * <img src="http://www.gridgain.com/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
- */
-@IgniteSpiNoop
-@IgniteSpiMultipleInstancesSupport(true)
-public class NoopAuthenticationSpi extends IgniteSpiAdapter
-    implements AuthenticationSpi, NoopAuthenticationSpiMBean {
-    /** Injected grid logger. */
-    @LoggerResource
-    @GridToStringExclude
-    private IgniteLogger log;
-
-    /** Always allow permission set. */
-    private static final GridSecurityPermissionSet allowAll = new GridAllowAllPermissionSet();
-
-    /** {@inheritDoc} */
-    @Override public boolean supported(GridSecuritySubjectType subjType) {
-        // If this SPI is configured, then authentication is disabled.
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridSecuritySubject authenticate(AuthenticationContext authCtx) throws
IgniteSpiException {
-        GridSecuritySubjectAdapter subj = new GridSecuritySubjectAdapter(authCtx.subjectType(),
authCtx.subjectId());
-
-        subj.address(authCtx.address());
-        subj.permissions(allowAll);
-
-        if (authCtx.credentials() != null)
-            subj.login(authCtx.credentials().getLogin());
-
-        return subj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isGlobalNodeAuthentication() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void spiStart(String gridName) throws IgniteSpiException {
-        // Start SPI start stopwatch.
-        startStopwatch();
-
-        registerMBean(gridName, this, NoopAuthenticationSpiMBean.class);
-
-        // Ack ok start.
-        if (log.isDebugEnabled())
-            log.debug(startInfo());
-    }
-
-    /** {@inheritDoc} */
-    @Override public void spiStop() throws IgniteSpiException {
-        unregisterMBean();
-
-        // Ack ok stop.
-        if (log.isDebugEnabled())
-            log.debug(stopInfo());
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(NoopAuthenticationSpi.class, this);
-    }
-}


Mime
View raw message