Retrieval of entries

In some cases it will be possible to retrieve entries sent to AuditLog component using XMPP. To retrieve 2 oldest entries (oldest entries from cache) following iq stanza of get type should be sent to AuditLog component:

<iq type="get" id="auditlog-2" from="admin@example.com/res-1" to="auditlog@example.com">
  <retrieve xmlns="http://tigase.org/protocol/auditlog" offset="0" limit="2"/>
</iq>

AuditLog component will respond with stanza in following format:

<iq type="result" id="auditlog-2" from="auditlog@example.com" to="admin@example.com/res-1">
  <entries xmlns="http://tigase.org/protocol/auditlog" offset="0" limit="2">
    <entry>
      <whenOccurred>2015-01-15T14:54:04Z</whenOccurred>
      <srcAddress>user1@example.com</srcAddress>
      <dstAddress>user2@example.com</dstAddress>
      ...
    </entry>
    ...
  </entries>
</iq>

in which entries element contains requested entries as subelements in entry XML format.

If there was an error and entries could not be returned due to component not containing cached entries following result will be sent:

<iq type="error" id="auditlog-2" from="auditlog@example.com" to="admin@example.com/res-1">
  <error type="cancel">
    <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  </error>
</iq>

Other types of errors specified by XMPP protocol might also be returned by server if during processing of request error occurred.