ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptupit...@apache.org
Subject [2/3] ignite git commit: Fixing naming
Date Wed, 14 Sep 2016 10:08:30 GMT
Fixing naming


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

Branch: refs/heads/ignite-3199-1
Commit: 101a0c40b9e82d2d76e0eb6e6bb2dc5027280274
Parents: b28aea9
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Wed Sep 14 13:07:00 2016 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Wed Sep 14 13:07:00 2016 +0300

----------------------------------------------------------------------
 .../PlatformDotNetSessionCacheExtension1.java   | 144 ++++++++++
 .../websession/PlatformDotNetSessionData1.java  | 273 +++++++++++++++++++
 .../PlatformDotNetSessionLockProcessor1.java    |  84 ++++++
 .../PlatformDotNetSessionLockResult1.java       |  99 +++++++
 ...formDotNetSessionSetAndUnlockProcessor1.java | 179 ++++++++++++
 .../PlatformDotnetSessionCacheExtension.java    | 144 ----------
 .../websession/PlatformDotnetSessionData.java   | 273 -------------------
 .../PlatformDotnetSessionLockProcessor.java     |  84 ------
 .../PlatformDotnetSessionLockResult.java        |  99 -------
 ...tformDotnetSessionSetAndUnlockProcessor.java | 179 ------------
 10 files changed, 779 insertions(+), 779 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionCacheExtension1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionCacheExtension1.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionCacheExtension1.java
new file mode 100644
index 0000000..aa5f69f
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionCacheExtension1.java
@@ -0,0 +1,144 @@
+/*
+ * 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.internal.processors.platform.websession;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.binary.BinaryRawWriterEx;
+import org.apache.ignite.internal.processors.platform.cache.PlatformCache;
+import org.apache.ignite.internal.processors.platform.cache.PlatformCacheExtension;
+import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
+import org.apache.ignite.internal.processors.platform.utils.PlatformWriterClosure;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+import java.sql.Timestamp;
+import java.util.UUID;
+
+/**
+ * Custom entry processor invoker.
+ */
+public class PlatformDotNetSessionCacheExtension implements PlatformCacheExtension {
+    /** Extension ID. */
+    private static final int EXT_ID = 0;
+
+    /** Operation: session lock. */
+    private static final int OP_LOCK = 1;
+
+    /** Operation: session set/unlock. */
+    private static final int OP_SET_AND_UNLOCK = 2;
+
+    /** Operation: session get without lock. */
+    private static final int OP_GET = 3;
+
+    /** Operation: session put without lock. */
+    private static final int OP_PUT = 4;
+
+    /** Operation: session remove without lock. */
+    private static final int OP_REMOVE = 5;
+
+    /** {@inheritDoc} */
+    @Override public int id() {
+        return EXT_ID;
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override public long processInOutStreamLong(PlatformCache target, int type, BinaryRawReaderEx reader,
+        PlatformMemory mem) throws IgniteCheckedException {
+        switch (type) {
+            case OP_LOCK: {
+                String key = reader.readString();
+                UUID lockNodeId = reader.readUuid();
+                long lockId = reader.readLong();
+                Timestamp lockTime = reader.readTimestamp();
+
+                final PlatformDotNetSessionLockResult res = (PlatformDotNetSessionLockResult)
+                    target.rawCache().invoke(key, new PlatformDotNetSessionLockProcessor(lockNodeId, lockId, lockTime));
+
+                return target.writeResult(mem, res, new PlatformWriterClosure() {
+                    @Override public void write(BinaryRawWriterEx writer, Object val) {
+                        res.writeBinary(writer);
+                    }
+                });
+            }
+
+            case OP_SET_AND_UNLOCK: {
+                String key = reader.readString();
+
+                PlatformDotNetSessionSetAndUnlockProcessor proc;
+
+                if (reader.readBoolean()) {
+                    PlatformDotNetSessionData data = new PlatformDotNetSessionData();
+
+                    data.readBinary(reader);
+
+                    proc = new PlatformDotNetSessionSetAndUnlockProcessor(data);
+                }
+                else {
+                    UUID lockNodeId = reader.readUuid();
+                    long lockId = reader.readLong();
+
+                    proc = new PlatformDotNetSessionSetAndUnlockProcessor(lockNodeId, lockId);
+                }
+
+                target.rawCache().invoke(key, proc);
+
+                return target.writeResult(mem, null);
+            }
+
+            case OP_GET: {
+                String key = reader.readString();
+
+                final PlatformDotNetSessionData data = (PlatformDotNetSessionData)target.rawCache().get(key);
+
+                return target.writeResult(mem, data, new PlatformWriterClosure() {
+                    @Override public void write(BinaryRawWriterEx writer, Object val) {
+                        data.writeBinary(writer);
+                    }
+                });
+            }
+
+            case OP_PUT: {
+                String key = reader.readString();
+
+                PlatformDotNetSessionData data = new PlatformDotNetSessionData();
+
+                data.readBinary(reader);
+
+                target.rawCache().put(key, data);
+
+                return target.writeResult(mem, null);
+            }
+
+            case OP_REMOVE: {
+                String key = reader.readString();
+
+                target.rawCache().remove(key);
+
+                return target.writeResult(mem, null);
+            }
+        }
+
+        throw new IgniteCheckedException("Unsupported operation type: " + type);
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PlatformDotNetSessionCacheExtension.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData1.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData1.java
new file mode 100644
index 0000000..9aef02e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionData1.java
@@ -0,0 +1,273 @@
+/*
+ * 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.internal.processors.platform.websession;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.util.tostring.GridToStringExclude;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+import java.sql.Timestamp;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.UUID;
+
+/**
+ * Web session state data.
+ */
+@SuppressWarnings({"ReturnOfDateField", "AssignmentToDateFieldFromParameter"})
+public class PlatformDotNetSessionData implements Binarylizable {
+    /** Items. */
+    private Map<String, byte[]> items;
+
+    /** Diff flag. */
+    private boolean isDiff;
+
+    /** Static objects. */
+    @GridToStringExclude
+    private byte[] staticObjects;
+
+    /** Timeout. */
+    private int timeout;
+
+    /** Lock ID. */
+    private long lockId;
+
+    /** Lock node ID. */
+    private UUID lockNodeId;
+
+    /** Lock time. */
+    private Timestamp lockTime;
+
+    /**
+     * @return Items.
+     */
+    public Map<String, byte[]> items() {
+        return items;
+    }
+
+    /**
+     * @return Diff flag.
+     */
+    public boolean isDiff() {
+        return isDiff;
+    }
+
+    /**
+     * @return Static objects.
+     */
+    public byte[] staticObjects() {
+        return staticObjects;
+    }
+
+    /**
+     * @return Timeout.
+     */
+    public int timeout() {
+        return timeout;
+    }
+
+    /**
+     * @return Lock ID.
+     */
+    public long lockId() {
+        return lockId;
+    }
+
+    /**
+     * @return Lock node ID.
+     */
+    public UUID lockNodeId() {
+        return lockNodeId;
+    }
+
+    /**
+     * @return Lock time.
+     */
+    public Timestamp lockTime() {
+        return lockTime;
+    }
+
+    /**
+     * @return {@code True} if locked.
+     */
+    public boolean isLocked() {
+        return lockTime != null;
+    }
+
+    /**
+     * Locks the session state data.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     * @param lockTime Lock time.
+     *
+     * @return Unlocked data copy.
+     */
+    public PlatformDotNetSessionData lock(UUID lockNodeId, long lockId, Timestamp lockTime) {
+        assert !isLocked();
+
+        PlatformDotNetSessionData res = copyWithoutLockInfo();
+
+        res.lockId = lockId;
+        res.lockNodeId = lockNodeId;
+        res.lockTime = lockTime;
+
+        return res;
+    }
+
+    /**
+     * Unlocks the session state data.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     *
+     * @return Unlocked data copy.
+     */
+    public PlatformDotNetSessionData unlock(UUID lockNodeId, long lockId) {
+        assert isLocked();
+
+        if (!this.lockNodeId.equals(lockNodeId))
+            throw new IllegalStateException("Can not unlock session data: lock node id check failed.");
+
+        if (this.lockId != lockId)
+            throw new IllegalStateException("Can not unlock session data: lock id check failed.");
+
+        return copyWithoutLockInfo();
+    }
+
+    /**
+     * Update session state and release the lock.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     * @param items Items.
+     * @param isDiff Diff flag.
+     * @param staticObjects Static objects.
+     * @param timeout Timeout.
+     * @return Result.
+     */
+    public PlatformDotNetSessionData updateAndUnlock(UUID lockNodeId, long lockId, Map<String, byte[]> items,
+        boolean isDiff, byte[] staticObjects, int timeout) {
+        assert items != null;
+
+        PlatformDotNetSessionData res = unlock(lockNodeId, lockId);
+
+        if (!isDiff) {
+            // Not a diff: remove all
+            this.items.clear();
+        }
+
+        for (Map.Entry<String, byte[]> e : items.entrySet()) {
+            String key = e.getKey();
+            byte[] value = e.getValue();
+
+            if (value != null)
+                this.items.put(key, value);
+            else
+                this.items.remove(key);   // Null value indicates removed key.
+        }
+
+        res.staticObjects = staticObjects;
+        res.timeout = timeout;
+
+        return res;
+    }
+
+    /**
+     * Gets a copy of this instance with non-lock properties set.
+     *
+     * @return Copied state data.
+     */
+    private PlatformDotNetSessionData copyWithoutLockInfo() {
+        PlatformDotNetSessionData res = new PlatformDotNetSessionData();
+
+        res.staticObjects = staticObjects;
+        res.items = items;
+        res.timeout = timeout;
+        res.isDiff = isDiff;
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+        BinaryRawWriter raw = writer.rawWriter();
+
+        writeBinary(raw);
+    }
+
+    /**
+     * Writes to a binary writer.
+     *
+     * @param writer Binary writer.
+     */
+    public void writeBinary(BinaryRawWriter writer) {
+        writer.writeBoolean(isDiff);
+        writer.writeInt(items.size());
+
+        for (Map.Entry<String, byte[]> e : items.entrySet()) {
+            writer.writeString(e.getKey());
+            writer.writeByteArray(e.getValue());
+        }
+
+        writer.writeByteArray(staticObjects);
+
+        writer.writeInt(timeout);
+        writer.writeUuid(lockNodeId);
+        writer.writeLong(lockId);
+        writer.writeTimestamp(lockTime);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+        BinaryRawReader raw = reader.rawReader();
+
+        readBinary(raw);
+    }
+
+    /**
+     * Reads from a binary reader.
+     *
+     * @param reader Reader.
+     */
+    public void readBinary(BinaryRawReader reader) {
+        items = new TreeMap<>();
+        isDiff = reader.readBoolean();
+        int count = reader.readInt();
+
+        for (int i = 0; i < count; i++)
+            items.put(reader.readString(), reader.readByteArray());
+
+        staticObjects = reader.readByteArray();
+
+        timeout = reader.readInt();
+        lockNodeId = reader.readUuid();
+        lockId = reader.readLong();
+        lockTime = reader.readTimestamp();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PlatformDotNetSessionData.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockProcessor1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockProcessor1.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockProcessor1.java
new file mode 100644
index 0000000..efa0183
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockProcessor1.java
@@ -0,0 +1,84 @@
+/*
+ * 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.internal.processors.platform.websession;
+
+import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import java.sql.Timestamp;
+import java.util.UUID;
+
+/**
+ * Entry processor that locks web session data.
+ */
+@SuppressWarnings("AssignmentToDateFieldFromParameter")
+public class PlatformDotNetSessionLockProcessor implements CacheEntryProcessor<String, PlatformDotNetSessionData, Object> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Lock node id. */
+    private UUID lockNodeId;
+
+    /** Lock id. */
+    private long lockId;
+
+    /** Lock time. */
+    private Timestamp lockTime;
+
+    /**
+     * Ctor.
+     *
+     * @param lockNodeId Lock node id.
+     * @param lockId Lock id.
+     * @param lockTime Lock time.
+     */
+    public PlatformDotNetSessionLockProcessor(UUID lockNodeId, long lockId, Timestamp lockTime) {
+        this.lockNodeId = lockNodeId;
+        this.lockId = lockId;
+        this.lockTime = lockTime;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object process(MutableEntry<String, PlatformDotNetSessionData> entry, Object... args)
+        throws EntryProcessorException {
+        if (!entry.exists())
+            return null;
+
+        PlatformDotNetSessionData data = entry.getValue();
+
+        assert data != null;
+
+        if (data.isLocked())
+            return new PlatformDotNetSessionLockResult(false, null, data.lockTime());
+
+        // Not locked: lock and return result
+        data = data.lock(lockNodeId, lockId, lockTime);
+
+        // Apply.
+        entry.setValue(data);
+
+        return new PlatformDotNetSessionLockResult(true, data, null);
+    }
+
+    /** {@inheritDoc */
+    @Override public String toString() {
+        return S.toString(PlatformDotNetSessionLockProcessor.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockResult1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockResult1.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockResult1.java
new file mode 100644
index 0000000..17f38fc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionLockResult1.java
@@ -0,0 +1,99 @@
+/*
+ * 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.internal.processors.platform.websession;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+import java.sql.Timestamp;
+
+/**
+ * Result of the {@link PlatformDotNetSessionLockProcessor} execution.
+ */
+@SuppressWarnings({"AssignmentToDateFieldFromParameter", "ReturnOfDateField"})
+public class PlatformDotNetSessionLockResult implements Binarylizable {
+    /** Success flag. */
+    private boolean success;
+
+    /** Data. */
+    private PlatformDotNetSessionData data;
+
+    /** Lock time. */
+    private Timestamp lockTime;
+
+    /**
+     * Constructor.
+     *
+     * @param success Success flag.
+     * @param data Session data.
+     * @param lockTime Lock time.
+     */
+    public PlatformDotNetSessionLockResult(boolean success, PlatformDotNetSessionData data, Timestamp lockTime) {
+        assert success ^ (data == null);
+
+        this.success = success;
+        this.data = data;
+        this.lockTime = lockTime;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+        BinaryRawWriter raw = writer.rawWriter();
+
+        writeBinary(raw);
+    }
+
+    /**
+     * Writes to a binary writer.
+     *
+     * @param writer Binary writer.
+     */
+    public void writeBinary(BinaryRawWriter writer) {
+        writer.writeBoolean(success);
+
+        if (success)
+            data.writeBinary(writer);
+
+        writer.writeTimestamp(lockTime);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+        BinaryRawReader raw = reader.rawReader();
+
+        success = raw.readBoolean();
+
+        if (success) {
+            data = new PlatformDotNetSessionData();
+
+            data.readBinary(raw);
+        }
+
+        lockTime = raw.readTimestamp();
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PlatformDotNetSessionLockResult.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor1.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor1.java
new file mode 100644
index 0000000..589ed03
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotNetSessionSetAndUnlockProcessor1.java
@@ -0,0 +1,179 @@
+/*
+ * 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.internal.processors.platform.websession;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.cache.CacheEntryProcessor;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.UUID;
+
+/**
+ * Processor to unlock and optionally update the session.
+ */
+public class PlatformDotNetSessionSetAndUnlockProcessor implements
+    CacheEntryProcessor<String, PlatformDotNetSessionData, Void>, Binarylizable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Lock node ID. */
+    private UUID lockNodeId;
+
+    /** Lock ID. */
+    private long lockId;
+
+    /** Update flag. */
+    private boolean update;
+
+    /** Data. */
+    private Map<String, byte[]> items;
+
+    /** Whether items collection represents a diff. */
+    private boolean isDiff;
+
+    /** Static data. */
+    private byte[] staticData;
+
+    /** Timeout. */
+    private int timeout;
+
+    /**
+     * Constructor for unlock.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     */
+    public PlatformDotNetSessionSetAndUnlockProcessor(UUID lockNodeId, long lockId) {
+        this(lockNodeId, lockId, false, null, false, null, 0);
+    }
+
+    /**
+     * Constructor for unlock/update.
+     *
+     * @param data Data.
+     */
+    public PlatformDotNetSessionSetAndUnlockProcessor(PlatformDotNetSessionData data) {
+        this(data.lockNodeId(), data.lockId(), true, data.items(), data.isDiff(), data.staticObjects(), data.timeout());
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param lockNodeId Lock node ID.
+     * @param lockId Lock ID.
+     * @param update Whether to perform update.
+     * @param items Items.
+     * @param isDiff Whether items is a diff.
+     * @param staticData Static data.
+     * @param timeout Timeout.
+     */
+    public PlatformDotNetSessionSetAndUnlockProcessor(UUID lockNodeId, long lockId, boolean update,
+        Map<String, byte[]> items, boolean isDiff, byte[] staticData, int timeout) {
+        this.lockNodeId = lockNodeId;
+        this.lockId = lockId;
+        this.update = update;
+        this.items = items;
+        this.isDiff = isDiff;
+        this.staticData = staticData;
+        this.timeout = timeout;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Void process(MutableEntry<String, PlatformDotNetSessionData> entry, Object... args)
+        throws EntryProcessorException {
+        assert entry.exists();
+
+        PlatformDotNetSessionData data = entry.getValue();
+
+        assert data != null;
+
+        // Unlock and update.
+        data = update
+            ? data.updateAndUnlock(lockNodeId, lockId, items, isDiff, staticData, timeout)
+            : data.unlock(lockNodeId, lockId);
+
+        // Apply.
+        entry.setValue(data);
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+        BinaryRawWriter raw = writer.rawWriter();
+
+        raw.writeUuid(lockNodeId);
+        raw.writeLong(lockId);
+        raw.writeBoolean(update);
+
+        if (update) {
+            raw.writeBoolean(isDiff);
+            raw.writeByteArray(staticData);
+            raw.writeInt(timeout);
+
+            if (items != null) {
+                raw.writeInt(items.size());
+
+                for (Map.Entry<String, byte[]> e : items.entrySet()) {
+                    raw.writeString(e.getKey());
+                    raw.writeByteArray(e.getValue());
+                }
+            }
+            else
+                raw.writeInt(-1);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+        BinaryRawReader raw = reader.rawReader();
+
+        lockNodeId = raw.readUuid();
+        lockId = raw.readLong();
+        update = raw.readBoolean();
+
+        if (update) {
+            isDiff = raw.readBoolean();
+            staticData = raw.readByteArray();
+            timeout = raw.readInt();
+
+            int cnt = raw.readInt();
+
+            if (cnt >= 0) {
+                items = new TreeMap<>();
+
+                for (int i = 0; i < cnt; i++)
+                    items.put(raw.readString(), raw.readByteArray());
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(PlatformDotNetSessionSetAndUnlockProcessor.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionCacheExtension.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionCacheExtension.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionCacheExtension.java
deleted file mode 100644
index b5a0dfa..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionCacheExtension.java
+++ /dev/null
@@ -1,144 +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.internal.processors.platform.websession;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.internal.binary.BinaryRawReaderEx;
-import org.apache.ignite.internal.binary.BinaryRawWriterEx;
-import org.apache.ignite.internal.processors.platform.cache.PlatformCache;
-import org.apache.ignite.internal.processors.platform.cache.PlatformCacheExtension;
-import org.apache.ignite.internal.processors.platform.memory.PlatformMemory;
-import org.apache.ignite.internal.processors.platform.utils.PlatformWriterClosure;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import java.sql.Timestamp;
-import java.util.UUID;
-
-/**
- * Custom entry processor invoker.
- */
-public class PlatformDotnetSessionCacheExtension implements PlatformCacheExtension {
-    /** Extension ID. */
-    private static final int EXT_ID = 0;
-
-    /** Operation: session lock. */
-    private static final int OP_LOCK = 1;
-
-    /** Operation: session set/unlock. */
-    private static final int OP_SET_AND_UNLOCK = 2;
-
-    /** Operation: session get without lock. */
-    private static final int OP_GET = 3;
-
-    /** Operation: session put without lock. */
-    private static final int OP_PUT = 4;
-
-    /** Operation: session remove without lock. */
-    private static final int OP_REMOVE = 5;
-
-    /** {@inheritDoc} */
-    @Override public int id() {
-        return EXT_ID;
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override public long processInOutStreamLong(PlatformCache target, int type, BinaryRawReaderEx reader,
-        PlatformMemory mem) throws IgniteCheckedException {
-        switch (type) {
-            case OP_LOCK: {
-                String key = reader.readString();
-                UUID lockNodeId = reader.readUuid();
-                long lockId = reader.readLong();
-                Timestamp lockTime = reader.readTimestamp();
-
-                final PlatformDotnetSessionLockResult res = (PlatformDotnetSessionLockResult)
-                    target.rawCache().invoke(key, new PlatformDotnetSessionLockProcessor(lockNodeId, lockId, lockTime));
-
-                return target.writeResult(mem, res, new PlatformWriterClosure() {
-                    @Override public void write(BinaryRawWriterEx writer, Object val) {
-                        res.writeBinary(writer);
-                    }
-                });
-            }
-
-            case OP_SET_AND_UNLOCK: {
-                String key = reader.readString();
-
-                PlatformDotnetSessionSetAndUnlockProcessor proc;
-
-                if (reader.readBoolean()) {
-                    PlatformDotnetSessionData data = new PlatformDotnetSessionData();
-
-                    data.readBinary(reader);
-
-                    proc = new PlatformDotnetSessionSetAndUnlockProcessor(data);
-                }
-                else {
-                    UUID lockNodeId = reader.readUuid();
-                    long lockId = reader.readLong();
-
-                    proc = new PlatformDotnetSessionSetAndUnlockProcessor(lockNodeId, lockId);
-                }
-
-                target.rawCache().invoke(key, proc);
-
-                return target.writeResult(mem, null);
-            }
-
-            case OP_GET: {
-                String key = reader.readString();
-
-                final PlatformDotnetSessionData data = (PlatformDotnetSessionData)target.rawCache().get(key);
-
-                return target.writeResult(mem, data, new PlatformWriterClosure() {
-                    @Override public void write(BinaryRawWriterEx writer, Object val) {
-                        data.writeBinary(writer);
-                    }
-                });
-            }
-
-            case OP_PUT: {
-                String key = reader.readString();
-
-                PlatformDotnetSessionData data = new PlatformDotnetSessionData();
-
-                data.readBinary(reader);
-
-                target.rawCache().put(key, data);
-
-                return target.writeResult(mem, null);
-            }
-
-            case OP_REMOVE: {
-                String key = reader.readString();
-
-                target.rawCache().remove(key);
-
-                return target.writeResult(mem, null);
-            }
-        }
-
-        throw new IgniteCheckedException("Unsupported operation type: " + type);
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PlatformDotnetSessionCacheExtension.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
deleted file mode 100644
index 9aef02e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionData.java
+++ /dev/null
@@ -1,273 +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.internal.processors.platform.websession;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryRawReader;
-import org.apache.ignite.binary.BinaryRawWriter;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.util.tostring.GridToStringExclude;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import java.sql.Timestamp;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.UUID;
-
-/**
- * Web session state data.
- */
-@SuppressWarnings({"ReturnOfDateField", "AssignmentToDateFieldFromParameter"})
-public class PlatformDotNetSessionData implements Binarylizable {
-    /** Items. */
-    private Map<String, byte[]> items;
-
-    /** Diff flag. */
-    private boolean isDiff;
-
-    /** Static objects. */
-    @GridToStringExclude
-    private byte[] staticObjects;
-
-    /** Timeout. */
-    private int timeout;
-
-    /** Lock ID. */
-    private long lockId;
-
-    /** Lock node ID. */
-    private UUID lockNodeId;
-
-    /** Lock time. */
-    private Timestamp lockTime;
-
-    /**
-     * @return Items.
-     */
-    public Map<String, byte[]> items() {
-        return items;
-    }
-
-    /**
-     * @return Diff flag.
-     */
-    public boolean isDiff() {
-        return isDiff;
-    }
-
-    /**
-     * @return Static objects.
-     */
-    public byte[] staticObjects() {
-        return staticObjects;
-    }
-
-    /**
-     * @return Timeout.
-     */
-    public int timeout() {
-        return timeout;
-    }
-
-    /**
-     * @return Lock ID.
-     */
-    public long lockId() {
-        return lockId;
-    }
-
-    /**
-     * @return Lock node ID.
-     */
-    public UUID lockNodeId() {
-        return lockNodeId;
-    }
-
-    /**
-     * @return Lock time.
-     */
-    public Timestamp lockTime() {
-        return lockTime;
-    }
-
-    /**
-     * @return {@code True} if locked.
-     */
-    public boolean isLocked() {
-        return lockTime != null;
-    }
-
-    /**
-     * Locks the session state data.
-     *
-     * @param lockNodeId Lock node ID.
-     * @param lockId Lock ID.
-     * @param lockTime Lock time.
-     *
-     * @return Unlocked data copy.
-     */
-    public PlatformDotNetSessionData lock(UUID lockNodeId, long lockId, Timestamp lockTime) {
-        assert !isLocked();
-
-        PlatformDotNetSessionData res = copyWithoutLockInfo();
-
-        res.lockId = lockId;
-        res.lockNodeId = lockNodeId;
-        res.lockTime = lockTime;
-
-        return res;
-    }
-
-    /**
-     * Unlocks the session state data.
-     *
-     * @param lockNodeId Lock node ID.
-     * @param lockId Lock ID.
-     *
-     * @return Unlocked data copy.
-     */
-    public PlatformDotNetSessionData unlock(UUID lockNodeId, long lockId) {
-        assert isLocked();
-
-        if (!this.lockNodeId.equals(lockNodeId))
-            throw new IllegalStateException("Can not unlock session data: lock node id check failed.");
-
-        if (this.lockId != lockId)
-            throw new IllegalStateException("Can not unlock session data: lock id check failed.");
-
-        return copyWithoutLockInfo();
-    }
-
-    /**
-     * Update session state and release the lock.
-     *
-     * @param lockNodeId Lock node ID.
-     * @param lockId Lock ID.
-     * @param items Items.
-     * @param isDiff Diff flag.
-     * @param staticObjects Static objects.
-     * @param timeout Timeout.
-     * @return Result.
-     */
-    public PlatformDotNetSessionData updateAndUnlock(UUID lockNodeId, long lockId, Map<String, byte[]> items,
-        boolean isDiff, byte[] staticObjects, int timeout) {
-        assert items != null;
-
-        PlatformDotNetSessionData res = unlock(lockNodeId, lockId);
-
-        if (!isDiff) {
-            // Not a diff: remove all
-            this.items.clear();
-        }
-
-        for (Map.Entry<String, byte[]> e : items.entrySet()) {
-            String key = e.getKey();
-            byte[] value = e.getValue();
-
-            if (value != null)
-                this.items.put(key, value);
-            else
-                this.items.remove(key);   // Null value indicates removed key.
-        }
-
-        res.staticObjects = staticObjects;
-        res.timeout = timeout;
-
-        return res;
-    }
-
-    /**
-     * Gets a copy of this instance with non-lock properties set.
-     *
-     * @return Copied state data.
-     */
-    private PlatformDotNetSessionData copyWithoutLockInfo() {
-        PlatformDotNetSessionData res = new PlatformDotNetSessionData();
-
-        res.staticObjects = staticObjects;
-        res.items = items;
-        res.timeout = timeout;
-        res.isDiff = isDiff;
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-        BinaryRawWriter raw = writer.rawWriter();
-
-        writeBinary(raw);
-    }
-
-    /**
-     * Writes to a binary writer.
-     *
-     * @param writer Binary writer.
-     */
-    public void writeBinary(BinaryRawWriter writer) {
-        writer.writeBoolean(isDiff);
-        writer.writeInt(items.size());
-
-        for (Map.Entry<String, byte[]> e : items.entrySet()) {
-            writer.writeString(e.getKey());
-            writer.writeByteArray(e.getValue());
-        }
-
-        writer.writeByteArray(staticObjects);
-
-        writer.writeInt(timeout);
-        writer.writeUuid(lockNodeId);
-        writer.writeLong(lockId);
-        writer.writeTimestamp(lockTime);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-        BinaryRawReader raw = reader.rawReader();
-
-        readBinary(raw);
-    }
-
-    /**
-     * Reads from a binary reader.
-     *
-     * @param reader Reader.
-     */
-    public void readBinary(BinaryRawReader reader) {
-        items = new TreeMap<>();
-        isDiff = reader.readBoolean();
-        int count = reader.readInt();
-
-        for (int i = 0; i < count; i++)
-            items.put(reader.readString(), reader.readByteArray());
-
-        staticObjects = reader.readByteArray();
-
-        timeout = reader.readInt();
-        lockNodeId = reader.readUuid();
-        lockId = reader.readLong();
-        lockTime = reader.readTimestamp();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PlatformDotNetSessionData.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockProcessor.java
deleted file mode 100644
index efa0183..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockProcessor.java
+++ /dev/null
@@ -1,84 +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.internal.processors.platform.websession;
-
-import org.apache.ignite.cache.CacheEntryProcessor;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
-import java.sql.Timestamp;
-import java.util.UUID;
-
-/**
- * Entry processor that locks web session data.
- */
-@SuppressWarnings("AssignmentToDateFieldFromParameter")
-public class PlatformDotNetSessionLockProcessor implements CacheEntryProcessor<String, PlatformDotNetSessionData, Object> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Lock node id. */
-    private UUID lockNodeId;
-
-    /** Lock id. */
-    private long lockId;
-
-    /** Lock time. */
-    private Timestamp lockTime;
-
-    /**
-     * Ctor.
-     *
-     * @param lockNodeId Lock node id.
-     * @param lockId Lock id.
-     * @param lockTime Lock time.
-     */
-    public PlatformDotNetSessionLockProcessor(UUID lockNodeId, long lockId, Timestamp lockTime) {
-        this.lockNodeId = lockNodeId;
-        this.lockId = lockId;
-        this.lockTime = lockTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object process(MutableEntry<String, PlatformDotNetSessionData> entry, Object... args)
-        throws EntryProcessorException {
-        if (!entry.exists())
-            return null;
-
-        PlatformDotNetSessionData data = entry.getValue();
-
-        assert data != null;
-
-        if (data.isLocked())
-            return new PlatformDotNetSessionLockResult(false, null, data.lockTime());
-
-        // Not locked: lock and return result
-        data = data.lock(lockNodeId, lockId, lockTime);
-
-        // Apply.
-        entry.setValue(data);
-
-        return new PlatformDotNetSessionLockResult(true, data, null);
-    }
-
-    /** {@inheritDoc */
-    @Override public String toString() {
-        return S.toString(PlatformDotNetSessionLockProcessor.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockResult.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockResult.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockResult.java
deleted file mode 100644
index 17f38fc..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionLockResult.java
+++ /dev/null
@@ -1,99 +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.internal.processors.platform.websession;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryRawReader;
-import org.apache.ignite.binary.BinaryRawWriter;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import java.sql.Timestamp;
-
-/**
- * Result of the {@link PlatformDotNetSessionLockProcessor} execution.
- */
-@SuppressWarnings({"AssignmentToDateFieldFromParameter", "ReturnOfDateField"})
-public class PlatformDotNetSessionLockResult implements Binarylizable {
-    /** Success flag. */
-    private boolean success;
-
-    /** Data. */
-    private PlatformDotNetSessionData data;
-
-    /** Lock time. */
-    private Timestamp lockTime;
-
-    /**
-     * Constructor.
-     *
-     * @param success Success flag.
-     * @param data Session data.
-     * @param lockTime Lock time.
-     */
-    public PlatformDotNetSessionLockResult(boolean success, PlatformDotNetSessionData data, Timestamp lockTime) {
-        assert success ^ (data == null);
-
-        this.success = success;
-        this.data = data;
-        this.lockTime = lockTime;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-        BinaryRawWriter raw = writer.rawWriter();
-
-        writeBinary(raw);
-    }
-
-    /**
-     * Writes to a binary writer.
-     *
-     * @param writer Binary writer.
-     */
-    public void writeBinary(BinaryRawWriter writer) {
-        writer.writeBoolean(success);
-
-        if (success)
-            data.writeBinary(writer);
-
-        writer.writeTimestamp(lockTime);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-        BinaryRawReader raw = reader.rawReader();
-
-        success = raw.readBoolean();
-
-        if (success) {
-            data = new PlatformDotNetSessionData();
-
-            data.readBinary(raw);
-        }
-
-        lockTime = raw.readTimestamp();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PlatformDotNetSessionLockResult.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/101a0c40/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionSetAndUnlockProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionSetAndUnlockProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionSetAndUnlockProcessor.java
deleted file mode 100644
index 71cecd0..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/websession/PlatformDotnetSessionSetAndUnlockProcessor.java
+++ /dev/null
@@ -1,179 +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.internal.processors.platform.websession;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryRawReader;
-import org.apache.ignite.binary.BinaryRawWriter;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.cache.CacheEntryProcessor;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.UUID;
-
-/**
- * Processor to unlock and optionally update the session.
- */
-public class PlatformDotnetSessionSetAndUnlockProcessor implements
-    CacheEntryProcessor<String, PlatformDotnetSessionData, Void>, Binarylizable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Lock node ID. */
-    private UUID lockNodeId;
-
-    /** Lock ID. */
-    private long lockId;
-
-    /** Update flag. */
-    private boolean update;
-
-    /** Data. */
-    private Map<String, byte[]> items;
-
-    /** Whether items collection represents a diff. */
-    private boolean isDiff;
-
-    /** Static data. */
-    private byte[] staticData;
-
-    /** Timeout. */
-    private int timeout;
-
-    /**
-     * Constructor for unlock.
-     *
-     * @param lockNodeId Lock node ID.
-     * @param lockId Lock ID.
-     */
-    public PlatformDotnetSessionSetAndUnlockProcessor(UUID lockNodeId, long lockId) {
-        this(lockNodeId, lockId, false, null, false, null, 0);
-    }
-
-    /**
-     * Constructor for unlock/update.
-     *
-     * @param data Data.
-     */
-    public PlatformDotnetSessionSetAndUnlockProcessor(PlatformDotnetSessionData data) {
-        this(data.lockNodeId(), data.lockId(), true, data.items(), data.isDiff(), data.staticObjects(), data.timeout());
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param lockNodeId Lock node ID.
-     * @param lockId Lock ID.
-     * @param update Whether to perform update.
-     * @param items Items.
-     * @param isDiff Whether items is a diff.
-     * @param staticData Static data.
-     * @param timeout Timeout.
-     */
-    public PlatformDotnetSessionSetAndUnlockProcessor(UUID lockNodeId, long lockId, boolean update,
-        Map<String, byte[]> items, boolean isDiff, byte[] staticData, int timeout) {
-        this.lockNodeId = lockNodeId;
-        this.lockId = lockId;
-        this.update = update;
-        this.items = items;
-        this.isDiff = isDiff;
-        this.staticData = staticData;
-        this.timeout = timeout;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Void process(MutableEntry<String, PlatformDotnetSessionData> entry, Object... args)
-        throws EntryProcessorException {
-        assert entry.exists();
-
-        PlatformDotnetSessionData data = entry.getValue();
-
-        assert data != null;
-
-        // Unlock and update.
-        data = update
-            ? data.updateAndUnlock(lockNodeId, lockId, items, isDiff, staticData, timeout)
-            : data.unlock(lockNodeId, lockId);
-
-        // Apply.
-        entry.setValue(data);
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-        BinaryRawWriter raw = writer.rawWriter();
-
-        raw.writeUuid(lockNodeId);
-        raw.writeLong(lockId);
-        raw.writeBoolean(update);
-
-        if (update) {
-            raw.writeBoolean(isDiff);
-            raw.writeByteArray(staticData);
-            raw.writeInt(timeout);
-
-            if (items != null) {
-                raw.writeInt(items.size());
-
-                for (Map.Entry<String, byte[]> e : items.entrySet()) {
-                    raw.writeString(e.getKey());
-                    raw.writeByteArray(e.getValue());
-                }
-            }
-            else
-                raw.writeInt(-1);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-        BinaryRawReader raw = reader.rawReader();
-
-        lockNodeId = raw.readUuid();
-        lockId = raw.readLong();
-        update = raw.readBoolean();
-
-        if (update) {
-            isDiff = raw.readBoolean();
-            staticData = raw.readByteArray();
-            timeout = raw.readInt();
-
-            int cnt = raw.readInt();
-
-            if (cnt >= 0) {
-                items = new TreeMap<>();
-
-                for (int i = 0; i < cnt; i++)
-                    items.put(raw.readString(), raw.readByteArray());
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PlatformDotnetSessionSetAndUnlockProcessor.class, this);
-    }
-}


Mime
View raw message