org.apache.ignite.internal.processors.portable

## Interface GridPortableProcessor

All Superinterfaces:
  GridComponent, GridProcessor

All Known Implementing Classes:
  GridOsPortableProcessor

    public interface GridPortableProcessor
    extends GridProcessor

Portable processor.

### Nested Class Summary

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

`GridComponent.DiscoveryDataExchangeType`

### Method Summary

Methods
`Object` `affinityKey(Object obj)` Gets affinity key of portable object.
`Object` `detachPortable(Object obj)`
`Object` `field(Object obj, String fieldName)`
`boolean` `hasField(Object obj, String fieldName)` Checks whether field is set in the object.
`boolean` `isPortable(GridClientMarshaller marsh)`
`boolean` `isPortableObject(Object obj)` Checks whether object is portable object.
`ByteBuffer` `marshal(Object obj, boolean trim)`
`Object` `marshalToPortable(Object obj)`
`void` `onCacheProcessorStarted()`
`boolean` `portableEnabled(ClusterNode node, String cacheName)`
`GridClientMarshaller` `portableMarshaller()`
`int` `typeId(Object obj)`
`int` `typeId(String typeName)`
`Object` `unmarshal(byte[] arr, int off)`
`Object` `unmarshal(long ptr, boolean forceHeap)`
`Object` `unwrapTemporary(Object obj)` Converts temporary offheap object to heap-based.

### Methods inherited from interface org.apache.ignite.internal.processors.GridProcessor

`addAttributes`

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

`collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, onKernalStart, onKernalStop, printMemoryStats, start, stop, validateNode`

### Method Detail

#### onCacheProcessorStarted

    void onCacheProcessorStarted()

#### 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.

#### marshal

    ByteBuffer marshal(@Nullable
                     Object obj,
                     boolean trim)
                       throws IgniteException

Parameters:
  `obj` - Object to marshal.
  `trim` - If `true` trims result byte buffer.
Returns:
  Object bytes.
Throws:
  `IgniteException` - In case of error.

#### unmarshal

    Object unmarshal(byte[] arr,
                   int off)
                     throws IgniteException

Parameters:
  `arr` - Byte array.
  `off` - Offset.
Returns:
  Unmarshalled object.
Throws:
  `IgniteException` - In case of error.

#### unmarshal

    Object unmarshal(long ptr,
                   boolean forceHeap)
                     throws IgniteException

Parameters:
  `ptr` - Offheap pointer.
  `forceHeap` - If `true` creates heap-based object.
Returns:
  Unmarshalled object.
Throws:
  `IgniteException` - In case of error.

#### unwrapTemporary

    @Nullable
    Object unwrapTemporary(@Nullable
                                  Object obj)
                           throws IgniteException

Converts temporary offheap object to heap-based.

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

#### marshalToPortable

    Object marshalToPortable(@Nullable
                           Object obj)
                             throws IgniteException

Parameters:
  `obj` - Object to marshal.
Returns:
  Portable object.
Throws:
  `IgniteException` - In case of error.

#### detachPortable

    Object detachPortable(@Nullable
                        Object obj)

Parameters:
  `obj` - Object (portable or not).
Returns:
  Detached portable object or original object.

#### portableMarshaller

    @Nullable
    GridClientMarshaller portableMarshaller()

Returns:
  Portable marshaller for client connectivity or `null` if it's not supported (in case of OS edition).

#### isPortable

    boolean isPortable(GridClientMarshaller marsh)

Parameters:
  `marsh` - Client marshaller.
Returns:
  Whether marshaller is portable.

#### portableEnabled

    boolean portableEnabled(ClusterNode node,
                          String cacheName)

Parameters:
  `node` - Node to check.
  `cacheName` - Cache name to check.
Returns:
  `True` if portable enabled for the specified cache, `false` otherwise.

#### isPortableObject

    boolean isPortableObject(Object obj)

Checks whether object is portable object.

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

#### affinityKey

    Object affinityKey(Object obj)

Gets affinity key of portable object.

Parameters:
  `obj` - Object to get affinity key for.
Returns:
  Affinity key.

#### field

    Object field(Object obj,
               String fieldName)

Parameters:
  `obj` - Portable object to get field from.
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.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015