public MsmServiceExample(MsmMonitorRequest request)
 {
     this.request = request;
     response     = new MsmMonitorResponse {
         source  = getRequestMapping(),
         version = "1.0"
     };
 }
Exemple #2
0
 public MsmServiceInterface getMonitorForRequest(MsmMonitorRequest request)
 {
     if (MsmServiceHWiNFO.REQUEST_MAPPING.Equals(request.source, StringComparison.InvariantCultureIgnoreCase))
     {
         log.Debug("@SERVICE#MsmServiceHWiNFO");
         return(new MsmServiceHWiNFO(request));
     }
     else if (MsmServiceExample.REQUEST_MAPPING.Equals(request.source, StringComparison.InvariantCultureIgnoreCase))
     {
         log.Debug("@SERVICE#MsmServiceExample");
         return(new MsmServiceExample(request));
     }
     else
     {
         logUnknownServiceRequested(request);
         request.source = MsmServiceExample.REQUEST_MAPPING;
         return(new MsmServiceExample(request));
     }
 }
Exemple #3
0
 public static void Main(string[] commandLineArguments)
 {
     MsmLogging.configureLogging();
     log.Debug("MSM starting#args@" + commandLineArguments.Length);
     if (commandLineArguments.Length != 1)
     {
         log.Warn("Invalid command line specified : @JSON#" + commandLineArguments);
         sendInvalidCommandLineJsonResponse(commandLineArguments);
     }
     else
     {
         try {
             var json    = commandLineArguments[REQUEST_BODY_OFFSET];
             var request = new MsmMonitorRequest(json);
             log.Debug("Request forged@" + request.ToString());
             var monitor = new MintySenorMonitor(request);
             log.Debug("Monitor forged@" + monitor.ToString());
             sendValidJsonResponse(monitor.getSensorInfoAsJSON());
         } catch (MsmException e) {
             log.Error("@" + e.InnerException.Source + "#" + e.Message, e);
             sendInvalidJsonResponse(e);
         }
     }
 }
 public MintySenorMonitor(MsmMonitorRequest request)
 {
     this.request  = request;
     this.response = new MsmMonitorResponse();
     log.Debug("Created new MintySensorMonitor");
 }