/* * * Copyright (C) 2006-2008 Board of Regents of the University of Wisconsin System (Univ. of Wisconsin-Madison, Trace R&D Center). * * This piece of the software package, developed by the Trace Center - University of Wisconsin is released to the public domain with only the following restrictions: * * 1) That the following acknowledgement be included in the source code and documentation for the program or package that use this code: * * "Parts of this program were based on software developed by the Trace Center, University of Wisconsin-Madison under funding from NIDRR / US Dept of Education." * * 2) That this program not be modified unless it is plainly marked as modified from the original distributed by Trace. * * NOTE: This license agreement does not cover third-party components bundled with this software, which have their own license agreement with them. A list of included third-party components with references to their license files is provided with this distribution. * * This software was developed under funding from NIDRR / US Dept of Education under grant # H133E030012. * * THIS SOFTWARE IS EXPERIMENTAL/DEMONSTRATION IN NATURE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Note: This file is based on the UCH 1.0 specification of the URC Consortium, http://myurc.org/TR/uch1.0/. * */ #ifndef _IUIPM_H #define _IUIPM_H #include "IUIPMListener.h" #include "LoggerUtil.h" #include #include #include using std::string; using std::map; using std::list; using namespace std; using namespace org::myurc::uch; namespace org { namespace myurc{ namespace uch{ /** * UIPM - User Interface Protocol Module, takes care of communication from the end-client to the UCH. * * After getting information from ITDMListener regarding Discovery and Discarding of devices, * UCH instantiates UIPM if it is not instantiated, if it is already instantiated then UCH informs UIPM about * Discovery and Discarding of the devices. UIPM forwards calls to the UCH and gets desired response. * * @author Parikshit Thakur & Team, Trace R&D Center * @version $Revision: 1.1 $ */ class IUIPM{ private: public: /** * When the UIPM is installed and loaded, the UCH calls this method prior to any other UIPM function * and allows the UIPM to initialize itself. * * @param uipmListener an Object of IUIPMListener * @param uipmProps a Map of IUIPM Properties * @param uchProps a Map of UCH Properties * @throws UIPMFatalException */ virtual void init(IUIPMListener*uipmListener, map *uipmProps, map *uchProps){} /** * The UCH should call finalize() before it uninstalls or unloads the UIPM. * */ virtual void finalize(){} /** * Returns Properties of UIPM. * * @return Map */ virtual map *getUIPMProps(){} /** * This function is called by UCH when a new target has been discovered after initialization of the UIPM. * * @param targetId a String value of targetId * @throws UIPMFatalException */ virtual void targetDiscovered(string targetId){} /** * This function is called by UCH when a target has been discarded after initialization of the UIPM. * * @param targetId a String value of targetId * @throws UIPMFatalException */ virtual void targetDiscarded(string targetId){} /** * The target requests the UIPM to open a session with a different socket. * * @param sessionId a String value of sessionId * @param forwardInfo a Map value * @throws UIPMFatalException */ virtual void sessionForwardRequest(string sessionId, map *forwardInfo){} /** * The target has terminated a session. * * @param sessionId a String value of sessionId * @throws UIPMFatalException */ virtual void sessionAborted(string sessionId){} /** * The target's status has changed, affecting one or more sessions. * * @param sessionIds a List of sessionIds * @param paths a List of paths * @param operations a List of operations * @param values a List of values * @param hasDynRes a List of hasDynRes * @throws UIPMFatalException */ virtual void updateValues(list *sessionIds, list *paths, list *operations, list *values, list *hasDynRes){} /** * Checks whether specified function is implemented or not. * * @param functionName a String value of function Name * @return whether the function is implemented or not */ virtual bool isImplemented(string functionName){} /** * The UCH calls this function if it has received a request from a controller to a URI * that the UIPM has claimed for itself by a previous call to startUriService().It call * desired methods of IUIPMListener and make changes to response object. * * @param request an Object of HttpServletRequest * @param response an Object of HttpServletResponse */ virtual void controllerRequest(map *requestMap, map*responseMap){} }; } } } #endif /* _IUIPM_H */