/* * * 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 _ITDMLISTENER_H #define _ITDMLISTENER_H #include "IUCHStore.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{ class ITDM; /** * ITDMListener receives calls from TDM. UCH implements this interface. * The Listener gets information from TDM regarding Discovery and Discarding of devices. * * @author Parikshit Thakur & Team, Trace R&D Center * @version $Revision: 1.1 $ */ class ITDMListener{ public: /** * This function is called by a TDM when it has discovered a new target * and loads appropriate TA for the new target. * If the corresponding TA is already installed, the new target should be registered with the already installed TA. * * @param targetProps a Map of discovered Target Properties * @param taProps a Map of TA(Target Adapter)'s Properties * @return a String The UCH shall return the targetId (String) that it has assigned the newly discovered target. This may be identical to the property 'targetInstance' in targetProps */ virtual string targetDiscovered(map*targetProps, map*taProps){} /** * A TDM calls this function when a target has been disappeared from the network. * * @param targetId a String value of targetId */ virtual void targetDiscarded(string targetId){} /** * Get the Local UCH Store. * * @return an Object of IUCHStore */ virtual IUCHStore* getLocalUCHStore(){} /** * Get specified document through HTTP GET or POST. * * @param uri a String value of URI * @param postData a String value of postData * @return a String value of requested Document * @throws UCHException */ virtual string getDocument(string uri, string postData) {} /** * Get a Map of UCH Properties. * * @return an object of Map or UCH Properties */ virtual map *getUCHProps(){} /** * 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){} /** * Get the IP address of the UCH. * * @return return a string value */ virtual string getIpAddress(){} /** * The ITDM requests the UCH to start servicing a URI which is made up of a given scheme, port, and base path. * If successful, then the UCH will forward all messages that have this URI as its base, to controllerRequest(). * * @param tdm an Object of ITDM * @param scheme a String value of scheme * @param port an int value of port number * @param portIsFlexible a boolean value * @param basePath a String value of basePath * @param basePathIsFlexible a boolean value * @return a String value of URI * @throws UCHException */ virtual string startUriService(ITDM *tdm, string scheme, int port, bool portIsFlexible, string basePath, bool basePathIsFlexible){} /** * The ITDM requests the UCH to stop servicing a URI that was requested to be serviced in a previous call to startUriService(). * * @param uri a String value of URI * @throws UCHException */ virtual void stopUriService(string uri){} }; } } } #endif /* _ITDMLISTENER_H */