318 lines
12 KiB
Java
318 lines
12 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.sys.license.dom.VendorLicense
|
|
* javax.baja.naming.SlotPath
|
|
* javax.baja.nre.util.Array
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.BVector
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.SlotCursor
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.util.Version
|
|
* javax.baja.xml.XContent
|
|
* javax.baja.xml.XElem
|
|
*/
|
|
package com.tridium.platform.license;
|
|
|
|
import com.tridium.platform.license.BVendorLicenseSummary;
|
|
import com.tridium.platform.license.LicenseInfo;
|
|
import com.tridium.sys.license.dom.VendorLicense;
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Map;
|
|
import javax.baja.naming.SlotPath;
|
|
import javax.baja.nre.util.Array;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.BVector;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.SlotCursor;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.Version;
|
|
import javax.baja.xml.XContent;
|
|
import javax.baja.xml.XElem;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BEnvLicenseSummary
|
|
extends BComponent {
|
|
public static final Property hostId = BEnvLicenseSummary.newProperty((int)1, (String)"", null);
|
|
public static final Property brandIdString = BEnvLicenseSummary.newProperty((int)1, (String)"", null);
|
|
public static final Property vendorInfo = BEnvLicenseSummary.newProperty((int)1, (BValue)new BVector(), null);
|
|
public static final Type TYPE;
|
|
static /* synthetic */ Class class$com$tridium$platform$license$BEnvLicenseSummary;
|
|
static /* synthetic */ Class class$com$tridium$sys$license$dom$VendorLicense;
|
|
static /* synthetic */ Class class$java$lang$String;
|
|
static /* synthetic */ Class class$com$tridium$platform$license$BVendorLicenseSummary;
|
|
|
|
public String getHostId() {
|
|
return this.getString(hostId);
|
|
}
|
|
|
|
public void setHostId(String string) {
|
|
this.setString(hostId, string, null);
|
|
}
|
|
|
|
public String getBrandIdString() {
|
|
return this.getString(brandIdString);
|
|
}
|
|
|
|
public void setBrandIdString(String string) {
|
|
this.setString(brandIdString, string, null);
|
|
}
|
|
|
|
public BVector getVendorInfo() {
|
|
return (BVector)this.get(vendorInfo);
|
|
}
|
|
|
|
public void setVendorInfo(BVector bVector) {
|
|
this.set(vendorInfo, (BValue)bVector, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static BEnvLicenseSummary make(XElem xElem) {
|
|
BEnvLicenseSummary bEnvLicenseSummary = new BEnvLicenseSummary(xElem.get("hostId"), xElem.get("brandId", null));
|
|
XElem[] xElemArray = xElem.elems("vendorInfo");
|
|
int n = 0;
|
|
while (n < xElemArray.length) {
|
|
bEnvLicenseSummary.updateVendorInfo(xElemArray[n].get("vendor"), BVendorLicenseSummary.make(xElemArray[n]));
|
|
++n;
|
|
}
|
|
return bEnvLicenseSummary;
|
|
}
|
|
|
|
public static BEnvLicenseSummary make(LicenseInfo licenseInfo) {
|
|
return BEnvLicenseSummary.make(licenseInfo.vendorLicense);
|
|
}
|
|
|
|
public static BEnvLicenseSummary[] make(LicenseInfo[] licenseInfoArray) {
|
|
VendorLicense[] vendorLicenseArray = new VendorLicense[licenseInfoArray.length];
|
|
int n = 0;
|
|
while (n < licenseInfoArray.length) {
|
|
vendorLicenseArray[n] = licenseInfoArray[n].vendorLicense;
|
|
++n;
|
|
}
|
|
return BEnvLicenseSummary.make(vendorLicenseArray);
|
|
}
|
|
|
|
public static BEnvLicenseSummary[] make(VendorLicense[] vendorLicenseArray) {
|
|
Object object;
|
|
Object object2;
|
|
HashSet<String> hashSet = new HashSet<String>();
|
|
HashMap<Object, Array> hashMap = new HashMap<Object, Array>();
|
|
HashMap<Object, Array> hashMap2 = new HashMap<Object, Array>();
|
|
int n = 0;
|
|
while (n < vendorLicenseArray.length) {
|
|
object2 = vendorLicenseArray[n].getHostId();
|
|
hashSet.add((String)object2);
|
|
if (vendorLicenseArray[n].getVendor().equalsIgnoreCase("tridium")) {
|
|
object = (Map)hashMap.get(object2);
|
|
if (object == null) {
|
|
object = new HashMap();
|
|
hashMap.put(object2, (Array)object);
|
|
}
|
|
object.put(vendorLicenseArray[n].getBrandId(), vendorLicenseArray[n]);
|
|
} else {
|
|
object = (Array)hashMap2.get(object2);
|
|
if (object == null) {
|
|
Class clazz = class$com$tridium$sys$license$dom$VendorLicense;
|
|
if (clazz == null) {
|
|
clazz = BEnvLicenseSummary.class("[Lcom.tridium.sys.license.dom.VendorLicense;", false);
|
|
}
|
|
object = new Array(clazz);
|
|
hashMap2.put(object2, (Array)object);
|
|
}
|
|
object.add((Object)vendorLicenseArray[n]);
|
|
}
|
|
++n;
|
|
}
|
|
Class clazz = class$com$tridium$platform$license$BEnvLicenseSummary;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$license$BEnvLicenseSummary = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BEnvLicenseSummary;", false);
|
|
}
|
|
Array array = new Array(clazz);
|
|
object2 = hashSet.iterator();
|
|
while (object2.hasNext()) {
|
|
BEnvLicenseSummary bEnvLicenseSummary;
|
|
Object object3;
|
|
object = (String)object2.next();
|
|
Map map = (Map)hashMap.get(object);
|
|
Array array2 = (Array)hashMap2.get(object);
|
|
if (map == null) {
|
|
object3 = new BEnvLicenseSummary((String)object);
|
|
if (array2 != null) {
|
|
int n2 = 0;
|
|
while (n2 < array2.size()) {
|
|
bEnvLicenseSummary = (VendorLicense)array2.get(n2);
|
|
((BEnvLicenseSummary)((Object)object3)).updateVendorInfo((VendorLicense)bEnvLicenseSummary);
|
|
++n2;
|
|
}
|
|
}
|
|
array.add(object3);
|
|
continue;
|
|
}
|
|
object3 = map.keySet().iterator();
|
|
while (object3.hasNext()) {
|
|
String string = (String)object3.next();
|
|
bEnvLicenseSummary = new BEnvLicenseSummary((String)object, string);
|
|
VendorLicense vendorLicense = (VendorLicense)map.get(string);
|
|
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
|
|
if (array2 != null) {
|
|
int n3 = 0;
|
|
while (n3 < array2.size()) {
|
|
vendorLicense = (VendorLicense)array2.get(n3);
|
|
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
|
|
++n3;
|
|
}
|
|
}
|
|
array.add((Object)bEnvLicenseSummary);
|
|
}
|
|
}
|
|
return (BEnvLicenseSummary[])array.trim();
|
|
}
|
|
|
|
public static BEnvLicenseSummary make(VendorLicense vendorLicense) {
|
|
BEnvLicenseSummary bEnvLicenseSummary = new BEnvLicenseSummary(vendorLicense.getHostId(), vendorLicense.getBrandId());
|
|
bEnvLicenseSummary.updateVendorInfo(vendorLicense);
|
|
return bEnvLicenseSummary;
|
|
}
|
|
|
|
public String getBrandId() {
|
|
String string = this.getBrandIdString();
|
|
return string.length() == 0 ? null : string;
|
|
}
|
|
|
|
public void setBrandId(String string) {
|
|
this.setBrandIdString(string == null ? "" : string);
|
|
}
|
|
|
|
/*
|
|
* Unable to fully structure code
|
|
*/
|
|
public String[] getVendors() {
|
|
v0 = BEnvLicenseSummary.class$java$lang$String;
|
|
if (v0 == null) {
|
|
v0 = BEnvLicenseSummary.class$java$lang$String = BEnvLicenseSummary.class("[Ljava.lang.String;", false);
|
|
}
|
|
var1_1 = new Array(v0);
|
|
var2_2 = this.getVendorInfo().getProperties();
|
|
if (true) ** GOTO lbl10
|
|
do {
|
|
var1_1.add((Object)SlotPath.unescape((String)var2_2.slot().getName()));
|
|
lbl10:
|
|
// 2 sources
|
|
|
|
if ((v1 = BEnvLicenseSummary.class$com$tridium$platform$license$BVendorLicenseSummary) != null) continue;
|
|
v1 = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BVendorLicenseSummary;", false);
|
|
} while (var2_2.next(v1));
|
|
return (String[])var1_1.trim();
|
|
}
|
|
|
|
public String getLicenseSignature(String string) {
|
|
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(string);
|
|
return bVendorLicenseSummary == null ? null : bVendorLicenseSummary.getLicenseSignature();
|
|
}
|
|
|
|
public long getLicenseGenerated(String string) {
|
|
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(string);
|
|
return bVendorLicenseSummary == null ? Long.MIN_VALUE : bVendorLicenseSummary.getLicenseGenerated();
|
|
}
|
|
|
|
public Version getTridiumVersion() {
|
|
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo("tridium");
|
|
return bVendorLicenseSummary == null ? null : bVendorLicenseSummary.getLicenseVersion();
|
|
}
|
|
|
|
public BVendorLicenseSummary getVendorInfo(String string) {
|
|
SlotCursor slotCursor = this.getVendorInfo().getProperties();
|
|
while (slotCursor.next()) {
|
|
if (!SlotPath.unescape((String)slotCursor.property().getName()).toLowerCase().equals(string.toLowerCase())) continue;
|
|
return (BVendorLicenseSummary)slotCursor.get();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void updateVendorInfo(String string, BVendorLicenseSummary bVendorLicenseSummary) {
|
|
BVendorLicenseSummary bVendorLicenseSummary2 = this.getVendorInfo(string);
|
|
if (bVendorLicenseSummary2 == null) {
|
|
this.getVendorInfo().add(SlotPath.escape((String)string), (BValue)bVendorLicenseSummary);
|
|
} else {
|
|
bVendorLicenseSummary2.update(bVendorLicenseSummary);
|
|
}
|
|
}
|
|
|
|
public void updateVendorInfo(VendorLicense vendorLicense) {
|
|
BVendorLicenseSummary bVendorLicenseSummary = this.getVendorInfo(vendorLicense.getVendor());
|
|
if (bVendorLicenseSummary == null) {
|
|
this.updateVendorInfo(vendorLicense.getVendor(), BVendorLicenseSummary.make(vendorLicense));
|
|
} else {
|
|
bVendorLicenseSummary.update(vendorLicense);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Unable to fully structure code
|
|
*/
|
|
public XElem asXml() {
|
|
var1_1 = new XElem("licenseSummary");
|
|
var1_1.setAttr("hostId", this.getHostId());
|
|
if (this.getBrandId() != null) {
|
|
var1_1.setAttr("brandId", this.getBrandId());
|
|
}
|
|
var2_2 = this.getVendorInfo().getProperties();
|
|
if (true) ** GOTO lbl10
|
|
do {
|
|
var1_1.addContent((XContent)((BVendorLicenseSummary)var2_2.get()).asXml());
|
|
lbl10:
|
|
// 2 sources
|
|
|
|
if ((v0 = BEnvLicenseSummary.class$com$tridium$platform$license$BVendorLicenseSummary) != null) continue;
|
|
v0 = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BVendorLicenseSummary;", false);
|
|
} while (var2_2.next(v0));
|
|
return var1_1;
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
public BEnvLicenseSummary() {
|
|
}
|
|
|
|
public BEnvLicenseSummary(String string) {
|
|
this(string, null);
|
|
}
|
|
|
|
public BEnvLicenseSummary(String string, String string2) {
|
|
this.setHostId(string);
|
|
this.setBrandId(string2);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$platform$license$BEnvLicenseSummary;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$license$BEnvLicenseSummary = BEnvLicenseSummary.class("[Lcom.tridium.platform.license.BEnvLicenseSummary;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
}
|
|
}
|
|
|