/*
* Guacamole - Pure JavaScript/HTML VNC Client
* Copyright (C) 2010 Michael Jumper
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
function GuacamoleMessage(xml) {
var server = null;
var framebuffer = null;
var errors = new Array();
var updates = new Array();
this.getServer = function() { return server; };
this.getFramebuffer = function() { return framebuffer; };
this.getErrors = function() { return errors; };
this.hasErrors = function() { return errors.length > 0; };
this.getUpdates = function() { return updates; };
if (xml) {
// Parse document
var root = xml.documentElement;
if (root) {
// Parse errors
var errorElements = root.getElementsByTagName("error");
if (errorElements.length >= 1) {
for (var errorIndex=0; errorIndex