## Methods

destroy()
getData(_count, callback)

getKey()
getMeta(callback)

## Abstract types

getDataCallback(err, items)

getMetaCallback(err, data)

## new _MessageArchive()

Message archive.
May not be directly instanced. An instance of the class is created by the method HomeServerConnector._Connection#getMessageArchive.

### Example

    var ma = conn.getMessageArchive("MA@MyMessageArchive", function(err, data) {});

## Methods

### destroy()

Enables the object and cancels any existing subscription.

#### Example

    ma.destroy();

### getData(_count, callback)

Retrieves a specific number of entries of a message archive. The latest entries are always returned.

#### Example

Retrieval of the (max). 10 last entries.

    ma.getData(10, function(err, items) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
_count | Number |  | Max. number of entries to be returned.
callback | function() |  | HomeServerConnector._MessageArchive~getDataCallback

### getKey() → String

Returns the key of the object.

#### Example

    var object_key = ma.getKey();

Returns

  `String`

### getMeta(callback)

Retrieves the metadata.

#### Example

Retrieval of metadata.

    ma.getMeta(function(err, data) {});

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
callback | function() |  | HomeServerConnector._MessageArchive~getMetaCallback

## Abstract types

inner

### getDataCallback(err, items)

#### Example

Retrieval of the (max). 10 last entries.

    ma.getData(10, function(err, items) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
err | (Object or undefined) |  | Error object
items | Array |  | List with the data of the message archive. Each entry contains the following fields: #### Structure
    [
       {
          "ts":    Number,
          "token": String,
          "text":  String
       }
    ]
#### Explanation ts - Unix time stamp (in seconds, milliseconds as a decimal value) of the entry. token - Abbreviation defined in Expert for the entry. text - Text defined in Expert for the entry.

inner

### getMetaCallback(err, data)

#### Example

Retrieval of metadata.

    ma.getMeta(function(err, data) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
err | (Object or undefined) |  | Error object
data | Object |  | Meta information #### Structure
    {
      "keys":        Array of String,
      "caption":     String,
      "description": String,
      "tags":        Array of String,
      "size":        Number,
      "tokens":      Array of String
    }
#### Explanation keys - List with keys (e.g.: ["MA:3", "MA@MyMessageArchive"]). Contains at least one number. caption - Designation of the object. description - Description of the object. tags - List of tags (e.g.: ["BM", "Light"]). size - Maximum size of ring buffer. tokens - List of all possible abbreviations (messages).