Class PushHttpHandler

java.lang.Object
com.iizix.server.push.engine.http.PushHttpHandler

public final class PushHttpHandler extends Object
The five POST /iizi-push/<func> endpoints of WIRE-CONTRACT §1, implemented to the client as it is: keys, get_subs, subscribe, unsubscribe and push.

The common front door (§0.3, §4.1): POST only; the X-iizi header is the device UUID and must parse, else 400; the body is JSON, else 400; a reply is application/json;charset=utf-8 with no caching, always a non-empty object, because the client treats an empty 200 as a failure. A failure carries its status and an error member the client never shows (§7.27) but a log or a curl does.

Authentication is delegated to an PushHttpHandler.Authenticator: Authorization: Basic (the header the client sends; the severed handler read Authentication, §7.7) against the server's users. What happens when the client sends no credentials over plain http (§7.5) is the authenticator's policy.

Names: application ID and Topic are validated with Utilities.getValidName and the returned string is what is stored and looked up (ruling S-C11). * is the iiziRun application; the empty Topic is the application-level subscription (§7.11: the client sends "", and that is what is stored).

Author:
Christopher Mindus