"Fossies" - the Fresh Open Source Software Archive

Member "netxms-3.8.193/src/server/libnxsrv/hdlink.cpp" (4 Mar 2021, 3176 Bytes) of package /linux/misc/netxms-3.8.193.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "hdlink.cpp" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3.6.300_vs_3.7.95.

    1 /* 
    2 ** NetXMS - Network Management System
    3 ** Copyright (C) 2003-2014 Victor Kirhenshtein
    4 **
    5 ** This program is free software; you can redistribute it and/or modify
    6 ** it under the terms of the GNU Lesser General Public License as published by
    7 ** the Free Software Foundation; either version 3 of the License, or
    8 ** (at your option) any later version.
    9 **
   10 ** This program is distributed in the hope that it will be useful,
   11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 ** GNU General Public License for more details.
   14 **
   15 ** You should have received a copy of the GNU Lesser General Public License
   16 ** along with this program; if not, write to the Free Software
   17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18 **
   19 ** File: hdlink.cpp
   20 **/
   21 
   22 #include "libnxsrv.h"
   23 #include <hdlink.h>
   24 #include <netxms-version.h>
   25 
   26 /**
   27  * Server entry points for alarm resolve and close
   28  */
   29 static UINT32 (*__resolveAlarmByHdRef)(const TCHAR *hdref);
   30 static UINT32 (*__closeAlarmByHdRef)(const TCHAR *hdref);
   31 
   32 /**
   33  * Initialize server entry points
   34  */
   35 void LIBNXSRV_EXPORTABLE SetHDLinkEntryPoints(UINT32 (*__resolve)(const TCHAR *), UINT32 (*__close)(const TCHAR *))
   36 {
   37    __resolveAlarmByHdRef = __resolve;
   38    __closeAlarmByHdRef = __close;
   39 }
   40 
   41 /**
   42  * Constructor
   43  */
   44 HelpDeskLink::HelpDeskLink()
   45 {
   46 }
   47 
   48 /**
   49  * Destructor
   50  */
   51 HelpDeskLink::~HelpDeskLink()
   52 {
   53 }
   54 
   55 /**
   56  * Get module name
   57  *
   58  * @return module name
   59  */
   60 const TCHAR *HelpDeskLink::getName()
   61 {
   62     return _T("GENERIC");
   63 }
   64 
   65 /**
   66  * Get module version
   67  *
   68  * @return module version
   69  */
   70 const TCHAR *HelpDeskLink::getVersion()
   71 {
   72     return NETXMS_VERSION_STRING;
   73 }
   74 
   75 /**
   76  * Initialize module
   77  *
   78  * @return true if initialization was successful
   79  */
   80 bool HelpDeskLink::init()
   81 {
   82    return true;
   83 }
   84 
   85 /**
   86  * Check that connection with helpdesk system is working
   87  *
   88  * @return true if connection is working
   89  */
   90 bool HelpDeskLink::checkConnection()
   91 {
   92    return false;
   93 }
   94 
   95 /**
   96  * Open new issue in helpdesk system.
   97  *
   98  * @param description description for issue to be opened
   99  * @param hdref reference assigned to issue by helpdesk system
  100  * @return RCC ready to be sent to client
  101  */
  102 UINT32 HelpDeskLink::openIssue(const TCHAR *description, TCHAR *hdref)
  103 {
  104    return RCC_NOT_IMPLEMENTED;
  105 }
  106 
  107 /**
  108  * Add comment to existing issue
  109  *
  110  * @param hdref issue reference
  111  * @param comment comment text
  112  * @return RCC ready to be sent to client
  113  */
  114 UINT32 HelpDeskLink::addComment(const TCHAR *hdref, const TCHAR *comment)
  115 {
  116    return RCC_NOT_IMPLEMENTED;
  117 }
  118 
  119 /**
  120  * Must be called by actual link implementation when issue 
  121  * is resolved in helpdesk system.
  122  *
  123  * @param hdref helpdesk issue reference
  124  */
  125 void HelpDeskLink::onResolveIssue(const TCHAR *hdref)
  126 {
  127    __resolveAlarmByHdRef(hdref);
  128 }
  129 
  130 /**
  131  * Must be called by actual link implementation when issue 
  132  * is closed in helpdesk system.
  133  *
  134  * @param hdref helpdesk issue reference
  135  */
  136 void HelpDeskLink::onCloseIssue(const TCHAR *hdref)
  137 {
  138    __closeAlarmByHdRef(hdref);
  139 }
  140 
  141 /**
  142  * Get URL to view issue in helpdesk system
  143  */
  144 bool HelpDeskLink::getIssueUrl(const TCHAR *hdref, TCHAR *url, size_t size)
  145 {
  146    return false;
  147 }