103 lines
2.5 KiB
Java
103 lines
2.5 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.naming.OrdQuery
|
|
* javax.baja.naming.OrdQueryList
|
|
* javax.baja.naming.SyntaxException
|
|
* javax.baja.util.BUuid
|
|
*/
|
|
package com.tridium.alarm.db;
|
|
|
|
import java.util.HashMap;
|
|
import javax.baja.naming.OrdQuery;
|
|
import javax.baja.naming.OrdQueryList;
|
|
import javax.baja.naming.SyntaxException;
|
|
import javax.baja.util.BUuid;
|
|
|
|
public class AlarmQuery
|
|
implements OrdQuery {
|
|
private String query;
|
|
private HashMap paramMap;
|
|
|
|
public boolean isHost() {
|
|
return false;
|
|
}
|
|
|
|
public boolean isSession() {
|
|
return false;
|
|
}
|
|
|
|
public void normalize(OrdQueryList ordQueryList, int n) {
|
|
ordQueryList.shiftToSession(n);
|
|
}
|
|
|
|
public String getScheme() {
|
|
return "alarm";
|
|
}
|
|
|
|
public String getBody() {
|
|
return this.query;
|
|
}
|
|
|
|
public boolean isDbQuery() {
|
|
this.parse();
|
|
boolean bl = false;
|
|
if (this.paramMap.size() == 0) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
public BUuid getUuid() {
|
|
String string = (String)this.paramMap.get("uuid");
|
|
if (string != null) {
|
|
return BUuid.make((String)string);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public String getQueryParameter(String string, String string2) {
|
|
this.parse();
|
|
String string3 = (String)this.paramMap.get(string);
|
|
if (string3 == null) {
|
|
return string2;
|
|
}
|
|
return string3;
|
|
}
|
|
|
|
public String toString() {
|
|
return "alarm:" + this.query;
|
|
}
|
|
|
|
public void parse() {
|
|
if (this.paramMap != null) {
|
|
return;
|
|
}
|
|
this.paramMap = new HashMap();
|
|
if (this.query == null || this.query.length() == 0) {
|
|
return;
|
|
}
|
|
int n = 0;
|
|
int n2 = this.query.indexOf(61);
|
|
while (n2 != -1) {
|
|
String string = null;
|
|
String string2 = null;
|
|
int n3 = this.query.indexOf(59, n2);
|
|
string = this.query.substring(n, n2);
|
|
string2 = n3 == -1 ? this.query.substring(n2 + 1) : this.query.substring(n2 + 1, n3);
|
|
this.paramMap.put(string, string2);
|
|
if (n3 == -1) break;
|
|
n = n3 + 1;
|
|
n2 = this.query.indexOf(61, n);
|
|
if (n2 != -1 || n == this.query.length()) continue;
|
|
throw new SyntaxException("Expecting =");
|
|
}
|
|
}
|
|
|
|
public AlarmQuery(String string) {
|
|
this.query = string;
|
|
}
|
|
}
|
|
|