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: move AuthorizationEvent to enterprise.
Date Fri, 13 Feb 2015 09:46:29 GMT
#ignite-189: move AuthorizationEvent to enterprise.


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

Branch: refs/heads/ignite-189
Commit: f297514933565ff18e893b288cf06c28b0182411
Parents: 0ca50cd
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Feb 13 12:46:10 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Feb 13 12:46:10 2015 +0300

----------------------------------------------------------------------
 .../ignite/events/AuthorizationEvent.java       | 146 -------------------
 .../org/apache/ignite/events/EventType.java     |  40 -----
 .../event/VisorGridAuthorizationEvent.java      |   2 +-
 .../node/VisorNodeEventsCollectorTask.java      |   8 +-
 .../internal/visor/util/VisorTaskUtils.java     |  10 +-
 .../optimized/optimized-classnames.properties   |   1 -
 .../commands/events/VisorEventsCommand.scala    |   2 -
 7 files changed, 3 insertions(+), 206 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/events/AuthorizationEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/AuthorizationEvent.java b/modules/core/src/main/java/org/apache/ignite/events/AuthorizationEvent.java
deleted file mode 100644
index f776040..0000000
--- a/modules/core/src/main/java/org/apache/ignite/events/AuthorizationEvent.java
+++ /dev/null
@@ -1,146 +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.events;
-
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.security.*;
-
-/**
- * Grid authorization event.
- * <p>
- * Grid events are used for notification about what happens within the grid. Note that by
- * design Ignite keeps all events generated on the local node locally and it provides
- * APIs for performing a distributed queries across multiple nodes:
- * <ul>
- *      <li>
- *          {@link org.apache.ignite.IgniteEvents#remoteQuery(org.apache.ignite.lang.IgnitePredicate,
long, int...)} -
- *          asynchronously querying events occurred on the nodes specified, including remote
nodes.
- *      </li>
- *      <li>
- *          {@link org.apache.ignite.IgniteEvents#localQuery(org.apache.ignite.lang.IgnitePredicate,
int...)} -
- *          querying only local events stored on this local node.
- *      </li>
- *      <li>
- *          {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate,
int...)} -
- *          listening to local grid events (events from remote nodes not included).
- *      </li>
- * </ul>
- * User can also wait for events using method {@link org.apache.ignite.IgniteEvents#waitForLocal(org.apache.ignite.lang.IgnitePredicate,
int...)}.
- * <h1 class="header">Events and Performance</h1>
- * It is <b>highly recommended</b> to enable only those events that your application
logic requires
- * by using {@link org.apache.ignite.configuration.IgniteConfiguration#getIncludeEventTypes()}
method in Ignite configuration. Note that certain
- * events are required for Ignite's internal operations and such events will still be generated
but not stored by
- * event storage SPI if they are disabled in Ignite configuration.
- * @see EventType#EVT_AUTHORIZATION_FAILED
- * @see EventType#EVT_AUTHORIZATION_SUCCEEDED
- */
-public class AuthorizationEvent extends EventAdapter {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Requested operation. */
-    private GridSecurityPermission op;
-
-    /** Authenticated subject authorized to perform operation. */
-    private GridSecuritySubject subj;
-
-    /** {@inheritDoc} */
-    @Override public String shortDisplay() {
-        return name() + ": op=" + op;
-    }
-
-    /**
-     * No-arg constructor.
-     */
-    public AuthorizationEvent() {
-        // No-op.
-    }
-
-    /**
-     * Creates authorization event with given parameters.
-     *
-     * @param msg Optional message.
-     * @param type Event type.
-     */
-    public AuthorizationEvent(ClusterNode node, String msg, int type) {
-        super(node, msg, type);
-    }
-
-    /**
-     * Creates authorization event with given parameters.
-     *
-     * @param node Node.
-     * @param msg Optional message.
-     * @param type Event type.
-     * @param op Requested operation.
-     * @param subj Authenticated subject.
-     */
-    public AuthorizationEvent(ClusterNode node, String msg, int type, GridSecurityPermission
op,
-        GridSecuritySubject subj) {
-        super(node, msg, type);
-
-        this.op = op;
-        this.subj = subj;
-    }
-
-    /**
-     * Gets requested operation.
-     *
-     * @return Requested operation.
-     */
-    public GridSecurityPermission operation() {
-        return op;
-    }
-
-    /**
-     * Sets requested operation.
-     *
-     * @param op Requested operation.
-     */
-    public void operation(GridSecurityPermission op) {
-        this.op = op;
-    }
-
-    /**
-     * Gets authenticated subject.
-     *
-     * @return Authenticated subject.
-     */
-    public GridSecuritySubject subject() {
-        return subj;
-    }
-
-    /**
-     * Sets authenticated subject.
-     *
-     * @param subj Authenticated subject.
-     */
-    public void subject(GridSecuritySubject subj) {
-        this.subj = subj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(AuthorizationEvent.class, this,
-            "nodeId8", U.id8(node().id()),
-            "msg", message(),
-            "type", name(),
-            "tstamp", timestamp());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/events/EventType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/EventType.java b/modules/core/src/main/java/org/apache/ignite/events/EventType.java
index 8669c95..2910ac1 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/EventType.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/EventType.java
@@ -770,34 +770,6 @@ public interface EventType {
     public static final int EVT_GGFS_FILE_PURGED = 127;
 
     /**
-     * Built-in event type: authorization succeed.
-     * <p>
-     * Authorization procedure succeed. This event is triggered every time
-     * an authorization procedure finished without exception.
-     * <p>
-     * NOTE: all types in range <b>from 1 to 1000 are reserved</b> for
-     * internal Ignite events and should not be used by user-defined events.
-     *
-     * @see AuthorizationEvent
-     */
-    public static final int EVT_AUTHORIZATION_SUCCEEDED = 128;
-
-    /**
-     * Built-in event type: authorization failed.
-     * <p>
-     * Authorization procedure failed. This means that  there was some error event
-     * during authorization procedure and authorization procedure was not successful.
-     * <p>
-     * NOTE: all types in range <b>from 1 to 1000 are reserved</b> for
-     * internal Ignite events and should not be used by user-defined events.
-     *
-     * @see AuthorizationEvent
-     */
-    public static final int EVT_AUTHORIZATION_FAILED = 129;
-
-
-
-    /**
      * All checkpoint events. This array can be directly passed into
      * {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate,
int...)} method to
      * subscribe to all checkpoint events.
@@ -978,18 +950,6 @@ public interface EventType {
     };
 
     /**
-     * All authorization events. This array can be directly passed into
-     * {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate,
int...)} method to
-     * subscribe to all cloud events.
-     *
-     * @see AuthorizationEvent
-     */
-    public static final int[] EVTS_AUTHORIZATION = {
-        EVT_AUTHORIZATION_SUCCEEDED,
-        EVT_AUTHORIZATION_FAILED
-    };
-
-    /**
      * All GGFS events. This array can be directly passed into
      * {@link org.apache.ignite.IgniteEvents#localListen(org.apache.ignite.lang.IgnitePredicate,
int...)} method to
      * subscribe to all cloud events.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridAuthorizationEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridAuthorizationEvent.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridAuthorizationEvent.java
index 864968e..1c44e4d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridAuthorizationEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/event/VisorGridAuthorizationEvent.java
@@ -24,7 +24,7 @@ import org.apache.ignite.plugin.security.*;
 import java.util.*;
 
 /**
- * Lightweight counterpart for {@link org.apache.ignite.events.AuthorizationEvent}.
+ * Lightweight counterpart for AuthorizationEvent.
  */
 public class VisorGridAuthorizationEvent extends VisorGridEvent {
     /** */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java
index 0a54f9d..768bd42 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeEventsCollectorTask.java
@@ -117,7 +117,7 @@ public class VisorNodeEventsCollectorTask extends VisorMultiNodeTask<VisorNodeEv
         public static VisorNodeEventsCollectorTaskArg createTasksArg(@Nullable Long timeArg,
@Nullable String taskName,
             @Nullable IgniteUuid taskSessionId) {
             return new VisorNodeEventsCollectorTaskArg(null,
-                VisorTaskUtils.concat(EVTS_JOB_EXECUTION, EVTS_TASK_EXECUTION, EVTS_AUTHORIZATION),
+                VisorTaskUtils.concat(EVTS_JOB_EXECUTION, EVTS_TASK_EXECUTION),
                 timeArg, taskName, taskSessionId);
         }
 
@@ -319,12 +319,6 @@ public class VisorNodeEventsCollectorTask extends VisorMultiNodeTask<VisorNodeEv
                     res.add(new VisorGridDiscoveryEvent(tid, id, name, nid, t, msg, shortDisplay,
                         node.id(), addr, node.isDaemon()));
                 }
-                else if (e instanceof AuthorizationEvent) {
-                    AuthorizationEvent ae = (AuthorizationEvent)e;
-
-                    res.add(new VisorGridAuthorizationEvent(tid, id, name, nid, t, msg, shortDisplay,
ae.operation(),
-                        ae.subject()));
-                }
                 else
                     res.add(new VisorGridEvent(tid, id, name, nid, t, msg, shortDisplay));
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
index dedee7f..db7fe47 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorTaskUtils.java
@@ -85,9 +85,7 @@ public class VisorTaskUtils {
     /** Only non task event types that Visor should collect. */
     private static final int[] VISOR_NON_TASK_EVTS = {
         EVT_CLASS_DEPLOY_FAILED,
-        EVT_TASK_DEPLOY_FAILED,
-
-        EVT_AUTHORIZATION_FAILED
+        EVT_TASK_DEPLOY_FAILED
     };
 
     /** Only non task event types that Visor should collect. */
@@ -416,12 +414,6 @@ public class VisorTaskUtils {
 
                 res.add(new VisorGridDeploymentEvent(tid, id, name, nid, t, msg, shortDisplay,
de.alias()));
             }
-            else if (e instanceof AuthorizationEvent) {
-                AuthorizationEvent ae = (AuthorizationEvent)e;
-
-                res.add(new VisorGridAuthorizationEvent(tid, id, name, nid, t, msg, shortDisplay,
ae.operation(),
-                    ae.subject()));
-            }
         }
 
         return res;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
index 101020f..020c08f 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/optimized-classnames.properties
@@ -130,7 +130,6 @@ org.apache.ignite.compute.gridify.aop.GridifyDefaultTask
 org.apache.ignite.compute.gridify.aop.spring.GridifySpringPointcut$GridifySpringPointcutType
 org.apache.ignite.configuration.DeploymentMode
 org.apache.ignite.configuration.TransactionConfiguration
-org.apache.ignite.events.AuthorizationEvent
 org.apache.ignite.events.CacheEvent
 org.apache.ignite.events.CachePreloadingEvent
 org.apache.ignite.events.CacheQueryExecutedEvent

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f2975149/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/VisorEventsCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/VisorEventsCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/VisorEventsCommand.scala
index d88711a..a928160 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/VisorEventsCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/events/VisorEventsCommand.scala
@@ -165,7 +165,6 @@ class VisorEventsCommand {
                 case "cp" => arr ++= EVTS_CACHE_PRELOAD.toList
                 case "sw" => arr ++= EVTS_SWAPSPACE.toList
                 case "di" => arr ++= EVTS_DISCOVERY.toList
-                case "az" => arr ++= EVTS_AUTHORIZATION.toList
                 case t => throw new IllegalArgumentException("Unknown event type: " +
t)
             }
 
@@ -190,7 +189,6 @@ class VisorEventsCommand {
             case t if EVTS_CACHE.contains(t) => "ca"
             case t if EVTS_SWAPSPACE.contains(t) => "sw"
             case t if EVTS_CACHE_PRELOAD.contains(t) => "cp"
-            case t if EVTS_AUTHORIZATION.contains(t) => "az"
         }
     }
 


Mime
View raw message