decentralized-internet
Version:
An NPM library of programs to create decentralized web and distributed computing projects
1,107 lines • 339 kB
JavaScript
$estr = function() { return js.Boot.__string_rec(this,''); }
if(typeof henkolib=='undefined') henkolib = {}
if(!henkolib.events) henkolib.events = {}
henkolib.events.PublicEvent = function() { }
henkolib.events.PublicEvent.__name__ = ["henkolib","events","PublicEvent"];
henkolib.events.PublicEvent.prototype.subscribe = null;
henkolib.events.PublicEvent.prototype.unsubscribe = null;
henkolib.events.PublicEvent.prototype.__class__ = henkolib.events.PublicEvent;
if(typeof gridbee=='undefined') gridbee = {}
if(!gridbee.worksource) gridbee.worksource = {}
if(!gridbee.worksource.boinc) gridbee.worksource.boinc = {}
if(!gridbee.worksource.boinc.webrpc) gridbee.worksource.boinc.webrpc = {}
if(!gridbee.worksource.boinc.webrpc.result) gridbee.worksource.boinc.webrpc.result = {}
gridbee.worksource.boinc.webrpc.result.TeamMembrListRes = function(input) {
if( input === $_ ) return;
if(input.hasNode.resolve("user")) {
this.Membr_arr = new Array();
var $it0 = input.nodes.resolve("user").iterator();
while( $it0.hasNext() ) {
var i = $it0.next();
this.Membr_arr.push(new gridbee.worksource.boinc.webrpc.subclasses.TeamMembr(i));
}
}
}
gridbee.worksource.boinc.webrpc.result.TeamMembrListRes.__name__ = ["gridbee","worksource","boinc","webrpc","result","TeamMembrListRes"];
gridbee.worksource.boinc.webrpc.result.TeamMembrListRes.prototype.Membr_arr = null;
gridbee.worksource.boinc.webrpc.result.TeamMembrListRes.prototype.print = function() {
if(this.Membr_arr[0] != null) this.Membr_arr[0].print(); else haxe.Log.trace("No members",{ fileName : "TeamMembrListRes.hx", lineNumber : 40, className : "gridbee.worksource.boinc.webrpc.result.TeamMembrListRes", methodName : "print"});
}
gridbee.worksource.boinc.webrpc.result.TeamMembrListRes.prototype.__class__ = gridbee.worksource.boinc.webrpc.result.TeamMembrListRes;
if(!henkolib.async) henkolib.async = {}
henkolib.async.AsyncResult = function() { }
henkolib.async.AsyncResult.__name__ = ["henkolib","async","AsyncResult"];
henkolib.async.AsyncResult.prototype.isCompleted = null;
henkolib.async.AsyncResult.prototype.isError = null;
henkolib.async.AsyncResult.prototype.getError = null;
henkolib.async.AsyncResult.prototype.getProgress = null;
henkolib.async.AsyncResult.prototype.getResult = null;
henkolib.async.AsyncResult.prototype.getElapsedTime = null;
henkolib.async.AsyncResult.prototype.onComplete = null;
henkolib.async.AsyncResult.prototype.onError = null;
henkolib.async.AsyncResult.prototype.onProgress = null;
henkolib.async.AsyncResult.prototype.__class__ = henkolib.async.AsyncResult;
gridbee.Main = function() { }
gridbee.Main.__name__ = ["gridbee","Main"];
gridbee.Main.main = function() {
}
gridbee.Main.prototype.__class__ = gridbee.Main;
if(!gridbee.js) gridbee.js = {}
gridbee.js.Event = function() { }
gridbee.js.Event.__name__ = ["gridbee","js","Event"];
gridbee.js.Event.prototype.__class__ = gridbee.js.Event;
henkolib.async.AsyncOperation = function(p) {
if( p === $_ ) return;
this.starttime = Date.now();
this.state = henkolib.async.AsyncState.Waiting;
this.result = null;
this.error = null;
this.progress = 0;
this.onComplete = this.oncomplete = new henkolib.events.Event();
this.onError = this.onerror = new henkolib.events.Event();
this.onProgress = this.onprogress = new henkolib.events.Event();
}
henkolib.async.AsyncOperation.__name__ = ["henkolib","async","AsyncOperation"];
henkolib.async.AsyncOperation.prototype.result = null;
henkolib.async.AsyncOperation.prototype.error = null;
henkolib.async.AsyncOperation.prototype.progress = null;
henkolib.async.AsyncOperation.prototype.state = null;
henkolib.async.AsyncOperation.prototype.starttime = null;
henkolib.async.AsyncOperation.prototype.oncomplete = null;
henkolib.async.AsyncOperation.prototype.onerror = null;
henkolib.async.AsyncOperation.prototype.onprogress = null;
henkolib.async.AsyncOperation.prototype.onComplete = null;
henkolib.async.AsyncOperation.prototype.onError = null;
henkolib.async.AsyncOperation.prototype.onProgress = null;
henkolib.async.AsyncOperation.prototype.setResult = function(result) {
if(this.state == henkolib.async.AsyncState.Waiting) {
var self = this;
haxe.Timer.delay(function() {
self.result = result;
self.state = henkolib.async.AsyncState.Completed;
self.progress = 1.0;
self.onprogress.invoke(self.progress);
self.oncomplete.invoke(result);
},0);
} else henkolib.log.Console.main.logError("Async operation result can only be set once!",null,null,{ fileName : "AsyncOperation.hx", lineNumber : 76, className : "henkolib.async.AsyncOperation", methodName : "setResult"});
}
henkolib.async.AsyncOperation.prototype.setError = function(error) {
if(this.state == henkolib.async.AsyncState.Waiting) {
this.error = error;
this.state = henkolib.async.AsyncState.Error;
this.onerror.invoke(error);
} else henkolib.log.Console.main.logError("Async operation error can only be set once!",null,null,{ fileName : "AsyncOperation.hx", lineNumber : 90, className : "henkolib.async.AsyncOperation", methodName : "setError"});
}
henkolib.async.AsyncOperation.prototype.setProgress = function(progress) {
if(progress > this.progress) {
this.progress = progress;
this.onprogress.invoke(progress);
}
}
henkolib.async.AsyncOperation.prototype.getElapsedTime = function() {
return Date.fromTime(Date.now().getTime() - this.starttime.getTime());
}
henkolib.async.AsyncOperation.prototype.isCompleted = function() {
return this.state == henkolib.async.AsyncState.Completed;
}
henkolib.async.AsyncOperation.prototype.isError = function() {
return this.state == henkolib.async.AsyncState.Error;
}
henkolib.async.AsyncOperation.prototype.getState = function() {
return this.state;
}
henkolib.async.AsyncOperation.prototype.getError = function() {
if(this.state != henkolib.async.AsyncState.Error) henkolib.log.Console.main.logWarning("Async operation has not completed yet.",null,null,{ fileName : "AsyncOperation.hx", lineNumber : 125, className : "henkolib.async.AsyncOperation", methodName : "getError"});
return this.error;
}
henkolib.async.AsyncOperation.prototype.getProgress = function() {
return this.progress;
}
henkolib.async.AsyncOperation.prototype.getResult = function() {
if(this.state != henkolib.async.AsyncState.Completed) henkolib.log.Console.main.logWarning("Async operation has not completed yet.",null,null,{ fileName : "AsyncOperation.hx", lineNumber : 136, className : "henkolib.async.AsyncOperation", methodName : "getResult"});
return this.result;
}
henkolib.async.AsyncOperation.prototype.__class__ = henkolib.async.AsyncOperation;
henkolib.async.AsyncOperation.__interfaces__ = [henkolib.async.AsyncResult];
if(!gridbee.core) gridbee.core = {}
if(!gridbee.core.iface) gridbee.core.iface = {}
gridbee.core.iface.Persistent = function() { }
gridbee.core.iface.Persistent.__name__ = ["gridbee","core","iface","Persistent"];
gridbee.core.iface.Persistent.prototype.init = null;
gridbee.core.iface.Persistent.prototype.isChanged = null;
gridbee.core.iface.Persistent.prototype.hxSerialize = null;
gridbee.core.iface.Persistent.prototype.hxUnserialize = null;
gridbee.core.iface.Persistent.prototype.__class__ = gridbee.core.iface.Persistent;
gridbee.core.iface.Operable = function() { }
gridbee.core.iface.Operable.__name__ = ["gridbee","core","iface","Operable"];
gridbee.core.iface.Operable.prototype.operate = null;
gridbee.core.iface.Operable.prototype.__class__ = gridbee.core.iface.Operable;
if(!gridbee.core.work) gridbee.core.work = {}
gridbee.core.work.WorkSourcePool = function(p) {
if( p === $_ ) return;
this.worksources = new Array();
this.targetactive = 1;
this.currentwsindex = 0;
this.init();
henkolib.log.Console.main.logNotice("WorkSourcePool created: targetactive = " + this.targetactive,null,null,{ fileName : "WorkSourcePool.hx", lineNumber : 42, className : "gridbee.core.work.WorkSourcePool", methodName : "new"});
}
gridbee.core.work.WorkSourcePool.__name__ = ["gridbee","core","work","WorkSourcePool"];
gridbee.core.work.WorkSourcePool.prototype.worksources = null;
gridbee.core.work.WorkSourcePool.prototype.targetactive = null;
gridbee.core.work.WorkSourcePool.prototype.currentwsindex = null;
gridbee.core.work.WorkSourcePool.prototype.changed = null;
gridbee.core.work.WorkSourcePool.prototype.init = function() {
this.changed = false;
this.currentwsindex = 0;
this.changed = false;
}
gridbee.core.work.WorkSourcePool.prototype.addWorkSource = function(ws) {
this.worksources.push(ws);
this.changed = true;
}
gridbee.core.work.WorkSourcePool.prototype.removeWorkSource = function(ws) {
this.worksources.remove(ws);
}
gridbee.core.work.WorkSourcePool.prototype.getWorkSources = function() {
return this.worksources;
}
gridbee.core.work.WorkSourcePool.prototype.setTargetActive = function(num) {
this.targetactive = num;
}
gridbee.core.work.WorkSourcePool.prototype.getTargetActive = function() {
return this.targetactive;
}
gridbee.core.work.WorkSourcePool.prototype.getNumActive = function() {
var active = 0;
var _g = 0, _g1 = this.worksources;
while(_g < _g1.length) {
var ws = _g1[_g];
++_g;
active += ws.getNumActive();
}
return active;
}
gridbee.core.work.WorkSourcePool.prototype.stepToNext = function() {
this.currentwsindex = (this.currentwsindex + 1) % this.worksources.length;
}
gridbee.core.work.WorkSourcePool.prototype.stepToPrev = function() {
if(this.currentwsindex == 0) this.currentwsindex = this.worksources.length - 1; else this.currentwsindex == this.currentwsindex - 1;
}
gridbee.core.work.WorkSourcePool.prototype.operate = function() {
var _g = 0, _g1 = this.worksources;
while(_g < _g1.length) {
var ws = _g1[_g];
++_g;
ws.operate();
}
if(this.getNumActive() < this.targetactive && this.worksources.length > 0) {
this.stepToNext();
this.worksources[this.currentwsindex].startOne();
}
if(this.getNumActive() > this.targetactive) {
this.worksources[this.currentwsindex].terminateOne();
this.stepToPrev();
}
}
gridbee.core.work.WorkSourcePool.prototype.terminate = function() {
var _g = 0, _g1 = this.worksources;
while(_g < _g1.length) {
var ws = _g1[_g];
++_g;
ws.terminate();
}
}
gridbee.core.work.WorkSourcePool.prototype.isChanged = function() {
var _g = 0, _g1 = this.worksources;
while(_g < _g1.length) {
var ws = _g1[_g];
++_g;
if(ws.isChanged()) this.changed = true;
}
return this.changed;
}
gridbee.core.work.WorkSourcePool.prototype.hxSerialize = function(s) {
s.serialize(this.worksources);
s.serialize(this.targetactive);
this.changed = false;
}
gridbee.core.work.WorkSourcePool.prototype.hxUnserialize = function(s) {
this.worksources = s.unserialize();
this.targetactive = s.unserialize();
this.init();
}
gridbee.core.work.WorkSourcePool.prototype.__class__ = gridbee.core.work.WorkSourcePool;
gridbee.core.work.WorkSourcePool.__interfaces__ = [gridbee.core.iface.Persistent,gridbee.core.iface.Operable];
if(!gridbee.worksource.boinc.request) gridbee.worksource.boinc.request = {}
gridbee.worksource.boinc.request.Host = function(p) {
if( p === $_ ) return;
this.hostid = null;
this.host_info = new gridbee.worksource.boinc.request.HostInfo();
}
gridbee.worksource.boinc.request.Host.__name__ = ["gridbee","worksource","boinc","request","Host"];
gridbee.worksource.boinc.request.Host.prototype.hostid = null;
gridbee.worksource.boinc.request.Host.prototype.host_info = null;
gridbee.worksource.boinc.request.Host.prototype.toXmlString = function(indent) {
if(indent == null) indent = "";
var xml = "";
if(this.hostid != null) xml += indent + "<hostid>" + this.hostid + "</hostid>\n";
if(this.host_info != null) xml += this.host_info.toXmlString(indent);
return xml;
}
gridbee.worksource.boinc.request.Host.prototype.__class__ = gridbee.worksource.boinc.request.Host;
gridbee.worksource.boinc.BoincUploader = function(wu) {
if( wu === $_ ) return;
this.workunit = wu.getUnitinfo();
this.boincworkunit = wu;
this.context = wu.getContext();
this.results = new Array();
this.status = new henkolib.async.AsyncOperation();
}
gridbee.worksource.boinc.BoincUploader.__name__ = ["gridbee","worksource","boinc","BoincUploader"];
gridbee.worksource.boinc.BoincUploader.prototype.workunit = null;
gridbee.worksource.boinc.BoincUploader.prototype.boincworkunit = null;
gridbee.worksource.boinc.BoincUploader.prototype.context = null;
gridbee.worksource.boinc.BoincUploader.prototype.results = null;
gridbee.worksource.boinc.BoincUploader.prototype.status = null;
gridbee.worksource.boinc.BoincUploader.prototype.uploadAll = function() {
this.boincworkunit.setUploadingState();
henkolib.log.Console.main.logNotice("Uploading results.",null,null,{ fileName : "BoincUploader.hx", lineNumber : 55, className : "gridbee.worksource.boinc.BoincUploader", methodName : "uploadAll"});
var streams = this.context.getFileList();
var _g = 0;
while(_g < streams.length) {
var stream = streams[_g];
++_g;
var ok = false;
var _g1 = 0, _g2 = this.workunit.result.file_ref;
while(_g1 < _g2.length) {
var ref = _g2[_g1];
++_g1;
if(ref.open_name == stream) {
this.results.push(new gridbee.worksource.boinc.BoincResult(this.boincworkunit,this.workunit.result,ref,this.context.read(ref.open_name)));
ok = true;
}
}
if(!ok) {
}
}
return this.status;
}
gridbee.worksource.boinc.BoincUploader.prototype.isChanged = function() {
var _g = 0, _g1 = this.results;
while(_g < _g1.length) {
var r = _g1[_g];
++_g;
if(r.isChanged()) return true;
}
return false;
}
gridbee.worksource.boinc.BoincUploader.prototype.isCompleted = function() {
return this.status.isCompleted();
}
gridbee.worksource.boinc.BoincUploader.prototype.getResult = function() {
if(this.status.isCompleted()) return this.status.getResult(); else return null;
}
gridbee.worksource.boinc.BoincUploader.prototype.operate = function() {
if(!this.status.isError()) {
var _g = 0, _g1 = this.results;
while(_g < _g1.length) {
var result = _g1[_g];
++_g;
result.operate();
}
var completed = this.results.length > 0;
var error = false;
var _g = 0, _g1 = this.results;
while(_g < _g1.length) {
var result = _g1[_g];
++_g;
completed = completed && result.isCompleted();
error = error || result.isError();
}
if(completed) {
if(!this.status.isCompleted()) {
this.status.setResult(this.boincworkunit);
this.boincworkunit.setUploadedState(this.results);
}
} else if(error) this.status.setError("Error while uploading results");
}
}
gridbee.worksource.boinc.BoincUploader.prototype.__class__ = gridbee.worksource.boinc.BoincUploader;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes = function(input) {
if( input === $_ ) return;
if(input.hasNode.resolve("id")) this.id = Std.parseInt(input.node.resolve("id").getInnerData());
if(input.hasNode.resolve("cpid")) this.cpid = input.node.resolve("cpid").getInnerData();
if(input.hasNode.resolve("create_time")) this.create_time = Std.parseInt(input.node.resolve("create_time").getInnerData());
if(input.hasNode.resolve("name")) this.name = input.node.resolve("name").getInnerData();
if(input.hasNode.resolve("country")) this.country = input.node.resolve("country").getInnerData();
if(input.hasNode.resolve("total_credit")) this.total_credit = Std.parseFloat(input.node.resolve("total_credit").getInnerData());
if(input.hasNode.resolve("expavg_credit")) this.expavg_credit = Std.parseFloat(input.node.resolve("expavg_credit").getInnerData());
if(input.hasNode.resolve("expavg_time")) this.expavg_time = Std.parseFloat(input.node.resolve("expavg_time").getInnerData());
if(input.hasNode.resolve("teamid")) this.teamid = Std.parseInt(input.node.resolve("teamid").getInnerData());
if(input.hasNode.resolve("url")) this.url = input.node.resolve("url").getInnerData();
if(input.hasNode.resolve("has_profile")) {
if(input.node.resolve("has_profile").getInnerData() == "1") this.has_profile = true; else if(input.node.resolve("has_profile").getInnerData() == "0") this.has_profile = false;
}
if(input.hasNode.resolve("host")) {
this.host_arr = new Array();
var $it0 = input.nodes.resolve("host").iterator();
while( $it0.hasNext() ) {
var i = $it0.next();
this.host_arr.push(new gridbee.worksource.boinc.webrpc.subclasses.Host(i));
}
}
}
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.__name__ = ["gridbee","worksource","boinc","webrpc","result","CreditInfoRes"];
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.id = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.cpid = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.create_time = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.name = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.country = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.total_credit = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.expavg_credit = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.expavg_time = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.teamid = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.url = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.has_profile = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.host_arr = null;
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.print = function() {
haxe.Log.trace("id: " + this.id,{ fileName : "CreditInfoRes.hx", lineNumber : 75, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("cpid:" + this.cpid,{ fileName : "CreditInfoRes.hx", lineNumber : 76, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("create_time: " + this.create_time,{ fileName : "CreditInfoRes.hx", lineNumber : 77, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("name: " + this.name,{ fileName : "CreditInfoRes.hx", lineNumber : 78, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("country: " + this.country,{ fileName : "CreditInfoRes.hx", lineNumber : 79, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("total_credit: " + this.total_credit,{ fileName : "CreditInfoRes.hx", lineNumber : 80, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("expavg_credit: " + this.expavg_credit,{ fileName : "CreditInfoRes.hx", lineNumber : 81, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("expavg_time: " + this.expavg_time,{ fileName : "CreditInfoRes.hx", lineNumber : 82, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("teamid: " + this.teamid,{ fileName : "CreditInfoRes.hx", lineNumber : 83, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("url: " + this.url,{ fileName : "CreditInfoRes.hx", lineNumber : 84, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
haxe.Log.trace("has_profile: " + this.has_profile,{ fileName : "CreditInfoRes.hx", lineNumber : 85, className : "gridbee.worksource.boinc.webrpc.result.CreditInfoRes", methodName : "print"});
}
gridbee.worksource.boinc.webrpc.result.CreditInfoRes.prototype.__class__ = gridbee.worksource.boinc.webrpc.result.CreditInfoRes;
List = function(p) {
if( p === $_ ) return;
this.length = 0;
}
List.__name__ = ["List"];
List.prototype.h = null;
List.prototype.q = null;
List.prototype.length = null;
List.prototype.add = function(item) {
var x = [item];
if(this.h == null) this.h = x; else this.q[1] = x;
this.q = x;
this.length++;
}
List.prototype.push = function(item) {
var x = [item,this.h];
this.h = x;
if(this.q == null) this.q = x;
this.length++;
}
List.prototype.first = function() {
return this.h == null?null:this.h[0];
}
List.prototype.last = function() {
return this.q == null?null:this.q[0];
}
List.prototype.pop = function() {
if(this.h == null) return null;
var x = this.h[0];
this.h = this.h[1];
if(this.h == null) this.q = null;
this.length--;
return x;
}
List.prototype.isEmpty = function() {
return this.h == null;
}
List.prototype.clear = function() {
this.h = null;
this.q = null;
this.length = 0;
}
List.prototype.remove = function(v) {
var prev = null;
var l = this.h;
while(l != null) {
if(l[0] == v) {
if(prev == null) this.h = l[1]; else prev[1] = l[1];
if(this.q == l) this.q = prev;
this.length--;
return true;
}
prev = l;
l = l[1];
}
return false;
}
List.prototype.iterator = function() {
return { h : this.h, hasNext : function() {
return this.h != null;
}, next : function() {
if(this.h == null) return null;
var x = this.h[0];
this.h = this.h[1];
return x;
}};
}
List.prototype.toString = function() {
var s = new StringBuf();
var first = true;
var l = this.h;
s.b[s.b.length] = "{" == null?"null":"{";
while(l != null) {
if(first) first = false; else s.b[s.b.length] = ", " == null?"null":", ";
s.add(Std.string(l[0]));
l = l[1];
}
s.b[s.b.length] = "}" == null?"null":"}";
return s.b.join("");
}
List.prototype.join = function(sep) {
var s = new StringBuf();
var first = true;
var l = this.h;
while(l != null) {
if(first) first = false; else s.b[s.b.length] = sep == null?"null":sep;
s.add(l[0]);
l = l[1];
}
return s.b.join("");
}
List.prototype.filter = function(f) {
var l2 = new List();
var l = this.h;
while(l != null) {
var v = l[0];
l = l[1];
if(f(v)) l2.add(v);
}
return l2;
}
List.prototype.map = function(f) {
var b = new List();
var l = this.h;
while(l != null) {
var v = l[0];
l = l[1];
b.add(f(v));
}
return b;
}
List.prototype.__class__ = List;
IntIter = function(min,max) {
if( min === $_ ) return;
this.min = min;
this.max = max;
}
IntIter.__name__ = ["IntIter"];
IntIter.prototype.min = null;
IntIter.prototype.max = null;
IntIter.prototype.hasNext = function() {
return this.min < this.max;
}
IntIter.prototype.next = function() {
return this.min++;
}
IntIter.prototype.__class__ = IntIter;
if(!gridbee.worksource.boinc.reply) gridbee.worksource.boinc.reply = {}
gridbee.worksource.boinc.reply.ResultAck = function(node) {
if( node === $_ ) return;
if(node.hasNode.resolve("name")) this.name = node.node.resolve("name").getInnerData();
}
gridbee.worksource.boinc.reply.ResultAck.__name__ = ["gridbee","worksource","boinc","reply","ResultAck"];
gridbee.worksource.boinc.reply.ResultAck.prototype.name = null;
gridbee.worksource.boinc.reply.ResultAck.prototype.__class__ = gridbee.worksource.boinc.reply.ResultAck;
gridbee.worksource.boinc.webrpc.result.AccountCreateRes = function(input) {
if( input === $_ ) return;
if(input.hasNode.resolve("authenticator")) this.authenticator = input.node.resolve("authenticator").getInnerData();
}
gridbee.worksource.boinc.webrpc.result.AccountCreateRes.__name__ = ["gridbee","worksource","boinc","webrpc","result","AccountCreateRes"];
gridbee.worksource.boinc.webrpc.result.AccountCreateRes.prototype.authenticator = null;
gridbee.worksource.boinc.webrpc.result.AccountCreateRes.prototype.print = function() {
haxe.Log.trace("authenticator: " + this.authenticator,{ fileName : "AccountCreateRes.hx", lineNumber : 34, className : "gridbee.worksource.boinc.webrpc.result.AccountCreateRes", methodName : "print"});
}
gridbee.worksource.boinc.webrpc.result.AccountCreateRes.prototype.__class__ = gridbee.worksource.boinc.webrpc.result.AccountCreateRes;
Hash = function(p) {
if( p === $_ ) return;
this.h = {}
if(this.h.__proto__ != null) {
this.h.__proto__ = null;
delete(this.h.__proto__);
}
}
Hash.__name__ = ["Hash"];
Hash.prototype.h = null;
Hash.prototype.set = function(key,value) {
this.h["$" + key] = value;
}
Hash.prototype.get = function(key) {
return this.h["$" + key];
}
Hash.prototype.exists = function(key) {
try {
key = "$" + key;
return this.hasOwnProperty.call(this.h,key);
} catch( e ) {
for(var i in this.h) if( i == key ) return true;
return false;
}
}
Hash.prototype.remove = function(key) {
if(!this.exists(key)) return false;
delete(this.h["$" + key]);
return true;
}
Hash.prototype.keys = function() {
var a = new Array();
for(var i in this.h) a.push(i.substr(1));
return a.iterator();
}
Hash.prototype.iterator = function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref["$" + i];
}};
}
Hash.prototype.toString = function() {
var s = new StringBuf();
s.b[s.b.length] = "{" == null?"null":"{";
var it = this.keys();
while( it.hasNext() ) {
var i = it.next();
s.b[s.b.length] = i == null?"null":i;
s.b[s.b.length] = " => " == null?"null":" => ";
s.add(Std.string(this.get(i)));
if(it.hasNext()) s.b[s.b.length] = ", " == null?"null":", ";
}
s.b[s.b.length] = "}" == null?"null":"}";
return s.b.join("");
}
Hash.prototype.__class__ = Hash;
IntHash = function(p) {
if( p === $_ ) return;
this.h = {}
if(this.h.__proto__ != null) {
this.h.__proto__ = null;
delete(this.h.__proto__);
}
}
IntHash.__name__ = ["IntHash"];
IntHash.prototype.h = null;
IntHash.prototype.set = function(key,value) {
this.h[key] = value;
}
IntHash.prototype.get = function(key) {
return this.h[key];
}
IntHash.prototype.exists = function(key) {
return this.h[key] != null;
}
IntHash.prototype.remove = function(key) {
if(this.h[key] == null) return false;
delete(this.h[key]);
return true;
}
IntHash.prototype.keys = function() {
var a = new Array();
for( x in this.h ) a.push(x);
return a.iterator();
}
IntHash.prototype.iterator = function() {
return { ref : this.h, it : this.keys(), hasNext : function() {
return this.it.hasNext();
}, next : function() {
var i = this.it.next();
return this.ref[i];
}};
}
IntHash.prototype.toString = function() {
var s = new StringBuf();
s.b[s.b.length] = "{" == null?"null":"{";
var it = this.keys();
while( it.hasNext() ) {
var i = it.next();
s.b[s.b.length] = i == null?"null":i;
s.b[s.b.length] = " => " == null?"null":" => ";
s.add(Std.string(this.get(i)));
if(it.hasNext()) s.b[s.b.length] = ", " == null?"null":", ";
}
s.b[s.b.length] = "}" == null?"null":"}";
return s.b.join("");
}
IntHash.prototype.__class__ = IntHash;
if(!henkolib.log) henkolib.log = {}
henkolib.log.LogSource = function() { }
henkolib.log.LogSource.__name__ = ["henkolib","log","LogSource"];
henkolib.log.LogSource.prototype.getScreenName = null;
henkolib.log.LogSource.prototype.__class__ = henkolib.log.LogSource;
gridbee.core.iface.WorkSource = function() { }
gridbee.core.iface.WorkSource.__name__ = ["gridbee","core","iface","WorkSource"];
gridbee.core.iface.WorkSource.prototype.getWorkUnits = null;
gridbee.core.iface.WorkSource.prototype.start = null;
gridbee.core.iface.WorkSource.prototype.terminate = null;
gridbee.core.iface.WorkSource.prototype.operate = null;
gridbee.core.iface.WorkSource.prototype.getNumActive = null;
gridbee.core.iface.WorkSource.prototype.startOne = null;
gridbee.core.iface.WorkSource.prototype.terminateOne = null;
gridbee.core.iface.WorkSource.prototype.onAddWorkunit = null;
gridbee.core.iface.WorkSource.prototype.onRemoveWorkunit = null;
gridbee.core.iface.WorkSource.prototype.getScreenName = null;
gridbee.core.iface.WorkSource.prototype.isChanged = null;
gridbee.core.iface.WorkSource.prototype.hxSerialize = null;
gridbee.core.iface.WorkSource.prototype.hxUnserialize = null;
gridbee.core.iface.WorkSource.prototype.__class__ = gridbee.core.iface.WorkSource;
gridbee.core.iface.WorkSource.__interfaces__ = [gridbee.core.iface.Persistent,henkolib.log.LogSource,gridbee.core.iface.Operable];
gridbee.core.work.BasicWorkSource = function(p) {
if( p === $_ ) return;
this.workpool = new gridbee.core.work.WorkUnitPool();
this.init();
}
gridbee.core.work.BasicWorkSource.__name__ = ["gridbee","core","work","BasicWorkSource"];
gridbee.core.work.BasicWorkSource.prototype.workpool = null;
gridbee.core.work.BasicWorkSource.prototype.isRunning = null;
gridbee.core.work.BasicWorkSource.prototype.onaddworkunit = null;
gridbee.core.work.BasicWorkSource.prototype.onremoveworkunit = null;
gridbee.core.work.BasicWorkSource.prototype.onAddWorkunit = null;
gridbee.core.work.BasicWorkSource.prototype.onRemoveWorkunit = null;
gridbee.core.work.BasicWorkSource.prototype.init = function() {
this.isRunning = false;
this.onAddWorkunit = this.onaddworkunit = new henkolib.events.Event();
this.onRemoveWorkunit = this.onremoveworkunit = new henkolib.events.Event();
}
gridbee.core.work.BasicWorkSource.prototype.getWorkUnits = function() {
return this.workpool.getWorkUnits();
}
gridbee.core.work.BasicWorkSource.prototype.start = function() {
this.isRunning = true;
}
gridbee.core.work.BasicWorkSource.prototype.terminate = function() {
this.isRunning = false;
this.workpool.terminateAll();
}
gridbee.core.work.BasicWorkSource.prototype.operate = function() {
if(this.isRunning) this.workpool.operate();
}
gridbee.core.work.BasicWorkSource.prototype.getNumActive = function() {
return this.workpool.getNumActive();
}
gridbee.core.work.BasicWorkSource.prototype.startOne = function() {
this.isRunning = true;
this.workpool.startOne();
}
gridbee.core.work.BasicWorkSource.prototype.terminateOne = function() {
this.workpool.terminateOne();
}
gridbee.core.work.BasicWorkSource.prototype.getScreenName = function() {
return "BasicWorkSource";
}
gridbee.core.work.BasicWorkSource.prototype.isChanged = function() {
return this.workpool.isChanged();
}
gridbee.core.work.BasicWorkSource.prototype.hxSerialize = function(s) {
s.serialize(this.workpool);
}
gridbee.core.work.BasicWorkSource.prototype.hxUnserialize = function(s) {
this.workpool = s.unserialize();
this.init();
}
gridbee.core.work.BasicWorkSource.prototype.__class__ = gridbee.core.work.BasicWorkSource;
gridbee.core.work.BasicWorkSource.__interfaces__ = [gridbee.core.iface.WorkSource];
gridbee.worksource.boinc.BoincData = function() { }
gridbee.worksource.boinc.BoincData.__name__ = ["gridbee","worksource","boinc","BoincData"];
gridbee.worksource.boinc.BoincData.prototype.toXmlString = null;
gridbee.worksource.boinc.BoincData.prototype.__class__ = gridbee.worksource.boinc.BoincData;
gridbee.worksource.boinc.request.ClientVersion = function(major,minor,release) {
if( major === $_ ) return;
if(release == null) release = 0;
if(minor == null) minor = 0;
if(major == null) major = 1;
this.core_client_major_version = major;
this.core_client_minor_version = minor;
this.core_client_release = release;
}
gridbee.worksource.boinc.request.ClientVersion.__name__ = ["gridbee","worksource","boinc","request","ClientVersion"];
gridbee.worksource.boinc.request.ClientVersion.prototype.core_client_major_version = null;
gridbee.worksource.boinc.request.ClientVersion.prototype.core_client_minor_version = null;
gridbee.worksource.boinc.request.ClientVersion.prototype.core_client_release = null;
gridbee.worksource.boinc.request.ClientVersion.prototype.toXmlString = function(indent) {
if(indent == null) indent = "";
var xml = "";
if(this.core_client_major_version != null) xml += indent + "<core_client_major_version>" + this.core_client_major_version + "</core_client_major_version>\n";
if(this.core_client_minor_version != null) xml += indent + "<core_client_minor_version>" + this.core_client_minor_version + "</core_client_minor_version>\n";
if(this.core_client_release != null) xml += indent + "<core_client_release>" + this.core_client_release + "</core_client_release>\n";
return xml;
}
gridbee.worksource.boinc.request.ClientVersion.prototype.__class__ = gridbee.worksource.boinc.request.ClientVersion;
gridbee.worksource.boinc.request.ClientVersion.__interfaces__ = [gridbee.worksource.boinc.BoincData];
gridbee.worksource.boinc.BoincWorkSource = function(scheduler_url,authkey) {
if( scheduler_url === $_ ) return;
this.projecturl = new String("");
this.projectname = new String("");
this.username = new String("");
this.uploadqueue = new Array();
this.reportqueue = new Array();
this.scheduler_url = scheduler_url;
this.authinfo = new gridbee.worksource.boinc.request.AuthInfo();
this.authinfo.authenticator = authkey;
this.benchmarkpool = new gridbee.core.work.WorkUnitPool();
this.uploader = new gridbee.worksource.boinc.BoincUploaderPool();
if(gridbee.core.info.BrowserInfo.NaCl()) {
this.platform = "nacl";
henkolib.log.Console.main.logInformation("Setting platform to 'nacl'",null,this,{ fileName : "BoincWorkSource.hx", lineNumber : 104, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "new"});
} else {
this.platform = "javascript";
henkolib.log.Console.main.logInformation("Setting platform to 'javascript'",null,this,{ fileName : "BoincWorkSource.hx", lineNumber : 109, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "new"});
}
this.host = new gridbee.worksource.boinc.request.Host();
this.host.host_info.p_fpops = 0;
this.host.host_info.p_iops = 0;
gridbee.core.work.BasicWorkSource.call(this);
}
gridbee.worksource.boinc.BoincWorkSource.__name__ = ["gridbee","worksource","boinc","BoincWorkSource"];
gridbee.worksource.boinc.BoincWorkSource.__super__ = gridbee.core.work.BasicWorkSource;
for(var k in gridbee.core.work.BasicWorkSource.prototype ) gridbee.worksource.boinc.BoincWorkSource.prototype[k] = gridbee.core.work.BasicWorkSource.prototype[k];
gridbee.worksource.boinc.BoincWorkSource.version = null;
gridbee.worksource.boinc.BoincWorkSource.getVersion = function() {
return gridbee.worksource.boinc.BoincWorkSource.version;
}
gridbee.worksource.boinc.BoincWorkSource.prototype.projecturl = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.projectname = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.username = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.platform = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.scheduler_url = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.authinfo = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.host = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.uploadqueue = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.reportqueue = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.benchmarkpool = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.requestinprogress = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.uploader = null;
gridbee.worksource.boinc.BoincWorkSource.prototype.init = function() {
gridbee.core.work.BasicWorkSource.prototype.init.call(this);
this.updateHostInfo();
this.uploader.onUpload.subscribe($closure(this,"wuUploaded"));
if(this.host.host_info.p_fpops == 0) {
this.benchmarkpool = new gridbee.core.work.WorkUnitPool();
var benchmark = new gridbee.worksource.boinc.benchmark.WhetstoneBenchmark();
var self = this;
benchmark.onComplete.subscribe(function(c) {
self.host.host_info.p_fpops = benchmark.getFlops();
self.updateHostInfo();
self.benchmarkpool.removeCompleted();
henkolib.log.Console.main.logInformation("Benchmark successfully executed.",null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 136, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "init"});
});
benchmark.onError.subscribe(function(e) {
henkolib.log.Console.main.logError("Benchmark error: " + e,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 140, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "init"});
self.benchmarkpool.removeCompleted();
});
this.benchmarkpool.addFirst(benchmark);
this.onaddworkunit.invoke(benchmark);
}
}
gridbee.worksource.boinc.BoincWorkSource.prototype.isChanged = function() {
return gridbee.core.work.BasicWorkSource.prototype.isChanged.call(this) || this.benchmarkpool.isChanged() || this.uploader.isChanged();
}
gridbee.worksource.boinc.BoincWorkSource.prototype.startOne = function() {
if(this.host.host_info.p_fpops != 0) {
if(this.workpool.getNumInit() + this.workpool.getNumPassive() == 0 && !this.requestinprogress) {
var newworks = this.requestWorks();
var self = this;
newworks.onComplete.subscribe(function(wus) {
if(wus.length == 0) {
self.platform = "javascript";
henkolib.log.Console.main.logInformation("Setting platform to JavaScript",null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 168, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "startOne"});
}
var _g = 0;
while(_g < wus.length) {
var wu = wus[_g];
++_g;
self.workpool.add(wu);
self.onaddworkunit.invoke(wu);
henkolib.log.Console.main.logInformation("New workunit recieved",null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 174, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "startOne"});
}
});
newworks.onError.subscribe(function(errormes) {
henkolib.log.Console.main.logNotice(errormes,null,null,{ fileName : "BoincWorkSource.hx", lineNumber : 180, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "startOne"});
});
}
gridbee.core.work.BasicWorkSource.prototype.startOne.call(this);
} else this.benchmarkpool.startOne();
}
gridbee.worksource.boinc.BoincWorkSource.prototype.getSchedulerUrl = function() {
return this.scheduler_url;
}
gridbee.worksource.boinc.BoincWorkSource.prototype.getAuthkey = function() {
return this.authinfo.authenticator;
}
gridbee.worksource.boinc.BoincWorkSource.prototype.updateHostInfo = function() {
gridbee.worksource.boinc.request.HostInfo.updateHostInfo(this.host.host_info);
}
gridbee.worksource.boinc.BoincWorkSource.prototype.getScreenName = function() {
return "BOINC Server WorkSource (" + this.scheduler_url + ")";
}
gridbee.worksource.boinc.BoincWorkSource.prototype.operate = function() {
gridbee.core.work.BasicWorkSource.prototype.operate.call(this);
this.uploader.operate();
var wus = this.workpool.removeCompleted();
var _g = 0;
while(_g < wus.length) {
var wu = wus[_g];
++_g;
this.uploader.add(wu);
}
}
gridbee.worksource.boinc.BoincWorkSource.prototype.wuUploaded = function(wu) {
this.reportWork(wu);
}
gridbee.worksource.boinc.BoincWorkSource.prototype.requestWorks = function() {
this.requestinprogress = true;
var request = new gridbee.worksource.boinc.request.SchedulerRequest(this.platform);
request.setClientVersion(gridbee.worksource.boinc.BoincWorkSource.version);
request.setPlatform(this.platform);
request.setAuthInfo(this.authinfo);
request.setHost(this.host);
request.setWorkRequest(new gridbee.worksource.boinc.request.WorkRequest(10));
var _g = 0, _g1 = this.reportqueue;
while(_g < _g1.length) {
var work = _g1[_g];
++_g;
henkolib.log.Console.main.logInformation("Reporting uploaded results to: " + this.getScreenName(),null,work,{ fileName : "BoincWorkSource.hx", lineNumber : 245, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
request.addResult(work.getBoincResult());
}
var result = new henkolib.async.AsyncOperation();
var self = this;
var http = gridbee.core.net.HTTPRequest.post(this.scheduler_url);
http.rawData(request.toXmlString());
http.errorCallback(function(error) {
result.setError(error);
self.requestinprogress = false;
});
http.successCallback(function(response) {
henkolib.log.Console.main.logInformation("Received Boinc Scheduler reply.",null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 257, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
var xml = new haxe.xml.Fast(Xml.parse(response.content).firstElement());
var reply = new gridbee.worksource.boinc.reply.SchedulerReply(xml);
if(reply.hostid != null) {
self.host.hostid = reply.hostid;
henkolib.log.Console.main.logNotice("Registered new host: " + reply.hostid,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 267, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
henkolib.log.Console.main.logNotice("Project name: " + reply.project_name,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 268, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
henkolib.log.Console.main.logNotice("Username: " + reply.user_name,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 269, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
}
var _g = 0, _g1 = reply.result_ack;
while(_g < _g1.length) {
var ack = _g1[_g];
++_g;
henkolib.log.Console.main.logInformation("Received result ack: " + ack.name,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 277, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
var _g2 = 0, _g3 = self.reportqueue;
while(_g2 < _g3.length) {
var work = _g3[_g2];
++_g2;
if(work.getWorkUnitResultName() == ack.name) {
self.reportqueue.remove(work);
henkolib.log.Console.main.logNotice("Reported result accepted. WorkUnit removed.",null,work,{ fileName : "BoincWorkSource.hx", lineNumber : 283, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
self.onremoveworkunit.invoke(work);
}
}
}
var _g = 0, _g1 = reply.message;
while(_g < _g1.length) {
var message = _g1[_g];
++_g;
henkolib.log.Console.main.logNotice("BOINC " + message.priority + " priority message: " + message.message,null,self,{ fileName : "BoincWorkSource.hx", lineNumber : 294, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
}
var workunits = new Array();
var _g = 0, _g1 = reply.workunit;
while(_g < _g1.length) {
var unit = _g1[_g];
++_g;
var _g2 = 0, _g3 = reply.app;
while(_g2 < _g3.length) {
var app = _g3[_g2];
++_g2;
if(app.name == unit.app_name) unit.application = app;
}
var _g2 = 0, _g3 = reply.app_version;
while(_g2 < _g3.length) {
var appv = _g3[_g2];
++_g2;
if(appv.app_name == unit.app_name) {
var _g4 = 0, _g5 = appv.file_ref;
while(_g4 < _g5.length) {
var ref = _g5[_g4];
++_g4;
var _g6 = 0, _g7 = reply.file_info;
while(_g6 < _g7.length) {
var finfo = _g7[_g6];
++_g6;
if(finfo.name == ref.file_name) ref.file_info = finfo;
if(ref.main_program) appv.main_program = ref;
}
}
unit.application.version = appv;
}
}
var _g2 = 0, _g3 = unit.file_ref;
while(_g2 < _g3.length) {
var ref = _g3[_g2];
++_g2;
var _g4 = 0, _g5 = reply.file_info;
while(_g4 < _g5.length) {
var finfo = _g5[_g4];
++_g4;
if(finfo.name == ref.file_name) ref.file_info = finfo;
}
}
var _g2 = 0, _g3 = reply.result;
while(_g2 < _g3.length) {
var res = _g3[_g2];
++_g2;
if(res.wu_name == unit.name) {
var _g4 = 0, _g5 = res.file_ref;
while(_g4 < _g5.length) {
var ref = _g5[_g4];
++_g4;
var _g6 = 0, _g7 = reply.file_info;
while(_g6 < _g7.length) {
var finfo = _g7[_g6];
++_g6;
if(finfo.name == ref.file_name) ref.file_info = finfo;
}
}
unit.result = res;
break;
}
}
var platform = "";
var _g2 = 0, _g3 = reply.app_version;
while(_g2 < _g3.length) {
var v = _g3[_g2];
++_g2;
platform = v.platform;
}
var bwu = new gridbee.worksource.boinc.BoincWorkUnit(unit,platform);
workunits.push(bwu);
}
result.setResult(workunits);
self.requestinprogress = false;
});
henkolib.log.Console.main.logInformation("Sending Boinc Scheduler request.",null,this,{ fileName : "BoincWorkSource.hx", lineNumber : 369, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "requestWorks"});
http.send();
return result;
}
gridbee.worksource.boinc.BoincWorkSource.prototype.reportWork = function(work) {
henkolib.log.Console.main.logInformation("Added to reporting queue: " + work.getScreenName(),null,this,{ fileName : "BoincWorkSource.hx", lineNumber : 377, className : "gridbee.worksource.boinc.BoincWorkSource", methodName : "reportWork"});
this.reportqueue.push(work);
}
gridbee.worksource.boinc.BoincWorkSource.prototype.hxSerialize = function(s) {
s.serialize(this.scheduler_url);
s.serialize(this.authinfo);
s.serialize(this.host);
s.serialize(this.uploader);
s.serialize(this.reportqueue);
s.serialize(this.projecturl);
s.serialize(this.projectname);
s.serialize(this.username);
s.serialize(this.platform);
gridbee.core.work.BasicWorkSource.prototype.hxSerialize.call(this,s);
}
gridbee.worksource.boinc.BoincWorkSource.prototype.hxUnserialize = function(s) {
this.scheduler_url = s.unserialize();
this.authinfo = s.unserialize();
this.host = s.unserialize();
this.uploader = s.unserialize();
this.reportqueue = s.unserialize();
this.projecturl = s.unserialize();
this.projectname = s.unserialize();
this.username = s.unserialize();
this.platform = s.unserialize();
gridbee.core.work.BasicWorkSource.prototype.hxUnserialize.call(this,s);
}
gridbee.worksource.boinc.BoincWorkSource.prototype.__class__ = gridbee.worksource.boinc.BoincWorkSource;
gridbee.worksource.boinc.request.UploadFileInfo = function(reply_file_info) {
if( reply_file_info === $_ ) return;
if(reply_file_info != null) {
this.name = reply_file_info.name;
this.generated_locally = reply_file_info.generated_locally;
this.upload_when_present = reply_file_info.upload_when_present;
this.max_nbytes = reply_file_info.max_nbytes;
this.url = reply_file_info.url;
this.xml_signature = reply_file_info.xml_signature;
}
}
gridbee.worksource.boinc.request.UploadFileInfo.__name__ = ["gridbee","worksource","boinc","request","UploadFileInfo"];
gridbee.worksource.boinc.request.UploadFileInfo.prototype.name = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.generated_locally = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.upload_when_present = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.max_nbytes = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.url = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.xml_signature = null;
gridbee.worksource.boinc.request.UploadFileInfo.prototype.toXmlString = function(indent) {
if(indent == null) indent = "";
indent = "";
var innerindent = indent + "\t";
var xml = indent + "<file_info>\n";
if(this.name != null) xml += innerindent + "<name>" + this.name + "</name>\n";
if(this.generated_locally) xml += innerindent + "<generated_locally/>\n";
if(this.upload_when_present) xml += innerindent + "<upload_when_present/>\n";
if(this.max_nbytes != null) xml += innerindent + "<max_nbytes>" + this.max_nbytes + "</max_nbytes>\n";
if(this.url != null) xml += innerindent + "<url>" + this.url + "</url>\n";
if(this.xml_signature != null) xml += "<xml_signature>" + this.xml_signature + "</xml_signature>\n";
xml += indent + "</file_info>\n";
return xml;
}
gridbee.worksource.boinc.request.UploadFileInfo.prototype.__class__ = gridbee.worksource.boinc.request.UploadFileInfo;
gridbee.worksource.boinc.request.UploadFileInfo.__interfaces__ = [gridbee.worksource.boinc.BoincData];
gridbee.js.ProgressEvent = function() { }
gridbee.js.ProgressEvent.__name__ = ["gridbee","js","ProgressEvent"];
gridbee.js.ProgressEvent.prototype.lengthComputable = null;
gridbee.js.ProgressEvent.prototype.loaded = null;
gridbee.js.ProgressEvent.prototype.total = null;
gridbee.js.ProgressEvent.prototype.__class__ = gridbee.js.ProgressEvent;
gridbee.js.ProgressEvent.__interfaces__ = [gridbee.js.Event];
gridbee.js.EventTarget = function() { }
gridbee.js.EventTarget.__name__ = ["gridbee","js","EventTarget"];
gridbee.js.EventTarget.prototype.addEventListener = null;
gridbee.js.EventTarget.prototype.removeEventListener = null;
gridbee.js.EventTarget.prototype.dispatchEvent = null;
gridbee.js.EventTarget.prototype.__class__ = gridbee.js.EventTarget;
gridbee.js.XMLHttpRequestEventTarget = function() { }
gridbee.js.XMLHttpRequestEventTarget.__name__ = ["gridbee","js","XMLHttpRequestEventTarget"];
gridbee.js.XMLHttpRequestEventTarget.prototype.onloadstart = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.onprogress = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.onabort = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.onerror = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.onload = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.ontimeout = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.onloadend = null;
gridbee.js.XMLHttpRequestEventTarget.prototype.__class__ = gridbee.js.XMLHttpRequestEventTarget;
gridbee.js.XMLHttpRequestEventTarget.__interfaces__ = [gridbee.js.EventTarget];
gridbee.js.XMLHttpRequestUpload = function() { }
gridbee.js.XMLHttpRequestUpload.__name__ = ["gridbee","js","XMLHttpRequestUpload"];
gridbee.js.XMLHttpRequestUpload.prototype.__class__ = gridbee.js.XMLHttpRequestUpload;
gridbee.js.XMLHttpRequestUpload.__interfaces__ = [gridbee.js.XMLHttpRequestEventTarget];
StringTools = function() { }
StringTools.__name__ = ["StringTools"];
StringTools.urlEncode = function(s) {
return encodeURIComponent(s);
}
StringTools.urlDecode = function(s) {
return decodeURIComponent(s.split("+").join(" "));
}
StringTools.htmlEscape = function(s) {
return s.split("&").join("&").split("<").join("<").split(">").join(">");
}
StringTools.htmlUnescape = function(s) {
return s.split(">").join(">").split("<").join("<").split("&").join("&");
}
StringTools.startsWith = function(s,start) {
return s.length >= start.length && s.substr(0,start.length) == start;
}
StringTools.endsWith = function(s,end) {
var elen = end.length;
var slen = s.length;
return slen >= elen && s.substr(slen - elen,elen) == end;
}
St