## org.red5.server.net.rtmp.status
Class StatusObjectService

    java.lang.Object
      org.red5.server.net.rtmp.status.StatusObjectService

All Implemented Interfaces:
  StatusCodes

    public class StatusObjectService

extends Object
implements StatusCodes

Service that works with status objects. Note all status object should aim to be under 128 bytes.

Author:
  The Red5 Project (red5@osflash.org), Luke Hubbard, Codegent Ltd (luke@codegent.com)

Field Summary
`protected Map<String,byte[]>` `cachedStatusObjects` Cached status objects map
`protected static Logger` `log` Logger
`protected Serializer` `serializer` Serializer
`protected Map<String,StatusObject>` `statusObjects` Status objects map

Fields inherited from interface org.red5.server.net.rtmp.status.StatusCodes

`APP_GC, APP_RESOURCE_LOWMEMORY, APP_SCRIPT_ERROR, APP_SCRIPT_WARNING, APP_SHUTDOWN, NC_CALL_BADVERSION, NC_CALL_FAILED, NC_CONNECT_APPSHUTDOWN, NC_CONNECT_CLOSED, NC_CONNECT_FAILED, NC_CONNECT_INVALID_APPLICATION, NC_CONNECT_REJECTED, NC_CONNECT_SUCCESS, NS_CLEAR_FAILED, NS_CLEAR_SUCCESS, NS_DATA_START, NS_FAILED, NS_INVALID_ARGUMENT, NS_PAUSE_NOTIFY, NS_PLAY_COMPLETE, NS_PLAY_FAILED, NS_PLAY_FILE_STRUCTURE_INVALID, NS_PLAY_INSUFFICIENT_BW, NS_PLAY_NO_SUPPORTED_TRACK_FOUND, NS_PLAY_PUBLISHNOTIFY, NS_PLAY_RESET, NS_PLAY_START, NS_PLAY_STOP, NS_PLAY_STREAMNOTFOUND, NS_PLAY_SWITCH, NS_PLAY_UNPUBLISHNOTIFY, NS_PUBLISH_BADNAME, NS_PUBLISH_START, NS_RECORD_FAILED, NS_RECORD_NOACCESS, NS_RECORD_START, NS_RECORD_STOP, NS_SEEK_FAILED, NS_SEEK_NOTIFY, NS_UNPAUSE_NOTIFY, NS_UNPUBLISHED_SUCCESS, SO_CREATION_FAILED, SO_NO_READ_ACCESS, SO_NO_WRITE_ACCESS, SO_PERSISTENCE_MISMATCH`

Constructor Summary
`StatusObjectService()`

Method Summary
`void` `cacheStatusObjects()` Cache status objects
`byte[]` `getCachedStatusObjectAsByteArray(String statusCode)` Return status object by code as byte array
`StatusObject` `getStatusObject(String statusCode)` Return status object by code
`void` `initialize()` Initialization
`void` `loadStatusObjects()` Creates all status objects and adds them to status objects map
`void` `serializeStatusObject(IoBuffer out, StatusObject statusObject)` Serializes status object
`void` `setSerializer(Serializer serializer)` Setter for serializer

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    protected static Logger log

  Logger

### serializer

    protected Serializer serializer

  Serializer

### statusObjects

    protected Map<String,StatusObject> statusObjects

  Status objects map

### cachedStatusObjects

    protected Map<String,byte[]> cachedStatusObjects

  Cached status objects map

Constructor Detail

### StatusObjectService

    public StatusObjectService()

Method Detail

### setSerializer

    public void setSerializer(Serializer serializer)

  Setter for serializer

  Parameters:
    `serializer` - Serializer object

### initialize

    public void initialize()

  Initialization

### loadStatusObjects

    public void loadStatusObjects()

  Creates all status objects and adds them to status objects map

### cacheStatusObjects

    public void cacheStatusObjects()

  Cache status objects

### serializeStatusObject

    public void serializeStatusObject(IoBuffer out,
                                      StatusObject statusObject)

  Serializes status object

  Parameters:
    `out` - Byte buffer for output object
    `statusObject` - Status object to serialize

### getStatusObject

    public StatusObject getStatusObject(String statusCode)

  Return status object by code

  Parameters:
    `statusCode` - Status object code
  Returns:
    Status object with given code

### getCachedStatusObjectAsByteArray

    public byte[] getCachedStatusObjectAsByteArray(String statusCode)

  Return status object by code as byte array

  Parameters:
    `statusCode` - Status object code
  Returns:
    Status object with given code as byte array

Copyright © 2006-2010 The Red5 Project