Page Content:
Please refer to the UCH specification.
You must mplement the IUIPM Interface, and may use any method of the IUIPMListener.
Step 3. Implement Step by Step the following methods as written below:
init(IUIPMListener *uipmListener, map<string, string> *uipmProps, map<string, string> *uchProps)
When the UIPM is installed and loaded, the UCH calls init() prior to any other UIPM function. This allows the UIPM to initialize itself.
If UIPM fails to instantiate itself (because of uipmListener is null or uipmProps are invalid/in-sufficient or because of any other problem) then UIPM should throw UIPMFatalException().
UIPM should Store the reference of 'uipmListener' for invoking methods of IUIPMListener.
UIPM should start URI services for the URI's which are independent of any Target Control, by invoking startUriService() of IUIPMListener.
void targetDiscovered(string targetId)
This function is called when a new target has been discovered after initialization of the UIPM.
UIPM should collect information(like targetName, Target Description URI, Socket Names, Socket Friendly Names, Socket Description URIs) for preparing a URI which the UIPM will service. It can call IUIPMListener's startUriService() to forward all requests on that URI to this UIPM. After that is done, it needs to call IUIPMListener's addCompatibleUI() for the registering to the UCH, so that UCH can show to the controllers, which Compatible UIs are availale to control.
UIPM can get baseUri(http://myurc.org/ns/res#httpBaseUrl) from 'uipmProps' which is used for startUriService() for discovered Target.
UIPM should maintain information about all the URI's for which service is started, so that it can call IUIPMListener's stopServiceURI() when the target is discarded.
Read more in UCH Specification.
void controllerRequest(map<string,string>* request, map<string,string>* response)
When UCH receives a request on a particular URI, which was registered by this UIPM, then it calls this method to forward the Request.
UIPM should parse the 'request' and invoke relative method of IUIPMListener. And make changes to the 'response' according to the return of the invoked IUIPMListener's method.
UIPM needs to call any one of the openSession(), getValues(), setValueRequest(),getResource() or closeSession() of the IUIPMListener according to the queryString and requestBody of 'request', or as defined by the UIPM protocol.
Called From IUIPMListener when value/state of target is changed.
UIPM has two ways to handle this:
void sessionAborted(string sessionId)
Called from IUIPMListener when target encounter a problem that can not be fixed or target is discarded from network before calling targetDiscarded(), if session is existing with that target.
UIPM should clean up information about that session. It should also close any Update Channel, if exists, with the controller or any such session specific functionality provided by the UIPM.
void targetDiscarded(string targetId)
Called from IUIPMListener when target encountered a problem that can not be fixed or target is discarded from the network.
UIPM should clean up all information about that target and also invoke stopServiceUri() and removeCompatibleUIs() of IUIPMListener for the URIs related to that target.
UCH header files required:
Please refer to How to create a dynamic library.
Please refer to How to Modify the UCH Configuration File.
Last update: Parikshit Thakur & Team, 2008-05-26; Gottfried Zimmermann, 2008-06-25