org.apache.ignite.internal.processors.cacheobject

## Interface IgniteCacheObjectProcessor

All Superinterfaces:
  GridComponent, GridProcessor

All Known Subinterfaces:
  CacheObjectBinaryProcessor

All Known Implementing Classes:
  CacheObjectBinaryProcessorImpl, IgniteCacheObjectProcessorImpl

    public interface IgniteCacheObjectProcessor
    extends GridProcessor

Cache objects processor.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Method Summary

Methods
`IgniteBinary` `binary()`
`CacheObjectContext` `contextForCache(CacheConfiguration ccfg)`
`Object` `field(Object obj, String fieldName)`
`boolean` `hasField(Object obj, String fieldName)` Checks whether field is set in the object.
`boolean` `immutable(Object obj)`
`boolean` `isBinaryEnabled(CacheConfiguration<?,?> ccfg)` Checks whether given class is binary.
`boolean` `isBinaryObject(Object obj)` Checks whether object is binary object.
`byte[]` `marshal(CacheObjectValueContext ctx, Object val)`
`void` `onContinuousProcessorStarted(GridKernalContext ctx)`
`CacheObject` `prepareForCache(CacheObject obj, GridCacheContext cctx)` Prepares cache object for cache (e.g. copies user-provided object if needed).
`KeyCacheObject` `toCacheKeyObject(CacheObjectContext ctx, GridCacheContext cctx, Object obj, boolean userObj)`
`CacheObject` `toCacheObject(CacheObjectContext ctx, ByteBuffer buf)`
`IncompleteCacheObject` `toCacheObject(CacheObjectContext ctx, ByteBuffer buf, IncompleteCacheObject incompleteObj)`
`CacheObject` `toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes)`
`CacheObject` `toCacheObject(CacheObjectContext ctx, Object obj, boolean userObj)`
`IncompleteCacheObject` `toKeyCacheObject(CacheObjectContext ctx, ByteBuffer buf, IncompleteCacheObject incompleteObj)`
`KeyCacheObject` `toKeyCacheObject(CacheObjectContext ctx, byte type, byte[] bytes)`
`int` `typeId(Object obj)`
`int` `typeId(String typeName)`
`Object` `unmarshal(CacheObjectValueContext ctx, byte[] bytes, ClassLoader clsLdr)`
`Object` `unwrapTemporary(GridCacheContext ctx, Object obj)` Converts temporary off-heap object to heap-based.

### Methods inherited from interface org.apache.ignite.internal.GridComponent

`collectGridNodeData, collectJoiningNodeData, discoveryDataType, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, start, stop, validateNode`

### Method Detail

#### onContinuousProcessorStarted

    void onContinuousProcessorStarted(GridKernalContext ctx)
                                      throws IgniteCheckedException

Parameters:
  `ctx` - Context.
Throws:
  `IgniteCheckedException` - If failed.

#### typeId

    int typeId(String typeName)

Parameters:
  `typeName` - Type name.
Returns:
  Type ID.

#### typeId

    int typeId(Object obj)

Parameters:
  `obj` - Object to get type ID for.
Returns:
  Type ID.

#### unwrapTemporary

    @Nullable
    Object unwrapTemporary(GridCacheContext ctx,
                                  @Nullable
                                  Object obj)
                           throws IgniteException

Converts temporary off-heap object to heap-based.

Parameters:
  `ctx` - Context.
  `obj` - Object.
Returns:
  Heap-based object.
Throws:
  `IgniteException` - In case of error.

#### prepareForCache

    @Nullable
    CacheObject prepareForCache(@Nullable
                                       CacheObject obj,
                                       GridCacheContext cctx)

Prepares cache object for cache (e.g. copies user-provided object if needed).

Parameters:
  `obj` - Cache object.
  `cctx` - Cache context.
Returns:
  Object to be store in cache.

#### isBinaryObject

    boolean isBinaryObject(Object obj)

Checks whether object is binary object.

Parameters:
  `obj` - Object to check.
Returns:
  `True` if object is already a binary object, `false` otherwise.

#### isBinaryEnabled

    boolean isBinaryEnabled(CacheConfiguration<?,?> ccfg)

Checks whether given class is binary.

Returns:
  `true` If binary objects are enabled.

#### field

    Object field(Object obj,
               String fieldName)

Parameters:
  `obj` - Binary object to get field from.
  `fieldName` - Field name.
Returns:
  Field value.

#### hasField

    boolean hasField(Object obj,
                   String fieldName)

Checks whether field is set in the object.

Parameters:
  `obj` - Object.
  `fieldName` - Field name.
Returns:
  `true` if field is set.

#### marshal

    byte[] marshal(CacheObjectValueContext ctx,
                 Object val)
                   throws IgniteCheckedException

Parameters:
  `ctx` - Cache object context.
  `val` - Value.
Returns:
  Value bytes.
Throws:
  `IgniteCheckedException` - If failed.

#### unmarshal

    Object unmarshal(CacheObjectValueContext ctx,
                   byte[] bytes,
                   ClassLoader clsLdr)
                     throws IgniteCheckedException

Parameters:
  `ctx` - Context.
  `bytes` - Bytes.
  `clsLdr` - Class loader.
Returns:
  Unmarshalled object.
Throws:
  `IgniteCheckedException` - If failed.

#### contextForCache

    CacheObjectContext contextForCache(CacheConfiguration ccfg)
                                       throws IgniteCheckedException

Parameters:
  `ccfg` - Cache configuration.
Returns:
  Cache object context.
Throws:
  `IgniteCheckedException` - If failed.

#### toCacheKeyObject

    KeyCacheObject toCacheKeyObject(CacheObjectContext ctx,
                                  @Nullable
                                  GridCacheContext cctx,
                                  Object obj,
                                  boolean userObj)

Parameters:
  `ctx` - Cache objects context.
  `cctx` - Cache context if cache is available.
  `obj` - Key value.
  `userObj` - If `true` then given object is object provided by user and should be copied before stored in cache.
Returns:
  Cache key object.

#### toCacheObject

    @Nullable
    CacheObject toCacheObject(CacheObjectContext ctx,
                                     @Nullable
                                     Object obj,
                                     boolean userObj)

Parameters:
  `ctx` - Cache context.
  `obj` - Object.
  `userObj` - If `true` then given object is object provided by user and should be copied before stored in cache.
Returns:
  Cache object.

#### toCacheObject

    CacheObject toCacheObject(CacheObjectContext ctx,
                            byte type,
                            byte[] bytes)

Parameters:
  `ctx` - Cache context.
  `type` - Object type.
  `bytes` - Object bytes.
Returns:
  Cache object.

#### toKeyCacheObject

    KeyCacheObject toKeyCacheObject(CacheObjectContext ctx,
                                  byte type,
                                  byte[] bytes)
                                    throws IgniteCheckedException

Parameters:
  `ctx` - Cache context.
  `type` - Object type.
  `bytes` - Object bytes.
Returns:
  Cache object.
Throws:
  `IgniteCheckedException`

#### toCacheObject

    CacheObject toCacheObject(CacheObjectContext ctx,
                            ByteBuffer buf)

Parameters:
  `ctx` - Cache context.
  `buf` - Buffer to read from.
Returns:
  Cache object.

#### toCacheObject

    IncompleteCacheObject toCacheObject(CacheObjectContext ctx,
                                      ByteBuffer buf,
                                      @Nullable
                                      IncompleteCacheObject incompleteObj)
                                        throws IgniteCheckedException

Parameters:
  `ctx` - Cache object context.
  `buf` - Buffer.
  `incompleteObj` - Incomplete cache object or `null` if it's a first read.
Returns:
  Incomplete cache object.
Throws:
  `IgniteCheckedException` - If fail.

#### toKeyCacheObject

    IncompleteCacheObject toKeyCacheObject(CacheObjectContext ctx,
                                         ByteBuffer buf,
                                         @Nullable
                                         IncompleteCacheObject incompleteObj)
                                           throws IgniteCheckedException

Parameters:
  `ctx` - Cache object context.
  `buf` - Buffer.
  `incompleteObj` - Incomplete cache object or `null` if it's a first read.
Returns:
  Incomplete cache object.
Throws:
  `IgniteCheckedException` - If fail.

#### immutable

    boolean immutable(Object obj)

Parameters:
  `obj` - Value.
Returns:
  `True` if object is of known immutable type.

#### binary

    IgniteBinary binary()

Returns:
  Ignite binary interface.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.1.0
Release Date | : July 20 2017