wiki:Reference/Responses

Responses

This section describes the possible server responses of the Nabu protocol. Every request must be answered by exactly one of these responses. There are three types of responses:

  • Replies. Replies return information, like logging states ,query results etc. Reponse codes 200-299
  • Acknowledgements. Acknowledge that the corresponding request was executed, without containing more detailed information. Response codes 300-399
  • Error responses. Resporting errors or illegal requests, response codes 400-599

A response might have a explanatory string appended to the formal response, like "200 TRUE message logging is enabled". Everything after "200 TRUE" has no formal meaning and is for human readers only. It should be ignored by parsers. Responses of variable length like query results do not contain these explanatory comments.

If the request was prefixed by a request ID, the response will be prefixed with the same ID. Example: For a request "0x04DDAA LOGMESSAGES STATUS", the response might look like this: "0x04DDAA 201 TRUE message logging enabled".

Replies

Replies are responses that return information, like logging states, query results etc.

200 (status presence logging)

Syntax: 200 TRUE|FALSE

Presence logging is enabled iff TRUE is returned-

201 (status message logging)

Syntax: 201 TRUE|FALSE

Message logging is enabled iff TRUE is returned-

202 (status user observation)

Syntax: 202 <n> [<resource>]n

Returns a list of resources registered as user observers. <n> is the number of resources, followed by the resource names.

Example:

202 2 observer1 observer2

Here two resources, observer1 and observer2, are registered as observers.

210 (query result)

Syntax: 210 <queryResultAsRDF>

Returns the result of a query in RDF/XML format.

211 (model result)

Syntax: 211 <modelAsRDF>

Returns the complete user-visible part of the Nabu model in RDF/XML format

220 (policy list)

Syntax: 220 <n> [<policyName>]n

Returns the the policy list of the requesting user. n is the number of privacy policies, <policyName> is a policy name (not a URI!).

Example:

220 3 default friendsOnly workGroup

A list containing three policies, with names "default", "friendsOnly" and "workGroup".

221 (policy description)

Syntax: 221 <policyName> <policyOwner> <n> <directive>n

<policyOwner> is the Jabber ID of the owner account, <n> is the number of directives. <directive> has the form "<rule> <accountOrGroupURI>".

Example:

221 default alice@jabber.foo.org 2
 allowGroup  http://foo.org/nabustore/Groups/jabber.foo.org/alice/workGroup denyAccount http://foo.org/nabustore/Accounts/jabber.foo.org/bob

The policy name is "default", owned by "alice@…". The policy has two directives, allowing access to the group workGroup and denying it for bob@….

222 (active policy)

Syntax 222 <policyName>

Returns the name of the currently active policy

230 (group list)

Syntax: 230 <n> [<groupURI> <groupName>]n

Returns a list of user-defined groups n is the number of groups, followed by a (group URI, group name) pair for every group

Example:

230 2 http://foo.org/nabustore/Groups/jabber.foo.org/alice/friends friends
      http://foo.org/nabustore/Groups/jabber.foo.org/alice/family family

249 (debug)

This returns debug information, request via the DEBUG request. This response is not formally specified and for interactive use only.

Acknoledgement responses

These responses acknowledge that the corresponding request was executed, without containing any detailed information.

250 (presence logging enabled)

Presence logging was enabled.

251 (presence logging disabled)

Presence logging was disabled.

252 (message logging enabled)

Message logging was enabled.

253 (message logging disabled)

Message logging was disabled.

254 (user observation enabled)

User observation was enabled.

255 (user observation disabled)

User observation was disabled.

260 (policy created)

Policy was created.

261 (policy activated)

The active policy has changed.

262 (policy deleted)

Policy was deleted.

263 (policy edited)

Policy editing was successful.

264 (policy changed)

Policy was changed for a resource.

265 (group created)

Group was created.

266 (group deleted)

Group was deleted.

267 (group edited)

Group was edited.

270 (statement created)

User statement was added to the graph.

271 (statement deleted)

User statement was removed from the graph.

280 (message deleted)

Message was deleted.

Error responses

400 (bad request)

The request is unknown (unknown command name), or the syntax is wrong (invalid parameters).

401 (permission denied)

Permission was denied due to security and/or privacy settings. This is e.g. returned when the user tries to read a message he is not allowed to access.

420 (invalid query)

The query syntax (e.g. SPARQL) was invalid. A more description is appended.

430 (policy already exists)

Returned when the user tries to create a policy that already exists.

431 (policy not found)

Returned when the request refers to a non-existant policy.

432 (group already exists)

Returned when the user tries to create a group that already exists.

433 (group not found)

Returned when the request refers to a non-existant group.

441 (account not found)

Returned when the request refers to a non-existant account.

442 (resource not found)

Returned when the request refers to a non-existant resource.

443 (statement not found)

Returned when the request refers to a non-existant statement.

444 (group list not found)

Returned when the request refers to a non-existant group list.

500 (server error)

Returned when an internal server error occurs, due to a bug in the implementation.

Last modified 13 years ago Last modified on 08/01/05 00:52:04