org.apache.ignite.internal.websession

## Class WebSessionEntity

- java.lang.Object
- - org.apache.ignite.internal.websession.WebSessionEntity

All Implemented Interfaces:
  Serializable, Binarylizable

    public class WebSessionEntity
    extends Object
    implements Serializable, Binarylizable

Entity

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`WebSessionEntity()` Constructor.
`WebSessionEntity(String id, long createTime, long accessTime, int maxInactiveInterval)` Constructor.
`WebSessionEntity(WebSessionEntity other)` Constructor.

### Method Summary

Methods
`long` `accessTime()`
`void` `accessTime(long accessTime)` Set access time.
`Map<String,byte[]>` `attributes()`
`long` `createTime()`
`String` `id()`
`int` `maxInactiveInterval()`
`void` `maxInactiveInterval(int maxInactiveInterval)` Set max inactive interval;
`void` `putAttribute(String name, byte[] val)` Add attribute to attribute map.
`void` `readBinary(BinaryReader reader)` Reads fields from provided reader.
`void` `removeAttribute(String name)` Remove attribute.
`String` `toString()`
`void` `writeBinary(BinaryWriter writer)` Writes fields to provided writer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### WebSessionEntity

    public WebSessionEntity()

Constructor.

#### WebSessionEntity

    public WebSessionEntity(String id,
                    long createTime,
                    long accessTime,
                    int maxInactiveInterval)

Constructor.

Parameters:
  `id` - Session ID.
  `createTime` - Session create time.
  `accessTime` - Session last access time.
  `maxInactiveInterval` - Session will be removed if not accessed more then this value.

#### WebSessionEntity

    public WebSessionEntity(WebSessionEntity other)

Constructor.

### Method Detail

#### id

    public String id()

Returns:
  Session ID.

#### createTime

    public long createTime()

Returns:
  Create time.

#### accessTime

    public long accessTime()

Returns:
  Access time.

#### accessTime

    public void accessTime(long accessTime)

Set access time.

Parameters:
  `accessTime` - Access time.

#### maxInactiveInterval

    public int maxInactiveInterval()

Returns:
  Max inactive interval.

#### maxInactiveInterval

    public void maxInactiveInterval(int maxInactiveInterval)

Set max inactive interval;

Parameters:
  `maxInactiveInterval` - Max inactive interval.

#### attributes

    public Map<String,byte[]> attributes()

Returns:
  Session attributes or `Collections.emptyMap()`.

#### putAttribute

    public void putAttribute(String name,
                    byte[] val)

Add attribute to attribute map.

Parameters:
  `name` - Attribute name.
  `val` - Attribute value.

#### removeAttribute

    public void removeAttribute(String name)

Remove attribute.

Parameters:
  `name` - Attribute name.

#### writeBinary

    public void writeBinary(BinaryWriter writer)
                     throws BinaryObjectException

Writes fields to provided writer.

Specified by:
  `writeBinary` in interface `Binarylizable`
Parameters:
  `writer` - Binary object writer.
Throws:
  `BinaryObjectException` - In case of error.

#### readBinary

    public void readBinary(BinaryReader reader)
                    throws BinaryObjectException

Reads fields from provided reader.

Specified by:
  `readBinary` in interface `Binarylizable`
Parameters:
  `reader` - Binary object reader.
Throws:
  `BinaryObjectException` - In case of error.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017