link start!
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
class Attrib {
|
||||
int nameIndex;
|
||||
String name;
|
||||
int len;
|
||||
byte[] info;
|
||||
|
||||
Attrib(DataInputStream dataInputStream, String[] stringArray) throws IOException {
|
||||
this.nameIndex = dataInputStream.readUnsignedShort();
|
||||
this.name = stringArray[this.nameIndex];
|
||||
if (this.name == null) {
|
||||
throw new IOException("Could not look up attribute.");
|
||||
}
|
||||
this.len = dataInputStream.readInt();
|
||||
this.info = new byte[this.len];
|
||||
dataInputStream.readFully(this.info, 0, this.len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,587 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.Action
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.BajaRuntimeException
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.timezone.BTimeZone
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BModuleList;
|
||||
import com.tridium.install.BRemoteModuleList;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.part.BArchPart;
|
||||
import com.tridium.install.part.BBrandPart;
|
||||
import com.tridium.install.part.BModelPart;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BNrePart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.install.part.BVmPart;
|
||||
import com.tridium.platform.BPlatformSSLSettings;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.daemon.DaemonTimeUtil;
|
||||
import com.tridium.platform.daemon.file.BDaemonDirectoryStore;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.net.ConnectException;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BDaemonPlatform
|
||||
extends BComponent {
|
||||
public static final Property hostId = BDaemonPlatform.newProperty((int)1, (String)"", null);
|
||||
public static final Property hostName = BDaemonPlatform.newProperty((int)1, (String)"", null);
|
||||
public static final Property port = BDaemonPlatform.newProperty((int)1, (int)-1, null);
|
||||
public static final Property archPart = BDaemonPlatform.newProperty((int)1, (BValue)BArchPart.makeNull(), null);
|
||||
public static final Property osPart = BDaemonPlatform.newProperty((int)1, (BValue)BOsPart.makeNull(), null);
|
||||
public static final Property nrePart = BDaemonPlatform.newProperty((int)1, (BValue)BNrePart.makeNull(), null);
|
||||
public static final Property brandPart = BDaemonPlatform.newProperty((int)1, (BValue)BBrandPart.makeNull(), null);
|
||||
public static final Property vmPart = BDaemonPlatform.newProperty((int)1, (BValue)BVmPart.makeNull(), null);
|
||||
public static final Property modelPart = BDaemonPlatform.newProperty((int)1, (BValue)BModelPart.makeNull(), null);
|
||||
public static final Property moduleList = BDaemonPlatform.newProperty((int)1, (BValue)new BModuleList(), null);
|
||||
public static final Property otherParts = BDaemonPlatform.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property moduleContent = BDaemonPlatform.newProperty((int)1, (BValue)BModuleContent.doc, null);
|
||||
public static final Property stripLineNumbers = BDaemonPlatform.newProperty((int)1, (boolean)false, null);
|
||||
public static final Property maxStations = BDaemonPlatform.newProperty((int)1, (int)1, null);
|
||||
public static final Property maxSedonaApps = BDaemonPlatform.newProperty((int)1, (int)1, null);
|
||||
public static final Property osTimeZone = BDaemonPlatform.newProperty((int)1, (BValue)BTimeZone.NULL, null);
|
||||
public static final Property allowStationRestart = BDaemonPlatform.newProperty((int)1, (boolean)true, null);
|
||||
public static final Property configDistFileName = BDaemonPlatform.newProperty((int)1, (String)"nre-config-*.dist", null);
|
||||
public static final Property isNpsdk = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property sedonaSupported = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property sedonaEnabled = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property niagaraStationsEnabled = BDaemonPlatform.newProperty((int)3, (boolean)true, null);
|
||||
public static final Property niagaraR2Supported = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property niagaraR2Enabled = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property platformSSLSupported = BDaemonPlatform.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property platformSSLSettings = BDaemonPlatform.newProperty((int)3, (BValue)new BPlatformSSLSettings(), null);
|
||||
public static final Action checkSession = BDaemonPlatform.newAction((int)4, null);
|
||||
public static final Type TYPE;
|
||||
private static BIcon icon;
|
||||
private boolean sessionInvalid;
|
||||
private String daemonTimestamp;
|
||||
private BDaemonSession session;
|
||||
protected boolean localInstance;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDaemonPlatform;
|
||||
|
||||
public String getHostId() {
|
||||
return this.getString(hostId);
|
||||
}
|
||||
|
||||
public void setHostId(String string) {
|
||||
this.setString(hostId, string, null);
|
||||
}
|
||||
|
||||
public String getHostName() {
|
||||
return this.getString(hostName);
|
||||
}
|
||||
|
||||
public void setHostName(String string) {
|
||||
this.setString(hostName, string, null);
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return this.getInt(port);
|
||||
}
|
||||
|
||||
public void setPort(int n) {
|
||||
this.setInt(port, n, null);
|
||||
}
|
||||
|
||||
public BArchPart getArchPart() {
|
||||
return (BArchPart)this.get(archPart);
|
||||
}
|
||||
|
||||
public void setArchPart(BArchPart bArchPart) {
|
||||
this.set(archPart, (BValue)bArchPart, null);
|
||||
}
|
||||
|
||||
public BOsPart getOsPart() {
|
||||
return (BOsPart)this.get(osPart);
|
||||
}
|
||||
|
||||
public void setOsPart(BOsPart bOsPart) {
|
||||
this.set(osPart, (BValue)bOsPart, null);
|
||||
}
|
||||
|
||||
public BNrePart getNrePart() {
|
||||
return (BNrePart)this.get(nrePart);
|
||||
}
|
||||
|
||||
public void setNrePart(BNrePart bNrePart) {
|
||||
this.set(nrePart, (BValue)bNrePart, null);
|
||||
}
|
||||
|
||||
public BBrandPart getBrandPart() {
|
||||
return (BBrandPart)this.get(brandPart);
|
||||
}
|
||||
|
||||
public void setBrandPart(BBrandPart bBrandPart) {
|
||||
this.set(brandPart, (BValue)bBrandPart, null);
|
||||
}
|
||||
|
||||
public BVmPart getVmPart() {
|
||||
return (BVmPart)this.get(vmPart);
|
||||
}
|
||||
|
||||
public void setVmPart(BVmPart bVmPart) {
|
||||
this.set(vmPart, (BValue)bVmPart, null);
|
||||
}
|
||||
|
||||
public BModelPart getModelPart() {
|
||||
return (BModelPart)this.get(modelPart);
|
||||
}
|
||||
|
||||
public void setModelPart(BModelPart bModelPart) {
|
||||
this.set(modelPart, (BValue)bModelPart, null);
|
||||
}
|
||||
|
||||
public BModuleList getModuleList() {
|
||||
return (BModuleList)this.get(moduleList);
|
||||
}
|
||||
|
||||
public void setModuleList(BModuleList bModuleList) {
|
||||
this.set(moduleList, (BValue)bModuleList, null);
|
||||
}
|
||||
|
||||
public BVector getOtherParts() {
|
||||
return (BVector)this.get(otherParts);
|
||||
}
|
||||
|
||||
public void setOtherParts(BVector bVector) {
|
||||
this.set(otherParts, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public BModuleContent getModuleContent() {
|
||||
return (BModuleContent)this.get(moduleContent);
|
||||
}
|
||||
|
||||
public void setModuleContent(BModuleContent bModuleContent) {
|
||||
this.set(moduleContent, (BValue)bModuleContent, null);
|
||||
}
|
||||
|
||||
public boolean getStripLineNumbers() {
|
||||
return this.getBoolean(stripLineNumbers);
|
||||
}
|
||||
|
||||
public void setStripLineNumbers(boolean bl) {
|
||||
this.setBoolean(stripLineNumbers, bl, null);
|
||||
}
|
||||
|
||||
public int getMaxStations() {
|
||||
return this.getInt(maxStations);
|
||||
}
|
||||
|
||||
public void setMaxStations(int n) {
|
||||
this.setInt(maxStations, n, null);
|
||||
}
|
||||
|
||||
public int getMaxSedonaApps() {
|
||||
return this.getInt(maxSedonaApps);
|
||||
}
|
||||
|
||||
public void setMaxSedonaApps(int n) {
|
||||
this.setInt(maxSedonaApps, n, null);
|
||||
}
|
||||
|
||||
public BTimeZone getOsTimeZone() {
|
||||
return (BTimeZone)this.get(osTimeZone);
|
||||
}
|
||||
|
||||
public void setOsTimeZone(BTimeZone bTimeZone) {
|
||||
this.set(osTimeZone, (BValue)bTimeZone, null);
|
||||
}
|
||||
|
||||
public boolean getAllowStationRestart() {
|
||||
return this.getBoolean(allowStationRestart);
|
||||
}
|
||||
|
||||
public void setAllowStationRestart(boolean bl) {
|
||||
this.setBoolean(allowStationRestart, bl, null);
|
||||
}
|
||||
|
||||
public String getConfigDistFileName() {
|
||||
return this.getString(configDistFileName);
|
||||
}
|
||||
|
||||
public void setConfigDistFileName(String string) {
|
||||
this.setString(configDistFileName, string, null);
|
||||
}
|
||||
|
||||
public boolean getIsNpsdk() {
|
||||
return this.getBoolean(isNpsdk);
|
||||
}
|
||||
|
||||
public void setIsNpsdk(boolean bl) {
|
||||
this.setBoolean(isNpsdk, bl, null);
|
||||
}
|
||||
|
||||
public boolean getSedonaSupported() {
|
||||
return this.getBoolean(sedonaSupported);
|
||||
}
|
||||
|
||||
public void setSedonaSupported(boolean bl) {
|
||||
this.setBoolean(sedonaSupported, bl, null);
|
||||
}
|
||||
|
||||
public boolean getSedonaEnabled() {
|
||||
return this.getBoolean(sedonaEnabled);
|
||||
}
|
||||
|
||||
public void setSedonaEnabled(boolean bl) {
|
||||
this.setBoolean(sedonaEnabled, bl, null);
|
||||
}
|
||||
|
||||
public boolean getNiagaraStationsEnabled() {
|
||||
return this.getBoolean(niagaraStationsEnabled);
|
||||
}
|
||||
|
||||
public void setNiagaraStationsEnabled(boolean bl) {
|
||||
this.setBoolean(niagaraStationsEnabled, bl, null);
|
||||
}
|
||||
|
||||
public boolean getNiagaraR2Supported() {
|
||||
return this.getBoolean(niagaraR2Supported);
|
||||
}
|
||||
|
||||
public void setNiagaraR2Supported(boolean bl) {
|
||||
this.setBoolean(niagaraR2Supported, bl, null);
|
||||
}
|
||||
|
||||
public boolean getNiagaraR2Enabled() {
|
||||
return this.getBoolean(niagaraR2Enabled);
|
||||
}
|
||||
|
||||
public void setNiagaraR2Enabled(boolean bl) {
|
||||
this.setBoolean(niagaraR2Enabled, bl, null);
|
||||
}
|
||||
|
||||
public boolean getPlatformSSLSupported() {
|
||||
return this.getBoolean(platformSSLSupported);
|
||||
}
|
||||
|
||||
public void setPlatformSSLSupported(boolean bl) {
|
||||
this.setBoolean(platformSSLSupported, bl, null);
|
||||
}
|
||||
|
||||
public BPlatformSSLSettings getPlatformSSLSettings() {
|
||||
return (BPlatformSSLSettings)this.get(platformSSLSettings);
|
||||
}
|
||||
|
||||
public void setPlatformSSLSettings(BPlatformSSLSettings bPlatformSSLSettings) {
|
||||
this.set(platformSSLSettings, (BValue)bPlatformSSLSettings, null);
|
||||
}
|
||||
|
||||
public void checkSession() {
|
||||
this.invoke(checkSession, null, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final BPart getPart(String string, BTypeSpec bTypeSpec) {
|
||||
try {
|
||||
return this.getPart(string, bTypeSpec, null);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException((Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
public final BPart getPart(BPart bPart) {
|
||||
return this.getPart(bPart.getPartName(), bPart.getType().getTypeSpec());
|
||||
}
|
||||
|
||||
public final BPart getPart(BDependency bDependency) {
|
||||
return this.getPart(bDependency.getPartName(), bDependency.getPartTypeSpec());
|
||||
}
|
||||
|
||||
public final BDaemonSession getDaemonSession() {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BDaemonPlatform");
|
||||
}
|
||||
return this.session;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
BPart bPart = this.getPart(bDependency);
|
||||
boolean bl = false;
|
||||
if (bPart != null) {
|
||||
bl = bPart.meets(bDependency);
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
protected final void init() throws ConnectException, AuthenticationException {
|
||||
this.init(null);
|
||||
}
|
||||
|
||||
protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
BPlatformSSLSettings bPlatformSSLSettings;
|
||||
BDaemonSession bDaemonSession = this.getDaemonSession();
|
||||
if (bDaemonSession == null) {
|
||||
return;
|
||||
}
|
||||
if (bDaemonSession.getHostProperties().getHostId().trim().length() == 0) {
|
||||
bDaemonSession.reloadHostProperties();
|
||||
}
|
||||
try {
|
||||
BTimeZone bTimeZone = DaemonTimeUtil.getOsTimeZone(bDaemonSession);
|
||||
if (bTimeZone != null) {
|
||||
this.setOsTimeZone(bTimeZone);
|
||||
}
|
||||
}
|
||||
catch (ConnectException connectException) {
|
||||
throw connectException;
|
||||
}
|
||||
catch (AuthenticationException authenticationException) {
|
||||
throw authenticationException;
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException((Throwable)exception);
|
||||
}
|
||||
this.daemonTimestamp = bDaemonSession.getHostProperties().getSessionTimestamp();
|
||||
this.setModuleContent(bDaemonSession.getHostProperties().getModuleContent());
|
||||
this.setStripLineNumbers(bDaemonSession.getHostProperties().getStripLineNumbers());
|
||||
this.setMaxStations(bDaemonSession.getHostProperties().getMaxStations());
|
||||
this.setMaxSedonaApps(bDaemonSession.getHostProperties().getMaxSedonaApps());
|
||||
this.setSedonaSupported(bDaemonSession.getHostProperties().getSedonaSupported());
|
||||
this.setSedonaEnabled(bDaemonSession.getHostProperties().getSedonaEnabled());
|
||||
this.setNiagaraStationsEnabled(bDaemonSession.getHostProperties().getNiagaraStationsEnabled());
|
||||
this.setAllowStationRestart(bDaemonSession.getHostProperties().getAllowStationRestart());
|
||||
this.setNiagaraR2Supported(bDaemonSession.getHostProperties().getNiagaraR2Supported());
|
||||
boolean bl = false;
|
||||
if (bDaemonSession.getHostProperties().getNiagaraR2Supported() && BDaemonDirectoryStore.make(bDaemonSession.getFileSpace(), new FilePath("/niagara/niagaraR2")) != null && bDaemonSession.getHostProperties().getNiagaraR2Enabled()) {
|
||||
bl = true;
|
||||
}
|
||||
this.setNiagaraR2Enabled(bl);
|
||||
this.setPlatformSSLSupported(bDaemonSession.getHostProperties().getSslSupported());
|
||||
if (bDaemonSession.getHostProperties().getSslSupported()) {
|
||||
bPlatformSSLSettings = bDaemonSession.getHostProperties().getSslSettings();
|
||||
this.setPlatformSSLSettings(new BPlatformSSLSettings(bPlatformSSLSettings));
|
||||
}
|
||||
this.setHostName(bDaemonSession.getRemoteHost().getHostname());
|
||||
if (bDaemonSession.getHostProperties().getHttpPort() != -1) {
|
||||
this.setPort(bDaemonSession.getHostProperties().getHttpPort());
|
||||
} else {
|
||||
this.setPort(bDaemonSession.getRemotePort());
|
||||
}
|
||||
this.setHostId(bDaemonSession.getHostProperties().getHostId());
|
||||
this.setArchPart(new BArchPart(bDaemonSession.getHostProperties().getHostArch(), null));
|
||||
if (bDaemonSession.getHostProperties().getIsVmUnspecified()) {
|
||||
this.setVmPart(new BVmPart());
|
||||
} else if (bDaemonSession.getHostProperties().getVmName().equals("unknown")) {
|
||||
this.setVmPart(BVmPart.makeNull());
|
||||
} else {
|
||||
this.setVmPart(new BVmPart(bDaemonSession.getHostProperties().getVmName(), new BVersion(bDaemonSession.getHostProperties().getVmVendor(), bDaemonSession.getHostProperties().getVmVersion()), null));
|
||||
}
|
||||
this.setModelPart(new BModelPart(bDaemonSession.getHostProperties().getModelName(), null));
|
||||
this.setOsPart(new BOsPart(bDaemonSession.getHostProperties().getOsName(), bDaemonSession.getHostProperties().getOsDesc(), new BVersion(null, bDaemonSession.getHostProperties().getOsVersion()), null, bDaemonSession.getHostProperties().getOsInstallable()));
|
||||
if (bDaemonSession.getHostProperties().getNrePartDesc().equals("unknown") || bDaemonSession.getHostProperties().getNrePartName().indexOf("-???") != -1) {
|
||||
this.setNrePart(BNrePart.makeNull());
|
||||
} else {
|
||||
this.setNrePart(new BNrePart(bDaemonSession.getHostProperties().getNrePartName(), bDaemonSession.getHostProperties().getNrePartDesc(), new BVersion(null, bDaemonSession.getHostProperties().getNrePartVersion()), null));
|
||||
}
|
||||
this.setBrandPart(new BBrandPart(bDaemonSession.getHostProperties().getBrandId(), null));
|
||||
this.getOtherParts().removeAll();
|
||||
bPlatformSSLSettings = bDaemonSession.getHostProperties().getParts().getProperties();
|
||||
while (bPlatformSSLSettings.next()) {
|
||||
this.getOtherParts().add(bPlatformSSLSettings.property().getName(), (BValue)((BPart)((BPart)bPlatformSSLSettings.get()).newCopy()));
|
||||
}
|
||||
this.setConfigDistFileName(bDaemonSession.getHostProperties().getConfigDistFileName());
|
||||
this.setIsNpsdk(bDaemonSession.getHostProperties().getIsNpsdk());
|
||||
this.sessionInvalid = false;
|
||||
}
|
||||
|
||||
public final void checkSession(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
this.doCheckSession(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public final void doCheckSession() throws ConnectException, AuthenticationException {
|
||||
this.doCheckSession(null);
|
||||
}
|
||||
|
||||
public void doCheckSession(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
if (!this.localInstance) {
|
||||
return;
|
||||
}
|
||||
if (this.getDaemonSession() == null || !this.getDaemonSession().getHostProperties().getSessionTimestamp().equals(this.daemonTimestamp) || this.sessionInvalid) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
}
|
||||
|
||||
public void requestReload() {
|
||||
this.sessionInvalid = true;
|
||||
}
|
||||
|
||||
public BPart getPart(String string, BTypeSpec bTypeSpec, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
this.checkSession(daemonSessionTaskListener);
|
||||
if (bTypeSpec == null) {
|
||||
return this.getPartCompat(string, daemonSessionTaskListener);
|
||||
}
|
||||
BPart bPart = null;
|
||||
if (bTypeSpec.equals((Object)BArchPart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getArchPart();
|
||||
} else if (bTypeSpec.equals((Object)BOsPart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getOsPart();
|
||||
} else if (bTypeSpec.equals((Object)BBrandPart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getBrandPart();
|
||||
} else if (bTypeSpec.equals((Object)BModelPart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getModelPart();
|
||||
} else if (bTypeSpec.equals((Object)BNrePart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getNrePart();
|
||||
} else if (bTypeSpec.equals((Object)BVmPart.TYPE.getTypeSpec())) {
|
||||
bPart = this.getVmPart();
|
||||
} else {
|
||||
if (bTypeSpec.equals((Object)BModulePart.TYPE.getTypeSpec())) {
|
||||
BModuleList bModuleList = this.getModuleList();
|
||||
bModuleList.init(daemonSessionTaskListener);
|
||||
return bModuleList.getPart(string);
|
||||
}
|
||||
bPart = (BPart)this.getOtherParts().get(SlotPath.escape((String)string));
|
||||
}
|
||||
if (bPart != null && bPart.matchesName(string)) {
|
||||
return bPart;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BPart getSingleModulePart(String string, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
BModuleList bModuleList = this.getModuleList();
|
||||
if (string != null && string.equalsIgnoreCase("baja") && bModuleList instanceof BRemoteModuleList) {
|
||||
BRemoteModuleList bRemoteModuleList = (BRemoteModuleList)bModuleList;
|
||||
try {
|
||||
XElem xElem;
|
||||
XElem[] xElemArray = bRemoteModuleList.fetchModules(string);
|
||||
if (xElemArray.length == 1 && (xElem = xElemArray[0]) != null && (xElem = xElem.elem("module")) != null) {
|
||||
String string2 = null;
|
||||
string2 = xElem.get("name", null);
|
||||
if (string2 != null && string2.equalsIgnoreCase("baja")) {
|
||||
return BModulePart.make(string2, xElem);
|
||||
}
|
||||
}
|
||||
if (bRemoteModuleList != null) {
|
||||
bRemoteModuleList.setModuleElems(xElemArray);
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
}
|
||||
bModuleList.init(daemonSessionTaskListener);
|
||||
return bModuleList.getPart(string);
|
||||
}
|
||||
|
||||
protected BPart getPartCompat(String string, DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
if (!this.getArchPart().isNull() && this.getArchPart().matchesName(string)) {
|
||||
return this.getArchPart();
|
||||
}
|
||||
if (!this.getOsPart().isNull() && this.getOsPart().matchesName(string)) {
|
||||
return this.getOsPart();
|
||||
}
|
||||
if (!this.getBrandPart().isNull() && this.getBrandPart().matchesName(string)) {
|
||||
return this.getBrandPart();
|
||||
}
|
||||
if (!this.getModelPart().isNull() && this.getModelPart().matchesName(string)) {
|
||||
return this.getModelPart();
|
||||
}
|
||||
if (!this.getNrePart().isNull() && this.getNrePart().matchesName(string)) {
|
||||
return this.getNrePart();
|
||||
}
|
||||
BPart bPart = (BPart)this.getOtherParts().get(SlotPath.escape((String)string));
|
||||
if (bPart != null) {
|
||||
return bPart;
|
||||
}
|
||||
if (this.getVmPart().matchesName(string)) {
|
||||
return this.getVmPart();
|
||||
}
|
||||
this.getModuleList().init(daemonSessionTaskListener);
|
||||
return this.getModuleList().getPart(string);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
if (icon == null) {
|
||||
icon = BIcon.std((String)"daemon.png");
|
||||
}
|
||||
return icon;
|
||||
}
|
||||
|
||||
public String getNavDescription(Context context) {
|
||||
return this.getLexicon().getText("DaemonPlatform.navDescription", new Object[]{this.getHostName()});
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.sessionInvalid = false;
|
||||
this.localInstance = false;
|
||||
}
|
||||
|
||||
public BDaemonPlatform() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BDaemonPlatform(BDaemonSession bDaemonSession) {
|
||||
this.this();
|
||||
this.session = bDaemonSession;
|
||||
this.localInstance = true;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BDaemonPlatform;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDaemonPlatform = BDaemonPlatform.class("[Lcom.tridium.install.BDaemonPlatform;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,795 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.TextUtil
|
||||
* javax.baja.registry.DependencyInfo
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.BStruct
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BasicContext
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.util.LexiconText
|
||||
* javax.baja.util.PatternFilter
|
||||
* javax.baja.util.Version
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.PartSpec;
|
||||
import com.tridium.install.part.BApplicationPart;
|
||||
import com.tridium.install.part.BArchPart;
|
||||
import com.tridium.install.part.BBrandPart;
|
||||
import com.tridium.install.part.BGenericPart;
|
||||
import com.tridium.install.part.BModelPart;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BNrePart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.install.part.BVmPart;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.TreeMap;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.platform.install.BPlatformPartType;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.platform.install.PlatformDependency;
|
||||
import javax.baja.platform.install.PlatformPart;
|
||||
import javax.baja.registry.DependencyInfo;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BasicContext;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.util.LexiconText;
|
||||
import javax.baja.util.PatternFilter;
|
||||
import javax.baja.util.Version;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BDependency
|
||||
extends BStruct
|
||||
implements BIDataValue {
|
||||
public static final Property partName = BDependency.newProperty((int)1, (String)"unknown", null);
|
||||
public static final Property version = BDependency.newProperty((int)1, (BValue)BVersion.makeZero(), null);
|
||||
public static final Property versionRelation = BDependency.newProperty((int)1, (BValue)BVersionRelation.minimum, null);
|
||||
public static final Property partTypeSpec = BDependency.newProperty((int)1, (BValue)BTypeSpec.DEFAULT, null);
|
||||
public static final Property solverFiltersString = BDependency.newProperty((int)1, (String)"*", null);
|
||||
public static final Type TYPE;
|
||||
public static final LexiconText anyVersionText;
|
||||
public static final LexiconText anyVersionTextWithExclude;
|
||||
public static final LexiconText nameVersionWithExclude;
|
||||
public static final LexiconText maxVersionText;
|
||||
public static final LexiconText maxVersionTextWithExclude;
|
||||
public static final LexiconText exactVersionText;
|
||||
public static final LexiconText exactVersionTextWithExclude;
|
||||
public static final LexiconText minVersionExclusiveText;
|
||||
public static final LexiconText notEqualVersionText;
|
||||
public static final LexiconText minMaxText;
|
||||
public static final LexiconText minNeText;
|
||||
public static final LexiconText maxInclusiveMinExclusiveText;
|
||||
public static final DependencySync DEP_SYNC_KEEP_FIRST;
|
||||
public static final DependencySync DEP_SYNC_KEEP_SECOND;
|
||||
public static final DependencySync DEP_SYNC_NO_CHANGE;
|
||||
public static final DependencySync DEP_SYNC_CONFLICT;
|
||||
public static final String DEFAULT_SOLVER = "default";
|
||||
public static final String NO_SOLVERS = "";
|
||||
public static final String COMMISSIONING_SOLVER = "commissioning";
|
||||
public static final String APP_SOLVER = "app";
|
||||
public static final String ANY_SOLVER = "*";
|
||||
public static final String EXCLUSION_FACET = "exclusion";
|
||||
public static final Comparator COMPARATOR;
|
||||
private Type resolvedType;
|
||||
private PartSpec spec;
|
||||
private PatternFilter[] solverFilters;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
|
||||
public String getPartName() {
|
||||
return this.getString(partName);
|
||||
}
|
||||
|
||||
public void setPartName(String string) {
|
||||
this.setString(partName, string, null);
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return (BVersion)this.get(version);
|
||||
}
|
||||
|
||||
public void setVersion(BVersion bVersion) {
|
||||
this.set(version, (BValue)bVersion, null);
|
||||
}
|
||||
|
||||
public BVersionRelation getVersionRelation() {
|
||||
return (BVersionRelation)this.get(versionRelation);
|
||||
}
|
||||
|
||||
public void setVersionRelation(BVersionRelation bVersionRelation) {
|
||||
this.set(versionRelation, (BValue)bVersionRelation, null);
|
||||
}
|
||||
|
||||
public BTypeSpec getPartTypeSpec() {
|
||||
return (BTypeSpec)this.get(partTypeSpec);
|
||||
}
|
||||
|
||||
public void setPartTypeSpec(BTypeSpec bTypeSpec) {
|
||||
this.set(partTypeSpec, (BValue)bTypeSpec, null);
|
||||
}
|
||||
|
||||
public String getSolverFiltersString() {
|
||||
return this.getString(solverFiltersString);
|
||||
}
|
||||
|
||||
public void setSolverFiltersString(String string) {
|
||||
this.setString(solverFiltersString, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem();
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
if (!this.getSolverFiltersString().equals(ANY_SOLVER)) {
|
||||
xElem.setAttr("solvers", this.getSolverFiltersString());
|
||||
}
|
||||
if (this.getVersion().getBajaVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString());
|
||||
}
|
||||
if (this.getVersion().getVendorVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("vendorVersion", this.getVersion().getVendorVersionString());
|
||||
if (this.getVersionRelation() != BVersionRelation.minimum) {
|
||||
xElem.setAttr("rel", this.getVersionRelation().getTag());
|
||||
}
|
||||
}
|
||||
if (this.getVersion().getVendor().trim().length() > 0) {
|
||||
xElem.setAttr("vendor", this.getVersion().getVendor());
|
||||
}
|
||||
if (this.getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("dependency");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("os");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BVmPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("vm");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BArchPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("arch");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BModelPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("model");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BBrandPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("brand");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BNrePart.TYPE.getTypeSpec())) {
|
||||
xElem.setName("nre");
|
||||
} else if (this.getPartTypeSpec().equals((Object)BApplicationPart.TYPE.getTypeSpec())) {
|
||||
xElem.setName(APP_SOLVER);
|
||||
} else {
|
||||
xElem.setName("part");
|
||||
}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public static BDependency forModule(String string) {
|
||||
return new BDependency(string, BVersion.ZERO, BModulePart.TYPE.getTypeSpec());
|
||||
}
|
||||
|
||||
public static BDependency forPart(BPart bPart) {
|
||||
return BDependency.forPart(bPart, BVersionRelation.minimum);
|
||||
}
|
||||
|
||||
public static BDependency forPart(BPart bPart, BVersionRelation bVersionRelation) {
|
||||
return new BDependency(bPart.getPartName(), bPart.getVersion(), bVersionRelation, bPart.getType().getTypeSpec(), ANY_SOLVER);
|
||||
}
|
||||
|
||||
public static BDependency make(XElem xElem) {
|
||||
if (xElem.name().equals("dependency") || xElem.name().equals("module")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BModulePart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER));
|
||||
}
|
||||
if (xElem.name().equals("os")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BOsPart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER));
|
||||
}
|
||||
if (xElem.name().equals("vm")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BVmPart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER));
|
||||
}
|
||||
if (xElem.name().equals("arch")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BArchPart.TYPE.getTypeSpec(), NO_SOLVERS);
|
||||
}
|
||||
if (xElem.name().equals("model")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BModelPart.TYPE.getTypeSpec(), NO_SOLVERS);
|
||||
}
|
||||
if (xElem.name().equals("brand")) {
|
||||
return new BDependency(xElem.get("name"), BVersion.ZERO, BVersionRelation.minimum, BBrandPart.TYPE.getTypeSpec(), xElem.get("solvers", NO_SOLVERS));
|
||||
}
|
||||
if (xElem.name().equals("nre")) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BNrePart.TYPE.getTypeSpec(), xElem.get("solvers", ANY_SOLVER));
|
||||
}
|
||||
if (xElem.name().equals(APP_SOLVER)) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(xElem.get("vendor", NO_SOLVERS), BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BApplicationPart.TYPE.getTypeSpec(), xElem.get("solvers", APP_SOLVER));
|
||||
}
|
||||
if (xElem.get("name", null) != null) {
|
||||
return new BDependency(xElem.get("name"), new BVersion(null, BDependency.getVendorVersion(xElem)), BVersionRelation.make(xElem.get("rel", "minimum")), BGenericPart.TYPE.getTypeSpec(), xElem.get("solvers", NO_SOLVERS));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public PlatformDependency asPlatformDependency() {
|
||||
return new PlatformDependency(){
|
||||
|
||||
public final PlatformPart getPartPrototype() {
|
||||
return new PlatformPart(){
|
||||
|
||||
public final String getPartName() {
|
||||
return BDependency.this.getPartName();
|
||||
}
|
||||
|
||||
public final BPlatformPartType getPartType() {
|
||||
return BPart.getPlatformPartType(BDependency.this.getPartTypeSpec());
|
||||
}
|
||||
|
||||
public final Version getPartVersion() {
|
||||
return BDependency.this.getVersion().getVendorVersion();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public final BVersionRelation getVersionRelation() {
|
||||
return BDependency.this.getVersionRelation();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static final String getVendorVersion(XElem xElem) {
|
||||
return xElem.get("vendorVersion", xElem.get("version", NO_SOLVERS));
|
||||
}
|
||||
|
||||
public Type getPartType() {
|
||||
if (this.resolvedType == null) {
|
||||
this.resolvedType = this.getPartTypeSpec().getResolvedType();
|
||||
}
|
||||
return this.resolvedType;
|
||||
}
|
||||
|
||||
public PartSpec getPartSpec() {
|
||||
if (this.spec == null) {
|
||||
this.spec = new PartSpec(this.getPartName(), this.getPartTypeSpec());
|
||||
}
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public void changed(Property property, Context context) {
|
||||
if (property == partTypeSpec) {
|
||||
this.resolvedType = this.getPartTypeSpec().getResolvedType();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BDependency) {
|
||||
BDependency bDependency = (BDependency)((Object)object);
|
||||
boolean bl = false;
|
||||
if (this.getPartName().equals(bDependency.getPartName()) && this.getPartType().equals(bDependency.getPartType()) && this.getVersionRelation().equals((Object)bDependency.getVersionRelation()) && this.getVersion().equivalent((Object)bDependency.getVersion()) && this.getSolverFiltersString().equals(bDependency.getSolverFiltersString())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enabled aggressive block sorting
|
||||
*/
|
||||
public static DependencySync sync(BDependency bDependency, BDependency bDependency2) {
|
||||
String string;
|
||||
BVersionRelation bVersionRelation;
|
||||
BVersion bVersion;
|
||||
String string2;
|
||||
block40: {
|
||||
int n;
|
||||
block46: {
|
||||
block45: {
|
||||
block42: {
|
||||
block44: {
|
||||
block43: {
|
||||
block41: {
|
||||
if (bDependency == bDependency2 || bDependency.equivalent((Object)bDependency2)) {
|
||||
return DEP_SYNC_KEEP_FIRST;
|
||||
}
|
||||
if (!bDependency.getPartTypeSpec().equals((Object)bDependency2.getPartTypeSpec())) {
|
||||
return DEP_SYNC_NO_CHANGE;
|
||||
}
|
||||
if (bDependency.getPartName().equals(bDependency2.getPartName()) || BPart.isWildcardName(bDependency2.getPartName()) && BPart.matchesName(bDependency.getPartName(), bDependency2.getPartName())) {
|
||||
string2 = bDependency.getPartName();
|
||||
} else if (BPart.isWildcardName(bDependency.getPartName()) && BPart.matchesName(bDependency2.getPartName(), bDependency.getPartName())) {
|
||||
string2 = bDependency2.getPartName();
|
||||
} else {
|
||||
return DEP_SYNC_NO_CHANGE;
|
||||
}
|
||||
bVersion = null;
|
||||
bVersionRelation = null;
|
||||
n = bDependency.getVersion().checkVersionRequirement(bDependency2.getVersion());
|
||||
if (n == 8) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
if (bDependency.getVersionRelation() != BVersionRelation.exact) break block41;
|
||||
if (bDependency2.getVersionRelation() == BVersionRelation.exact) {
|
||||
if (n != 2 && n != 16) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
} else if (bDependency2.getVersionRelation() == BVersionRelation.minimum) {
|
||||
if (n != 2 && n != 16 && n != 1 && n != 32) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
} else {
|
||||
if (n != 4 && n != 32 && n != 2 && n != 16) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
}
|
||||
break block40;
|
||||
}
|
||||
if (bDependency.getVersionRelation() != BVersionRelation.minimum) break block42;
|
||||
if (bDependency2.getVersionRelation() != BVersionRelation.exact) break block43;
|
||||
if (n != 2 && n != 16 && n != 4 && n != 64) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
bVersion = bDependency2.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
}
|
||||
if (bDependency2.getVersionRelation() != BVersionRelation.minimum) break block44;
|
||||
bVersionRelation = BVersionRelation.minimum;
|
||||
bVersion = n == 2 || n == 16 || n == 1 || n == 32 ? bDependency.getVersion() : bDependency2.getVersion();
|
||||
break block40;
|
||||
}
|
||||
if (n == 2 || n == 16) {
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
} else if (n == 64) {
|
||||
bVersion = bDependency2.getVersion();
|
||||
bVersionRelation = BVersionRelation.maximum;
|
||||
break block40;
|
||||
} else {
|
||||
if (n == 4) {
|
||||
return DEP_SYNC_NO_CHANGE;
|
||||
}
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
}
|
||||
if (bDependency2.getVersionRelation() != BVersionRelation.exact) break block45;
|
||||
if (n != 2 && n != 16 && n != 1) {
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
bVersion = bDependency2.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
}
|
||||
if (bDependency2.getVersionRelation() != BVersionRelation.minimum) break block46;
|
||||
if (n == 2 || n == 16) {
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.exact;
|
||||
break block40;
|
||||
} else if (n == 32) {
|
||||
bVersion = bDependency.getVersion();
|
||||
bVersionRelation = BVersionRelation.maximum;
|
||||
break block40;
|
||||
} else {
|
||||
if (n == 1) {
|
||||
return DEP_SYNC_NO_CHANGE;
|
||||
}
|
||||
return DEP_SYNC_CONFLICT;
|
||||
}
|
||||
}
|
||||
bVersionRelation = BVersionRelation.maximum;
|
||||
bVersion = n == 2 || n == 16 || n == 4 ? bDependency.getVersion() : bDependency2.getVersion();
|
||||
}
|
||||
if (bDependency.getSolverFiltersString().equals(bDependency2.getSolverFiltersString())) {
|
||||
string = bDependency.getSolverFiltersString();
|
||||
} else if (bDependency.getSolverFiltersString().equals(ANY_SOLVER) || bDependency2.getSolverFiltersString().equals(ANY_SOLVER)) {
|
||||
string = ANY_SOLVER;
|
||||
} else {
|
||||
TreeMap<String, PatternFilter> treeMap = new TreeMap<String, PatternFilter>();
|
||||
PatternFilter[] patternFilterArray = bDependency.getSolvers();
|
||||
int n = 0;
|
||||
while (n < patternFilterArray.length) {
|
||||
treeMap.put(patternFilterArray[n].getPattern(), patternFilterArray[n]);
|
||||
++n;
|
||||
}
|
||||
PatternFilter[] patternFilterArray2 = bDependency2.getSolvers();
|
||||
int n2 = 0;
|
||||
while (n2 < patternFilterArray2.length) {
|
||||
if (!treeMap.containsKey(patternFilterArray2[n2].getPattern())) {
|
||||
boolean bl = true;
|
||||
Iterator iterator = treeMap.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PatternFilter patternFilter = (PatternFilter)iterator.next();
|
||||
if (patternFilter.accept(patternFilterArray2[n2].getPattern())) {
|
||||
bl = false;
|
||||
break;
|
||||
}
|
||||
if (!patternFilterArray2[n2].accept(patternFilter.getPattern())) continue;
|
||||
treeMap.remove(patternFilter.getPattern());
|
||||
break;
|
||||
}
|
||||
if (bl) {
|
||||
treeMap.put(patternFilterArray2[n2].getPattern(), patternFilterArray2[n2]);
|
||||
}
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
Iterator iterator = treeMap.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
if (stringBuffer.length() > 0) {
|
||||
stringBuffer.append(';');
|
||||
}
|
||||
stringBuffer.append((String)iterator.next());
|
||||
}
|
||||
string = stringBuffer.toString();
|
||||
}
|
||||
if (bDependency.getPartName().equals(string2) && bDependency.getVersion().equivalent((Object)bVersion) && bDependency.getVersionRelation().equals((Object)bVersionRelation) && bDependency.getSolverFiltersString().equals(string)) {
|
||||
return DEP_SYNC_KEEP_FIRST;
|
||||
}
|
||||
if (bDependency2.getPartName().equals(string2) && bDependency2.getVersion().equivalent((Object)bVersion) && bDependency2.getVersionRelation().equals((Object)bVersionRelation) && bDependency2.getSolverFiltersString().equals(string)) {
|
||||
return DEP_SYNC_KEEP_SECOND;
|
||||
}
|
||||
return new DependencySync(new BDependency(string2, bVersion, bVersionRelation, bDependency.getPartTypeSpec(), string));
|
||||
}
|
||||
|
||||
public boolean supersedes(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (BDependency.sync(this, bDependency) == DEP_SYNC_KEEP_FIRST) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean isPlatformDependency() {
|
||||
boolean bl = false;
|
||||
if (this.getPartTypeSpec().equals((Object)BModelPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BArchPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BGenericPart.TYPE.getTypeSpec()) || this.getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
String string;
|
||||
BDependency bDependency = null;
|
||||
if (context != null) {
|
||||
bDependency = (BDependency)context.getFacet(EXCLUSION_FACET);
|
||||
context = new BasicContext(context.getUser(), context.getLanguage());
|
||||
}
|
||||
if ((string = this.getVersion().toString(context)).trim().length() == 0) {
|
||||
if (bDependency != null) {
|
||||
if (bDependency.getPartName().equals(this.getPartName())) {
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.minimum) {
|
||||
return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return notEqualVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
} else {
|
||||
return anyVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), bDependency.toString(context)});
|
||||
}
|
||||
}
|
||||
return this.getPartName();
|
||||
}
|
||||
if (string.equals("0")) {
|
||||
if (bDependency != null && bDependency.getPartName().equals(this.getPartName())) {
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.minimum) {
|
||||
return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return notEqualVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
}
|
||||
string = anyVersionText.getText(context);
|
||||
}
|
||||
if (this.getVersionRelation() == BVersionRelation.minimum) {
|
||||
if (bDependency != null) {
|
||||
if (bDependency.getPartName().equals(this.getPartName())) {
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.minimum) {
|
||||
return minMaxText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum && this.getVersion().compareTo((Object)bDependency.getVersion()) <= 0) {
|
||||
return minVersionExclusiveText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return minNeText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()});
|
||||
}
|
||||
} else {
|
||||
return nameVersionWithExclude.getText(context, new Object[]{this.getPartName(), string, bDependency.toString(context)});
|
||||
}
|
||||
}
|
||||
return BVersion.nameVersionText.getText(context, new Object[]{this.getPartName(), string});
|
||||
}
|
||||
if (this.getVersionRelation() == BVersionRelation.maximum) {
|
||||
if (bDependency != null) {
|
||||
if (bDependency.getPartName().equals(this.getPartName())) {
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.minimum && this.getVersion().compareTo((Object)bDependency.getVersion()) > 0) {
|
||||
return maxVersionText.getText(context, new Object[]{this.getPartName(), bDependency.getVersion()});
|
||||
}
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.maximum) {
|
||||
return maxInclusiveMinExclusiveText.getText(context, new Object[]{this.getPartName(), string, bDependency.getVersion()});
|
||||
}
|
||||
} else {
|
||||
return maxVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), bDependency.getVersion(), bDependency.toString(context)});
|
||||
}
|
||||
}
|
||||
return maxVersionText.getText(context, new Object[]{this.getPartName(), string});
|
||||
}
|
||||
if (bDependency == null || bDependency.getPartName().equals(this.getPartName())) {
|
||||
return exactVersionText.getText(context, new Object[]{this.getPartName(), string});
|
||||
}
|
||||
return exactVersionTextWithExclude.getText(context, new Object[]{this.getPartName(), string, bDependency.toString(context)});
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return BPart.getPartTypeIcon(this.getPartType());
|
||||
}
|
||||
|
||||
public static BDependency[] merge(BDependency[] bDependencyArray) {
|
||||
Array array = new Array((Object[])bDependencyArray);
|
||||
array = array.sort(COMPARATOR);
|
||||
int n = 0;
|
||||
while (n < array.size() - 1) {
|
||||
BDependency bDependency = (BDependency)((Object)array.get(n));
|
||||
int n2 = n + 1;
|
||||
while (n2 < array.size()) {
|
||||
BDependency bDependency2 = (BDependency)((Object)array.get(n2));
|
||||
DependencySync dependencySync = BDependency.sync(bDependency, bDependency2);
|
||||
if (dependencySync == DEP_SYNC_KEEP_FIRST) {
|
||||
array.remove(n2);
|
||||
continue;
|
||||
}
|
||||
if (dependencySync == DEP_SYNC_KEEP_SECOND) {
|
||||
array.swap(n, n2);
|
||||
array.remove(n2);
|
||||
continue;
|
||||
}
|
||||
if (dependencySync == DEP_SYNC_CONFLICT || dependencySync == DEP_SYNC_NO_CHANGE) {
|
||||
++n2;
|
||||
continue;
|
||||
}
|
||||
array.set(n, (Object)dependencySync.mergedResult);
|
||||
array.remove(n2);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public PatternFilter[] getSolvers() {
|
||||
if (this.solverFilters == null) {
|
||||
this.solverFilters = PatternFilter.parseList((String)this.getSolverFiltersString());
|
||||
}
|
||||
return this.solverFilters;
|
||||
}
|
||||
|
||||
public boolean canSolveWith(String[] stringArray) {
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
if (this.canSolveWith(stringArray[n])) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean canSolveWith(String string) {
|
||||
this.getSolvers();
|
||||
int n = 0;
|
||||
while (n < this.solverFilters.length) {
|
||||
if (this.solverFilters[n].accept(string)) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObject decode(DataInput dataInput) throws IOException {
|
||||
this.setPartName(dataInput.readUTF());
|
||||
this.setVersion((BVersion)BVersion.ZERO.decode(dataInput));
|
||||
this.setVersionRelation((BVersionRelation)BVersionRelation.minimum.decode(dataInput));
|
||||
this.setPartTypeSpec(BTypeSpec.make((String)dataInput.readUTF()));
|
||||
this.setSolverFiltersString(dataInput.readUTF());
|
||||
return null;
|
||||
}
|
||||
|
||||
public void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.getPartName());
|
||||
this.getVersion().encode(dataOutput);
|
||||
this.getVersionRelation().encode(dataOutput);
|
||||
dataOutput.writeUTF(this.getPartTypeSpec().toString());
|
||||
dataOutput.writeUTF(this.getSolverFiltersString());
|
||||
}
|
||||
|
||||
public BObject decodeFromString(String string) throws IOException {
|
||||
BDependency bDependency = new BDependency();
|
||||
String[] stringArray = TextUtil.split((String)string, (char)';');
|
||||
bDependency.setPartName(stringArray[0]);
|
||||
bDependency.getVersion().setBajaVersionString(stringArray[1]);
|
||||
bDependency.getVersion().setVendor(stringArray[2]);
|
||||
bDependency.getVersion().setVendorVersionString(stringArray[3]);
|
||||
bDependency.setVersionRelation(BVersionRelation.make(stringArray[4]));
|
||||
bDependency.setPartTypeSpec(BTypeSpec.make((String)stringArray[5]));
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
int n = 6;
|
||||
while (n < stringArray.length) {
|
||||
if (stringBuffer.length() > 0) {
|
||||
stringBuffer.append(';');
|
||||
}
|
||||
stringBuffer.append(stringArray[n]);
|
||||
++n;
|
||||
}
|
||||
bDependency.setSolverFiltersString(stringBuffer.toString());
|
||||
return bDependency;
|
||||
}
|
||||
|
||||
public String encodeToString() throws IOException {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(this.getPartName());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVersion().encodeToString());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVersionRelation().getTag());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getPartTypeSpec().toString());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getSolverFiltersString());
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.resolvedType = null;
|
||||
this.spec = null;
|
||||
this.solverFilters = null;
|
||||
}
|
||||
|
||||
public BDependency() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BDependency(String string, BVersion bVersion, BTypeSpec bTypeSpec) {
|
||||
this(string, bVersion, BVersionRelation.minimum, bTypeSpec, ANY_SOLVER);
|
||||
}
|
||||
|
||||
public BDependency(String string, BVersion bVersion, BVersionRelation bVersionRelation, BTypeSpec bTypeSpec) {
|
||||
this(string, bVersion, bVersionRelation, bTypeSpec, ANY_SOLVER);
|
||||
}
|
||||
|
||||
public BDependency(String string, BVersion bVersion, BVersionRelation bVersionRelation, BTypeSpec bTypeSpec, String string2) {
|
||||
this.this();
|
||||
this.setPartName(string);
|
||||
this.setVersion((BVersion)bVersion.newCopy());
|
||||
this.setVersionRelation(bVersionRelation);
|
||||
this.setPartTypeSpec(bTypeSpec);
|
||||
this.setSolverFiltersString(string2);
|
||||
}
|
||||
|
||||
public BDependency(DependencyInfo dependencyInfo) {
|
||||
this.this();
|
||||
this.setPartTypeSpec(BModulePart.TYPE.getTypeSpec());
|
||||
this.setPartName(dependencyInfo.getModuleName());
|
||||
if (dependencyInfo.getVendor() != null) {
|
||||
this.getVersion().setVendor(dependencyInfo.getVendor());
|
||||
}
|
||||
this.getVersion().setVendorVersion(dependencyInfo.getVendorVersion());
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = BDependency.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
anyVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.anyVersion");
|
||||
anyVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.anyVersion.exclude");
|
||||
nameVersionWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.nameVersion.exclude");
|
||||
maxVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.maxVersion");
|
||||
maxVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.maxVersion.exclude");
|
||||
exactVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.exactVersion");
|
||||
exactVersionTextWithExclude = LexiconText.make((Type)TYPE, (String)"Dependency.exactVersion.exclude");
|
||||
minVersionExclusiveText = LexiconText.make((Type)TYPE, (String)"Dependency.minVersionExclusive");
|
||||
notEqualVersionText = LexiconText.make((Type)TYPE, (String)"Dependency.notEqualVersion");
|
||||
minMaxText = LexiconText.make((Type)TYPE, (String)"Dependency.minMax");
|
||||
minNeText = LexiconText.make((Type)TYPE, (String)"Dependency.minNe");
|
||||
maxInclusiveMinExclusiveText = LexiconText.make((Type)TYPE, (String)"Dependency.maxInclusiveMinExclusive");
|
||||
DEP_SYNC_KEEP_FIRST = new DependencySync("keep first");
|
||||
DEP_SYNC_KEEP_SECOND = new DependencySync("keep second");
|
||||
DEP_SYNC_NO_CHANGE = new DependencySync("no change");
|
||||
DEP_SYNC_CONFLICT = new DependencySync("conflict");
|
||||
COMPARATOR = new Comparator(){
|
||||
|
||||
public final int compare(Object object, Object object2) {
|
||||
BDependency bDependency = (BDependency)((Object)object);
|
||||
BDependency bDependency2 = (BDependency)((Object)object2);
|
||||
int n = bDependency.getPartTypeSpec().toString().compareTo(bDependency2.getPartTypeSpec().toString());
|
||||
if (n == 0 && (n = bDependency.getPartName().compareTo(bDependency2.getPartName())) == 0 && (n = bDependency.getVersion().compareTo((Object)bDependency2.getVersion())) == 0) {
|
||||
n = bDependency.getVersionRelation().getTag().compareTo(bDependency2.getVersionRelation().getTag());
|
||||
}
|
||||
return n;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static class DependencySync {
|
||||
public BDependency mergedResult;
|
||||
public String descr;
|
||||
|
||||
public boolean equals(Object object) {
|
||||
if (this == object) {
|
||||
return true;
|
||||
}
|
||||
if (this.mergedResult != null && object instanceof DependencySync) {
|
||||
boolean bl = false;
|
||||
if (((DependencySync)object).mergedResult != null && ((DependencySync)object).mergedResult.equivalent((Object)this.mergedResult)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.descr == null ? "merge into " + this.mergedResult.toString() : this.descr;
|
||||
}
|
||||
|
||||
public DependencySync(BDependency bDependency) {
|
||||
this.mergedResult = bDependency;
|
||||
this.descr = null;
|
||||
}
|
||||
|
||||
public DependencySync(String string) {
|
||||
this.mergedResult = null;
|
||||
this.descr = string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BRegisteredModuleList;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.LocalSessionUtil;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.net.ConnectException;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BLocalDaemonPlatform
|
||||
extends BDaemonPlatform {
|
||||
public static final Type TYPE;
|
||||
private static BLocalDaemonPlatform instance;
|
||||
static /* synthetic */ Class class$com$tridium$install$BLocalDaemonPlatform;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
super.init(daemonSessionTaskListener);
|
||||
BRegisteredModuleList bRegisteredModuleList = new BRegisteredModuleList();
|
||||
bRegisteredModuleList.init(null);
|
||||
this.setModuleList(bRegisteredModuleList);
|
||||
}
|
||||
|
||||
public static BLocalDaemonPlatform getInstance() throws ConnectException, AuthenticationException {
|
||||
BDaemonSession bDaemonSession;
|
||||
if (instance == null && (bDaemonSession = LocalSessionUtil.getLocalSession()) != null) {
|
||||
instance = new BLocalDaemonPlatform(bDaemonSession);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
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 BLocalDaemonPlatform() {
|
||||
}
|
||||
|
||||
private BLocalDaemonPlatform(BDaemonSession bDaemonSession) throws ConnectException, AuthenticationException {
|
||||
super(bDaemonSession);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BLocalDaemonPlatform;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BLocalDaemonPlatform = BLocalDaemonPlatform.class("[Lcom.tridium.install.BLocalDaemonPlatform;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BDirectory
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.LocalizableRuntimeException
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BModuleList;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import javax.baja.file.BDirectory;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.LocalizableRuntimeException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BLocalDirectoryModuleList
|
||||
extends BModuleList {
|
||||
public static final Type TYPE;
|
||||
private boolean initialized;
|
||||
private BDirectory[] moduleDirectories;
|
||||
static /* synthetic */ Class class$com$tridium$install$BLocalDirectoryModuleList;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BDirectory[] getDirectories() {
|
||||
return this.moduleDirectories;
|
||||
}
|
||||
|
||||
public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
super.reset();
|
||||
this.getModules().removeAll();
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
private final void addFiles(BDirectory bDirectory) {
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
BModuleInstallable bModuleInstallable;
|
||||
if (bIFileArray[n].getExtension() != null && (bIFileArray[n].getExtension().equals("jar") || bIFileArray[n].getExtension().equals("sjar")) && (bModuleInstallable = (BModuleInstallable)BModuleInstallable.make(bIFileArray[n])) != null) {
|
||||
String string = SlotPath.escape((String)bModuleInstallable.getInstallableName());
|
||||
if (this.getModules().getProperty(string) == null) {
|
||||
this.getModules().add(string, (BValue)bModuleInstallable);
|
||||
} else {
|
||||
throw new LocalizableRuntimeException("platform", "ModuleList.exception.dupModule", new Object[]{bModuleInstallable.getInstallableName()});
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.initialized) {
|
||||
this.getModules().removeAll();
|
||||
int n = 0;
|
||||
while (n < this.moduleDirectories.length) {
|
||||
this.addFiles(this.moduleDirectories[n]);
|
||||
++n;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
public BLocalDirectoryModuleList(BDirectory bDirectory) {
|
||||
this(new BDirectory[]{bDirectory});
|
||||
}
|
||||
|
||||
public BLocalDirectoryModuleList(BDirectory[] bDirectoryArray) {
|
||||
this.this();
|
||||
this.moduleDirectories = bDirectoryArray;
|
||||
this.setLocalInstance(true);
|
||||
this.reset();
|
||||
}
|
||||
|
||||
public BLocalDirectoryModuleList() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BLocalDirectoryModuleList;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BLocalDirectoryModuleList = BLocalDirectoryModuleList.class("[Lcom.tridium.install.BLocalDirectoryModuleList;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.Action
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Cursor
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.install.installable.ClosableCursor;
|
||||
import com.tridium.install.installable.CursorUtil;
|
||||
import com.tridium.install.installable.InstallableRegistry;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.util.HashMap;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Cursor;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BModuleList
|
||||
extends BComponent
|
||||
implements InstallableRegistry {
|
||||
public static final Property modules = BModuleList.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Action init = BModuleList.newAction((int)4, null);
|
||||
public static final Type TYPE;
|
||||
private HashMap dependentModuleNames;
|
||||
private boolean isLocalInstance;
|
||||
static /* synthetic */ Class class$com$tridium$install$BModuleList;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
|
||||
|
||||
public BVector getModules() {
|
||||
return (BVector)this.get(modules);
|
||||
}
|
||||
|
||||
public void setModules(BVector bVector) {
|
||||
this.set(modules, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
this.invoke(init, null, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public final synchronized void load() {
|
||||
this.load(null);
|
||||
}
|
||||
|
||||
public final synchronized void load(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.checkLocalInstance();
|
||||
this.doReload(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public final synchronized void reload() {
|
||||
this.reload(null);
|
||||
}
|
||||
|
||||
public final synchronized void reload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.reset();
|
||||
this.init(daemonSessionTaskListener);
|
||||
this.doReload(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public synchronized void reset() {
|
||||
this.checkLocalInstance();
|
||||
this.dependentModuleNames = null;
|
||||
}
|
||||
|
||||
protected synchronized void doReload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
}
|
||||
|
||||
public BPart getPart(String string) {
|
||||
BModuleInstallable bModuleInstallable = this.getModuleInstallable(string);
|
||||
return bModuleInstallable == null ? null : bModuleInstallable.getModulePart();
|
||||
}
|
||||
|
||||
public BModuleInstallable getModuleInstallable(String string) {
|
||||
return (BModuleInstallable)this.getModules().get(SlotPath.escape((String)string));
|
||||
}
|
||||
|
||||
public Array getDependentModuleNames(String string) {
|
||||
Array array;
|
||||
if (this.dependentModuleNames == null) {
|
||||
this.dependentModuleNames = new HashMap();
|
||||
array = this.getModules().getProperties();
|
||||
while (array.next()) {
|
||||
BModulePart bModulePart = ((BModuleInstallable)array.get()).getModulePart();
|
||||
BDependency[] bDependencyArray = bModulePart.getDependencyArray();
|
||||
int n = 0;
|
||||
while (n < bDependencyArray.length) {
|
||||
String string2 = bDependencyArray[n].getPartName();
|
||||
Array array2 = (Array)this.dependentModuleNames.get(string2);
|
||||
if (array2 == null) {
|
||||
array2 = new Array();
|
||||
this.dependentModuleNames.put(string2, array2);
|
||||
}
|
||||
array2.add((Object)bModulePart.getPartName());
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (array = (Array)this.dependentModuleNames.get(string)) == null ? new Array() : array;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
BPart bPart = this.getPart(bDependency.getPartName());
|
||||
if (bPart == null) {
|
||||
return false;
|
||||
}
|
||||
return bPart.meets(bDependency);
|
||||
}
|
||||
|
||||
public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener);
|
||||
if (bInstallable == null) {
|
||||
return new BInstallable[0];
|
||||
}
|
||||
return new BInstallable[]{bInstallable};
|
||||
}
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public BInstallable findInstallable(BDependency var1_1, DaemonSessionTaskListener var2_2) throws Exception {
|
||||
this.init(var2_2);
|
||||
var3_3 = this.getModules().getProperties();
|
||||
if (true) ** GOTO lbl7
|
||||
do {
|
||||
if ((var4_4 = (BModuleInstallable)var3_3.get()).meets(var1_1)) {
|
||||
return var4_4;
|
||||
}
|
||||
lbl7:
|
||||
// 3 sources
|
||||
|
||||
if ((v0 = BModuleList.class$com$tridium$install$installable$BModuleInstallable) != null) continue;
|
||||
v0 = BModuleList.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
||||
} while (var3_3.next(v0));
|
||||
return null;
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.init();
|
||||
return CursorUtil.closable((Cursor)this.getModules().getProperties());
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
BInstallable bInstallable = this.findInstallable(bDependency, daemonSessionTaskListener);
|
||||
if (bInstallable == null) {
|
||||
return new ClosableCursor(){
|
||||
|
||||
public final void close() {
|
||||
}
|
||||
|
||||
public final BObject get() {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public final Context getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final boolean next() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public final boolean next(Class clazz) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public final boolean nextComponent() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
return new ItemCursor((BObject)bInstallable);
|
||||
}
|
||||
|
||||
public final void init(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.doInit(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public final void doInit() {
|
||||
this.doInit(null);
|
||||
}
|
||||
|
||||
public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
protected void setLocalInstance(boolean bl) {
|
||||
this.isLocalInstance = bl;
|
||||
}
|
||||
|
||||
protected boolean isLocalInstance() {
|
||||
return this.isLocalInstance;
|
||||
}
|
||||
|
||||
protected void checkLocalInstance() {
|
||||
if (!this.isLocalInstance()) {
|
||||
throw new IllegalStateException("operation not supported on remote BModuleList");
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.dependentModuleNames = null;
|
||||
}
|
||||
|
||||
public BModuleList() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BModuleList;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BModuleList = BModuleList.class("[Lcom.tridium.install.BModuleList;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public static class ItemCursor
|
||||
implements ClosableCursor {
|
||||
private BObject item;
|
||||
private int index;
|
||||
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
if (this.index == 0) {
|
||||
return this.item;
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (this.index < 0) {
|
||||
++this.index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
boolean bl = this.next();
|
||||
while (bl && !clazz.isAssignableFrom(this.get().getClass())) {
|
||||
bl = this.next();
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
Class clazz = class$javax$baja$sys$BComponent;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$sys$BComponent = ItemCursor.class("[Ljavax.baja.sys.BComponent;", false);
|
||||
}
|
||||
return this.next(clazz);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
public ItemCursor(BObject bObject) {
|
||||
this.this();
|
||||
this.item = bObject;
|
||||
this.index = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFrozenEnum
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import javax.baja.sys.BFrozenEnum;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BPartInstallStatus
|
||||
extends BFrozenEnum {
|
||||
public static final int NOT_FOUND = 0;
|
||||
public static final int NO_CHANGE = 1;
|
||||
public static final int INSTALL = 2;
|
||||
public static final int UPGRADE = 3;
|
||||
public static final int REINSTALL = 4;
|
||||
public static final int DOWNGRADE = 5;
|
||||
public static final int UNINSTALL = 6;
|
||||
public static final BPartInstallStatus notFound = new BPartInstallStatus(0);
|
||||
public static final BPartInstallStatus noChange = new BPartInstallStatus(1);
|
||||
public static final BPartInstallStatus install = new BPartInstallStatus(2);
|
||||
public static final BPartInstallStatus upgrade = new BPartInstallStatus(3);
|
||||
public static final BPartInstallStatus reinstall = new BPartInstallStatus(4);
|
||||
public static final BPartInstallStatus downgrade = new BPartInstallStatus(5);
|
||||
public static final BPartInstallStatus uninstall = new BPartInstallStatus(6);
|
||||
public static final Type TYPE;
|
||||
public static final BPartInstallStatus DEFAULT;
|
||||
static /* synthetic */ Class class$com$tridium$install$BPartInstallStatus;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static final BPartInstallStatus make(int n) {
|
||||
return (BPartInstallStatus)notFound.getRange().get(n, false);
|
||||
}
|
||||
|
||||
public static final BPartInstallStatus make(String string) {
|
||||
return (BPartInstallStatus)notFound.getRange().get(string);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private BPartInstallStatus(int n) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BPartInstallStatus;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BPartInstallStatus = BPartInstallStatus.class("[Lcom.tridium.install.BPartInstallStatus;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = notFound;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.sys.registry.NModuleInfo
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.registry.ModuleInfo
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BModuleList;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import com.tridium.sys.registry.NModuleInfo;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.registry.ModuleInfo;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BRegisteredModuleList
|
||||
extends BModuleList {
|
||||
public static final Type TYPE;
|
||||
private static BRegisteredModuleList instance;
|
||||
private boolean initialized;
|
||||
static /* synthetic */ Class class$com$tridium$install$BRegisteredModuleList;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static BModuleList getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new BRegisteredModuleList();
|
||||
instance.init(null);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
super.reset();
|
||||
this.getModules().removeAll();
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
public synchronized void doInit(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.initialized) {
|
||||
this.getModules().removeAll();
|
||||
ModuleInfo[] moduleInfoArray = Sys.getRegistry().getModules();
|
||||
int n = 0;
|
||||
while (n < moduleInfoArray.length) {
|
||||
BModuleInstallable bModuleInstallable = BModuleInstallable.make((NModuleInfo)moduleInfoArray[n]);
|
||||
if (bModuleInstallable != null) {
|
||||
this.getModules().add(SlotPath.escape((String)bModuleInstallable.getInstallableName()), (BValue)bModuleInstallable);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
public BRegisteredModuleList() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BRegisteredModuleList;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BRegisteredModuleList = BRegisteredModuleList.class("[Lcom.tridium.install.BRegisteredModuleList;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
instance = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BRemoteModuleList;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.net.ConnectException;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BRemoteDaemonPlatform
|
||||
extends BDaemonPlatform {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$install$BRemoteDaemonPlatform;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
protected void init(DaemonSessionTaskListener daemonSessionTaskListener) throws ConnectException, AuthenticationException {
|
||||
super.init(daemonSessionTaskListener);
|
||||
this.setModuleList(new BRemoteModuleList(this.getDaemonSession()));
|
||||
}
|
||||
|
||||
public static BRemoteDaemonPlatform make(BDaemonSession bDaemonSession, DaemonSessionTaskListener daemonSessionTaskListener) throws AuthenticationException, ConnectException {
|
||||
return BRemoteDaemonPlatform.make(bDaemonSession, daemonSessionTaskListener, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public static BRemoteDaemonPlatform make(BDaemonSession bDaemonSession, DaemonSessionTaskListener daemonSessionTaskListener, boolean bl) throws AuthenticationException, ConnectException {
|
||||
if (bDaemonSession == null) {
|
||||
return null;
|
||||
}
|
||||
BDaemonSession bDaemonSession2 = bDaemonSession;
|
||||
synchronized (bDaemonSession2) {
|
||||
BRemoteDaemonPlatform bRemoteDaemonPlatform;
|
||||
block6: {
|
||||
block5: {
|
||||
if (!bl) break block5;
|
||||
bRemoteDaemonPlatform = (BRemoteDaemonPlatform)bDaemonSession.getHostProperties().get("platform");
|
||||
if (bRemoteDaemonPlatform == null) {
|
||||
bRemoteDaemonPlatform = new BRemoteDaemonPlatform(bDaemonSession);
|
||||
bDaemonSession.getHostProperties().add("platform", (BValue)bRemoteDaemonPlatform);
|
||||
}
|
||||
break block6;
|
||||
}
|
||||
bRemoteDaemonPlatform = new BRemoteDaemonPlatform(bDaemonSession);
|
||||
}
|
||||
bRemoteDaemonPlatform.checkSession(daemonSessionTaskListener);
|
||||
return bRemoteDaemonPlatform;
|
||||
}
|
||||
}
|
||||
|
||||
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 BRemoteDaemonPlatform() {
|
||||
}
|
||||
|
||||
private BRemoteDaemonPlatform(BDaemonSession bDaemonSession) throws ConnectException, AuthenticationException {
|
||||
super(bDaemonSession);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BRemoteDaemonPlatform;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BRemoteDaemonPlatform = BRemoteDaemonPlatform.class("[Lcom.tridium.install.BRemoteDaemonPlatform;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.log.Log
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Clock
|
||||
* javax.baja.sys.LocalizableRuntimeException
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BModuleList;
|
||||
import com.tridium.install.GetModuleListMessage;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.message.RequestGarbageCollectionMessage;
|
||||
import com.tridium.platform.daemon.task.CancelableDaemonSessionTask;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.log.Log;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Clock;
|
||||
import javax.baja.sys.LocalizableRuntimeException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BRemoteModuleList
|
||||
extends BModuleList {
|
||||
public static final Type TYPE;
|
||||
private static Log log;
|
||||
private BDaemonSession session;
|
||||
private boolean initialized;
|
||||
private XElem[] moduleElems;
|
||||
private Object MODULE_ELEM_LOCK;
|
||||
static /* synthetic */ Class class$com$tridium$install$BRemoteModuleList;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void doReload(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
super.reset();
|
||||
this.moduleElems = null;
|
||||
this.getModules().removeAll();
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Unable to fully structure code
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public synchronized void doInit(DaemonSessionTaskListener var1_1) {
|
||||
if (!this.isLocalInstance()) {
|
||||
return;
|
||||
}
|
||||
if (this.initialized != false) return;
|
||||
var2_2 = Clock.ticks();
|
||||
BRemoteModuleList.log.trace("building remote module list");
|
||||
this.getModules().removeAll();
|
||||
var4_3 = this.getNewModuleInfoTask();
|
||||
if (var1_1 != null) {
|
||||
var1_1.taskStarted(var4_3);
|
||||
}
|
||||
try {
|
||||
try {
|
||||
var8_4 = this.MODULE_ELEM_LOCK;
|
||||
synchronized (var8_4) {
|
||||
if (this.moduleElems == null) {
|
||||
this.moduleElems = this.fetchModules(null);
|
||||
}
|
||||
var7_5 = this.moduleElems;
|
||||
// MONITOREXIT @DISABLED, blocks:[0, 1, 2, 4] lbl18 : MonitorExitStatement: MONITOREXIT : var8_4
|
||||
var10_8 = 0;
|
||||
if (true) ** GOTO lbl34
|
||||
}
|
||||
do {
|
||||
if (!(var11_9 = this.uriToFilePath(var7_5[var10_8].get("path"))).getParent().getName().equals("lib")) {
|
||||
var12_10 = new BModuleInstallable(var7_5[var10_8].getl("size", (long)-1), var11_9.getName(), var7_5[var10_8].elem("module"));
|
||||
var13_11 = SlotPath.escape((String)var12_10.getInstallableName());
|
||||
BRemoteModuleList.log.trace("adding remote module " + var12_10.getInstallableName());
|
||||
if (this.getModules().getProperty(var13_11) != null) {
|
||||
BRemoteModuleList.log.error(this.getLexicon().getText("ModuleList.exception.dupModule", new Object[]{var12_10.getInstallableName()}));
|
||||
throw new LocalizableRuntimeException("platform", "ModuleList.exception.dupModule", new Object[]{var12_10.getInstallableName()});
|
||||
}
|
||||
this.getModules().add(var13_11, (BValue)var12_10);
|
||||
}
|
||||
++var10_8;
|
||||
lbl34:
|
||||
// 2 sources
|
||||
|
||||
} while (var10_8 < var7_5.length && !var4_3.isCanceled());
|
||||
if (var4_3.isCanceled()) {
|
||||
throw new ICancelHint.CanceledException();
|
||||
}
|
||||
this.initialized = true;
|
||||
}
|
||||
catch (ICancelHint.CanceledException var7_6) {
|
||||
throw var7_6;
|
||||
}
|
||||
catch (Exception var7_7) {
|
||||
throw new LocalizableRuntimeException("platform", "RemoteModuleList.exception.xmlParse", (Throwable)var7_7);
|
||||
}
|
||||
var6_14 = null;
|
||||
}
|
||||
catch (Throwable var5_12) {
|
||||
var6_13 = null;
|
||||
Log.getLog((String)"platform.daemonTuning").trace("moduleList " + (Clock.ticks() - var2_2) + "ms");
|
||||
if (var1_1 == null) throw var5_12;
|
||||
var1_1.taskFinished(var4_3);
|
||||
throw var5_12;
|
||||
}
|
||||
Log.getLog((String)"platform.daemonTuning").trace("moduleList " + (Clock.ticks() - var2_2) + "ms");
|
||||
if (var1_1 == null) return;
|
||||
var1_1.taskFinished(var4_3);
|
||||
}
|
||||
|
||||
protected XElem[] fetchModules(String string) throws Exception, ConnectException {
|
||||
XElem[] xElemArray = XParser.make((InputStream)this.session.getInputStream(new GetModuleListMessage(false, true, true, string))).parse().elems("moduleItem");
|
||||
try {
|
||||
if (this.session.getHostProperties().getOsName().toLowerCase().startsWith("win")) {
|
||||
log.trace("sending remote garbage collection");
|
||||
this.session.sendMessage(RequestGarbageCollectionMessage.getInstance());
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
return xElemArray;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public void setModuleElems(XElem[] xElemArray) {
|
||||
Object object = this.MODULE_ELEM_LOCK;
|
||||
synchronized (object) {
|
||||
this.moduleElems = xElemArray;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public CancelableDaemonSessionTask getNewModuleInfoTask() {
|
||||
return new CancelableDaemonSessionTask(this.getLexicon(), "RemoteModuleList.dialog.loading.title", "RemoteModuleList.dialog.loading.message");
|
||||
}
|
||||
|
||||
private final FilePath uriToFilePath(String string) {
|
||||
if (string.startsWith("/files")) {
|
||||
return new FilePath("/" + HttpUtil.decodeUrl((String)string.substring(7)));
|
||||
}
|
||||
if (string.startsWith("/niagara")) {
|
||||
return new FilePath("!" + HttpUtil.decodeUrl((String)string.substring(9)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.session = null;
|
||||
this.initialized = false;
|
||||
this.moduleElems = null;
|
||||
this.MODULE_ELEM_LOCK = new Object();
|
||||
}
|
||||
|
||||
public BRemoteModuleList() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BRemoteModuleList(BDaemonSession bDaemonSession) {
|
||||
this.this();
|
||||
this.session = bDaemonSession;
|
||||
this.setLocalInstance(true);
|
||||
this.reset();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BRemoteModuleList;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BRemoteModuleList = BRemoteModuleList.class("[Lcom.tridium.install.BRemoteModuleList;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
log = Log.getLog((String)"platform");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XContent
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
* javax.baja.xml.XWriter
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.platform.install.BFileReconciler;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XContent;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
import javax.baja.xml.XWriter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BUnitDatabaseMerge
|
||||
extends BFileReconciler {
|
||||
public static final BUnitDatabaseMerge INSTANCE = new BUnitDatabaseMerge();
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$install$BUnitDatabaseMerge;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BFileReconciler.ReconciliationResults reconcile(BIFile bIFile, BIFile bIFile2) throws Exception {
|
||||
Object object;
|
||||
String string;
|
||||
boolean bl = false;
|
||||
HashMap<String, XElem> hashMap = new HashMap<String, XElem>();
|
||||
HashMap<String, XElem> hashMap2 = new HashMap<String, XElem>();
|
||||
HashMap<String, Object> hashMap3 = new HashMap<String, Object>();
|
||||
XElem xElem = this.parseFile(bIFile2);
|
||||
XElem[] xElemArray = xElem.elems("quantity");
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
XElem xElem2 = xElemArray[n];
|
||||
string = xElem2.get("n");
|
||||
hashMap2.put(string, xElem2);
|
||||
object = xElem2.elems("unit");
|
||||
int n2 = 0;
|
||||
while (n2 < ((XElem[])object).length) {
|
||||
String string2 = object[n2].get("n");
|
||||
hashMap.put(string2, object[n2]);
|
||||
hashMap3.put(string2, string);
|
||||
++n2;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
XElem xElem3 = this.parseFile(bIFile);
|
||||
xElemArray = xElem3.elems("quantity");
|
||||
int n3 = 0;
|
||||
while (n3 < xElemArray.length) {
|
||||
string = xElemArray[n3];
|
||||
object = string.get("n");
|
||||
XElem[] xElemArray2 = string.elems("unit");
|
||||
int n4 = 0;
|
||||
while (n4 < xElemArray2.length) {
|
||||
String string3;
|
||||
XElem xElem4 = xElemArray2[n4];
|
||||
String string4 = xElem4.get("n");
|
||||
XElem xElem5 = (XElem)hashMap.get(string4);
|
||||
if (xElem5 == null) {
|
||||
string3 = this.getOldQuantityElem((XElem)string, xElem, hashMap2);
|
||||
xElem5 = xElem4.copy();
|
||||
string3.addContent((XContent)xElem5);
|
||||
hashMap.put(string4, xElem5);
|
||||
bl = true;
|
||||
} else {
|
||||
XElem xElem6;
|
||||
string3 = (String)hashMap3.get(string4);
|
||||
if (!((String)object).equals(string3)) {
|
||||
xElem6 = (XElem)hashMap2.get(string3);
|
||||
xElem6.removeContent((XContent)xElem5);
|
||||
xElem6 = this.getOldQuantityElem((XElem)string, xElem, hashMap2);
|
||||
xElem5 = xElem4.copy();
|
||||
xElem6.addContent((XContent)xElem5);
|
||||
hashMap3.put(string4, object);
|
||||
hashMap.put(string4, xElem5);
|
||||
bl = true;
|
||||
} else if (!this.equivalent(xElem4, xElem5)) {
|
||||
xElem6 = this.getOldQuantityElem((XElem)string, xElem, hashMap2);
|
||||
xElem6.removeContent((XContent)xElem5);
|
||||
xElem5 = xElem4.copy();
|
||||
xElem6.addContent((XContent)xElem5);
|
||||
hashMap.put(string4, xElem5);
|
||||
bl = true;
|
||||
}
|
||||
}
|
||||
++n4;
|
||||
}
|
||||
++n3;
|
||||
}
|
||||
if (bl) {
|
||||
return new XmlReconciliationResults(xElem);
|
||||
}
|
||||
return NO_RECONCILIATION;
|
||||
}
|
||||
|
||||
protected XElem getOldQuantityElem(XElem xElem, XElem xElem2, Map map) {
|
||||
String string = xElem.get("n");
|
||||
XElem xElem3 = (XElem)map.get(string);
|
||||
if (xElem3 == null) {
|
||||
xElem3 = this.shallowCopy(xElem);
|
||||
xElem2.addContent((XContent)xElem3);
|
||||
map.put(string, xElem3);
|
||||
}
|
||||
return xElem3;
|
||||
}
|
||||
|
||||
protected boolean equivalent(XElem xElem, XElem xElem2) {
|
||||
if (xElem == xElem2) {
|
||||
return true;
|
||||
}
|
||||
if (xElem == null) {
|
||||
boolean bl = false;
|
||||
if (xElem2 == null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (xElem2 == null) {
|
||||
return false;
|
||||
}
|
||||
if (this.equals(xElem.ns(), xElem2.ns()) && this.equals(xElem.name(), xElem2.name()) && xElem.attrSize() == xElem2.attrSize()) {
|
||||
int n = 0;
|
||||
while (n < xElem.attrSize()) {
|
||||
int n2 = xElem2.attrIndex(xElem.attrNs(n), xElem.attrName(n));
|
||||
if (n2 < 0) {
|
||||
return false;
|
||||
}
|
||||
if (!this.equals(xElem.attrValue(n), xElem2.attrValue(n2))) {
|
||||
return false;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean equals(Object object, Object object2) {
|
||||
if (object == object2) {
|
||||
return true;
|
||||
}
|
||||
if (object == null) {
|
||||
boolean bl = false;
|
||||
if (object2 == null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return object.equals(object2);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
*/
|
||||
protected XElem parseFile(BIFile bIFile) throws Exception {
|
||||
XElem xElem;
|
||||
InputStream inputStream = bIFile.getInputStream();
|
||||
try {
|
||||
xElem = XParser.make((InputStream)inputStream).parse();
|
||||
Object var4_4 = null;
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var4_5 = null;
|
||||
try {
|
||||
inputStream.close();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
throw throwable;
|
||||
}
|
||||
try {
|
||||
inputStream.close();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
protected XElem shallowCopy(XElem xElem) {
|
||||
XElem xElem2 = new XElem(xElem.ns(), xElem.name());
|
||||
int n = 0;
|
||||
while (n < xElem.attrSize()) {
|
||||
xElem2.addAttr(xElem.attrNs(n), xElem.attrName(n), xElem.attrValue(n));
|
||||
++n;
|
||||
}
|
||||
return xElem2;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
protected BUnitDatabaseMerge() {
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BUnitDatabaseMerge;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BUnitDatabaseMerge = BUnitDatabaseMerge.class("[Lcom.tridium.install.BUnitDatabaseMerge;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
|
||||
public static class XmlReconciliationResults
|
||||
implements BFileReconciler.ReconciliationResults {
|
||||
public byte[] contents;
|
||||
|
||||
public InputStream getInputStream() {
|
||||
return new ByteArrayInputStream(this.contents);
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.contents.length;
|
||||
}
|
||||
|
||||
public boolean shouldReplaceContents() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public XmlReconciliationResults(XElem xElem) throws Exception {
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
XWriter xWriter = new XWriter((OutputStream)byteArrayOutputStream);
|
||||
xElem.write(xWriter);
|
||||
xWriter.flush();
|
||||
this.contents = byteArrayOutputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,393 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.nre.util.TextUtil
|
||||
* javax.baja.sys.BIComparable
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.BStruct
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.LexiconText
|
||||
* javax.baja.util.Version
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.part.BPart;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.BIComparable;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.LexiconText;
|
||||
import javax.baja.util.Version;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BVersion
|
||||
extends BStruct
|
||||
implements BIComparable,
|
||||
BIDataValue {
|
||||
public static final Property bajaVersionString = BVersion.newProperty((int)1, (String)"", null);
|
||||
public static final Property vendor = BVersion.newProperty((int)1, (String)"", null);
|
||||
public static final Property vendorVersionString = BVersion.newProperty((int)1, (String)"", null);
|
||||
public static final Type TYPE;
|
||||
public static final LexiconText nameVersionText;
|
||||
public static final BVersion ZERO;
|
||||
public static final int LATER_VERSION = 1;
|
||||
public static final int SAME_VERSION = 2;
|
||||
public static final int EARLIER_VERSION = 4;
|
||||
public static final int DIFFERENT_VERSION = 8;
|
||||
public static final int EQUIVALENT_VERSION = 16;
|
||||
public static final int MORE_SPECIFIC_VERSION = 32;
|
||||
public static final int LESS_SPECIFIC_VERSION = 64;
|
||||
public static final int MEETS_MINIMUM = 115;
|
||||
public static final int MEETS_MAXIMUM = 118;
|
||||
private Version vendorVersionObject;
|
||||
private boolean setting;
|
||||
private String settingMonitor;
|
||||
static /* synthetic */ Class class$com$tridium$install$BVersion;
|
||||
|
||||
public String getBajaVersionString() {
|
||||
return this.getString(bajaVersionString);
|
||||
}
|
||||
|
||||
public void setBajaVersionString(String string) {
|
||||
this.setString(bajaVersionString, string, null);
|
||||
}
|
||||
|
||||
public String getVendor() {
|
||||
return this.getString(vendor);
|
||||
}
|
||||
|
||||
public void setVendor(String string) {
|
||||
this.setString(vendor, string, null);
|
||||
}
|
||||
|
||||
public String getVendorVersionString() {
|
||||
return this.getString(vendorVersionString);
|
||||
}
|
||||
|
||||
public void setVendorVersionString(String string) {
|
||||
this.setString(vendorVersionString, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public int compareTo(Object object) {
|
||||
BVersion bVersion = (BVersion)((Object)object);
|
||||
if (bVersion == null) {
|
||||
return 1;
|
||||
}
|
||||
int n = TextUtil.toLowerCase((String)this.getVendor()).compareTo(TextUtil.toLowerCase((String)bVersion.getVendor()));
|
||||
if (n == 0) {
|
||||
if (bVersion.getVendorVersion() == null) {
|
||||
int n2 = 0;
|
||||
if (this.getVendorVersion() == null) {
|
||||
n2 = 1;
|
||||
}
|
||||
return 1 - n2;
|
||||
}
|
||||
if (this.getVendorVersion() == null) {
|
||||
return -1;
|
||||
}
|
||||
n = this.getVendorVersion().compareTo((Object)bVersion.getVendorVersion());
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
public static boolean meets(Version version, BDependency bDependency) {
|
||||
return BVersion.meetsVersionRequirement(version, bDependency.getVersion().getVendorVersion(), bDependency.getVersionRelation());
|
||||
}
|
||||
|
||||
public static boolean meetsVersionRequirement(Version version, Version version2, BVersionRelation bVersionRelation) {
|
||||
int n = BVersion.checkVersionRequirement(version, version2);
|
||||
if (bVersionRelation == BVersionRelation.minimum) {
|
||||
boolean bl = false;
|
||||
if ((n & 0x73) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (bVersionRelation == BVersionRelation.maximum) {
|
||||
boolean bl = false;
|
||||
if ((n & 0x76) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
boolean bl = false;
|
||||
if ((n & 2) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
return this.meetsVersionRequirement(bDependency.getVersion(), bDependency.getVersionRelation());
|
||||
}
|
||||
|
||||
public boolean meetsVersionRequirement(BVersion bVersion, BVersionRelation bVersionRelation) {
|
||||
int n = this.checkVersionRequirement(bVersion);
|
||||
if (bVersionRelation == BVersionRelation.minimum) {
|
||||
boolean bl = false;
|
||||
if ((n & 0x73) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (bVersionRelation == BVersionRelation.maximum) {
|
||||
boolean bl = false;
|
||||
if ((n & 0x76) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
boolean bl = false;
|
||||
if ((n & 2) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
/*
|
||||
* Enabled force condition propagation
|
||||
* Lifted jumps to return sites
|
||||
*/
|
||||
public int checkVersionRequirement(BVersion bVersion) {
|
||||
int n;
|
||||
if (!bVersion.getVendor().equalsIgnoreCase(this.getVendor()) && bVersion.getVendor().trim().length() != 0 && this.getVendor().trim().length() != 0) return 8;
|
||||
if (bVersion.getVendorVersion() == null) {
|
||||
if (this.getVendorVersion() != null) return 32;
|
||||
n = 0;
|
||||
} else {
|
||||
if (this.getVendorVersion() == null) {
|
||||
return 64;
|
||||
}
|
||||
n = this.getVendorVersion().compareTo((Object)bVersion.getVendorVersion());
|
||||
}
|
||||
if (n == 0) {
|
||||
if (!bVersion.getVendor().equalsIgnoreCase(this.getVendor())) return 16;
|
||||
return 2;
|
||||
}
|
||||
if (n >= 0) return 1;
|
||||
return 4;
|
||||
}
|
||||
|
||||
public static int checkVersionRequirement(Version version, Version version2) {
|
||||
int n = version2 == null ? 0 : (version == null ? -1 : version.compareTo((Object)version2));
|
||||
if (n == 0) {
|
||||
return 2;
|
||||
}
|
||||
if (n < 0) {
|
||||
return 4;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public synchronized boolean equivalent(Object object) {
|
||||
if (object instanceof BVersion) {
|
||||
BVersion bVersion = (BVersion)((Object)object);
|
||||
if (this.getVendorVersion() == null) {
|
||||
if (bVersion.getVendorVersion() != null) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (bVersion.getVendorVersion() == null) {
|
||||
return false;
|
||||
}
|
||||
if (!this.getVendorVersion().equals((Object)bVersion.getVendorVersion())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return bVersion.getVendor().equalsIgnoreCase(this.getVendor());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (this.getVendor().length() > 0) {
|
||||
stringBuffer.append(this.getVendor()).append(" ");
|
||||
}
|
||||
if (this.getVendorVersion() != null) {
|
||||
stringBuffer.append(this.getVendorVersion());
|
||||
}
|
||||
return stringBuffer.toString().trim();
|
||||
}
|
||||
|
||||
public Version getBajaVersion() {
|
||||
if (this.getVersionString(this.getBajaVersionString()).trim().length() > 0) {
|
||||
return new Version(this.getVersionString(this.getBajaVersionString()));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Version getVendorVersion() {
|
||||
if (this.vendorVersionObject == null && this.getVersionString(this.getVendorVersionString()).trim().length() > 0) {
|
||||
this.vendorVersionObject = new Version(this.getVersionString(this.getVendorVersionString()));
|
||||
}
|
||||
return this.vendorVersionObject;
|
||||
}
|
||||
|
||||
public void setVendorVersion(Version version) {
|
||||
if (this.setting) {
|
||||
return;
|
||||
}
|
||||
this.vendorVersionObject = version;
|
||||
if (version == null) {
|
||||
this.setVendorVersionString("");
|
||||
} else {
|
||||
this.setVendorVersionString(version.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private final String getVersionString(String string) {
|
||||
if (string == null) {
|
||||
return "";
|
||||
}
|
||||
int n = 0;
|
||||
while (n < string.length()) {
|
||||
if (string.charAt(n) != '.' && !Character.isDigit(string.charAt(n))) {
|
||||
return string.substring(0, n);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public void changed(Property property, Context context) {
|
||||
String string = this.settingMonitor;
|
||||
synchronized (string) {
|
||||
this.setting = true;
|
||||
if (property == vendorVersionString) {
|
||||
String string2 = this.propertyValueToString(property, context);
|
||||
this.vendorVersionObject = string2.trim().length() == 0 ? null : new Version(this.getVersionString(string2));
|
||||
}
|
||||
this.setting = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static String formatNameVersion(BPart bPart, Context context) {
|
||||
return BVersion.formatNameVersion(bPart.getPartName(), bPart.getVersion(), context);
|
||||
}
|
||||
|
||||
public static String formatNameVersion(String string, BVersion bVersion, Context context) {
|
||||
String string2 = bVersion.toString(context);
|
||||
if (string2.trim().length() == 0 || string2.equals("0")) {
|
||||
return string;
|
||||
}
|
||||
return nameVersionText.getText(context, new Object[]{string, string2});
|
||||
}
|
||||
|
||||
public static BVersion makeZero() {
|
||||
return new BVersion();
|
||||
}
|
||||
|
||||
public void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.getBajaVersionString());
|
||||
dataOutput.writeUTF(this.getVendor());
|
||||
dataOutput.writeUTF(this.getVendorVersionString());
|
||||
}
|
||||
|
||||
public BObject decode(DataInput dataInput) throws IOException {
|
||||
BVersion bVersion = new BVersion();
|
||||
bVersion.setBajaVersionString(dataInput.readUTF());
|
||||
bVersion.setVendor(dataInput.readUTF());
|
||||
bVersion.setVendorVersionString(dataInput.readUTF());
|
||||
return bVersion;
|
||||
}
|
||||
|
||||
public String encodeToString() throws IOException {
|
||||
StringBuffer stringBuffer = new StringBuffer(128);
|
||||
stringBuffer.append(this.getBajaVersionString());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVendor());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVendorVersionString());
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public BObject decodeFromString(String string) throws IOException {
|
||||
BVersion bVersion = new BVersion();
|
||||
String[] stringArray = TextUtil.split((String)string, (char)';');
|
||||
bVersion.setBajaVersionString(stringArray[0]);
|
||||
bVersion.setVendor(stringArray[1]);
|
||||
bVersion.setVendorVersionString(stringArray[2]);
|
||||
return bVersion;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.vendorVersionObject = null;
|
||||
this.setting = false;
|
||||
this.settingMonitor = new String("Setting");
|
||||
}
|
||||
|
||||
public BVersion() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BVersion(String string) {
|
||||
this(null, string);
|
||||
}
|
||||
|
||||
public BVersion(String string, String string2) {
|
||||
this.this();
|
||||
if (string != null && string.trim().length() > 0) {
|
||||
this.setVendor(string);
|
||||
} else {
|
||||
this.setVendor("");
|
||||
}
|
||||
if (string2 != null && string2.trim().length() > 0) {
|
||||
this.setVendorVersionString(string2);
|
||||
} else {
|
||||
this.setVendorVersionString("");
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$BVersion;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BVersion = BVersion.class("[Lcom.tridium.install.BVersion;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
nameVersionText = LexiconText.make((String)"platform", (String)"Version.nameVersion");
|
||||
ZERO = new BVersion();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.Attrib;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class ClassCondenser {
|
||||
private static final int MAGIC = -889275714;
|
||||
private static final int CONSTANT_Utf8 = 1;
|
||||
private static final int CONSTANT_Integer = 3;
|
||||
private static final int CONSTANT_Float = 4;
|
||||
private static final int CONSTANT_Long = 5;
|
||||
private static final int CONSTANT_Double = 6;
|
||||
private static final int CONSTANT_Class = 7;
|
||||
private static final int CONSTANT_String = 8;
|
||||
private static final int CONSTANT_Fieldref = 9;
|
||||
private static final int CONSTANT_Methodref = 10;
|
||||
private static final int CONSTANT_InterfaceMethodref = 11;
|
||||
private static final int CONSTANT_NameAndType = 12;
|
||||
private static final String CODE_ATTRIB = "Code";
|
||||
private static final String LINE_NUMBER_TABLE_ATTRIB = "LineNumberTable";
|
||||
private static final int EXCEPTION_TABLE_ENTRY_SIZE = 8;
|
||||
private static final int ATTRIB_HEADER_SIZE = 6;
|
||||
private String[] cpUtf;
|
||||
|
||||
public void condense(InputStream inputStream, OutputStream outputStream) throws IOException {
|
||||
this.condense(inputStream, outputStream, true);
|
||||
}
|
||||
|
||||
public void condense(InputStream inputStream, OutputStream outputStream, boolean bl) throws IOException {
|
||||
int n;
|
||||
DataInputStream dataInputStream = new DataInputStream(new BufferedInputStream(inputStream));
|
||||
DataOutputStream dataOutputStream = new DataOutputStream(new BufferedOutputStream(outputStream));
|
||||
if (this.echoInt(dataInputStream, dataOutputStream) != -889275714) {
|
||||
throw new IOException("Invalid magic");
|
||||
}
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.cpUtf = new String[this.echoUnsignedShort(dataInputStream, dataOutputStream)];
|
||||
int n2 = 1;
|
||||
while (n2 < this.cpUtf.length) {
|
||||
n = this.echoCpInfo(dataInputStream, dataOutputStream, n2);
|
||||
if (n != 0) {
|
||||
++n2;
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoFully(dataInputStream, dataOutputStream, this.echoUnsignedShort(dataInputStream, dataOutputStream) * 2);
|
||||
n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
n = 0;
|
||||
while (n < n2) {
|
||||
this.echoField(dataInputStream, dataOutputStream);
|
||||
++n;
|
||||
}
|
||||
n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
n = 0;
|
||||
while (n < n2) {
|
||||
this.echoMethod(dataInputStream, dataOutputStream);
|
||||
++n;
|
||||
}
|
||||
n2 = this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
n = 0;
|
||||
while (n < n2) {
|
||||
this.echoAttrib(dataInputStream, dataOutputStream);
|
||||
++n;
|
||||
}
|
||||
dataOutputStream.flush();
|
||||
if (bl) {
|
||||
dataOutputStream.close();
|
||||
outputStream.close();
|
||||
dataInputStream.close();
|
||||
inputStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
private final int echoUnsignedByte(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
int n = dataInputStream.readUnsignedByte();
|
||||
dataOutputStream.writeByte(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
private final int echoUnsignedShort(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
int n = dataInputStream.readUnsignedShort();
|
||||
dataOutputStream.writeShort(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
private final int echoInt(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
int n = dataInputStream.readInt();
|
||||
dataOutputStream.writeInt(n);
|
||||
return n;
|
||||
}
|
||||
|
||||
private final byte[] echoFully(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n) throws IOException {
|
||||
byte[] byArray = new byte[n];
|
||||
dataInputStream.readFully(byArray, 0, n);
|
||||
dataOutputStream.write(byArray, 0, n);
|
||||
return byArray;
|
||||
}
|
||||
|
||||
private final String echoUTF(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
String string = DataInputStream.readUTF(dataInputStream);
|
||||
dataOutputStream.writeUTF(string);
|
||||
return string;
|
||||
}
|
||||
|
||||
private final void echoMethod(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
int n = this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
this.echoAttrib(dataInputStream, dataOutputStream);
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
|
||||
private final void echoField(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
int n = this.echoUnsignedShort(dataInputStream, dataOutputStream);
|
||||
int n2 = 0;
|
||||
while (n2 < n) {
|
||||
this.echoAttrib(dataInputStream, dataOutputStream);
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
|
||||
private final void echoAttrib(DataInputStream dataInputStream, DataOutputStream dataOutputStream) throws IOException {
|
||||
int n = dataInputStream.readUnsignedShort();
|
||||
int n2 = dataInputStream.readInt();
|
||||
String string = this.cpUtf[n];
|
||||
if (string == null) {
|
||||
throw new IOException("Could not look up attribute.");
|
||||
}
|
||||
if (string.equals(CODE_ATTRIB)) {
|
||||
this.echoCodeAttrib(dataInputStream, dataOutputStream, n, n2);
|
||||
} else {
|
||||
dataOutputStream.writeShort(n);
|
||||
dataOutputStream.writeInt(n2);
|
||||
this.echoFully(dataInputStream, dataOutputStream, n2);
|
||||
}
|
||||
}
|
||||
|
||||
private final void echoCodeAttrib(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n, int n2) throws IOException {
|
||||
int n3 = dataInputStream.readUnsignedShort();
|
||||
int n4 = dataInputStream.readUnsignedShort();
|
||||
int n5 = dataInputStream.readInt();
|
||||
byte[] byArray = new byte[n5];
|
||||
dataInputStream.readFully(byArray, 0, n5);
|
||||
int n6 = dataInputStream.readUnsignedShort();
|
||||
int n7 = n6 * 8;
|
||||
byte[] byArray2 = new byte[n7];
|
||||
dataInputStream.readFully(byArray2, 0, n7);
|
||||
Attrib[] attribArray = new Attrib[dataInputStream.readUnsignedShort()];
|
||||
int n8 = 0;
|
||||
int n9 = 0;
|
||||
while (n9 < attribArray.length) {
|
||||
attribArray[n9] = new Attrib(dataInputStream, this.cpUtf);
|
||||
if (attribArray[n9].name.equals(LINE_NUMBER_TABLE_ATTRIB)) {
|
||||
n2 -= attribArray[n9].len + 6;
|
||||
attribArray[n9] = null;
|
||||
} else {
|
||||
++n8;
|
||||
}
|
||||
++n9;
|
||||
}
|
||||
dataOutputStream.writeShort(n);
|
||||
dataOutputStream.writeInt(n2);
|
||||
dataOutputStream.writeShort(n3);
|
||||
dataOutputStream.writeShort(n4);
|
||||
dataOutputStream.writeInt(n5);
|
||||
dataOutputStream.write(byArray, 0, n5);
|
||||
dataOutputStream.writeShort(n6);
|
||||
dataOutputStream.write(byArray2, 0, n7);
|
||||
dataOutputStream.writeShort(n8);
|
||||
n9 = 0;
|
||||
while (n9 < attribArray.length) {
|
||||
if (attribArray[n9] != null) {
|
||||
dataOutputStream.writeShort(attribArray[n9].nameIndex);
|
||||
dataOutputStream.writeInt(attribArray[n9].len);
|
||||
dataOutputStream.write(attribArray[n9].info, 0, attribArray[n9].len);
|
||||
}
|
||||
++n9;
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean echoCpInfo(DataInputStream dataInputStream, DataOutputStream dataOutputStream, int n) throws IOException {
|
||||
int n2 = this.echoUnsignedByte(dataInputStream, dataOutputStream);
|
||||
switch (n2) {
|
||||
case 1: {
|
||||
this.cpUtf[n] = this.echoUTF(dataInputStream, dataOutputStream);
|
||||
return false;
|
||||
}
|
||||
case 3: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
case 4: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
case 5: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 8);
|
||||
return true;
|
||||
}
|
||||
case 6: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 8);
|
||||
return true;
|
||||
}
|
||||
case 7: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 2);
|
||||
return false;
|
||||
}
|
||||
case 8: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 2);
|
||||
return false;
|
||||
}
|
||||
case 9: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
case 10: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
case 11: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
case 12: {
|
||||
this.echoFully(dataInputStream, dataOutputStream, 4);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
throw new IOException("Invalid cp tag 0x" + Integer.toHexString(n2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.util.Lexicon
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.part.BNrePart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.BStationSurrogate;
|
||||
import com.tridium.platform.daemon.task.CancelableDaemonSessionTask;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTask;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.net.SocketException;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class DaemonPlatformUtil {
|
||||
private static final BDependency fixedNre = new BDependency("nre-core-qnx-ppc", new BVersion(null, "3.0.103"), BNrePart.TYPE.getTypeSpec());
|
||||
static /* synthetic */ Class class$com$tridium$platform$daemon$BStationSurrogate;
|
||||
|
||||
/*
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public static void doExtraStationShutdownTasks(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener, ICancelHint iCancelHint) throws Exception {
|
||||
Object var11_19;
|
||||
Object object2;
|
||||
BOsPart bOsPart = bDaemonPlatform.getOsPart();
|
||||
if (!bOsPart.getPartName().startsWith("qnx")) return;
|
||||
BNrePart bNrePart = bDaemonPlatform.getNrePart();
|
||||
if (!bNrePart.isNull()) {
|
||||
if (((BPart)bNrePart).meets(fixedNre)) return;
|
||||
}
|
||||
if (daemonSessionTaskListener == null) {
|
||||
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
||||
}
|
||||
BDaemonSession bDaemonSession = bDaemonPlatform.getDaemonSession();
|
||||
String string = bDaemonSession.getHostProperties().getSessionTimestamp();
|
||||
Lexicon lexicon = Lexicon.make((String)"platform");
|
||||
Class clazz = class$com$tridium$platform$daemon$BStationSurrogate;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$daemon$BStationSurrogate = DaemonPlatformUtil.class("[Lcom.tridium.platform.daemon.BStationSurrogate;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.settingAutoStart.title", "DaemonPlatformUtil.settingAutoStart.message");
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
try {
|
||||
object2 = BStationSurrogate.makeAll(bDaemonSession);
|
||||
int n = 0;
|
||||
while (n < ((BStationSurrogate[])object2).length) {
|
||||
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
||||
if (object2[n].getIsAutoStart()) {
|
||||
object2[n].updateSettings(false, object2[n].getIsAutoRestart());
|
||||
array.add((Object)object2[n]);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
var11_19 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var11_18 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var17_23;
|
||||
daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.sendingReboot.title", "DaemonPlatformUtil.sendingReboot.message");
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
try {
|
||||
if (!bDaemonSession.sendRebootRequest(false)) {
|
||||
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
||||
bDaemonSession.sendForceRebootRequest();
|
||||
}
|
||||
var17_23 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
daemonSessionTask = new CancelableDaemonSessionTask(lexicon, "DaemonPlatformUtil.reconnecting.title", "DaemonPlatformUtil.reconnecting.message", iCancelHint);
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var17_22 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
try {
|
||||
bDaemonSession.getHostProperties().reset();
|
||||
while (true) {
|
||||
DaemonPlatformUtil.checkCanceled(iCancelHint);
|
||||
try {
|
||||
bDaemonSession.reloadHostProperties(15000);
|
||||
if (bDaemonSession.getHostProperties().getSessionTimestamp().equals(string)) continue;
|
||||
daemonSessionTask.setMessage(lexicon.getText("DaemonPlatformUtil.reconnecting.successMessage"));
|
||||
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
||||
}
|
||||
catch (SocketException socketException) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
var17_23 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
var17_23 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
var11_19 = null;
|
||||
daemonSessionTask = new DaemonSessionTask(lexicon, "DaemonPlatformUtil.restoringAutoStart.title", "DaemonPlatformUtil.restoringAutoStart.message");
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
}
|
||||
try {
|
||||
int n = 0;
|
||||
while (n < array.size()) {
|
||||
BStationSurrogate bStationSurrogate = (BStationSurrogate)((Object)array.get(n));
|
||||
bStationSurrogate.updateSettings(true, bStationSurrogate.getIsAutoRestart());
|
||||
++n;
|
||||
}
|
||||
Object var13_15 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
return;
|
||||
}
|
||||
catch (Throwable object2) {
|
||||
Object var13_14 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw object2;
|
||||
}
|
||||
}
|
||||
|
||||
private static final void checkCanceled(ICancelHint iCancelHint) {
|
||||
if (iCancelHint != null && iCancelHint.isCanceled()) {
|
||||
throw new ICancelHint.CanceledException();
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.PartSpec;
|
||||
import com.tridium.install.part.BPart;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class DependencyMap {
|
||||
private Map map = new HashMap();
|
||||
|
||||
public int size() {
|
||||
return this.map.size();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.map.clear();
|
||||
}
|
||||
|
||||
public void merge(DependencyMap dependencyMap) {
|
||||
if (dependencyMap == null) {
|
||||
return;
|
||||
}
|
||||
Iterator iterator = dependencyMap.map.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map map = (Map)iterator.next();
|
||||
Iterator iterator2 = map.keySet().iterator();
|
||||
while (iterator2.hasNext()) {
|
||||
PartSpec partSpec = (PartSpec)iterator2.next();
|
||||
this.addDependency(partSpec, (BDependency)((Object)map.get(partSpec)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean removeDependency(PartSpec partSpec, BDependency bDependency) {
|
||||
Map map = (Map)this.map.get(bDependency.getPartSpec());
|
||||
if (map != null) {
|
||||
Object v = map.remove(partSpec);
|
||||
if (map.size() == 0) {
|
||||
this.map.remove(bDependency.getPartSpec());
|
||||
}
|
||||
boolean bl = false;
|
||||
if (v != null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BDependency getStrictestDependencyOn(BPart bPart) {
|
||||
return this.getStrictestDependencyOn(bPart.getPartSpec());
|
||||
}
|
||||
|
||||
public BDependency getStrictestDependencyOn(PartSpec partSpec) {
|
||||
BDependency bDependency = null;
|
||||
Map map = this.getDependenciesOn(partSpec);
|
||||
Iterator iterator = map.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
BDependency bDependency2 = (BDependency)((Object)iterator.next());
|
||||
if (bDependency != null && !bDependency2.supersedes(bDependency)) continue;
|
||||
bDependency = bDependency2;
|
||||
}
|
||||
return bDependency;
|
||||
}
|
||||
|
||||
public Set getPartSpecs() {
|
||||
return this.map.keySet();
|
||||
}
|
||||
|
||||
public Map getDependenciesOn(BPart bPart) {
|
||||
return this.getDependenciesOn(bPart.getPartSpec());
|
||||
}
|
||||
|
||||
public Map getDependenciesOn(PartSpec partSpec) {
|
||||
return (Map)this.map.get(partSpec);
|
||||
}
|
||||
|
||||
public boolean addDependencies(Map map) {
|
||||
if (map == null) {
|
||||
return false;
|
||||
}
|
||||
boolean bl = false;
|
||||
Iterator iterator = map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PartSpec partSpec = (PartSpec)iterator.next();
|
||||
boolean bl2 = false;
|
||||
if (!this.addDependency(partSpec, (BDependency)((Object)map.get(partSpec))) && !bl) continue;
|
||||
bl2 = bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean addDependency(PartSpec partSpec, BDependency bDependency) {
|
||||
HashMap<PartSpec, BDependency> hashMap = (HashMap<PartSpec, BDependency>)this.map.get(bDependency.getPartSpec());
|
||||
if (hashMap == null) {
|
||||
hashMap = new HashMap<PartSpec, BDependency>();
|
||||
hashMap.put(partSpec, bDependency);
|
||||
this.map.put(bDependency.getPartSpec(), hashMap);
|
||||
return true;
|
||||
}
|
||||
BDependency bDependency2 = (BDependency)((Object)hashMap.get(partSpec));
|
||||
if (bDependency2 == null) {
|
||||
boolean bl = false;
|
||||
if (hashMap.put(partSpec, bDependency) == null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
if (bDependency.supersedes(bDependency2)) {
|
||||
boolean bl = false;
|
||||
if (hashMap.put(partSpec, bDependency) == null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void dump() {
|
||||
System.out.println("dumping " + this);
|
||||
Iterator iterator = this.map.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String)iterator.next();
|
||||
Map map = (Map)this.map.get(string);
|
||||
System.out.println(" dependencies on " + string);
|
||||
Iterator iterator2 = map.keySet().iterator();
|
||||
while (iterator2.hasNext()) {
|
||||
PartSpec partSpec = (PartSpec)iterator2.next();
|
||||
BDependency bDependency = (BDependency)((Object)map.get(partSpec));
|
||||
System.out.println(" " + partSpec.getPartName() + " requires " + (Object)((Object)bDependency));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,445 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BDirectory
|
||||
* javax.baja.file.BFileSpace
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.LocalizableRuntimeException
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.InstallScenario;
|
||||
import com.tridium.install.SolutionParameters;
|
||||
import com.tridium.install.installable.BDistribution;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.install.installable.InstallableRegistry;
|
||||
import com.tridium.install.installable.LocalInstallableRegistry;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.daemon.file.BDaemonDirectoryStore;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileStore;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import javax.baja.file.BDirectory;
|
||||
import javax.baja.file.BFileSpace;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.LocalizableRuntimeException;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
|
||||
public class DependencyUtil {
|
||||
private static final TreeSet ALL_WEB_UI_MODULES = new TreeSet();
|
||||
private static int ANALYSIS_REQ_STATION;
|
||||
private static int ANALYSIS_REQ_PLATFORM;
|
||||
private static int ANALYSIS_DEP_MISSING;
|
||||
private static int ANALYSIS_DEP_UNAVAILABLE;
|
||||
private static int ANALYSIS_DEP_UNSOLVABLE;
|
||||
|
||||
public static BDependency[] getPlatformDependencies(BDaemonPlatform bDaemonPlatform) throws ConnectException, AuthenticationException {
|
||||
return DependencyUtil.getPlatformDependencies(bDaemonPlatform, bDaemonPlatform.getModuleContent());
|
||||
}
|
||||
|
||||
public static BDependency[] getPlatformDependencies(BDaemonPlatform bDaemonPlatform, BModuleContent bModuleContent) throws ConnectException, AuthenticationException {
|
||||
return DependencyUtil.getModuleDeps(DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform));
|
||||
}
|
||||
|
||||
public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, FilePath filePath) throws ConnectException, AuthenticationException {
|
||||
return DependencyUtil.getStationDependencies(bDaemonPlatform, filePath, bDaemonPlatform.getModuleContent());
|
||||
}
|
||||
|
||||
public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, FilePath filePath, BModuleContent bModuleContent) throws ConnectException, AuthenticationException {
|
||||
try {
|
||||
BDaemonFileStore bDaemonFileStore = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), filePath.merge("config.bog"));
|
||||
InputStream inputStream = bDaemonFileStore.getInputStream();
|
||||
Set set = DependencyUtil.accumBogModuleDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), inputStream, "platform", "DependencyUtil.parseConfigBog");
|
||||
DependencyUtil.accumPlatformDeps(set, bDaemonPlatform);
|
||||
return DependencyUtil.getModuleDeps(set);
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "DependencyUtil.parseConfigBog", (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public static BDependency[] getStationDependencies(BDaemonPlatform bDaemonPlatform, BDirectory bDirectory) throws ConnectException, AuthenticationException {
|
||||
try {
|
||||
Object object;
|
||||
InputStream inputStream;
|
||||
if (bDirectory == null) {
|
||||
inputStream = null;
|
||||
} else if (bDirectory.getStore() instanceof BDaemonDirectoryStore) {
|
||||
object = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), bDirectory.getFilePath().merge("config.bog"));
|
||||
inputStream = ((BDaemonFileStore)((Object)object)).getInputStream();
|
||||
} else {
|
||||
object = (BIFile)bDirectory.getNavChild("config.bog");
|
||||
inputStream = object == null ? null : object.getInputStream();
|
||||
}
|
||||
object = DependencyUtil.accumBogModuleDeps(null, inputStream, "platform", "DependencyUtil.parseConfigBog");
|
||||
DependencyUtil.accumPlatformDeps((Set)object, bDaemonPlatform);
|
||||
return DependencyUtil.getModuleDeps((Set)object);
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "DependencyUtil.parseConfigBog", (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public static BDependency[] getPlatformModuleDependencies(BDaemonPlatform bDaemonPlatform, BDistribution bDistribution) throws ConnectException {
|
||||
XElem xElem = bDistribution.getUpdatedPlatformBog(bDaemonPlatform);
|
||||
return xElem == null ? null : DependencyUtil.getBogModuleDeps(xElem);
|
||||
}
|
||||
|
||||
private static final Set getWebUiModules(BDaemonPlatform bDaemonPlatform, BModuleContent bModuleContent) {
|
||||
if (bModuleContent == null) {
|
||||
bModuleContent = bDaemonPlatform.getModuleContent();
|
||||
}
|
||||
return bModuleContent == BModuleContent.runtime ? new TreeSet() : (Set)ALL_WEB_UI_MODULES.clone();
|
||||
}
|
||||
|
||||
public static BDependency[] getBogModuleDeps(XElem xElem) {
|
||||
TreeSet treeSet = new TreeSet();
|
||||
DependencyUtil.accumBogModuleNames(treeSet, xElem);
|
||||
return DependencyUtil.getModuleDeps(treeSet);
|
||||
}
|
||||
|
||||
private static final BDependency[] getModuleDeps(Set set) {
|
||||
BDependency[] bDependencyArray = new BDependency[set.size()];
|
||||
int n = 0;
|
||||
Iterator iterator = set.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
bDependencyArray[n] = BDependency.forModule((String)iterator.next());
|
||||
++n;
|
||||
}
|
||||
return bDependencyArray;
|
||||
}
|
||||
|
||||
private static final Set accumBogModuleNames(Set set, XElem xElem) {
|
||||
int n;
|
||||
Object object;
|
||||
Set set2;
|
||||
Set set3 = set2 = set == null ? new TreeSet() : set;
|
||||
if (xElem == null) {
|
||||
return set2;
|
||||
}
|
||||
if (xElem.name().equals("p") && (object = xElem.get("m", null)) != null) {
|
||||
n = ((String)object).indexOf(61);
|
||||
Object object2 = n < 0 ? object : ((String)object).substring(n + 1);
|
||||
set2.add(object2);
|
||||
}
|
||||
object = xElem.elems();
|
||||
n = 0;
|
||||
while (n < ((XElem[])object).length) {
|
||||
DependencyUtil.accumBogModuleNames(set2, (XElem)object[n]);
|
||||
++n;
|
||||
}
|
||||
return set2;
|
||||
}
|
||||
|
||||
private static final Set accumBogModuleDeps(Set set, InputStream inputStream, String string, String string2) throws ConnectException, AuthenticationException {
|
||||
Set set2 = set == null ? new TreeSet() : set;
|
||||
try {
|
||||
set2.add("platform");
|
||||
if (inputStream != null) {
|
||||
XParser xParser = XParser.make((InputStream)inputStream);
|
||||
while (xParser.next() != -1) {
|
||||
String string3;
|
||||
if (xParser.type() != 1 || !xParser.elem().name().equals("p") || (string3 = xParser.elem().get("m", null)) == null) continue;
|
||||
int n = string3.indexOf(61);
|
||||
String string4 = n < 0 ? string3 : string3.substring(n + 1);
|
||||
set2.add(string4);
|
||||
}
|
||||
}
|
||||
return set2;
|
||||
}
|
||||
catch (ConnectException connectException) {
|
||||
throw connectException;
|
||||
}
|
||||
catch (AuthenticationException authenticationException) {
|
||||
throw authenticationException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new LocalizableRuntimeException(string, string2, (Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
private static final Set accumPlatformDeps(Set set, BDaemonPlatform bDaemonPlatform) throws ConnectException, AuthenticationException {
|
||||
Set set2 = set == null ? new TreeSet() : set;
|
||||
BDaemonFileStore bDaemonFileStore = new BDaemonFileStore(bDaemonPlatform.getDaemonSession().getFileSpace(), new FilePath("!lib/platform.bog"));
|
||||
try {
|
||||
InputStream inputStream = bDaemonFileStore.getInputStream();
|
||||
if (inputStream == null) {
|
||||
return set2;
|
||||
}
|
||||
return DependencyUtil.accumBogModuleDeps(set2, inputStream, "platform", "DependencyUtil.parsePlatformBog");
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "DependencyUtil.parsePlatformBog", (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public static AnalysisResults analyzeAllDependencies(BDaemonPlatform bDaemonPlatform, BFileSpace bFileSpace, FilePath filePath, BModuleContent bModuleContent, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
Set set;
|
||||
if (bModuleContent == null) {
|
||||
bModuleContent = bDaemonPlatform.getModuleContent();
|
||||
}
|
||||
Set set2 = DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform);
|
||||
if (filePath == null) {
|
||||
set = new TreeSet(set2);
|
||||
} else {
|
||||
Object object = bFileSpace instanceof BDaemonFileSpace ? new BDaemonFileStore((BDaemonFileSpace)bFileSpace, filePath.merge("config.bog")) : bFileSpace.findStore(filePath.merge("config.bog"));
|
||||
InputStream inputStream = object.getInputStream();
|
||||
set = DependencyUtil.accumBogModuleDeps(new TreeSet(set2), inputStream, "platform", "DependencyUtil.parseConfigBog");
|
||||
}
|
||||
return new AnalysisResults(bDaemonPlatform, set, set2, bModuleContent, new SolutionParameters(daemonSessionTaskListener));
|
||||
}
|
||||
|
||||
public static AnalysisResults analyzeAllDependencies(BDaemonPlatform bDaemonPlatform, BDirectory[] bDirectoryArray, BModuleContent bModuleContent, SolutionParameters solutionParameters) throws Exception {
|
||||
if (bModuleContent == null) {
|
||||
bModuleContent = bDaemonPlatform.getModuleContent();
|
||||
}
|
||||
Set set = DependencyUtil.accumPlatformDeps(DependencyUtil.getWebUiModules(bDaemonPlatform, bModuleContent), bDaemonPlatform);
|
||||
Set set2 = new TreeSet(set);
|
||||
if (bDirectoryArray != null) {
|
||||
int n = 0;
|
||||
while (n < bDirectoryArray.length) {
|
||||
BIFile bIFile = (BIFile)bDirectoryArray[n].getNavChild("config.bog");
|
||||
if (bIFile != null) {
|
||||
InputStream inputStream = bIFile.getInputStream();
|
||||
set2 = DependencyUtil.accumBogModuleDeps(set2, inputStream, "platform", "DependencyUtil.parseConfigBog");
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return new AnalysisResults(bDaemonPlatform, set2, set, bModuleContent, solutionParameters);
|
||||
}
|
||||
|
||||
static final /* synthetic */ BDependency[] access$0(Set set) {
|
||||
return DependencyUtil.getModuleDeps(set);
|
||||
}
|
||||
|
||||
static {
|
||||
ALL_WEB_UI_MODULES.add("web");
|
||||
ALL_WEB_UI_MODULES.add("icons");
|
||||
ALL_WEB_UI_MODULES.add("converters");
|
||||
ALL_WEB_UI_MODULES.add("html");
|
||||
ALL_WEB_UI_MODULES.add("fonts");
|
||||
ALL_WEB_UI_MODULES.add("chart");
|
||||
ALL_WEB_UI_MODULES.add("wiresheet");
|
||||
ALL_WEB_UI_MODULES.add("workbench");
|
||||
ALL_WEB_UI_MODULES.add("pdf");
|
||||
ALL_WEB_UI_MODULES.add("kitPx");
|
||||
ANALYSIS_REQ_STATION = 1;
|
||||
ANALYSIS_REQ_PLATFORM = 2;
|
||||
ANALYSIS_DEP_MISSING = 256;
|
||||
ANALYSIS_DEP_UNAVAILABLE = 512;
|
||||
ANALYSIS_DEP_UNSOLVABLE = 1024;
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public static class AnalysisResults {
|
||||
private InstallScenario solution;
|
||||
private TreeMap flagsByPartName;
|
||||
private int status;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
|
||||
|
||||
public InstallScenario getSolution() {
|
||||
return this.solution;
|
||||
}
|
||||
|
||||
public boolean anyUnsolvable() {
|
||||
boolean bl = false;
|
||||
if ((this.status & ANALYSIS_DEP_UNSOLVABLE) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean anyUnvailable() {
|
||||
boolean bl = false;
|
||||
if ((this.status & ANALYSIS_DEP_UNAVAILABLE) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean anyToInstall() {
|
||||
boolean bl = false;
|
||||
if ((this.status & ANALYSIS_DEP_MISSING) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String[] getPartNames() {
|
||||
Set set = this.flagsByPartName.keySet();
|
||||
return set.toArray(new String[set.size()]);
|
||||
}
|
||||
|
||||
public boolean isStationModule(String string) {
|
||||
return this.isStatusFlagSet(string, ANALYSIS_REQ_STATION);
|
||||
}
|
||||
|
||||
public boolean isPlatformModule(String string) {
|
||||
return this.isStatusFlagSet(string, ANALYSIS_REQ_PLATFORM);
|
||||
}
|
||||
|
||||
public boolean isMissing(String string) {
|
||||
return this.isStatusFlagSet(string, ANALYSIS_DEP_MISSING);
|
||||
}
|
||||
|
||||
public boolean isUnavailable(String string) {
|
||||
return this.isStatusFlagSet(string, ANALYSIS_DEP_UNAVAILABLE);
|
||||
}
|
||||
|
||||
public boolean isUnsolvable(String string) {
|
||||
return this.isStatusFlagSet(string, ANALYSIS_DEP_UNSOLVABLE);
|
||||
}
|
||||
|
||||
private final void accumModuleDependencies(String string, Set set, Map map, int n) {
|
||||
if (set.contains(string)) {
|
||||
return;
|
||||
}
|
||||
this.setStatusFlag(string, n);
|
||||
set.add(string);
|
||||
BModulePart bModulePart = (BModulePart)((Object)map.get(string));
|
||||
if (bModulePart != null) {
|
||||
BDependency[] bDependencyArray = bModulePart.getDependencyArray();
|
||||
int n2 = 0;
|
||||
while (n2 < bDependencyArray.length) {
|
||||
if (bDependencyArray[n2].getPartType().equals(BModulePart.TYPE)) {
|
||||
this.accumModuleDependencies(bDependencyArray[n2].getPartName(), set, map, n);
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void setStatusFlag(String string, int n) {
|
||||
Integer n2 = (Integer)this.flagsByPartName.get(string);
|
||||
int n3 = 0;
|
||||
if (n2 != null) {
|
||||
n3 = n2;
|
||||
}
|
||||
int n4 = n3;
|
||||
this.flagsByPartName.put(string, new Integer(n4 | n));
|
||||
this.status |= n;
|
||||
}
|
||||
|
||||
private final boolean isStatusFlagSet(String string, int n) {
|
||||
Integer n2 = (Integer)this.flagsByPartName.get(string);
|
||||
boolean bl = false;
|
||||
if (n2 != null && (n2 & n) > 0) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.flagsByPartName = new TreeMap();
|
||||
this.status = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public AnalysisResults(BDaemonPlatform var1_1, Set var2_2, Set var3_3, BModuleContent var4_4, SolutionParameters var5_5) throws Exception {
|
||||
super();
|
||||
this.this();
|
||||
this.solution = new InstallScenario(var1_1, null, DependencyUtil.access$0(var2_2), null, null, null, var4_4, var5_5, (InstallableRegistry)LocalInstallableRegistry.getInstance()).solve();
|
||||
var6_6 = false;
|
||||
var7_7 = 0;
|
||||
while (var7_7 < this.solution.getToInstall().length) {
|
||||
if (this.solution.getToInstall()[var7_7] instanceof BDistribution && (var8_9 = DependencyUtil.getPlatformModuleDependencies(var1_1, (BDistribution)this.solution.getToInstall()[var7_7])) != null) {
|
||||
var9_12 = 0;
|
||||
while (var9_12 < var8_9.length) {
|
||||
if (var3_3.add(var8_9[var9_12].getPartName())) {
|
||||
var6_6 = true;
|
||||
}
|
||||
if (var2_2.add(var8_9[var9_12].getPartName())) {
|
||||
var6_6 = true;
|
||||
}
|
||||
++var9_12;
|
||||
}
|
||||
}
|
||||
++var7_7;
|
||||
}
|
||||
if (var6_6) {
|
||||
this.solution = this.solution.solve(null, null, DependencyUtil.access$0(var2_2), null, LocalInstallableRegistry.getInstance());
|
||||
}
|
||||
var7_8 = new HashMap<String, BModulePart>();
|
||||
var8_9 = var1_1.getModuleList().getModules().getProperties();
|
||||
if (true) ** GOTO lbl27
|
||||
do {
|
||||
var9_14 = ((BModuleInstallable)var8_9.get()).getModulePart();
|
||||
var7_8.put(var9_14.getPartName(), var9_14);
|
||||
lbl27:
|
||||
// 2 sources
|
||||
|
||||
if ((v0 = AnalysisResults.class$com$tridium$install$installable$BModuleInstallable) != null) continue;
|
||||
v0 = AnalysisResults.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
||||
} while (var8_9.next(v0));
|
||||
var8_10 = 0;
|
||||
while (var8_10 < this.solution.getToInstall().length) {
|
||||
this.setStatusFlag(this.solution.getToInstall()[var8_10].getInstallableName(), DependencyUtil.access$1());
|
||||
if (this.solution.getToInstall()[var8_10] instanceof BModuleInstallable) {
|
||||
var9_15 = ((BModuleInstallable)this.solution.getToInstall()[var8_10]).getModulePart();
|
||||
var7_8.put(var9_15.getPartName(), var9_15);
|
||||
}
|
||||
++var8_10;
|
||||
}
|
||||
var8_11 = this.solution.getUnmeetableDependencies();
|
||||
var9_16 = 0;
|
||||
while (var9_16 < var8_11.length) {
|
||||
var10_18 = var8_11[var9_16].dependency.getPartName();
|
||||
if (var8_11[var9_16].isUnsolvable) {
|
||||
this.setStatusFlag((String)var10_18, DependencyUtil.access$2() | DependencyUtil.access$1());
|
||||
} else {
|
||||
this.setStatusFlag((String)var10_18, DependencyUtil.access$3() | DependencyUtil.access$1());
|
||||
}
|
||||
++var9_16;
|
||||
}
|
||||
var9_17 = new HashSet<E>();
|
||||
var10_18 = var3_3.iterator();
|
||||
while (var10_18.hasNext()) {
|
||||
this.accumModuleDependencies((String)var10_18.next(), var9_17, var7_8, DependencyUtil.access$4() | DependencyUtil.access$5());
|
||||
}
|
||||
var10_18 = var2_2.iterator();
|
||||
while (var10_18.hasNext()) {
|
||||
this.accumModuleDependencies((String)var10_18.next(), var9_17, var7_8, DependencyUtil.access$5());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.nre.util.IFilter
|
||||
* javax.baja.util.Lexicon
|
||||
* javax.baja.util.PatternFilter
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.nre.util.IFilter;
|
||||
import javax.baja.util.Lexicon;
|
||||
import javax.baja.util.PatternFilter;
|
||||
|
||||
public class FilenameFilterUtil {
|
||||
public static final Lexicon lex = Lexicon.make((String)"platform");
|
||||
public static final IFilter NULL_FILTER = new NullFilenameFilter();
|
||||
|
||||
public static IFilter make(String string, String string2) {
|
||||
if (string == null || string.trim().length() == 0) {
|
||||
if (string2 == null || string2.trim().length() == 0) {
|
||||
return NULL_FILTER;
|
||||
}
|
||||
return FilenameFilterUtil.makeExclude(string2);
|
||||
}
|
||||
if (string2 == null || string2.trim().length() == 0) {
|
||||
return FilenameFilterUtil.makeInclude(string);
|
||||
}
|
||||
return FilenameFilterUtil.makeAnd(new IFilter[]{FilenameFilterUtil.makeInclude(string), FilenameFilterUtil.makeExclude(string2)});
|
||||
}
|
||||
|
||||
public static IFilter makeExclude(String string) {
|
||||
return FilenameFilterUtil.makeExclude((IFilter[])PatternFilter.parseList((String)string));
|
||||
}
|
||||
|
||||
public static IFilter makeExclude(String string, String string2) {
|
||||
return FilenameFilterUtil.makeExclude((IFilter[])PatternFilter.parseList((String)string, (String)string2));
|
||||
}
|
||||
|
||||
private static final IFilter makeExclude(IFilter[] iFilterArray) {
|
||||
if (iFilterArray.length == 0) {
|
||||
return NULL_FILTER;
|
||||
}
|
||||
IFilter[] iFilterArray2 = new IFilter[iFilterArray.length];
|
||||
int n = 0;
|
||||
while (n < iFilterArray2.length) {
|
||||
iFilterArray2[n] = FilenameFilterUtil.makeInverse(iFilterArray[n]);
|
||||
++n;
|
||||
}
|
||||
return FilenameFilterUtil.makeAnd(iFilterArray2);
|
||||
}
|
||||
|
||||
public static IFilter makeInclude(String string) {
|
||||
return FilenameFilterUtil.makeOr((IFilter[])PatternFilter.parseList((String)string));
|
||||
}
|
||||
|
||||
public static IFilter makeInclude(String string, String string2) {
|
||||
return FilenameFilterUtil.makeOr((IFilter[])PatternFilter.parseList((String)string, (String)string2));
|
||||
}
|
||||
|
||||
public static IFilter makeInverse(IFilter iFilter) {
|
||||
return new NotFilenameFilter(iFilter);
|
||||
}
|
||||
|
||||
public static IFilter makeOr(IFilter[] iFilterArray) {
|
||||
if (iFilterArray.length == 0) {
|
||||
return NULL_FILTER;
|
||||
}
|
||||
return new OrFilenameFilter(iFilterArray);
|
||||
}
|
||||
|
||||
public static IFilter makeAnd(IFilter[] iFilterArray) {
|
||||
if (iFilterArray.length == 0) {
|
||||
return NULL_FILTER;
|
||||
}
|
||||
return new AndFilenameFilter(iFilterArray);
|
||||
}
|
||||
|
||||
private static final String getFilename(Object object) {
|
||||
if (object instanceof BIFile) {
|
||||
return ((BIFile)object).getFileName();
|
||||
}
|
||||
if (object instanceof FilePath) {
|
||||
return ((FilePath)object).getName();
|
||||
}
|
||||
if (object instanceof String) {
|
||||
return (String)object;
|
||||
}
|
||||
throw new IllegalArgumentException("unrecognized file object");
|
||||
}
|
||||
|
||||
public static class NotFilenameFilter
|
||||
implements IFilter {
|
||||
private IFilter invert;
|
||||
|
||||
public boolean accept(Object object) {
|
||||
return this.invert.accept((Object)FilenameFilterUtil.getFilename(object)) ^ true;
|
||||
}
|
||||
|
||||
public NotFilenameFilter(IFilter iFilter) {
|
||||
this.invert = iFilter;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OrFilenameFilter
|
||||
implements IFilter {
|
||||
private IFilter[] filters;
|
||||
|
||||
public boolean accept(Object object) {
|
||||
int n = 0;
|
||||
while (n < this.filters.length) {
|
||||
if (this.filters[n].accept((Object)FilenameFilterUtil.getFilename(object))) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public OrFilenameFilter(IFilter[] iFilterArray) {
|
||||
if (iFilterArray == null || iFilterArray.length == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.filters = iFilterArray;
|
||||
}
|
||||
}
|
||||
|
||||
public static class AndFilenameFilter
|
||||
implements IFilter {
|
||||
private IFilter[] filters;
|
||||
|
||||
public boolean accept(Object object) {
|
||||
int n = 0;
|
||||
while (n < this.filters.length) {
|
||||
if (!this.filters[n].accept((Object)FilenameFilterUtil.getFilename(object))) {
|
||||
return false;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public AndFilenameFilter(IFilter[] iFilterArray) {
|
||||
if (iFilterArray == null || iFilterArray.length == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.filters = iFilterArray;
|
||||
}
|
||||
}
|
||||
|
||||
private static class NullFilenameFilter
|
||||
implements IFilter {
|
||||
public boolean accept(Object object) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private NullFilenameFilter() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class GetModuleListMessage
|
||||
extends XmlResponseMessage {
|
||||
private boolean sendCrc;
|
||||
private boolean full;
|
||||
private boolean depsOnly;
|
||||
private String moduleName;
|
||||
|
||||
public String getMessageString() {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("moduleInfo?sendCrc=").append(this.sendCrc).append("&full=").append(this.full);
|
||||
if (this.depsOnly) {
|
||||
stringBuffer.append("&depsOnly=").append(this.depsOnly);
|
||||
}
|
||||
if (this.moduleName != null && this.moduleName.length() > 0) {
|
||||
stringBuffer.append("&moduleName=").append(this.moduleName);
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public GetModuleListMessage() {
|
||||
this(false, false);
|
||||
}
|
||||
|
||||
public GetModuleListMessage(boolean bl, boolean bl2) {
|
||||
this(bl, bl2, false);
|
||||
}
|
||||
|
||||
public GetModuleListMessage(boolean bl, boolean bl2, boolean bl3) {
|
||||
this(bl, bl2, bl3, null);
|
||||
}
|
||||
|
||||
public GetModuleListMessage(boolean bl, boolean bl2, boolean bl3, String string) {
|
||||
this.sendCrc = bl;
|
||||
this.full = bl2;
|
||||
this.depsOnly = bl3;
|
||||
this.moduleName = string;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,367 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.BInteger
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.InstallScenario;
|
||||
import com.tridium.install.InstallableFilter;
|
||||
import com.tridium.install.PartSpec;
|
||||
import com.tridium.install.UnmeetableDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BInteger;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class InstallableCandidates {
|
||||
protected static final Comparator CANDIDATE_KEY_COMPARATOR = new Comparator(){
|
||||
|
||||
public final int compare(Object object, Object object2) {
|
||||
if (object instanceof BDependency) {
|
||||
if (object2 instanceof BDependency) {
|
||||
return BDependency.COMPARATOR.compare(object, object2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (object2 instanceof BDependency) {
|
||||
return -1;
|
||||
}
|
||||
return object.toString().compareTo(object2.toString());
|
||||
}
|
||||
};
|
||||
private Map candidatesByKey;
|
||||
private Map keyByNumCandidates;
|
||||
private Map unmeetableDependencyByPartSpec;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BInstallable;
|
||||
|
||||
public void addAll(InstallableCandidates installableCandidates) {
|
||||
if (installableCandidates == null) {
|
||||
return;
|
||||
}
|
||||
Object[] objectArray = installableCandidates.getKeys();
|
||||
int n = 0;
|
||||
while (n < objectArray.length) {
|
||||
TreeSet<Object> treeSet;
|
||||
BInteger bInteger;
|
||||
Object[] objectArray2 = installableCandidates.getCandidates(objectArray[n]);
|
||||
Array array = (Array)this.candidatesByKey.get(objectArray[n]);
|
||||
if (array == null) {
|
||||
array = new Array(objectArray2);
|
||||
this.candidatesByKey.put(objectArray[n], array);
|
||||
} else {
|
||||
bInteger = BInteger.make((int)array.size());
|
||||
treeSet = (TreeSet<Object>)this.keyByNumCandidates.get(bInteger);
|
||||
treeSet.remove(objectArray[n]);
|
||||
if (treeSet.size() == 0) {
|
||||
this.keyByNumCandidates.remove(bInteger);
|
||||
}
|
||||
array.addAll(objectArray2);
|
||||
}
|
||||
bInteger = BInteger.make((int)array.size());
|
||||
treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger);
|
||||
if (treeSet == null) {
|
||||
treeSet = new TreeSet<Object>(CANDIDATE_KEY_COMPARATOR);
|
||||
this.keyByNumCandidates.put(bInteger, treeSet);
|
||||
}
|
||||
treeSet.add(objectArray[n]);
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public InstallableCandidates newCopy() {
|
||||
InstallableCandidates installableCandidates = new InstallableCandidates();
|
||||
Iterator iterator = this.candidatesByKey.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Object k = iterator.next();
|
||||
Array array = (Array)this.candidatesByKey.get(k);
|
||||
installableCandidates.candidatesByKey.put(k, array.copy());
|
||||
BInteger bInteger = BInteger.make((int)array.size());
|
||||
TreeSet treeSet = (TreeSet)installableCandidates.keyByNumCandidates.get(bInteger);
|
||||
if (treeSet == null) {
|
||||
treeSet = new TreeSet(CANDIDATE_KEY_COMPARATOR);
|
||||
installableCandidates.keyByNumCandidates.put(bInteger, treeSet);
|
||||
}
|
||||
treeSet.add(k);
|
||||
}
|
||||
return installableCandidates;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.candidatesByKey.size();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.candidatesByKey.toString();
|
||||
}
|
||||
|
||||
public boolean isDependencyUnsolvable(BDependency bDependency, InstallScenario installScenario) {
|
||||
UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario);
|
||||
boolean bl = false;
|
||||
if (unmeetableDependency != null) {
|
||||
bl = unmeetableDependency.isUnsolvable;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public BDependency getFailedExclusion(BDependency bDependency, InstallScenario installScenario) {
|
||||
UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario);
|
||||
return unmeetableDependency == null ? null : unmeetableDependency.failedExclusion;
|
||||
}
|
||||
|
||||
public InstallableFilter getFailedFilter(BDependency bDependency, InstallScenario installScenario) {
|
||||
UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario);
|
||||
return unmeetableDependency == null ? null : unmeetableDependency.failedFilter;
|
||||
}
|
||||
|
||||
public boolean installableNotFound(BDependency bDependency, InstallScenario installScenario) {
|
||||
UnmeetableDependency unmeetableDependency = this.getUnmeetableDependency(bDependency.getPartSpec(), installScenario);
|
||||
boolean bl = true;
|
||||
if (unmeetableDependency != null) {
|
||||
bl = unmeetableDependency.isSoftwareNotFound;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public UnmeetableDependency getUnmeetableDependency(PartSpec partSpec, InstallScenario installScenario) {
|
||||
this.getUnmeetableDependencies(installScenario);
|
||||
return (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(partSpec);
|
||||
}
|
||||
|
||||
public UnmeetableDependency[] getUnmeetableDependencies(InstallScenario installScenario) {
|
||||
if (installScenario.isSolved()) {
|
||||
if (this.unmeetableDependencyByPartSpec == null) {
|
||||
this.unmeetableDependencyByPartSpec = new HashMap();
|
||||
Iterator iterator = this.candidatesByKey.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Object k = iterator.next();
|
||||
if (!(k instanceof BDependency)) continue;
|
||||
BDependency bDependency = (BDependency)((Object)k);
|
||||
boolean bl = installScenario.getTargetPlatform().meets(bDependency);
|
||||
if (bl && bDependency.getPartType() == BModulePart.TYPE && installScenario.getNewModuleContent() != null && installScenario.getNewModuleContent().getOrdinal() > ((BModulePart)installScenario.getTargetPlatform().getPart(bDependency)).getArchiveContent().getOrdinal()) {
|
||||
bl = false;
|
||||
}
|
||||
if (bl) continue;
|
||||
if (bDependency.canSolveWith(installScenario.getSolutionParameters().solvers)) {
|
||||
Object object;
|
||||
try {
|
||||
Object object2;
|
||||
boolean bl2 = false;
|
||||
object = installScenario.getInstallableRegistry().getInstallables(bDependency, installScenario.getSolutionParameters().listener);
|
||||
Object object3 = null;
|
||||
while (object.next()) {
|
||||
object2 = (BInstallable)object.get();
|
||||
BDependency bDependency2 = installScenario.getFailedExclusion((BInstallable)object2);
|
||||
if (bDependency2 == null) {
|
||||
InstallableFilter installableFilter = installScenario.getSolutionParameters().getFailedFilter((BInstallable)object2);
|
||||
if (installableFilter == null) {
|
||||
bl2 = true;
|
||||
break;
|
||||
}
|
||||
if (object3 != null) continue;
|
||||
object3 = installableFilter;
|
||||
continue;
|
||||
}
|
||||
if (object3 != null) continue;
|
||||
object3 = bDependency2;
|
||||
}
|
||||
try {
|
||||
object.close();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
if (bl2) continue;
|
||||
object2 = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec());
|
||||
if (object2 == null) {
|
||||
object2 = new UnmeetableDependency(bDependency);
|
||||
this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object2);
|
||||
}
|
||||
if (object3 == null) {
|
||||
((UnmeetableDependency)object2).isSoftwareNotFound = true;
|
||||
continue;
|
||||
}
|
||||
if (object3 instanceof BDependency) {
|
||||
((UnmeetableDependency)object2).failedExclusion = object3;
|
||||
} else {
|
||||
((UnmeetableDependency)object2).failedFilter = (InstallableFilter)object3;
|
||||
}
|
||||
this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object2);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
object = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec());
|
||||
if (object == null) {
|
||||
object = new UnmeetableDependency(bDependency);
|
||||
this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), object);
|
||||
}
|
||||
((UnmeetableDependency)object).isSoftwareNotFound = true;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
UnmeetableDependency unmeetableDependency = (UnmeetableDependency)this.unmeetableDependencyByPartSpec.get(bDependency.getPartSpec());
|
||||
if (unmeetableDependency == null) {
|
||||
unmeetableDependency = new UnmeetableDependency(bDependency);
|
||||
this.unmeetableDependencyByPartSpec.put(bDependency.getPartSpec(), unmeetableDependency);
|
||||
}
|
||||
unmeetableDependency.isUnsolvable = true;
|
||||
}
|
||||
}
|
||||
return this.unmeetableDependencyByPartSpec.values().toArray(new UnmeetableDependency[this.unmeetableDependencyByPartSpec.size()]);
|
||||
}
|
||||
throw new IllegalStateException("Cannot call getUnavailableDependencies() on a scenario that has not been solved");
|
||||
}
|
||||
|
||||
public BDependency[] getDependencies() {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = InstallableCandidates.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
Iterator iterator = this.candidatesByKey.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Object k = iterator.next();
|
||||
if (!(k instanceof BDependency)) continue;
|
||||
array.add(k);
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public Object[] getKeys() {
|
||||
return this.candidatesByKey.keySet().toArray();
|
||||
}
|
||||
|
||||
public boolean containsKey(Object object) {
|
||||
return this.candidatesByKey.containsKey(object);
|
||||
}
|
||||
|
||||
public void addKey(Object object) {
|
||||
this.add(object, null);
|
||||
}
|
||||
|
||||
public void add(Object object, BInstallable bInstallable) {
|
||||
TreeSet<Object> treeSet;
|
||||
BInteger bInteger;
|
||||
Array array = (Array)this.candidatesByKey.get(object);
|
||||
if (array == null) {
|
||||
if (bInstallable == null) {
|
||||
Class clazz = class$com$tridium$install$installable$BInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BInstallable = InstallableCandidates.class("[Lcom.tridium.install.installable.BInstallable;", false);
|
||||
}
|
||||
array = new Array(clazz);
|
||||
} else {
|
||||
array = new Array((Object[])new BInstallable[]{bInstallable});
|
||||
}
|
||||
this.candidatesByKey.put(object, array);
|
||||
} else {
|
||||
bInteger = BInteger.make((int)array.size());
|
||||
treeSet = (TreeSet<Object>)this.keyByNumCandidates.get(bInteger);
|
||||
treeSet.remove(object);
|
||||
if (treeSet.size() == 0) {
|
||||
this.keyByNumCandidates.remove(bInteger);
|
||||
}
|
||||
if (bInstallable != null) {
|
||||
array.add((Object)bInstallable);
|
||||
}
|
||||
}
|
||||
bInteger = BInteger.make((int)array.size());
|
||||
treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger);
|
||||
if (treeSet == null) {
|
||||
treeSet = new TreeSet<Object>(CANDIDATE_KEY_COMPARATOR);
|
||||
this.keyByNumCandidates.put(bInteger, treeSet);
|
||||
}
|
||||
treeSet.add(object);
|
||||
}
|
||||
|
||||
public void set(Object object, BInstallable[] bInstallableArray) {
|
||||
TreeSet<Object> treeSet;
|
||||
BInteger bInteger;
|
||||
Array array = (Array)this.candidatesByKey.get(object);
|
||||
if (array != null) {
|
||||
bInteger = BInteger.make((int)array.size());
|
||||
treeSet = (TreeSet<Object>)this.keyByNumCandidates.get(bInteger);
|
||||
treeSet.remove(object);
|
||||
if (treeSet.size() == 0) {
|
||||
this.keyByNumCandidates.remove(bInteger);
|
||||
}
|
||||
}
|
||||
Array array2 = new Array((Object[])bInstallableArray);
|
||||
this.candidatesByKey.put(object, array2);
|
||||
bInteger = BInteger.make((int)array2.size());
|
||||
treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger);
|
||||
if (treeSet == null) {
|
||||
treeSet = new TreeSet<Object>(CANDIDATE_KEY_COMPARATOR);
|
||||
this.keyByNumCandidates.put(bInteger, treeSet);
|
||||
}
|
||||
treeSet.add(object);
|
||||
}
|
||||
|
||||
public void removeKey(Object object) {
|
||||
Array array = (Array)this.candidatesByKey.get(object);
|
||||
if (array != null) {
|
||||
BInteger bInteger = BInteger.make((int)array.size());
|
||||
TreeSet treeSet = (TreeSet)this.keyByNumCandidates.get(bInteger);
|
||||
if (treeSet != null) {
|
||||
treeSet.remove(object);
|
||||
if (treeSet.size() == 0) {
|
||||
this.keyByNumCandidates.remove(bInteger);
|
||||
}
|
||||
}
|
||||
this.candidatesByKey.remove(object);
|
||||
}
|
||||
}
|
||||
|
||||
public Object getFirstKey() {
|
||||
Iterator iterator = this.keyByNumCandidates.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TreeSet treeSet = (TreeSet)iterator.next();
|
||||
Iterator iterator2 = treeSet.iterator();
|
||||
if (!iterator2.hasNext()) continue;
|
||||
return iterator2.next();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BInstallable[] getCandidates(Object object) {
|
||||
Array array = (Array)this.candidatesByKey.get(object);
|
||||
if (array == null) {
|
||||
return new BInstallable[0];
|
||||
}
|
||||
return (BInstallable[])array.trim();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.unmeetableDependencyByPartSpec = null;
|
||||
}
|
||||
|
||||
public InstallableCandidates() {
|
||||
this.this();
|
||||
this.candidatesByKey = new TreeMap(CANDIDATE_KEY_COMPARATOR);
|
||||
this.keyByNumCandidates = new TreeMap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
|
||||
public interface InstallableFilter {
|
||||
public boolean acceptInstallable(BInstallable var1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
|
||||
public class PartSpec
|
||||
implements Comparable {
|
||||
private String spec;
|
||||
private String partName;
|
||||
private BTypeSpec partType;
|
||||
|
||||
public static PartSpec forModule(String string) {
|
||||
return new PartSpec(string, BModulePart.TYPE);
|
||||
}
|
||||
|
||||
public String getPartName() {
|
||||
return this.partName;
|
||||
}
|
||||
|
||||
public BTypeSpec getPartType() {
|
||||
return this.partType;
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
boolean bl = false;
|
||||
if (object instanceof PartSpec && ((PartSpec)object).spec.equals(this.spec)) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return this.spec.hashCode();
|
||||
}
|
||||
|
||||
public int compareTo(Object object) {
|
||||
if (this == object) {
|
||||
return 0;
|
||||
}
|
||||
PartSpec partSpec = (PartSpec)object;
|
||||
if (this.getPartType().equals((Object)partSpec.getPartType())) {
|
||||
return this.getPartName().compareTo(partSpec.getPartName());
|
||||
}
|
||||
return this.getPartType().toString().compareTo(partSpec.getPartType().toString());
|
||||
}
|
||||
|
||||
public PartSpec(String string, Type type) {
|
||||
this(string, type.getTypeSpec());
|
||||
}
|
||||
|
||||
public PartSpec(String string, BTypeSpec bTypeSpec) {
|
||||
this.spec = string + ':' + bTypeSpec.toString();
|
||||
this.partName = string;
|
||||
this.partType = bTypeSpec;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.InstallScenario;
|
||||
import com.tridium.install.InstallableCandidates;
|
||||
import com.tridium.install.InstallableFilter;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class SolutionParameters {
|
||||
public DaemonSessionTaskListener listener;
|
||||
public boolean latestOnly;
|
||||
public String[] solvers;
|
||||
public InstallableFilter[] installableFilters;
|
||||
|
||||
public InstallableFilter getFailedFilter(BInstallable bInstallable) {
|
||||
int n = 0;
|
||||
while (n < this.installableFilters.length) {
|
||||
if (!this.installableFilters[n].acceptInstallable(bInstallable)) {
|
||||
return this.installableFilters[n];
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean acceptInstallable(BInstallable bInstallable) {
|
||||
boolean bl = false;
|
||||
if (this.getFailedFilter(bInstallable) == null) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public void addFilter(InstallableFilter installableFilter) {
|
||||
InstallableFilter[] installableFilterArray = new InstallableFilter[this.installableFilters.length + 1];
|
||||
System.arraycopy(this.installableFilters, 0, installableFilterArray, 0, this.installableFilters.length);
|
||||
installableFilterArray[this.installableFilters.length] = installableFilter;
|
||||
this.installableFilters = installableFilterArray;
|
||||
}
|
||||
|
||||
public SolutionParameters newCopy() {
|
||||
SolutionParameters solutionParameters = new SolutionParameters(this.listener);
|
||||
solutionParameters.latestOnly = this.latestOnly;
|
||||
solutionParameters.installableFilters = new InstallableFilter[this.installableFilters.length];
|
||||
System.arraycopy(this.installableFilters, 0, solutionParameters.installableFilters, 0, this.installableFilters.length);
|
||||
solutionParameters.solvers = new String[this.solvers.length];
|
||||
System.arraycopy(this.solvers, 0, solutionParameters.solvers, 0, this.solvers.length);
|
||||
return solutionParameters;
|
||||
}
|
||||
|
||||
public InstallableCandidates getAdditionalCandidates(InstallScenario installScenario, BDependency bDependency) throws Exception {
|
||||
return new InstallableCandidates();
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.latestOnly = false;
|
||||
this.solvers = new String[]{"default"};
|
||||
this.installableFilters = new InstallableFilter[0];
|
||||
}
|
||||
|
||||
public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.this();
|
||||
this.listener = daemonSessionTaskListener;
|
||||
}
|
||||
|
||||
public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener, boolean bl, String string) {
|
||||
this(daemonSessionTaskListener, bl, new String[]{string});
|
||||
}
|
||||
|
||||
public SolutionParameters(DaemonSessionTaskListener daemonSessionTaskListener, boolean bl, String[] stringArray) {
|
||||
this.this();
|
||||
this.listener = daemonSessionTaskListener;
|
||||
this.latestOnly = bl;
|
||||
this.solvers = stringArray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.data.BIDataValue
|
||||
* javax.baja.gx.BImage
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BasicContext
|
||||
* javax.baja.sys.Context
|
||||
*/
|
||||
package com.tridium.install;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.InstallableFilter;
|
||||
import javax.baja.data.BIDataValue;
|
||||
import javax.baja.gx.BImage;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BasicContext;
|
||||
import javax.baja.sys.Context;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class UnmeetableDependency {
|
||||
public BDependency dependency;
|
||||
public boolean isUnsolvable;
|
||||
public boolean isSoftwareNotFound;
|
||||
public BDependency failedExclusion;
|
||||
public InstallableFilter failedFilter;
|
||||
|
||||
public String toString() {
|
||||
return this.toString(null);
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
if (this.failedExclusion == null) {
|
||||
return this.dependency.toString(context);
|
||||
}
|
||||
return this.dependency.toString((Context)new BasicContext(context, BFacets.make((String)"exclusion", (BIDataValue)this.failedExclusion)));
|
||||
}
|
||||
|
||||
public BImage getIcon() {
|
||||
return BImage.make((BIcon)this.dependency.getIcon());
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.isUnsolvable = false;
|
||||
this.isSoftwareNotFound = false;
|
||||
this.failedExclusion = null;
|
||||
this.failedFilter = null;
|
||||
}
|
||||
|
||||
public UnmeetableDependency(BDependency bDependency) {
|
||||
this.this();
|
||||
this.dependency = bDependency;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.ByteArrayFileTransferElement;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BByteInstallable
|
||||
extends BInstallable {
|
||||
public static final Property destinationDirPathBody = BByteInstallable.newProperty((int)0, (String)"!", null);
|
||||
public static final Property contents = BByteInstallable.newProperty((int)0, (String)"", null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BByteInstallable;
|
||||
|
||||
public String getDestinationDirPathBody() {
|
||||
return this.getString(destinationDirPathBody);
|
||||
}
|
||||
|
||||
public void setDestinationDirPathBody(String string) {
|
||||
this.setString(destinationDirPathBody, string, null);
|
||||
}
|
||||
|
||||
public String getContents() {
|
||||
return this.getString(contents);
|
||||
}
|
||||
|
||||
public void setContents(String string) {
|
||||
this.setString(contents, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
return new FileTransferMessageElement[]{new ByteArrayFileTransferElement(new FilePath(this.getDestinationDirPathBody()), this.getContents().getBytes(), bDaemonPlatform.getDaemonSession().getFileSpace())};
|
||||
}
|
||||
|
||||
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BByteInstallable) {
|
||||
BByteInstallable bByteInstallable = (BByteInstallable)object;
|
||||
boolean bl = false;
|
||||
if (bByteInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bByteInstallable.getContents().equals(this.getContents())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BInstallable makeLocalInstance() {
|
||||
return this;
|
||||
}
|
||||
|
||||
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 BByteInstallable() {
|
||||
}
|
||||
|
||||
public BByteInstallable(FilePath filePath, byte[] byArray) {
|
||||
this.setDestinationDirPathBody(filePath.getBody());
|
||||
this.setContents(new String(byArray));
|
||||
this.setInstallableName(filePath.getBody());
|
||||
}
|
||||
|
||||
public BByteInstallable(FilePath filePath, String string) {
|
||||
this.setDestinationDirPathBody(filePath.getBody());
|
||||
this.setContents(string);
|
||||
this.setInstallableName(filePath.getBody());
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BByteInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BByteInstallable = BByteInstallable.class("[Lcom.tridium.install.installable.BByteInstallable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.naming.BOrd
|
||||
* javax.baja.naming.OrdQuery
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.naming.OrdQuery;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BDeleteFileInstallable
|
||||
extends BInstallable {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
private boolean localInstance;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BDeleteFileInstallable;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable");
|
||||
}
|
||||
if (this.getInstallableFileOrd().isNull()) {
|
||||
return new FileTransferMessageElement[0];
|
||||
}
|
||||
OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse();
|
||||
return new FileTransferMessageElement[]{new DeleteFileTransferMessageElement((FilePath)ordQueryArray[ordQueryArray.length - 1], bDaemonPlatform.getDaemonSession().getFileSpace())};
|
||||
}
|
||||
|
||||
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BDeleteFileInstallable");
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public BInstallable makeLocalInstance() {
|
||||
if (this.localInstance) {
|
||||
return this;
|
||||
}
|
||||
try {
|
||||
OrdQuery[] ordQueryArray = this.getInstallableFileOrd().parse();
|
||||
return new BDeleteFileInstallable((FilePath)ordQueryArray[ordQueryArray.length - 1]);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
System.out.println("ord: " + this.getInstallableFileOrd());
|
||||
throw runtimeException;
|
||||
}
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.localInstance = false;
|
||||
}
|
||||
|
||||
public BDeleteFileInstallable() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BDeleteFileInstallable(BIFile bIFile) {
|
||||
this.this();
|
||||
this.setInstallableFileOrd(bIFile.getOrdInSession());
|
||||
this.localInstance = true;
|
||||
this.setInstallableName(bIFile.getFilePath().getBody());
|
||||
}
|
||||
|
||||
public BDeleteFileInstallable(FilePath filePath) {
|
||||
this.this();
|
||||
this.setInstallableFileOrd(BOrd.make((OrdQuery)filePath));
|
||||
this.localInstance = true;
|
||||
this.setInstallableName(filePath.getBody());
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BDeleteFileInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BDeleteFileInstallable = BDeleteFileInstallable.class("[Lcom.tridium.install.installable.BDeleteFileInstallable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BIcon.std((String)"delete.png");
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BDataFile
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.BIFileStore
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.installable.BDistribution;
|
||||
import javax.baja.file.BDataFile;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.BIFileStore;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BDistributionFile
|
||||
extends BDataFile {
|
||||
private static final BIcon icon = BIcon.std((String)"modules.png");
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BDistributionFile;
|
||||
|
||||
public BDistribution makeDistribution() {
|
||||
return this.makeDistribution(true);
|
||||
}
|
||||
|
||||
public BDistribution makeDistribution(boolean bl) {
|
||||
return new BDistribution((BIFile)this, bl);
|
||||
}
|
||||
|
||||
public String getMimeType() {
|
||||
return "application/x-baja-dist";
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
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 BDistributionFile(BIFileStore bIFileStore) {
|
||||
super(bIFileStore);
|
||||
}
|
||||
|
||||
public BDistributionFile() {
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BDistributionFile;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BDistributionFile = BDistributionFile.class("[Lcom.tridium.install.installable.BDistributionFile;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BDirectory
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.file.FileUtil
|
||||
* javax.baja.naming.UnresolvedException
|
||||
* javax.baja.registry.TypeInfo
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.FileFileTransferElement;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.baja.file.BDirectory;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.file.FileUtil;
|
||||
import javax.baja.naming.UnresolvedException;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.registry.TypeInfo;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BFileInstallable
|
||||
extends BInstallable {
|
||||
public static final Property destinationFileName = BFileInstallable.newProperty((int)0, (String)"", null);
|
||||
public static final Property destinationDirPathBody = BFileInstallable.newProperty((int)0, (String)"!", null);
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
private BIFile file;
|
||||
private boolean localInstance;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BFileInstallable;
|
||||
|
||||
public String getDestinationFileName() {
|
||||
return this.getString(destinationFileName);
|
||||
}
|
||||
|
||||
public void setDestinationFileName(String string) {
|
||||
this.setString(destinationFileName, string, null);
|
||||
}
|
||||
|
||||
public String getDestinationDirPathBody() {
|
||||
return this.getString(destinationDirPathBody);
|
||||
}
|
||||
|
||||
public void setDestinationDirPathBody(String string) {
|
||||
this.setString(destinationDirPathBody, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BFileInstallable");
|
||||
}
|
||||
ArrayList arrayList = new ArrayList();
|
||||
String string = this.getDestinationFileName();
|
||||
if (string.length() == 0) {
|
||||
string = this.file.getFileName();
|
||||
}
|
||||
this.addFiles(arrayList, this.file, string, new FilePath(this.getDestinationDirPathBody()), bDaemonPlatform.getDaemonSession().getFileSpace(), iCancelHint);
|
||||
FileTransferMessageElement[] fileTransferMessageElementArray = new FileTransferMessageElement[arrayList.size()];
|
||||
arrayList.toArray(fileTransferMessageElementArray);
|
||||
return fileTransferMessageElementArray;
|
||||
}
|
||||
|
||||
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BFileInstallable");
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public BInstallable makeLocalInstance() {
|
||||
if (this.localInstance) {
|
||||
return this;
|
||||
}
|
||||
try {
|
||||
return new BFileInstallable((BIFile)this.getInstallableFileOrd().get(), this.getDestinationFileName(), new FilePath(this.getDestinationDirPathBody()));
|
||||
}
|
||||
catch (UnresolvedException unresolvedException) {
|
||||
return null;
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
System.out.println("ord: " + this.getInstallableFileOrd());
|
||||
throw runtimeException;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BFileInstallable) {
|
||||
BFileInstallable bFileInstallable = (BFileInstallable)object;
|
||||
boolean bl = false;
|
||||
if (super.equivalent(bFileInstallable) && bFileInstallable.getDestinationDirPathBody().equals(this.getDestinationDirPathBody()) && bFileInstallable.getDestinationFileName().equals(this.getDestinationFileName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private final void addFiles(List list, BIFile bIFile, String string, FilePath filePath, BDaemonFileSpace bDaemonFileSpace, ICancelHint iCancelHint) {
|
||||
if (bIFile instanceof BDirectory) {
|
||||
BIFile[] bIFileArray = ((BDirectory)bIFile).listFiles();
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
if (iCancelHint != null && iCancelHint.isCanceled()) {
|
||||
throw new ICancelHint.CanceledException();
|
||||
}
|
||||
this.addFiles(list, bIFileArray[n], bIFileArray[n].getFileName(), filePath.merge(string), bDaemonFileSpace, iCancelHint);
|
||||
++n;
|
||||
}
|
||||
} else {
|
||||
list.add(new FileFileTransferElement(filePath.merge(string), bIFile, bDaemonFileSpace));
|
||||
}
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
try {
|
||||
String string = FileUtil.getExtension((String)this.getInstallableFileName());
|
||||
if (string != null && string.length() > 0) {
|
||||
TypeInfo typeInfo = Sys.getRegistry().getFileTypeForExtension(string);
|
||||
BObject bObject = typeInfo.getInstance();
|
||||
return bObject.getIcon();
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
return icon;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return this.getInstallableName();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.localInstance = false;
|
||||
}
|
||||
|
||||
public BFileInstallable() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BFileInstallable(BIFile bIFile, FilePath filePath) {
|
||||
this(bIFile);
|
||||
this.setDestinationDirPathBody(filePath.getBody());
|
||||
this.setInstallableName(filePath.merge(bIFile.getFileName()).getBody());
|
||||
}
|
||||
|
||||
public BFileInstallable(BIFile bIFile, String string, FilePath filePath) {
|
||||
this(bIFile);
|
||||
this.setDestinationDirPathBody(filePath.getBody());
|
||||
this.setDestinationFileName(string);
|
||||
this.setInstallableName(filePath.merge(string).getBody());
|
||||
}
|
||||
|
||||
public BFileInstallable(BIFile bIFile) {
|
||||
this.this();
|
||||
this.setDestinationFileName(bIFile.getFileName());
|
||||
this.setInstallableName(bIFile.getFileName());
|
||||
this.setDescription(bIFile.getFileName());
|
||||
this.setInstallableFileProperties(bIFile);
|
||||
if (bIFile.isDirectory()) {
|
||||
this.setDestinationDirPathBody(bIFile.getFilePath().getBody());
|
||||
} else {
|
||||
this.setDestinationDirPathBody(bIFile.getFilePath().getParent().getBody());
|
||||
}
|
||||
this.file = bIFile;
|
||||
this.localInstance = true;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BFileInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BFileInstallable = BFileInstallable.class("[Lcom.tridium.install.installable.BFileInstallable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BIcon.std((String)"file.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,507 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIDirectory
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.BLocalFileStore
|
||||
* javax.baja.naming.BOrd
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.SlotCursor
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.timezone.BTimeZone
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.PartSpec;
|
||||
import com.tridium.install.installable.BDistribution;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.install.installable.LocalInstallableRegistry;
|
||||
import com.tridium.install.part.BArchPart;
|
||||
import com.tridium.install.part.BGenericPart;
|
||||
import com.tridium.install.part.BModelPart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import com.tridium.platform.tcpip.BTcpIpHostSettings;
|
||||
import java.io.File;
|
||||
import java.util.TreeMap;
|
||||
import javax.baja.file.BIDirectory;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.BLocalFileStore;
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.SlotCursor;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BInstallable
|
||||
extends BComponent
|
||||
implements Comparable {
|
||||
public static final Property parts = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property dependencies = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property exclusions = BInstallable.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property installableName = BInstallable.newProperty((int)1, (String)"unknown", null);
|
||||
public static final Property description = BInstallable.newProperty((int)1, (String)"", null);
|
||||
public static final Property version = BInstallable.newProperty((int)1, (BValue)BVersion.makeZero(), null);
|
||||
public static final Property installableFileOrd = BInstallable.newProperty((int)1, (BValue)BOrd.NULL, null);
|
||||
public static final Property installableFileName = BInstallable.newProperty((int)1, (String)"unknown ", null);
|
||||
public static final Property installableFileSize = BInstallable.newProperty((int)1, (int)-1, null);
|
||||
public static final Property updateModuleContent = BInstallable.newProperty((int)1, (boolean)false, null);
|
||||
public static final Property newModuleContent = BInstallable.newProperty((int)1, (BValue)BModuleContent.doc, null);
|
||||
public static final Property newOsTimeZone = BInstallable.newProperty((int)1, (BValue)BTimeZone.NULL, null);
|
||||
public static final Property isValid = BInstallable.newProperty((int)1, (boolean)true, null);
|
||||
public static final Property isStandalone = BInstallable.newProperty((int)1, (boolean)false, null);
|
||||
public static final Property isInstallable = BInstallable.newProperty((int)1, (boolean)true, null);
|
||||
public static final Type TYPE;
|
||||
public static final long FLAG_NO_RUNNING_APP = 1L;
|
||||
public static final long FLAG_NO_RUNNING_STATION = 2L;
|
||||
public static final long FLAG_UPDATE_RUNNING_STATION = 4L;
|
||||
public static final long FLAG_REBOOT = 65536L;
|
||||
public static final long FLAG_OS_INSTALL = 131072L;
|
||||
public static final long FLAG_UPDATE_DAEMON = 262144L;
|
||||
public static final long FLAG_UPDATE_TCPIP = 524288L;
|
||||
public static final long FLAG_UPDATE_CONTENT = 0x100000L;
|
||||
public static final long FLAG_UPDATE_OS_TZ = 0x200000L;
|
||||
private PartSpec partSpec;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BInstallable;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BPart;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
|
||||
public BVector getParts() {
|
||||
return (BVector)this.get(parts);
|
||||
}
|
||||
|
||||
public void setParts(BVector bVector) {
|
||||
this.set(parts, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public BVector getDependencies() {
|
||||
return (BVector)this.get(dependencies);
|
||||
}
|
||||
|
||||
public void setDependencies(BVector bVector) {
|
||||
this.set(dependencies, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public BVector getExclusions() {
|
||||
return (BVector)this.get(exclusions);
|
||||
}
|
||||
|
||||
public void setExclusions(BVector bVector) {
|
||||
this.set(exclusions, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public String getInstallableName() {
|
||||
return this.getString(installableName);
|
||||
}
|
||||
|
||||
public void setInstallableName(String string) {
|
||||
this.setString(installableName, string, null);
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.getString(description);
|
||||
}
|
||||
|
||||
public void setDescription(String string) {
|
||||
this.setString(description, string, null);
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return (BVersion)this.get(version);
|
||||
}
|
||||
|
||||
public void setVersion(BVersion bVersion) {
|
||||
this.set(version, (BValue)bVersion, null);
|
||||
}
|
||||
|
||||
public BOrd getInstallableFileOrd() {
|
||||
return (BOrd)this.get(installableFileOrd);
|
||||
}
|
||||
|
||||
public void setInstallableFileOrd(BOrd bOrd) {
|
||||
this.set(installableFileOrd, (BValue)bOrd, null);
|
||||
}
|
||||
|
||||
public String getInstallableFileName() {
|
||||
return this.getString(installableFileName);
|
||||
}
|
||||
|
||||
public void setInstallableFileName(String string) {
|
||||
this.setString(installableFileName, string, null);
|
||||
}
|
||||
|
||||
public long getInstallableFileSize() {
|
||||
return this.getLong(installableFileSize);
|
||||
}
|
||||
|
||||
public void setInstallableFileSize(long l) {
|
||||
this.setLong(installableFileSize, l, null);
|
||||
}
|
||||
|
||||
public boolean getUpdateModuleContent() {
|
||||
return this.getBoolean(updateModuleContent);
|
||||
}
|
||||
|
||||
public void setUpdateModuleContent(boolean bl) {
|
||||
this.setBoolean(updateModuleContent, bl, null);
|
||||
}
|
||||
|
||||
public BModuleContent getNewModuleContent() {
|
||||
return (BModuleContent)this.get(newModuleContent);
|
||||
}
|
||||
|
||||
public void setNewModuleContent(BModuleContent bModuleContent) {
|
||||
this.set(newModuleContent, (BValue)bModuleContent, null);
|
||||
}
|
||||
|
||||
public BTimeZone getNewOsTimeZone() {
|
||||
return (BTimeZone)this.get(newOsTimeZone);
|
||||
}
|
||||
|
||||
public void setNewOsTimeZone(BTimeZone bTimeZone) {
|
||||
this.set(newOsTimeZone, (BValue)bTimeZone, null);
|
||||
}
|
||||
|
||||
public boolean getIsValid() {
|
||||
return this.getBoolean(isValid);
|
||||
}
|
||||
|
||||
public void setIsValid(boolean bl) {
|
||||
this.setBoolean(isValid, bl, null);
|
||||
}
|
||||
|
||||
public boolean getIsStandalone() {
|
||||
return this.getBoolean(isStandalone);
|
||||
}
|
||||
|
||||
public void setIsStandalone(boolean bl) {
|
||||
this.setBoolean(isStandalone, bl, null);
|
||||
}
|
||||
|
||||
public boolean getIsInstallable() {
|
||||
return this.getBoolean(isInstallable);
|
||||
}
|
||||
|
||||
public void setIsInstallable(boolean bl) {
|
||||
this.setBoolean(isInstallable, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public abstract long getProcessingFlags(BDaemonPlatform var1, DaemonSessionTaskListener var2);
|
||||
|
||||
public abstract FileTransferMessageElement[] getTransferElements(BDaemonPlatform var1, StoreCache var2, ICancelHint var3, DaemonSessionTaskListener var4) throws Exception;
|
||||
|
||||
public BInstallable makeInstallableForPart(String string) {
|
||||
if (this.getParts().get(SlotPath.escape((String)string)) == null) {
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public BTcpIpHostSettings getTcpIpChanges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public BPart getPart() {
|
||||
SlotCursor slotCursor = this.getParts().getProperties();
|
||||
Class clazz = class$com$tridium$install$part$BPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BPart = BInstallable.class("[Lcom.tridium.install.part.BPart;", false);
|
||||
}
|
||||
return slotCursor.next(clazz) ? (BPart)slotCursor.get() : null;
|
||||
}
|
||||
|
||||
public PartSpec getPartSpec() {
|
||||
if (this.partSpec == null) {
|
||||
BPart bPart = this.getPart();
|
||||
this.partSpec = bPart == null ? new PartSpec(this.getInstallableName(), this.getType()) : bPart.getPartSpec();
|
||||
}
|
||||
return this.partSpec;
|
||||
}
|
||||
|
||||
public abstract void close() throws Exception;
|
||||
|
||||
public abstract BInstallable makeLocalInstance();
|
||||
|
||||
protected void setInstallableFileProperties(BIFile bIFile) {
|
||||
this.setInstallableFileOrd(bIFile.getOrdInSession());
|
||||
this.setInstallableFileName(bIFile.getFileName());
|
||||
this.setInstallableFileSize(bIFile.getSize());
|
||||
if (this.getInstallableName().equals("unknown")) {
|
||||
this.setInstallableName(bIFile.getFileName());
|
||||
}
|
||||
}
|
||||
|
||||
public File getLocalInstallableFile() {
|
||||
if (!this.getInstallableFileOrd().isNull()) {
|
||||
try {
|
||||
BIFile bIFile = (BIFile)this.getInstallableFileOrd().get();
|
||||
if (bIFile != null && bIFile.getStore() instanceof BLocalFileStore) {
|
||||
return ((BLocalFileStore)bIFile.getStore()).getLocalFile();
|
||||
}
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isInstallableFile(BIFile bIFile) {
|
||||
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
|
||||
return false;
|
||||
}
|
||||
if (bIFile.getExtension().equals("dist")) {
|
||||
return true;
|
||||
}
|
||||
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
|
||||
return true;
|
||||
}
|
||||
return LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension()) != null;
|
||||
}
|
||||
|
||||
public static BInstallable make(BIFile bIFile) {
|
||||
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
|
||||
return null;
|
||||
}
|
||||
if (bIFile.getExtension().equals("dist")) {
|
||||
return BInstallable.make(BDistribution.TYPE, bIFile);
|
||||
}
|
||||
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
|
||||
return BInstallable.make(BModuleInstallable.TYPE, bIFile);
|
||||
}
|
||||
Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension());
|
||||
if (type != null) {
|
||||
return BInstallable.make(type, bIFile);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BInstallable make(Type type, BIFile bIFile) {
|
||||
BInstallable bInstallable = (BInstallable)type.getInstance();
|
||||
bInstallable.setInstallableFileProperties(bIFile);
|
||||
return bInstallable.makeLocalInstance();
|
||||
}
|
||||
|
||||
public static BInstallable makeRemote(BIFile bIFile) {
|
||||
if (bIFile == null || bIFile instanceof BIDirectory || bIFile.getExtension() == null) {
|
||||
return null;
|
||||
}
|
||||
if (bIFile.getExtension().equals("dist")) {
|
||||
return BInstallable.makeRemote(BDistribution.TYPE, bIFile);
|
||||
}
|
||||
if (bIFile.getExtension().equals("jar") || bIFile.getExtension().equals("sjar")) {
|
||||
return BInstallable.makeRemote(BModuleInstallable.TYPE, bIFile);
|
||||
}
|
||||
Type type = LocalInstallableRegistry.getInstance().getInstallableTypeForExt(bIFile.getExtension());
|
||||
if (type != null) {
|
||||
return BInstallable.makeRemote(type, bIFile);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static BInstallable makeRemote(Type type, BIFile bIFile) {
|
||||
BInstallable bInstallable = (BInstallable)type.getInstance();
|
||||
bInstallable.setInstallableFileProperties(bIFile);
|
||||
return bInstallable;
|
||||
}
|
||||
|
||||
public final BDependency[] getAllDependencies() {
|
||||
TreeMap treeMap = new TreeMap();
|
||||
BDependency[] bDependencyArray = this.getDependencies().getProperties();
|
||||
while (bDependencyArray.next()) {
|
||||
this.updateDependencyMap(treeMap, (BDependency)bDependencyArray.get());
|
||||
}
|
||||
bDependencyArray = this.getParts().getProperties();
|
||||
while (bDependencyArray.next()) {
|
||||
BPart bPart = (BPart)bDependencyArray.get();
|
||||
SlotCursor slotCursor = bPart.getDependencies().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
this.updateDependencyMap(treeMap, (BDependency)slotCursor.get());
|
||||
}
|
||||
}
|
||||
bDependencyArray = new BDependency[treeMap.size()];
|
||||
treeMap.values().toArray(bDependencyArray);
|
||||
return bDependencyArray;
|
||||
}
|
||||
|
||||
public BDependency[] getAllExclusions() {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
SlotCursor slotCursor = this.getExclusions().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
array.add((Object)slotCursor.get());
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
private final void updateDependencyMap(TreeMap treeMap, BDependency bDependency) {
|
||||
BDependency bDependency2 = (BDependency)((Object)treeMap.get(bDependency.getPartSpec()));
|
||||
if (bDependency2 == null || bDependency.supersedes(bDependency2)) {
|
||||
treeMap.put(bDependency.getPartSpec(), bDependency);
|
||||
}
|
||||
}
|
||||
|
||||
public Array getUnmetPlatformDependencies(BDaemonPlatform bDaemonPlatform) {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = BInstallable.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
SlotCursor slotCursor = this.getDependencies().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
BDependency bDependency = (BDependency)slotCursor.get();
|
||||
Type type = bDependency.getPartType();
|
||||
if (type.is(BOsPart.TYPE)) {
|
||||
if (bDaemonPlatform.getOsPart().matchesName(bDependency.getPartName())) {
|
||||
if (bDaemonPlatform.getOsPart().isInstallable()) continue;
|
||||
array.add((Object)bDependency.newCopy());
|
||||
continue;
|
||||
}
|
||||
if (bDaemonPlatform.meets(bDependency)) continue;
|
||||
array.add((Object)bDependency.newCopy());
|
||||
continue;
|
||||
}
|
||||
if (!type.is(BArchPart.TYPE) && !type.is(BGenericPart.TYPE) && !type.is(BModelPart.TYPE) || bDaemonPlatform.meets(bDependency)) continue;
|
||||
array.add((Object)bDependency.newCopy());
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BInstallable) {
|
||||
BInstallable bInstallable = (BInstallable)object;
|
||||
return bInstallable.getInstallableFileOrd().equivalent((Object)this.getInstallableFileOrd());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int compareTo(Object object) {
|
||||
if (this.equivalent(object)) {
|
||||
return 0;
|
||||
}
|
||||
if (object instanceof BInstallable) {
|
||||
BInstallable bInstallable = (BInstallable)object;
|
||||
if (this.getType().equals(bInstallable.getType())) {
|
||||
int n = bInstallable.getInstallableName().compareTo(this.getInstallableName());
|
||||
if (n == 0) {
|
||||
return this.getVersion().compareTo((Object)bInstallable.getVersion());
|
||||
}
|
||||
return n;
|
||||
}
|
||||
return this.getType().toString().compareTo(bInstallable.getType().toString());
|
||||
}
|
||||
return this.toString().compareTo(object.toString());
|
||||
}
|
||||
|
||||
public final BPart getPart(String string) {
|
||||
return this.getPart(string, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public BPart getPart(String var1_1, DaemonSessionTaskListener var2_2) {
|
||||
block2: {
|
||||
if (!BPart.isWildcardName(var1_1)) break block2;
|
||||
var3_3 = this.getParts().getProperties();
|
||||
if (true) ** GOTO lbl7
|
||||
do {
|
||||
if ((var4_4 = (BPart)var3_3.get()).matchesName(var1_1)) {
|
||||
return var4_4;
|
||||
}
|
||||
lbl7:
|
||||
// 3 sources
|
||||
|
||||
if ((v0 = BInstallable.class$com$tridium$install$part$BPart) != null) continue;
|
||||
v0 = BInstallable.class("[Lcom.tridium.install.part.BPart;", false);
|
||||
} while (var3_3.next(v0));
|
||||
return null;
|
||||
}
|
||||
return (BPart)this.getParts().get(SlotPath.escape((String)var1_1));
|
||||
}
|
||||
|
||||
public void registerInstallableResources(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
}
|
||||
|
||||
public final boolean meets(BDependency bDependency) {
|
||||
return this.meets(bDependency, null);
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
BPart bPart = this.getPart(bDependency.getPartName(), daemonSessionTaskListener);
|
||||
boolean bl = false;
|
||||
if (bPart != null) {
|
||||
bl = bPart.meets(bDependency);
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
String string = this.getVersion().toString(context);
|
||||
if (string.trim().length() == 0) {
|
||||
return this.getInstallableName();
|
||||
}
|
||||
return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string});
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.partSpec = null;
|
||||
}
|
||||
|
||||
public BInstallable() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BInstallable = BInstallable.class("[Lcom.tridium.install.installable.BInstallable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.io.BIEncodable
|
||||
* javax.baja.nre.util.TextUtil
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.BStruct
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.util.Version
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
import javax.baja.io.BIEncodable;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.BStruct;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.util.Version;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BInstallableSpec
|
||||
extends BStruct
|
||||
implements BIEncodable {
|
||||
public static final Property installableName = BInstallableSpec.newProperty((int)1, (String)"", null);
|
||||
public static final Property version = BInstallableSpec.newProperty((int)1, (BValue)new BVersion(), null);
|
||||
public static final Property installableType = BInstallableSpec.newProperty((int)1, (BValue)BTypeSpec.NULL, null);
|
||||
public static final Type TYPE;
|
||||
public static final BInstallableSpec DEFAULT;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BInstallableSpec;
|
||||
|
||||
public String getInstallableName() {
|
||||
return this.getString(installableName);
|
||||
}
|
||||
|
||||
public void setInstallableName(String string) {
|
||||
this.setString(installableName, string, null);
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return (BVersion)this.get(version);
|
||||
}
|
||||
|
||||
public void setVersion(BVersion bVersion) {
|
||||
this.set(version, (BValue)bVersion, null);
|
||||
}
|
||||
|
||||
public BTypeSpec getInstallableType() {
|
||||
return (BTypeSpec)this.get(installableType);
|
||||
}
|
||||
|
||||
public void setInstallableType(BTypeSpec bTypeSpec) {
|
||||
this.set(installableType, (BValue)bTypeSpec, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static BInstallableSpec make(BInstallable bInstallable) {
|
||||
return new BInstallableSpec(bInstallable.getInstallableName(), (BVersion)bInstallable.getVersion().newCopy(), bInstallable.getType());
|
||||
}
|
||||
|
||||
public BDependency asDependency() {
|
||||
return new BDependency(this.getInstallableName(), this.getVersion(), BVersionRelation.exact, this.getInstallableType());
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
String string = this.getVersion().toString(context);
|
||||
if (string.trim().length() == 0) {
|
||||
return this.getInstallableName();
|
||||
}
|
||||
return BVersion.nameVersionText.getText(context, new Object[]{this.getInstallableName(), string});
|
||||
}
|
||||
|
||||
public void encode(DataOutput dataOutput) throws IOException {
|
||||
dataOutput.writeUTF(this.getInstallableName());
|
||||
this.getVersion().encode(dataOutput);
|
||||
this.getInstallableType().encode(dataOutput);
|
||||
}
|
||||
|
||||
public BObject decode(DataInput dataInput) throws IOException {
|
||||
BInstallableSpec bInstallableSpec = new BInstallableSpec();
|
||||
bInstallableSpec.setInstallableName(dataInput.readUTF());
|
||||
bInstallableSpec.setVersion((BVersion)BVersion.ZERO.decode(dataInput));
|
||||
bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decode(dataInput));
|
||||
return bInstallableSpec;
|
||||
}
|
||||
|
||||
public String encodeToString() throws IOException {
|
||||
StringBuffer stringBuffer = new StringBuffer(128);
|
||||
stringBuffer.append(this.getInstallableName());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVersion().getBajaVersionString());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVersion().getVendor());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getVersion().getVendorVersionString());
|
||||
stringBuffer.append(';');
|
||||
stringBuffer.append(this.getInstallableType().encodeToString());
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public BObject decodeFromString(String string) throws IOException {
|
||||
BInstallableSpec bInstallableSpec = new BInstallableSpec();
|
||||
String[] stringArray = TextUtil.split((String)string, (char)';');
|
||||
bInstallableSpec.setInstallableName(stringArray[0]);
|
||||
bInstallableSpec.getVersion().setBajaVersionString(stringArray[1]);
|
||||
bInstallableSpec.getVersion().setVendor(stringArray[2]);
|
||||
bInstallableSpec.getVersion().setVendorVersionString(stringArray[3]);
|
||||
bInstallableSpec.setInstallableType((BTypeSpec)BTypeSpec.DEFAULT.decodeFromString(stringArray[4]));
|
||||
return bInstallableSpec;
|
||||
}
|
||||
|
||||
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 BInstallableSpec() {
|
||||
}
|
||||
|
||||
public BInstallableSpec(String string, Version version, Type type) {
|
||||
this(string, new BVersion(version.toString()), type);
|
||||
}
|
||||
|
||||
public BInstallableSpec(String string, BVersion bVersion, Type type) {
|
||||
this.setInstallableName(string);
|
||||
this.setVersion(bVersion);
|
||||
this.setInstallableType(type.getTypeSpec());
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BInstallableSpec;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BInstallableSpec = BInstallableSpec.class("[Lcom.tridium.install.installable.BInstallableSpec;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = new BInstallableSpec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,315 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.sys.registry.NModuleInfo
|
||||
* javax.baja.file.BFileSystem
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.BLocalFileStore
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.file.zip.BZipFile
|
||||
* javax.baja.file.zip.BZipSpace
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.naming.UnresolvedException
|
||||
* javax.baja.sys.Action
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.SlotCursor
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.platform.daemon.DaemonFileUtil;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import com.tridium.sys.registry.NModuleInfo;
|
||||
import java.io.InputStream;
|
||||
import javax.baja.file.BFileSystem;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.BLocalFileStore;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.file.zip.BZipFile;
|
||||
import javax.baja.file.zip.BZipSpace;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.naming.UnresolvedException;
|
||||
import javax.baja.platform.ICancelHint;
|
||||
import javax.baja.sys.Action;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.SlotCursor;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BModuleInstallable
|
||||
extends BInstallable {
|
||||
public static final Action trace = BModuleInstallable.newAction((int)0, null);
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
private boolean localInstance;
|
||||
private boolean dependsInitialized;
|
||||
private RuntimeException throwMe;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
|
||||
|
||||
public void trace() {
|
||||
this.invoke(trace, null, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BModulePart getModulePart() {
|
||||
SlotCursor slotCursor = this.getParts().getProperties();
|
||||
slotCursor.next();
|
||||
return (BModulePart)slotCursor.get();
|
||||
}
|
||||
|
||||
public BVector getDependencies() {
|
||||
if (this.localInstance && !this.dependsInitialized) {
|
||||
BVector bVector = (BVector)this.get(dependencies);
|
||||
bVector.removeAll();
|
||||
SlotCursor slotCursor = this.getModulePart().getDependencies().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
bVector = (BVector)this.get(exclusions);
|
||||
bVector.removeAll();
|
||||
slotCursor = this.getModulePart().getExclusions().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
this.dependsInitialized = true;
|
||||
}
|
||||
return super.getDependencies();
|
||||
}
|
||||
|
||||
public BVector getExclusions() {
|
||||
if (this.localInstance && !this.dependsInitialized) {
|
||||
this.getDependencies();
|
||||
}
|
||||
return super.getExclusions();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public long getProcessingFlags(BDaemonPlatform bDaemonPlatform, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (bDaemonPlatform == null || !this.localInstance || this.getInstallableName().equals("baja") || this.getModulePart().getManifest().noRunningStation()) {
|
||||
return 2;
|
||||
}
|
||||
bDaemonPlatform.getModuleList().init(daemonSessionTaskListener);
|
||||
if (bDaemonPlatform.getModuleList().meets(BDependency.forModule(this.getInstallableName()))) {
|
||||
return 2;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
||||
public FileTransferMessageElement[] getTransferElements(BDaemonPlatform bDaemonPlatform, StoreCache storeCache, ICancelHint iCancelHint, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModuleInstallable");
|
||||
}
|
||||
return new FileTransferMessageElement[]{this.getModulePart().makeTransferElement(bDaemonPlatform)};
|
||||
}
|
||||
|
||||
public BInstallable makeLocalInstance() {
|
||||
if (this.localInstance) {
|
||||
return this;
|
||||
}
|
||||
try {
|
||||
return BModuleInstallable.make((BIFile)this.getInstallableFileOrd().get());
|
||||
}
|
||||
catch (UnresolvedException unresolvedException) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BModuleInstallable) {
|
||||
BModuleInstallable bModuleInstallable = (BModuleInstallable)object;
|
||||
boolean bl = false;
|
||||
if (bModuleInstallable.getInstallableName().equals(this.getInstallableName()) && bModuleInstallable.getVersion().equivalent((Object)this.getVersion())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static BInstallable make(BIFile bIFile) {
|
||||
return BModuleInstallable.make(bIFile, true);
|
||||
}
|
||||
|
||||
public static BModuleInstallable make(NModuleInfo nModuleInfo) {
|
||||
FilePath filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".jar");
|
||||
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath);
|
||||
if (bIFile == null && (bIFile = BFileSystem.INSTANCE.findFile(filePath = BModulePart.MODULES_PATH.merge(nModuleInfo.getModuleName() + ".sjar"))) == null) {
|
||||
return null;
|
||||
}
|
||||
return new BModuleInstallable(bIFile, nModuleInfo);
|
||||
}
|
||||
|
||||
public static BModuleInstallable make(BIFile bIFile, boolean bl) {
|
||||
return BModuleInstallable.make(bIFile, bl, true);
|
||||
}
|
||||
|
||||
public static BModuleInstallable make(BIFile bIFile, boolean bl, boolean bl2) {
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
if (bIFile.getStore() instanceof BLocalFileStore) {
|
||||
BZipFile bZipFile = bIFile instanceof BZipFile ? (BZipFile)bIFile : new BZipFile(bIFile.getStore());
|
||||
BZipSpace bZipSpace = (BZipSpace)bZipFile.open();
|
||||
BIFile bIFile2 = bZipSpace.findFile(new FilePath("META-INF/module.xml"));
|
||||
if (bIFile2 == null && (bIFile2 = bZipSpace.findFile(new FilePath("meta-inf/module.xml"))) == null) {
|
||||
try {
|
||||
bZipFile.close();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
inputStream = null;
|
||||
}
|
||||
inputStream = new DaemonFileUtil.ZipEntryInputStream(bZipFile, bIFile2);
|
||||
} else {
|
||||
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml"));
|
||||
if (inputStream == null) {
|
||||
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("meta-inf/module.xml"));
|
||||
}
|
||||
}
|
||||
if (inputStream == null) {
|
||||
if (bl) {
|
||||
return new BModuleInstallable(bIFile, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return new BModuleInstallable(bIFile, inputStream, bl2);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return new BModuleInstallable(bIFile, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void doTrace() {
|
||||
throw this.throwMe;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.localInstance = false;
|
||||
this.dependsInitialized = false;
|
||||
}
|
||||
|
||||
public BModuleInstallable() {
|
||||
this.this();
|
||||
this.throwMe = new RuntimeException("check");
|
||||
}
|
||||
|
||||
private BModuleInstallable(BIFile bIFile, NModuleInfo nModuleInfo) {
|
||||
this.this();
|
||||
this.throwMe = new RuntimeException("check");
|
||||
this.setInstallableFileProperties(bIFile);
|
||||
BModulePart bModulePart = new BModulePart(bIFile, nModuleInfo, (BInstallable)this);
|
||||
bModulePart.setInstallable(this);
|
||||
this.setInstallableName(bModulePart.getPartName());
|
||||
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
|
||||
this.setDescription(bModulePart.getDescription());
|
||||
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
|
||||
this.localInstance = true;
|
||||
}
|
||||
|
||||
private BModuleInstallable(BIFile bIFile, InputStream inputStream) {
|
||||
this(bIFile, inputStream, true);
|
||||
}
|
||||
|
||||
private BModuleInstallable(BIFile bIFile, InputStream inputStream, boolean bl) {
|
||||
this.this();
|
||||
this.throwMe = new RuntimeException("check");
|
||||
this.setInstallableFileProperties(bIFile);
|
||||
BModulePart bModulePart = new BModulePart(bIFile, inputStream, this, bl);
|
||||
bModulePart.setInstallable(this);
|
||||
this.setInstallableName(bModulePart.getPartName());
|
||||
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
|
||||
this.setDescription(bModulePart.getDescription());
|
||||
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
|
||||
BVector bVector = (BVector)this.get(dependencies);
|
||||
bVector.removeAll();
|
||||
SlotCursor slotCursor = bModulePart.getDependencies().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
bVector = (BVector)this.get(exclusions);
|
||||
bVector.removeAll();
|
||||
slotCursor = bModulePart.getExclusions().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
this.setIsInstallable(bModulePart.getIsInstallable());
|
||||
this.dependsInitialized = true;
|
||||
this.localInstance = true;
|
||||
}
|
||||
|
||||
public BModuleInstallable(long l, String string, XElem xElem) {
|
||||
this.this();
|
||||
this.throwMe = new RuntimeException("check");
|
||||
this.setInstallableFileName(string);
|
||||
this.setInstallableFileSize(l);
|
||||
BModulePart bModulePart = BModulePart.make(string.substring(0, string.length() - 4), xElem);
|
||||
this.setInstallableName(bModulePart.getPartName());
|
||||
bModulePart.setFileSize(l);
|
||||
bModulePart.setInstallable(this);
|
||||
this.getParts().add(SlotPath.escape((String)bModulePart.getPartName()), (BValue)bModulePart);
|
||||
this.setDescription(bModulePart.getDescription());
|
||||
this.setVersion((BVersion)bModulePart.getVersion().newCopy());
|
||||
BVector bVector = (BVector)this.get(dependencies);
|
||||
bVector.removeAll();
|
||||
SlotCursor slotCursor = bModulePart.getDependencies().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
bVector = (BVector)this.get(exclusions);
|
||||
bVector.removeAll();
|
||||
slotCursor = bModulePart.getExclusions().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
bVector.add(slotCursor.property().getName(), ((BDependency)slotCursor.get()).newCopy());
|
||||
}
|
||||
this.setIsInstallable(bModulePart.getIsInstallable());
|
||||
this.dependsInitialized = true;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$installable$BModuleInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BModuleInstallable = BModuleInstallable.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BIcon.std((String)"module.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,532 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.TextUtil
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.xml.XContent
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XWriter
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BDistribution;
|
||||
import com.tridium.install.part.BBrandPart;
|
||||
import com.tridium.install.part.BGenericPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.TextUtil;
|
||||
import javax.baja.platform.install.BFileReconciler;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.xml.XContent;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XWriter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BundleManifest {
|
||||
public static final int REPLACE_DEFAULT = -1;
|
||||
public static final int REPLACE_NEVER = 0;
|
||||
public static final int REPLACE_ALWAYS = 1;
|
||||
public static final int REPLACE_CRC = 2;
|
||||
public static final int DO_NOT_COPY = 3;
|
||||
public static final int REPLACE_HOSTID = 4;
|
||||
private static String[] replaceString = new String[]{"never", "always", "crc", "nocopy", "hostid"};
|
||||
protected XElem rootElem;
|
||||
protected XElem fileHandlingElem;
|
||||
protected XElem depsElem;
|
||||
protected XElem exclElem;
|
||||
protected XElem providesElem;
|
||||
protected XElem resourcesElem;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BundleManifest$FileHandlingRule;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BPart;
|
||||
|
||||
public void write(OutputStream outputStream) throws IOException {
|
||||
XWriter xWriter = new XWriter(outputStream);
|
||||
this.rootElem.write(xWriter);
|
||||
xWriter.flush();
|
||||
}
|
||||
|
||||
public String getBuildDate() {
|
||||
return this.rootElem.get("buildDate", "");
|
||||
}
|
||||
|
||||
public void setBuildDate(BAbsTime bAbsTime) {
|
||||
if (bAbsTime != null) {
|
||||
this.rootElem.setAttr("buildDate", bAbsTime.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public String getBuildHost() {
|
||||
return this.rootElem.get("buildHost", "");
|
||||
}
|
||||
|
||||
public void setBuildHost(String string) {
|
||||
this.rootElem.setAttr("buildHost", string);
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.rootElem.get("description", "");
|
||||
}
|
||||
|
||||
public void setDescription(String string) {
|
||||
this.rootElem.setAttr("description", string);
|
||||
}
|
||||
|
||||
public String getInstallableName() {
|
||||
return this.rootElem.get("name", "");
|
||||
}
|
||||
|
||||
public void setInstallableName(String string) {
|
||||
this.rootElem.setAttr("name", string);
|
||||
}
|
||||
|
||||
public BVersion getInstallableVersion() {
|
||||
return new BVersion(this.rootElem.get("vendor", ""), this.rootElem.get("version", ""));
|
||||
}
|
||||
|
||||
public void setInstallableVersion(BVersion bVersion) {
|
||||
this.rootElem.setAttr("vendor", bVersion.getVendor());
|
||||
this.rootElem.setAttr("version", bVersion.getVendorVersionString());
|
||||
}
|
||||
|
||||
public boolean useAbsoluteElementPaths() {
|
||||
return this.rootElem.getb("absoluteElementPaths", false);
|
||||
}
|
||||
|
||||
public void setUseAbsoluteElementPaths(boolean bl) {
|
||||
this.rootElem.setAttr("absoluteElementPaths", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public int getDefaultReplaceRule() {
|
||||
String string = this.fileHandlingElem.get("replace", "crc");
|
||||
int n = 0;
|
||||
while (n < replaceString.length) {
|
||||
if (replaceString[n].equals(string)) {
|
||||
return n;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
public void setDefaultReplaceRule(int n) {
|
||||
this.fileHandlingElem.setAttr("replace", replaceString[n]);
|
||||
}
|
||||
|
||||
public FileHandlingRule[] getFileHandlingRules() {
|
||||
XElem[] xElemArray = this.fileHandlingElem.elems();
|
||||
Class clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BundleManifest$FileHandlingRule = BundleManifest.class("[Lcom.tridium.install.installable.BundleManifest$FileHandlingRule;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
if (xElemArray[n].name().equals("dir")) {
|
||||
array.add((Object)new DirHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null), xElemArray[n].getb("clean", false)));
|
||||
} else if (xElemArray[n].name().equals("file")) {
|
||||
array.add((Object)new FileHandlingRule(xElemArray[n].get("name"), xElemArray[n].get("replace", null)));
|
||||
} else if (xElemArray[n].name().equals("remove")) {
|
||||
array.add((Object)new RemoveRule(xElemArray[n].get("name")));
|
||||
} else {
|
||||
throw new IllegalStateException("unrecognized file handling rule type '" + xElemArray[n].name() + '\'');
|
||||
}
|
||||
++n;
|
||||
}
|
||||
xElemArray = this.resourcesElem.elems();
|
||||
n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
if (xElemArray[n].get("content", null) != null) {
|
||||
array.add((Object)new FileHandlingRule(xElemArray[n].get("content"), "nocopy"));
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (FileHandlingRule[])array.trim();
|
||||
}
|
||||
|
||||
public void addFileToRemove(String string) {
|
||||
XElem xElem = new XElem("remove");
|
||||
xElem.setAttr("name", string);
|
||||
this.fileHandlingElem.addContent((XContent)xElem);
|
||||
}
|
||||
|
||||
public void addDir(String string, boolean bl) {
|
||||
this.addDir(string, -1, bl);
|
||||
}
|
||||
|
||||
public void addDir(String string, int n) {
|
||||
this.addDir(string, n, false);
|
||||
}
|
||||
|
||||
public void addDir(String string, int n, boolean bl) {
|
||||
XElem xElem = new XElem("dir");
|
||||
xElem.setAttr("name", string);
|
||||
if (n >= 0) {
|
||||
xElem.setAttr("replace", replaceString[n]);
|
||||
}
|
||||
if (bl) {
|
||||
xElem.setAttr("clean", "true");
|
||||
}
|
||||
this.fileHandlingElem.addContent((XContent)xElem);
|
||||
}
|
||||
|
||||
public void addFile(String string) {
|
||||
this.addFile(string, -1);
|
||||
}
|
||||
|
||||
public void addFile(String string, int n) {
|
||||
XElem xElem = new XElem("file");
|
||||
xElem.setAttr("name", string);
|
||||
if (n >= 0) {
|
||||
xElem.setAttr("replace", replaceString[n]);
|
||||
}
|
||||
this.fileHandlingElem.addContent((XContent)xElem);
|
||||
}
|
||||
|
||||
public void addFile(String string, BTypeSpec bTypeSpec, int n) {
|
||||
XElem xElem = new XElem("file");
|
||||
xElem.setAttr("name", string);
|
||||
if (n == -1) {
|
||||
xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString());
|
||||
} else {
|
||||
xElem.setAttr("replace", "reconcile:" + bTypeSpec.toString() + ':' + replaceString[n]);
|
||||
}
|
||||
this.fileHandlingElem.addContent((XContent)xElem);
|
||||
}
|
||||
|
||||
public BDependency[] getDependencies() {
|
||||
XElem[] xElemArray = this.depsElem.elems();
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
BDependency bDependency = BDependency.make(xElemArray[n]);
|
||||
if (!(bDependency == null || bDependency.getPartTypeSpec().equals((Object)BBrandPart.TYPE.getTypeSpec()) && (bDependency.getPartName().equals("noBrand") || bDependency.getPartName().equals("nullos") || bDependency.getPartName().equals("disabled")))) {
|
||||
if (bDependency.getVersionRelation() == BVersionRelation.exact && bDependency.getPartTypeSpec().equals((Object)BGenericPart.TYPE.getTypeSpec()) && this.providesElem.elems().length == 0) {
|
||||
bDependency.setVersion(BVersion.makeZero());
|
||||
bDependency.setVersionRelation(BVersionRelation.minimum);
|
||||
}
|
||||
array.add((Object)bDependency);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public BDependency[] getExclusions() {
|
||||
XElem[] xElemArray = this.exclElem.elems();
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = BundleManifest.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
BDependency bDependency = BDependency.make(xElemArray[n]);
|
||||
if (bDependency != null) {
|
||||
array.add((Object)bDependency);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public void addDependency(BDependency bDependency) {
|
||||
this.depsElem.addContent((XContent)bDependency.getXml());
|
||||
}
|
||||
|
||||
public void addExclusion(BDependency bDependency) {
|
||||
this.exclElem.addContent((XContent)bDependency.getXml());
|
||||
}
|
||||
|
||||
public InstallableResourceMetadata[] getInstallableResources() {
|
||||
XElem[] xElemArray = this.resourcesElem.elems("installable");
|
||||
InstallableResourceMetadata[] installableResourceMetadataArray = new InstallableResourceMetadata[xElemArray.length];
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
installableResourceMetadataArray[n] = new InstallableResourceMetadata(xElemArray[n]);
|
||||
++n;
|
||||
}
|
||||
return installableResourceMetadataArray;
|
||||
}
|
||||
|
||||
public BPart[] getProvidedParts(BDistribution bDistribution) {
|
||||
XElem[] xElemArray = this.providesElem.elems();
|
||||
Class clazz = class$com$tridium$install$part$BPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BPart = BundleManifest.class("[Lcom.tridium.install.part.BPart;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
BPart bPart = BPart.makePart(xElemArray[n], bDistribution);
|
||||
if (bPart != null) {
|
||||
array.add((Object)bPart);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BPart[])array.trim();
|
||||
}
|
||||
|
||||
public void addProvidedPart(BPart bPart) {
|
||||
this.providesElem.addContent((XContent)bPart.getXml());
|
||||
}
|
||||
|
||||
public String getEntryPath(FilePath filePath, String string) {
|
||||
FilePath filePath2 = this.getNormalFilePath(filePath, string);
|
||||
return filePath2 == null ? null : this.getEntryPath(filePath2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enabled force condition propagation
|
||||
* Lifted jumps to return sites
|
||||
*/
|
||||
public String getEntryPath(FilePath filePath) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
if (filePath.isSysHomeAbsolute()) {
|
||||
if (this.useAbsoluteElementPaths()) {
|
||||
stringBuffer.append("niagara");
|
||||
}
|
||||
int n = 0;
|
||||
while (n < filePath.depth()) {
|
||||
if (stringBuffer.length() > 0) {
|
||||
stringBuffer.append('/');
|
||||
}
|
||||
stringBuffer.append(filePath.nameAt(n));
|
||||
if (n == 0 && filePath.nameAt(n).equals("bin")) {
|
||||
stringBuffer.append("/stage");
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
} else {
|
||||
if (!filePath.isLocalAbsolute()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": only local and system home absolute paths supported");
|
||||
if (!this.useAbsoluteElementPaths()) throw new IllegalArgumentException("error with path " + filePath.getBody() + ": local absolute paths unsupported");
|
||||
int n = 0;
|
||||
while (n < filePath.depth()) {
|
||||
if (stringBuffer.length() > 0) {
|
||||
stringBuffer.append('/');
|
||||
}
|
||||
stringBuffer.append(filePath.nameAt(n));
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public FilePath getNormalFilePath(FilePath filePath) {
|
||||
return this.getNormalFilePath(filePath, null);
|
||||
}
|
||||
|
||||
public FilePath getNormalFilePath(FilePath filePath, String string) {
|
||||
if (filePath.isStationHomeAbsolute()) {
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
FilePath filePath2 = new FilePath("!stations");
|
||||
filePath2 = filePath2.merge(string);
|
||||
int n = 0;
|
||||
while (n < filePath.depth()) {
|
||||
filePath2 = filePath2.merge(filePath.nameAt(n));
|
||||
++n;
|
||||
}
|
||||
return filePath2;
|
||||
}
|
||||
if (filePath.isSysHomeAbsolute()) {
|
||||
return filePath;
|
||||
}
|
||||
if (filePath.isLocalAbsolute()) {
|
||||
if (this.useAbsoluteElementPaths()) {
|
||||
return filePath;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static /* synthetic */ String[] access$0() {
|
||||
return replaceString;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
protected BundleManifest(XElem xElem) throws Exception {
|
||||
this.rootElem = xElem.copy();
|
||||
this.fileHandlingElem = this.rootElem.elem("fileHandling");
|
||||
if (this.fileHandlingElem == null) {
|
||||
this.fileHandlingElem = new XElem("fileHandling");
|
||||
this.rootElem.addContent((XContent)this.fileHandlingElem);
|
||||
}
|
||||
this.depsElem = this.rootElem.elem("dependencies");
|
||||
if (this.depsElem == null) {
|
||||
this.depsElem = new XElem("dependencies");
|
||||
xElem.addContent((XContent)this.depsElem);
|
||||
}
|
||||
this.providesElem = this.rootElem.elem("provides");
|
||||
if (this.providesElem == null) {
|
||||
this.providesElem = new XElem("provides");
|
||||
this.rootElem.addContent((XContent)this.providesElem);
|
||||
}
|
||||
this.exclElem = this.rootElem.elem("exclusions");
|
||||
if (this.exclElem == null) {
|
||||
this.exclElem = new XElem("exclusions");
|
||||
xElem.addContent((XContent)this.exclElem);
|
||||
}
|
||||
this.resourcesElem = this.rootElem.elem("resources");
|
||||
if (this.resourcesElem == null) {
|
||||
this.resourcesElem = new XElem("resources");
|
||||
xElem.addContent((XContent)this.resourcesElem);
|
||||
}
|
||||
}
|
||||
|
||||
protected BundleManifest() {
|
||||
this.rootElem = new XElem("dist");
|
||||
this.fileHandlingElem = new XElem("fileHandling");
|
||||
this.rootElem.addContent((XContent)this.fileHandlingElem);
|
||||
this.depsElem = new XElem("dependencies");
|
||||
this.rootElem.addContent((XContent)this.depsElem);
|
||||
this.exclElem = new XElem("exclusions");
|
||||
this.rootElem.addContent((XContent)this.exclElem);
|
||||
this.providesElem = new XElem("provides");
|
||||
this.rootElem.addContent((XContent)this.providesElem);
|
||||
this.resourcesElem = new XElem("resources");
|
||||
this.rootElem.addContent((XContent)this.resourcesElem);
|
||||
}
|
||||
|
||||
public static class DirHandlingRule
|
||||
extends FileHandlingRule {
|
||||
public boolean clean;
|
||||
|
||||
public DirHandlingRule(String string, String string2, boolean bl) {
|
||||
super(string, string2);
|
||||
this.clean = bl;
|
||||
}
|
||||
|
||||
public DirHandlingRule(String string, int n, boolean bl) {
|
||||
super(string, n);
|
||||
this.clean = bl;
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileHandlingRule {
|
||||
public String entryPath;
|
||||
public int replaceRule;
|
||||
public BFileReconciler reconciler;
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
* Enabled force condition propagation
|
||||
* Lifted jumps to return sites
|
||||
*/
|
||||
public FileHandlingRule(String var1_1, String var2_2) {
|
||||
super();
|
||||
this.entryPath = var1_1;
|
||||
this.replaceRule = -1;
|
||||
if (var2_2 == null || var2_2.trim().length() <= 0) return;
|
||||
var3_3 = TextUtil.split((String)var2_2, (char)':');
|
||||
if (var3_3[0].equals("reconcile")) {
|
||||
try {
|
||||
this.reconciler = (BFileReconciler)BTypeSpec.make((String)var3_3[1], (String)var3_3[2]).getInstance();
|
||||
return;
|
||||
}
|
||||
catch (Exception var4_4) {
|
||||
if (var3_3.length <= 3) return;
|
||||
var5_6 = 0;
|
||||
** while (var5_6 < BundleManifest.access$0().length)
|
||||
}
|
||||
lbl-1000:
|
||||
// 1 sources
|
||||
|
||||
{
|
||||
if (BundleManifest.access$0()[var5_6].equals(var3_3[3])) {
|
||||
this.replaceRule = var5_6;
|
||||
return;
|
||||
} else {
|
||||
++var5_6;
|
||||
continue;
|
||||
}
|
||||
lbl19:
|
||||
// 1 sources
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
var4_5 = 0;
|
||||
while (var4_5 < BundleManifest.access$0().length) {
|
||||
if (BundleManifest.access$0()[var4_5].equals(var2_2)) {
|
||||
this.replaceRule = var4_5;
|
||||
return;
|
||||
}
|
||||
++var4_5;
|
||||
}
|
||||
}
|
||||
|
||||
public FileHandlingRule(String string, int n) {
|
||||
this.entryPath = string;
|
||||
this.replaceRule = n;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RemoveRule
|
||||
extends FileHandlingRule {
|
||||
public RemoveRule(String string) {
|
||||
super(string, -1);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InstallableResourceMetadata {
|
||||
public XElem elem;
|
||||
|
||||
public String getContentEntryPath() {
|
||||
return this.elem.get("content");
|
||||
}
|
||||
|
||||
public String getInstallableName() {
|
||||
return this.elem.get("name");
|
||||
}
|
||||
|
||||
public String getProvidedPartType() {
|
||||
return this.elem.get("type");
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return new BVersion(this.elem.get("vendor", ""), this.elem.get("vendorVersion"));
|
||||
}
|
||||
|
||||
public XElem makeDependencyElem() {
|
||||
return new XElem(this.elem.get("type")).addAttr("name", this.elem.get("name")).addAttr("vendor", this.elem.get("vendor", "")).addAttr("version", this.elem.get("vendorVersion")).addAttr("rel", "exact");
|
||||
}
|
||||
|
||||
public InstallableResourceMetadata(XElem xElem) {
|
||||
this.elem = xElem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.Cursor
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import javax.baja.sys.Cursor;
|
||||
|
||||
public interface ClosableCursor
|
||||
extends Cursor {
|
||||
public void close();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Cursor
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.installable.ClosableCursor;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Cursor;
|
||||
|
||||
public class CursorUtil {
|
||||
public static ClosableCursor closable(Cursor cursor) {
|
||||
return cursor instanceof ClosableCursor ? (ClosableCursor)cursor : new Closable(cursor);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Collection collection) {
|
||||
return CursorUtil.cursor(collection, null);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Collection collection, Context context) {
|
||||
return CursorUtil.cursor(collection.iterator(), context);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Iterator iterator) {
|
||||
return CursorUtil.cursor(iterator, null);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Iterator iterator, Context context) {
|
||||
return new IteratorCursor(iterator, context);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Object[] objectArray) {
|
||||
return CursorUtil.cursor(objectArray, null);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Object[] objectArray, Context context) {
|
||||
return CursorUtil.cursor(new Array(objectArray), context);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Array array) {
|
||||
return CursorUtil.cursor(array, null);
|
||||
}
|
||||
|
||||
public static Cursor cursor(Array array, Context context) {
|
||||
return new ArrayCursor(array, context);
|
||||
}
|
||||
|
||||
public static class Closable
|
||||
implements ClosableCursor {
|
||||
private Cursor innerCursor;
|
||||
|
||||
public Context getContext() {
|
||||
return this.innerCursor.getContext();
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
return this.innerCursor.next();
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
return this.innerCursor.nextComponent();
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
return this.innerCursor.next(clazz);
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return this.innerCursor.get();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public Closable(Cursor cursor) {
|
||||
this.innerCursor = cursor;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public static class IteratorCursor
|
||||
implements Cursor {
|
||||
private Iterator i;
|
||||
private BObject current;
|
||||
private Context cx;
|
||||
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
||||
|
||||
public Context getContext() {
|
||||
return this.cx;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (this.i.hasNext()) {
|
||||
this.current = (BObject)this.i.next();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
Class clazz = class$javax$baja$sys$BComponent;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$sys$BComponent = IteratorCursor.class("[Ljavax.baja.sys.BComponent;", false);
|
||||
}
|
||||
return this.next(clazz);
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
while (this.next()) {
|
||||
if (!clazz.isAssignableFrom(this.current.getClass())) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return this.current;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.current = null;
|
||||
}
|
||||
|
||||
public IteratorCursor(Iterator iterator, Context context) {
|
||||
this.this();
|
||||
this.i = iterator;
|
||||
this.cx = context;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public static class ArrayCursor
|
||||
implements Cursor {
|
||||
private int index;
|
||||
private Array a;
|
||||
private Context cx;
|
||||
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
||||
|
||||
public Context getContext() {
|
||||
return this.cx;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (this.index >= this.a.size() - 1) {
|
||||
return false;
|
||||
}
|
||||
++this.index;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
Class clazz = class$javax$baja$sys$BComponent;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$sys$BComponent = ArrayCursor.class("[Ljavax.baja.sys.BComponent;", false);
|
||||
}
|
||||
return this.next(clazz);
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
while (this.next()) {
|
||||
if (!clazz.isAssignableFrom(this.get().getClass())) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
if (this.index < 0 || this.index >= this.a.size()) {
|
||||
return null;
|
||||
}
|
||||
return (BObject)this.a.get(this.index);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
public ArrayCursor(Array array, Context context) {
|
||||
this.this();
|
||||
this.a = array;
|
||||
this.cx = context;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.timezone.BTimeZone
|
||||
* javax.baja.util.Version
|
||||
* javax.baja.xml.XContent
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BundleManifest;
|
||||
import com.tridium.install.part.BNrePart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.tcpip.BTcpIpHostSettings;
|
||||
import com.tridium.platform.tcpip.BTcpIpPlatformService;
|
||||
import com.tridium.platform.tcpip.TcpUtil;
|
||||
import java.io.InputStream;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.util.Version;
|
||||
import javax.baja.xml.XContent;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class DistributionManifest
|
||||
extends BundleManifest {
|
||||
private XElem platformElem;
|
||||
private XElem tcpIpElem;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
|
||||
public static DistributionManifest make() {
|
||||
return new DistributionManifest();
|
||||
}
|
||||
|
||||
public static DistributionManifest make(InputStream inputStream) throws Exception {
|
||||
return DistributionManifest.make(inputStream, true);
|
||||
}
|
||||
|
||||
public static DistributionManifest make(InputStream inputStream, boolean bl) throws Exception {
|
||||
return DistributionManifest.make(XParser.make((InputStream)inputStream).parse(bl));
|
||||
}
|
||||
|
||||
public static DistributionManifest make(XElem xElem) throws Exception {
|
||||
return new DistributionManifest(xElem);
|
||||
}
|
||||
|
||||
public boolean isDaemonBinaryUpdateRequired() {
|
||||
return this.rootElem.getb("updateDaemonBinaries", false);
|
||||
}
|
||||
|
||||
public void setDaemonBinaryUpdateRequired(boolean bl) {
|
||||
this.rootElem.setAttr("updateDaemonBinaries", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public boolean noRunningStation() {
|
||||
boolean bl = true;
|
||||
if (!this.noRunningApp()) {
|
||||
bl = this.rootElem.getb("noRunningStation", false);
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public void setNoRunningStation(boolean bl) {
|
||||
this.rootElem.setAttr("noRunningStation", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public boolean noRunningApp() {
|
||||
return this.rootElem.getb("noRunningApp", this.rootElem.getb("noStation", false));
|
||||
}
|
||||
|
||||
public void setNoRunningApp(boolean bl) {
|
||||
this.rootElem.setAttr("noRunningApp", String.valueOf(bl));
|
||||
this.rootElem.setAttr("noStation", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public String getHostId() {
|
||||
return this.rootElem.get("hostId", null);
|
||||
}
|
||||
|
||||
public void setHostId(String string) {
|
||||
if (string != null) {
|
||||
this.rootElem.setAttr("hostId", string);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOsUpdateRequired() {
|
||||
return this.rootElem.getb("osInstall", false);
|
||||
}
|
||||
|
||||
public void setOsUpdateRequired(boolean bl) {
|
||||
this.rootElem.setAttr("osInstall", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public boolean isStandalone() {
|
||||
return this.rootElem.getb("standalone", false);
|
||||
}
|
||||
|
||||
public void setIsStandalone(boolean bl) {
|
||||
this.rootElem.setAttr("standalone", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public boolean isRebootRequired() {
|
||||
return this.rootElem.getb("reboot", false);
|
||||
}
|
||||
|
||||
public void setRebootRequired(boolean bl) {
|
||||
this.rootElem.setAttr("reboot", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public boolean ignoreDefaultExclusions() {
|
||||
return this.rootElem.getb("ignoreDefaultExclusions", false);
|
||||
}
|
||||
|
||||
public void setIgnoreDefaultExclusions(boolean bl) {
|
||||
this.rootElem.setAttr("ignoreDefaultExclusions", String.valueOf(bl));
|
||||
}
|
||||
|
||||
public void setTargetOs(BOsPart bOsPart) {
|
||||
this.setUseAbsoluteElementPaths(bOsPart.allowGlobalFileAccess());
|
||||
}
|
||||
|
||||
public BModuleContent getUpdateModuleContent() {
|
||||
String string = this.rootElem.get("setInstallFlag", null);
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
return BModuleContent.make(string);
|
||||
}
|
||||
|
||||
public void setUpdateModuleContent(BModuleContent bModuleContent) {
|
||||
this.rootElem.setAttr("setInstallFlag", bModuleContent.getTag());
|
||||
}
|
||||
|
||||
public void setNewOsTimeZone(BTimeZone bTimeZone) throws Exception {
|
||||
if (bTimeZone == null) {
|
||||
bTimeZone = BTimeZone.NULL;
|
||||
}
|
||||
this.rootElem.setAttr("osTimeZone", bTimeZone.encodeToString());
|
||||
}
|
||||
|
||||
public BTimeZone getNewOsTimeZone() {
|
||||
String string = this.rootElem.get("osTimeZone", null);
|
||||
if (string == null) {
|
||||
return BTimeZone.NULL;
|
||||
}
|
||||
try {
|
||||
return (BTimeZone)BTimeZone.DEFAULT.decodeFromString(string);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
return BTimeZone.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public BDependency[] getExclusions() {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = DistributionManifest.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
array.addAll((Object[])super.getExclusions());
|
||||
if (!this.ignoreDefaultExclusions()) {
|
||||
BPart[] bPartArray = this.getProvidedParts(null);
|
||||
if (bPartArray.length > 0) {
|
||||
this.addDefaultOsExclusions(bPartArray[0], array);
|
||||
this.addDefaultNreCoreExclusions(bPartArray[0], array);
|
||||
}
|
||||
this.addDefaultNreConfigExclusions(array);
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
protected void addDefaultOsExclusions(BPart bPart, Array array) {
|
||||
if (bPart.getType().equals(BOsPart.TYPE) && bPart.getPartName().startsWith("qnx")) {
|
||||
Version version = bPart.getVersion().getVendorVersion();
|
||||
if (version.major() == 1) {
|
||||
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "2.0"), bPart.getType().getTypeSpec()));
|
||||
} else if (version.size() >= 2) {
|
||||
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void addDefaultNreCoreExclusions(BPart bPart, Array array) {
|
||||
Version version;
|
||||
if (bPart.getType().equals(BNrePart.TYPE) && bPart.getPartName().startsWith("nre-core-qnx") && (version = bPart.getVersion().getVendorVersion()).size() >= 2) {
|
||||
array.add((Object)new BDependency(bPart.getPartName(), new BVersion(bPart.getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bPart.getType().getTypeSpec()));
|
||||
}
|
||||
}
|
||||
|
||||
protected void addDefaultNreConfigExclusions(Array array) {
|
||||
if (this.getInstallableName().startsWith("nre-config")) {
|
||||
BDependency[] bDependencyArray = this.getDependencies();
|
||||
int n = 0;
|
||||
while (n < bDependencyArray.length) {
|
||||
if (bDependencyArray[n].getPartTypeSpec().equals((Object)BOsPart.TYPE.getTypeSpec()) && bDependencyArray[n].getPartName().startsWith("qnx") && bDependencyArray[n].getVersionRelation() != BVersionRelation.exact) {
|
||||
Version version = bDependencyArray[n].getVersion().getVendorVersion();
|
||||
if (version.major() == 1) {
|
||||
array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "2.0"), bDependencyArray[n].getPartTypeSpec()));
|
||||
} else if (version.size() >= 2) {
|
||||
array.add((Object)new BDependency(bDependencyArray[n].getPartName(), new BVersion(bDependencyArray[n].getVersion().getVendor(), "" + version.major() + '.' + (version.minor() + 1)), bDependencyArray[n].getPartTypeSpec()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public XElem getPlatformXml() {
|
||||
return this.platformElem;
|
||||
}
|
||||
|
||||
public void setPlatformXml(XElem xElem) {
|
||||
if (this.platformElem != null) {
|
||||
this.rootElem.removeContent((XContent)this.platformElem);
|
||||
}
|
||||
this.platformElem = xElem;
|
||||
this.rootElem.addContent((XContent)this.platformElem);
|
||||
}
|
||||
|
||||
public void setPlatformBog(BIFile bIFile) throws Exception {
|
||||
this.setPlatformBog(bIFile, true);
|
||||
}
|
||||
|
||||
public void setPlatformBog(BIFile bIFile, boolean bl) throws Exception {
|
||||
XElem xElem = new XElem("platform");
|
||||
if (!bl) {
|
||||
xElem.setAttr("merge", "false");
|
||||
}
|
||||
InputStream inputStream = bIFile.getInputStream();
|
||||
XElem xElem2 = XParser.make((InputStream)inputStream).parse().elem(0);
|
||||
XElem[] xElemArray = xElem2.elems("p");
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
xElem.addContent((XContent)xElemArray[n].copy());
|
||||
++n;
|
||||
}
|
||||
try {
|
||||
inputStream.close();
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
this.setPlatformXml(xElem);
|
||||
}
|
||||
|
||||
public BTcpIpHostSettings getTcpIpSettings() {
|
||||
if (this.tcpIpElem == null) {
|
||||
return null;
|
||||
}
|
||||
BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings();
|
||||
TcpUtil.updateFields(bTcpIpHostSettings, this.tcpIpElem);
|
||||
return bTcpIpHostSettings;
|
||||
}
|
||||
|
||||
public void setTcpIpSettings(BTcpIpHostSettings bTcpIpHostSettings) throws Exception {
|
||||
if (this.tcpIpElem != null) {
|
||||
this.rootElem.removeContent((XContent)this.tcpIpElem);
|
||||
}
|
||||
if (bTcpIpHostSettings == null) {
|
||||
this.tcpIpElem = null;
|
||||
} else if (!bTcpIpHostSettings.getIsReadonly()) {
|
||||
this.tcpIpElem = TcpUtil.getHostSettingsXml(bTcpIpHostSettings);
|
||||
this.rootElem.addContent((XContent)this.tcpIpElem);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStationTcpIpSettings() throws Exception {
|
||||
BTcpIpPlatformService bTcpIpPlatformService = (BTcpIpPlatformService)Sys.getService((Type)BTcpIpPlatformService.TYPE);
|
||||
bTcpIpPlatformService.poll();
|
||||
this.setTcpIpSettings(bTcpIpPlatformService.getSettings());
|
||||
}
|
||||
|
||||
public void setDaemonTcpIpSettings(BDaemonSession bDaemonSession) throws Exception {
|
||||
BTcpIpHostSettings bTcpIpHostSettings = new BTcpIpHostSettings();
|
||||
TcpUtil.loadFromSession(bTcpIpHostSettings, bDaemonSession);
|
||||
this.setTcpIpSettings(bTcpIpHostSettings);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.platformElem = null;
|
||||
this.tcpIpElem = null;
|
||||
}
|
||||
|
||||
private DistributionManifest(XElem xElem) throws Exception {
|
||||
super(xElem);
|
||||
this.this();
|
||||
this.platformElem = this.rootElem.elem("platform");
|
||||
this.tcpIpElem = this.rootElem.elem("tcpIpSettings");
|
||||
}
|
||||
|
||||
private DistributionManifest() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.installable.ClosableCursor;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
|
||||
public interface InstallableRegistry {
|
||||
public BInstallable findInstallable(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
|
||||
|
||||
public BInstallable[] findInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
|
||||
|
||||
public ClosableCursor getInstallables(BDependency var1, DaemonSessionTaskListener var2) throws Exception;
|
||||
|
||||
public ClosableCursor getInstallables(boolean var1, DaemonSessionTaskListener var2) throws Exception;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,938 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BDirectory
|
||||
* javax.baja.file.BFileSystem
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.file.FileUtil
|
||||
* javax.baja.naming.BOrd
|
||||
* javax.baja.naming.OrdQuery
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.nre.util.IFilter
|
||||
* javax.baja.sys.BObject
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.SlotCursor
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.util.Lexicon
|
||||
* javax.baja.util.PatternFilter
|
||||
* javax.baja.util.Version
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BRegisteredModuleList;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.FilenameFilterUtil;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.install.installable.ClosableCursor;
|
||||
import com.tridium.install.installable.InstallableRegistry;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.daemon.file.FilePathComparator;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTask;
|
||||
import com.tridium.platform.daemon.task.DaemonSessionTaskListener;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import javax.baja.file.BDirectory;
|
||||
import javax.baja.file.BFileSystem;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.file.FileUtil;
|
||||
import javax.baja.naming.BOrd;
|
||||
import javax.baja.naming.OrdQuery;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.nre.util.IFilter;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.BObject;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.SlotCursor;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.util.Lexicon;
|
||||
import javax.baja.util.PatternFilter;
|
||||
import javax.baja.util.Version;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class LocalInstallableRegistry
|
||||
implements InstallableRegistry {
|
||||
private static LocalInstallableRegistry INSTANCE = null;
|
||||
public static final BTypeSpec MODULE_PART = BModulePart.TYPE.getTypeSpec();
|
||||
public static final BTypeSpec MODULE_INST = BModuleInstallable.TYPE.getTypeSpec();
|
||||
public static final FilePath SW_PATH = new FilePath("!sw");
|
||||
public static final String INBOX_DIR = "inbox";
|
||||
public static final String FAILED_DIR = "failed_imports";
|
||||
public static final FilePath INBOX_PATH = SW_PATH.merge("inbox");
|
||||
public static final FilePath MODULES_PATH = new FilePath("!modules");
|
||||
private static final Lexicon lex = Lexicon.make((String)"platform");
|
||||
private boolean initialized;
|
||||
private InstallableCache installableCache;
|
||||
private boolean initializing;
|
||||
private Array listeners;
|
||||
private HashMap installableTypesByFileExt;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BModuleInstallable;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BPart;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BInstallable;
|
||||
static /* synthetic */ Class class$javax$baja$file$BIFile;
|
||||
static /* synthetic */ Class class$javax$baja$file$FilePath;
|
||||
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
||||
static /* synthetic */ Class class$com$tridium$install$installable$BDistribution;
|
||||
|
||||
public static LocalInstallableRegistry getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new LocalInstallableRegistry();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public void reload(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
this.reset();
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
this.initialized = false;
|
||||
}
|
||||
|
||||
public void init() throws Exception {
|
||||
this.init(null);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public void init(DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
if (!this.initialized) {
|
||||
if (daemonSessionTaskListener == null) {
|
||||
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
||||
}
|
||||
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
|
||||
BFileSystem.INSTANCE.makeDir(SW_PATH);
|
||||
this.initializing = true;
|
||||
try {
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
this.installableCache = new InstallableCache();
|
||||
this.importDirectory(BFileSystem.INSTANCE.makeDir(INBOX_PATH), daemonSessionTaskListener, daemonSessionTask, true);
|
||||
BRegisteredModuleList.getInstance().doInit(daemonSessionTaskListener);
|
||||
SlotCursor slotCursor = BRegisteredModuleList.getInstance().getModules().getProperties();
|
||||
while (true) {
|
||||
Class clazz;
|
||||
if ((clazz = class$com$tridium$install$installable$BModuleInstallable) == null) {
|
||||
clazz = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
||||
}
|
||||
if (slotCursor.next(clazz)) {
|
||||
BModuleInstallable bModuleInstallable = (BModuleInstallable)slotCursor.get();
|
||||
if (bModuleInstallable.getModulePart().getArchiveContent() != BModuleContent.doc) continue;
|
||||
if (this.isRegistered(bModuleInstallable)) {
|
||||
this.installableCache.register(SW_PATH.merge(bModuleInstallable.getVersion().getVendorVersion().toString()).merge(bModuleInstallable.getInstallableFileName()), (BInstallable)bModuleInstallable);
|
||||
continue;
|
||||
}
|
||||
this.register(daemonSessionTask, bModuleInstallable, daemonSessionTaskListener, false);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var4_6 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var4_7 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
this.initialized = true;
|
||||
this.initializing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRegistered(BInstallable bInstallable) throws Exception {
|
||||
String string = bInstallable.getVersion().getVendorVersion() == null ? "0" : bInstallable.getVersion().getVendorVersion().toString();
|
||||
BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(string));
|
||||
BIFile bIFile = (BIFile)bDirectory.getNavChild(bInstallable.getInstallableFileName());
|
||||
if (bIFile == null) {
|
||||
return false;
|
||||
}
|
||||
BIFile bIFile2 = (BIFile)bInstallable.getInstallableFileOrd().get();
|
||||
if (bIFile2 == null) {
|
||||
return false;
|
||||
}
|
||||
return bIFile2.getLastModified().isAfter(bIFile.getLastModified());
|
||||
}
|
||||
|
||||
public void register(BInstallable bInstallable, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
this.register(null, bInstallable, daemonSessionTaskListener, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public void register(String string, String string2, BVersion bVersion, InputStream inputStream, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
if (!this.initializing) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
if (daemonSessionTaskListener == null) {
|
||||
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
||||
}
|
||||
if (bVersion.getVendorVersion().equals((Object)Version.ZERO)) {
|
||||
return;
|
||||
}
|
||||
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
try {
|
||||
BDirectory bDirectory = BFileSystem.INSTANCE.makeDir(SW_PATH.merge(bVersion.getVendorVersion().toString()));
|
||||
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyModule", new Object[]{string}));
|
||||
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
||||
BIFile bIFile = BFileSystem.INSTANCE.makeFile(bDirectory.getFilePath().merge(string2));
|
||||
FileUtil.pipe((InputStream)inputStream, (OutputStream)bIFile.getOutputStream());
|
||||
BInstallable bInstallable = BInstallable.make(bIFile);
|
||||
this.installableCache.register(bIFile, bInstallable);
|
||||
this.notifyRegistration(bInstallable);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var8_11 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var8_12 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Exception decompiling
|
||||
*/
|
||||
private final void register(DaemonSessionTask var1_1, BInstallable var2_2, DaemonSessionTaskListener var3_3, boolean var4_4) throws Exception {
|
||||
/*
|
||||
* This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
|
||||
*
|
||||
* org.benf.cfr.reader.util.ConfusedCFRException: Back jump on a try block [egrp 1[TRYBLOCK] [1 : 274->278)] java.lang.Throwable
|
||||
* at org.benf.cfr.reader.bytecode.analysis.opgraph.Op02WithProcessedDataAndRefs.insertExceptionBlocks(Op02WithProcessedDataAndRefs.java:2283)
|
||||
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:415)
|
||||
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
|
||||
* at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
|
||||
* at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
|
||||
* at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
|
||||
* at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
|
||||
* at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
|
||||
* at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
|
||||
* at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
|
||||
* at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
|
||||
* at org.benf.cfr.reader.Main.main(Main.java:54)
|
||||
*/
|
||||
throw new IllegalStateException("Decompilation failed");
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public void importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
if (!this.initializing) {
|
||||
this.init(daemonSessionTaskListener);
|
||||
}
|
||||
if (daemonSessionTaskListener == null) {
|
||||
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
||||
}
|
||||
DaemonSessionTask daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.init.import.title", "LocalInstallableRegistry.init.import.message");
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
try {
|
||||
this.importDirectory(bDirectory, daemonSessionTaskListener, daemonSessionTask, false);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var5_5 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var5_6 = null;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private final void importDirectory(BDirectory bDirectory, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask, boolean bl) throws Exception {
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
if (bIFileArray[n] instanceof BDirectory) {
|
||||
this.importDirectory((BDirectory)bIFileArray[n], daemonSessionTaskListener, daemonSessionTask, bl);
|
||||
} else {
|
||||
FilePath filePath;
|
||||
FilePath filePath2;
|
||||
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFileArray[n].getFilePath().getBody()}));
|
||||
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
||||
BInstallable bInstallable = BInstallable.make(bIFileArray[n]);
|
||||
if (bInstallable == null || !bInstallable.getIsValid() || !bInstallable.getIsInstallable() || bInstallable instanceof BModuleInstallable && ((BModuleInstallable)bInstallable).getModulePart().getArchiveContent() != BModuleContent.doc) {
|
||||
filePath2 = bIFileArray[n].getFilePath();
|
||||
filePath = new FilePath(filePath2.getAbsoluteBase());
|
||||
int n2 = 0;
|
||||
while (n2 < filePath2.depth()) {
|
||||
filePath = filePath2.nameAt(n2).equals(INBOX_DIR) ? filePath.merge(FAILED_DIR) : filePath.merge(filePath2.nameAt(n2));
|
||||
++n2;
|
||||
}
|
||||
} else {
|
||||
filePath = SW_PATH.merge(bInstallable.getVersion().getVendorVersion().toString()).merge(this.getNormalFileName(bInstallable, bIFileArray[n]));
|
||||
bInstallable.setInstallableFileOrd(BOrd.make((OrdQuery)filePath));
|
||||
}
|
||||
if (!filePath.getBody().equals(bIFileArray[n].getFilePath().getBody())) {
|
||||
filePath2 = BFileSystem.INSTANCE.findFile(filePath);
|
||||
if (filePath2 != null) {
|
||||
filePath2.delete();
|
||||
}
|
||||
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.init.import.copyFile", new Object[]{bIFileArray[n].getFilePath().getBody()}));
|
||||
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
||||
if (filePath.depth() > 0) {
|
||||
BFileSystem.INSTANCE.makeDir(filePath.getParent(), null);
|
||||
}
|
||||
if (bl) {
|
||||
BFileSystem.INSTANCE.move(bIFileArray[n].getFilePath(), filePath);
|
||||
} else {
|
||||
BIFile bIFile = BFileSystem.INSTANCE.makeFile(filePath);
|
||||
FileUtil.pipe((BIFile)bIFileArray[n], (BIFile)bIFile);
|
||||
}
|
||||
this.notifyRegistration(bInstallable);
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
if (bl && !bDirectory.getFilePath().getBody().equals(INBOX_PATH.getBody())) {
|
||||
bDirectory.delete();
|
||||
}
|
||||
}
|
||||
|
||||
private final String getNormalFileName(BInstallable bInstallable, BIFile bIFile) {
|
||||
SlotCursor slotCursor = bInstallable.getParts().getProperties();
|
||||
Class clazz = class$com$tridium$install$part$BPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BPart = LocalInstallableRegistry.class("[Lcom.tridium.install.part.BPart;", false);
|
||||
}
|
||||
if (slotCursor.next(clazz)) {
|
||||
BPart bPart = (BPart)slotCursor.get();
|
||||
return bPart.getPartName() + '.' + bIFile.getExtension();
|
||||
}
|
||||
return bIFile.getFileName();
|
||||
}
|
||||
|
||||
private final Array getVersionSubdirs() {
|
||||
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(SW_PATH);
|
||||
Array array = new Array((Object[])bDirectory.listFiles());
|
||||
array = array.filter(new IFilter(){
|
||||
|
||||
public final boolean accept(Object object) {
|
||||
if (object == null || !(object instanceof BDirectory)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
new Version(((BDirectory)object).getFileName());
|
||||
return true;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
return array.sort(new Comparator(){
|
||||
|
||||
public final int compare(Object object, Object object2) {
|
||||
Version version;
|
||||
String string = ((BDirectory)object).getFileName();
|
||||
String string2 = ((BDirectory)object2).getFileName();
|
||||
Version version2 = new Version(string2);
|
||||
int n = version2.compareTo((Object)(version = new Version(string)));
|
||||
return n == 0 ? string2.compareTo(string) : n;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public BInstallable findInstallable(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
this.init(daemonSessionTaskListener);
|
||||
return this.installableCache.getInstallable(this.findInstallableFile(bDependency, daemonSessionTaskListener), daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
this.init(daemonSessionTaskListener);
|
||||
return new InstallableFileCursor(this.findInstallableFiles(bDependency, daemonSessionTaskListener), this.installableCache, daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public BInstallable[] findInstallables(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
this.init(daemonSessionTaskListener);
|
||||
BIFile[] bIFileArray = this.findInstallableFiles(bDependency, daemonSessionTaskListener);
|
||||
Class clazz = class$com$tridium$install$installable$BInstallable;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$BInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BInstallable;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
BInstallable bInstallable = this.installableCache.getInstallable(bIFileArray[n], daemonSessionTaskListener);
|
||||
if (bInstallable != null) {
|
||||
array.add((Object)bInstallable);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BInstallable[])array.trim();
|
||||
}
|
||||
|
||||
private static final boolean matchesDepend(BIFile bIFile, BDependency bDependency, PatternFilter[] patternFilterArray) {
|
||||
if (bIFile == null) {
|
||||
return false;
|
||||
}
|
||||
String string = bIFile.getExtension();
|
||||
if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST) ? !"jar".equals(string) && !"sjar".equals(string) : !"dist".equals(string) && LocalInstallableRegistry.getInstance().getInstallableTypeForExt(string) == null) {
|
||||
return false;
|
||||
}
|
||||
String string2 = bIFile.getFileName().substring(0, bIFile.getFileName().length() - string.length() - 1);
|
||||
int n = 0;
|
||||
while (n < patternFilterArray.length) {
|
||||
if (patternFilterArray[n].accept(string2)) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static final String[] getFixedFileNames(BDependency bDependency) {
|
||||
if (BPart.isWildcardName(bDependency.getPartName())) {
|
||||
return new String[0];
|
||||
}
|
||||
if (bDependency.getPartTypeSpec().equals((Object)MODULE_PART) || bDependency.getPartTypeSpec().equals((Object)MODULE_INST)) {
|
||||
return new String[]{bDependency.getPartName() + ".jar", bDependency.getPartName() + ".sjar"};
|
||||
}
|
||||
return new String[]{bDependency.getPartName() + ".dist"};
|
||||
}
|
||||
|
||||
public BIFile findInstallableFile(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
block14: {
|
||||
String[] stringArray;
|
||||
PatternFilter[] patternFilterArray;
|
||||
block12: {
|
||||
FilePath filePath;
|
||||
block13: {
|
||||
this.init(daemonSessionTaskListener);
|
||||
patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName());
|
||||
stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency);
|
||||
if (bDependency.getVersionRelation() != BVersionRelation.exact) break block12;
|
||||
filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString());
|
||||
if (stringArray.length != 0) break block13;
|
||||
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath);
|
||||
if (bDirectory == null) break block14;
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) {
|
||||
return bIFileArray[n];
|
||||
}
|
||||
++n;
|
||||
}
|
||||
break block14;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n]));
|
||||
if (bIFile != null) {
|
||||
return bIFile;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
break block14;
|
||||
}
|
||||
Array array = this.getVersionSubdirs();
|
||||
int n = 0;
|
||||
while (n < array.size()) {
|
||||
BDirectory bDirectory = (BDirectory)array.get(n);
|
||||
Version version = new Version(bDirectory.getFileName());
|
||||
if (BVersion.meets(version, bDependency)) {
|
||||
if (stringArray.length == 0) {
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n2 = 0;
|
||||
while (n2 < bIFileArray.length) {
|
||||
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) {
|
||||
return bIFileArray[n2];
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
} else {
|
||||
int n3 = 0;
|
||||
while (n3 < stringArray.length) {
|
||||
BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]);
|
||||
if (bIFile != null) {
|
||||
return bIFile;
|
||||
}
|
||||
++n3;
|
||||
}
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BIFile[] findInstallableFiles(BDependency bDependency, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
Array array;
|
||||
block13: {
|
||||
String[] stringArray;
|
||||
PatternFilter[] patternFilterArray;
|
||||
block15: {
|
||||
FilePath filePath;
|
||||
block16: {
|
||||
this.init(daemonSessionTaskListener);
|
||||
patternFilterArray = PatternFilter.parseList((String)bDependency.getPartName());
|
||||
stringArray = LocalInstallableRegistry.getFixedFileNames(bDependency);
|
||||
Class clazz = class$javax$baja$file$BIFile;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$file$BIFile = LocalInstallableRegistry.class("[Ljavax.baja.file.BIFile;", false);
|
||||
}
|
||||
array = new Array(clazz);
|
||||
if (bDependency.getVersionRelation() != BVersionRelation.exact) break block15;
|
||||
filePath = SW_PATH.merge(bDependency.getVersion().getVendorVersion().toString());
|
||||
if (stringArray.length != 0) break block16;
|
||||
BDirectory bDirectory = (BDirectory)BFileSystem.INSTANCE.findFile(filePath);
|
||||
if (bDirectory == null) break block13;
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n = 0;
|
||||
while (n < bIFileArray.length) {
|
||||
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n], bDependency, patternFilterArray)) {
|
||||
array.add((Object)bIFileArray[n]);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
break block13;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
BIFile bIFile = BFileSystem.INSTANCE.findFile(filePath.merge(stringArray[n]));
|
||||
if (bIFile != null) {
|
||||
array.add((Object)bIFile);
|
||||
break block13;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
break block13;
|
||||
}
|
||||
Array array2 = this.getVersionSubdirs();
|
||||
int n = 0;
|
||||
while (n < array2.size()) {
|
||||
BDirectory bDirectory = (BDirectory)array2.get(n);
|
||||
Version version = new Version(bDirectory.getFileName());
|
||||
if (BVersion.meets(version, bDependency)) {
|
||||
if (stringArray.length == 0) {
|
||||
BIFile[] bIFileArray = bDirectory.listFiles();
|
||||
int n2 = 0;
|
||||
while (n2 < bIFileArray.length) {
|
||||
if (LocalInstallableRegistry.matchesDepend(bIFileArray[n2], bDependency, patternFilterArray)) {
|
||||
array.add((Object)bIFileArray[n2]);
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
} else {
|
||||
int n3 = 0;
|
||||
while (n3 < stringArray.length) {
|
||||
BIFile bIFile = (BIFile)bDirectory.getNavChild(stringArray[n3]);
|
||||
if (bIFile != null) {
|
||||
array.add((Object)bIFile);
|
||||
break;
|
||||
}
|
||||
++n3;
|
||||
}
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
return (BIFile[])array.trim();
|
||||
}
|
||||
|
||||
public BInstallable findInstallable(String string, Version version, Type type, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
if (string.indexOf(46) > 0) {
|
||||
string = string.substring(0, string.indexOf(46));
|
||||
}
|
||||
if (version.isNull()) {
|
||||
return this.findInstallable(new BDependency(string, BVersion.ZERO, BVersionRelation.minimum, type.getTypeSpec()), daemonSessionTaskListener);
|
||||
}
|
||||
return this.findInstallable(new BDependency(string, new BVersion(version.toString()), BVersionRelation.exact, type.getTypeSpec()), daemonSessionTaskListener);
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener) throws Exception {
|
||||
return this.getInstallables(bl, daemonSessionTaskListener, null, null);
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string) throws Exception {
|
||||
return this.getInstallables(bl, daemonSessionTaskListener, string, null);
|
||||
}
|
||||
|
||||
public ClosableCursor getInstallables(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, String string, String string2) throws Exception {
|
||||
this.init(daemonSessionTaskListener);
|
||||
return new InstallableCursor(bl, daemonSessionTaskListener, FilenameFilterUtil.make(string, string2));
|
||||
}
|
||||
|
||||
public void addListener(RegistryListener registryListener) {
|
||||
this.listeners.add((Object)registryListener);
|
||||
}
|
||||
|
||||
public void removeListener(RegistryListener registryListener) {
|
||||
this.listeners.remove((Object)registryListener);
|
||||
}
|
||||
|
||||
private final void notifyRegistration(BInstallable bInstallable) {
|
||||
if (bInstallable == null) {
|
||||
return;
|
||||
}
|
||||
int n = 0;
|
||||
while (n < this.listeners.size()) {
|
||||
try {
|
||||
((RegistryListener)this.listeners.get(n)).installableRegistered(bInstallable);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public void registerInstallableFileType(String string, Type type) {
|
||||
this.installableTypesByFileExt.put(string, type);
|
||||
}
|
||||
|
||||
public Type getInstallableTypeForExt(String string) {
|
||||
return (Type)this.installableTypesByFileExt.get(string);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.initialized = false;
|
||||
this.installableCache = null;
|
||||
this.initializing = false;
|
||||
Class clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$installable$LocalInstallableRegistry$RegistryListener = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.LocalInstallableRegistry$RegistryListener;", false);
|
||||
}
|
||||
this.listeners = new Array(clazz);
|
||||
this.installableTypesByFileExt = new HashMap();
|
||||
}
|
||||
|
||||
private LocalInstallableRegistry() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
private static class InstallableCache {
|
||||
private TreeSet pathsNotFound = new TreeSet(FilePathComparator.INSTANCE);
|
||||
private TreeMap instByPath = new TreeMap(FilePathComparator.INSTANCE);
|
||||
|
||||
public void register(BIFile bIFile, BInstallable bInstallable) {
|
||||
this.register(bIFile.getFilePath(), bInstallable);
|
||||
}
|
||||
|
||||
public void register(FilePath filePath, BInstallable bInstallable) {
|
||||
this.pathsNotFound.remove(filePath);
|
||||
this.instByPath.put(filePath, bInstallable);
|
||||
}
|
||||
|
||||
public BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
return this.getInstallable(bIFile, daemonSessionTaskListener, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public BInstallable getInstallable(BIFile bIFile, DaemonSessionTaskListener daemonSessionTaskListener, DaemonSessionTask daemonSessionTask) {
|
||||
BInstallable bInstallable;
|
||||
block9: {
|
||||
if (bIFile == null) {
|
||||
return null;
|
||||
}
|
||||
if (this.pathsNotFound.contains(bIFile.getFilePath())) {
|
||||
return null;
|
||||
}
|
||||
bInstallable = (BInstallable)this.instByPath.get(bIFile.getFilePath());
|
||||
if (bInstallable != null) return bInstallable;
|
||||
if (daemonSessionTaskListener == null) {
|
||||
daemonSessionTaskListener = DaemonSessionTaskListener.NULL_TASK_LISTENER;
|
||||
}
|
||||
boolean bl = false;
|
||||
if (daemonSessionTask == null) {
|
||||
daemonSessionTask = new DaemonSessionTask(lex, "LocalInstallableRegistry.parse.genericTitle", "LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()});
|
||||
daemonSessionTaskListener.taskStarted(daemonSessionTask);
|
||||
bl = true;
|
||||
} else {
|
||||
daemonSessionTask.setMessage(lex.getText("LocalInstallableRegistry.parse", new Object[]{bIFile.getFilePath().getBody()}));
|
||||
daemonSessionTaskListener.taskUpdated(daemonSessionTask);
|
||||
}
|
||||
try {
|
||||
bInstallable = BInstallable.make(bIFile);
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var7_7 = null;
|
||||
if (!bl) throw throwable;
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var7_8 = null;
|
||||
if (bl) {
|
||||
daemonSessionTaskListener.taskFinished(daemonSessionTask);
|
||||
}
|
||||
if (bInstallable != null) break block9;
|
||||
this.pathsNotFound.add(bIFile.getFilePath());
|
||||
}
|
||||
return bInstallable;
|
||||
}
|
||||
this.instByPath.put(bIFile.getFilePath(), bInstallable);
|
||||
return bInstallable;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
protected static class InstallableFileCursor
|
||||
implements ClosableCursor {
|
||||
private BIFile[] files;
|
||||
private int index;
|
||||
private InstallableCache cache;
|
||||
private DaemonSessionTaskListener listener;
|
||||
static /* synthetic */ Class class$javax$baja$sys$BComponent;
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
if (this.index < 0 || this.index >= this.files.length) {
|
||||
return null;
|
||||
}
|
||||
return this.cache.getInstallable(this.files[this.index], this.listener);
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
if (this.index < this.files.length - 1) {
|
||||
++this.index;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean next(Class clazz) {
|
||||
boolean bl = this.next();
|
||||
while (bl && !clazz.isAssignableFrom(this.get().getClass())) {
|
||||
bl = this.next();
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
Class clazz = class$javax$baja$sys$BComponent;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$sys$BComponent = InstallableFileCursor.class("[Ljavax.baja.sys.BComponent;", false);
|
||||
}
|
||||
return this.next(clazz);
|
||||
}
|
||||
|
||||
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 InstallableFileCursor(BIFile[] bIFileArray, InstallableCache installableCache, DaemonSessionTaskListener daemonSessionTaskListener) {
|
||||
this.files = bIFileArray;
|
||||
this.index = -1;
|
||||
this.cache = installableCache;
|
||||
this.listener = daemonSessionTaskListener;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class InstallableCursor
|
||||
implements ClosableCursor {
|
||||
BInstallable current;
|
||||
Iterator iterator;
|
||||
DaemonSessionTaskListener listener;
|
||||
IFilter fileNameFilter;
|
||||
|
||||
public Context getContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public boolean next() {
|
||||
while (this.iterator.hasNext()) {
|
||||
FilePath filePath = (FilePath)this.iterator.next();
|
||||
if (!this.fileNameFilter.accept((Object)filePath)) continue;
|
||||
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
|
||||
if (this.current == null) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean nextComponent() {
|
||||
Class clazz = class$javax$baja$sys$BComponent;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$sys$BComponent = LocalInstallableRegistry.class("[Ljavax.baja.sys.BComponent;", false);
|
||||
}
|
||||
return this.next(clazz);
|
||||
}
|
||||
|
||||
public boolean nextDist() {
|
||||
while (this.iterator.hasNext()) {
|
||||
FilePath filePath = (FilePath)this.iterator.next();
|
||||
if (!this.fileNameFilter.accept((Object)filePath) || !"dist".equals(FileUtil.getExtension((String)filePath.getName()))) continue;
|
||||
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
|
||||
if (this.current == null) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean nextModule() {
|
||||
while (this.iterator.hasNext()) {
|
||||
FilePath filePath = (FilePath)this.iterator.next();
|
||||
if (!this.fileNameFilter.accept((Object)filePath) || !"jar".equals(FileUtil.getExtension((String)filePath.getName())) && !"sjar".equals(FileUtil.getExtension((String)filePath.getName())) && LocalInstallableRegistry.this.getInstallableTypeForExt(FileUtil.getExtension((String)filePath.getName())) == null) continue;
|
||||
this.current = LocalInstallableRegistry.this.installableCache.getInstallable(BFileSystem.INSTANCE.findFile(filePath), this.listener);
|
||||
if (this.current == null) continue;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public boolean next(Class var1_1) {
|
||||
block6: {
|
||||
block5: {
|
||||
v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable;
|
||||
if (v0 == null) {
|
||||
v0 = LocalInstallableRegistry.class$com$tridium$install$installable$BModuleInstallable = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BModuleInstallable;", false);
|
||||
}
|
||||
if (!v0.isAssignableFrom(var1_1)) break block5;
|
||||
while (this.nextModule()) {
|
||||
if (!var1_1.isInstance(this.current)) continue;
|
||||
return true;
|
||||
}
|
||||
break block6;
|
||||
}
|
||||
v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution;
|
||||
if (v1 == null) {
|
||||
v1 = LocalInstallableRegistry.class$com$tridium$install$installable$BDistribution = LocalInstallableRegistry.class("[Lcom.tridium.install.installable.BDistribution;", false);
|
||||
}
|
||||
if (!v1.isAssignableFrom(var1_1)) ** GOTO lbl20
|
||||
while (this.nextDist()) {
|
||||
if (!var1_1.isInstance(this.current)) continue;
|
||||
return true;
|
||||
}
|
||||
break block6;
|
||||
lbl-1000:
|
||||
// 1 sources
|
||||
|
||||
{
|
||||
if (!var1_1.isInstance(this.current)) continue;
|
||||
return true;
|
||||
lbl20:
|
||||
// 2 sources
|
||||
|
||||
** while (this.next())
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BObject get() {
|
||||
return this.current;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.current = null;
|
||||
}
|
||||
|
||||
public InstallableCursor(boolean bl, DaemonSessionTaskListener daemonSessionTaskListener, IFilter iFilter) {
|
||||
this.this();
|
||||
Class clazz = class$javax$baja$file$FilePath;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$file$FilePath = LocalInstallableRegistry.class("[Ljavax.baja.file.FilePath;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
HashSet<String> hashSet = new HashSet<String>();
|
||||
Array array2 = LocalInstallableRegistry.this.getVersionSubdirs();
|
||||
this.fileNameFilter = iFilter;
|
||||
this.listener = daemonSessionTaskListener == null ? DaemonSessionTaskListener.NULL_TASK_LISTENER : daemonSessionTaskListener;
|
||||
int n = 0;
|
||||
while (n < array2.size()) {
|
||||
BIFile[] bIFileArray = ((BDirectory)array2.get(n)).listFiles();
|
||||
int n2 = 0;
|
||||
while (n2 < bIFileArray.length) {
|
||||
FilePath filePath = bIFileArray[n2].getFilePath();
|
||||
String string = FileUtil.getExtension((String)filePath.getName());
|
||||
if (!(!"dist".equals(string) && !"jar".equals(string) && !"sjar".equals(string) && LocalInstallableRegistry.this.getInstallableTypeForExt(string) == null || bl && hashSet.contains(filePath.getName()))) {
|
||||
array.add((Object)filePath);
|
||||
hashSet.add(filePath.getName());
|
||||
}
|
||||
++n2;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
this.iterator = array.iterator();
|
||||
}
|
||||
}
|
||||
|
||||
public static interface RegistryListener {
|
||||
public void installableRegistered(BInstallable var1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,528 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.sys.LocalizableRuntimeException
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.xml.XContent
|
||||
* javax.baja.xml.XElem
|
||||
* javax.baja.xml.XParser
|
||||
* javax.baja.xml.XWriter
|
||||
*/
|
||||
package com.tridium.install.installable;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BModuleStatus;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.ListIterator;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.LocalizableRuntimeException;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.xml.XContent;
|
||||
import javax.baja.xml.XElem;
|
||||
import javax.baja.xml.XParser;
|
||||
import javax.baja.xml.XWriter;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class ModuleManifest {
|
||||
private XElem moduleElement;
|
||||
private HashMap typeByName;
|
||||
private Array types;
|
||||
private Array unknownElements;
|
||||
private HashMap dependencyByName;
|
||||
private HashMap moduleContentByPath;
|
||||
private XElem exclElement;
|
||||
private BModuleStatus status;
|
||||
private boolean noRunningStation;
|
||||
static /* synthetic */ Class class$javax$baja$xml$XElem;
|
||||
static /* synthetic */ Class class$com$tridium$install$BDependency;
|
||||
|
||||
public static ModuleManifest make(XElem xElem) {
|
||||
return xElem == null ? null : new ModuleManifest(xElem);
|
||||
}
|
||||
|
||||
public static ModuleManifest make(InputStream inputStream) {
|
||||
return ModuleManifest.make(inputStream, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed try catching itself - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
public static ModuleManifest make(InputStream inputStream, boolean bl) {
|
||||
ModuleManifest moduleManifest;
|
||||
block15: {
|
||||
ModuleManifest moduleManifest2;
|
||||
block14: {
|
||||
ModuleManifest moduleManifest3;
|
||||
block13: {
|
||||
try {
|
||||
try {
|
||||
XParser xParser = XParser.make((InputStream)inputStream);
|
||||
if (xParser.next() == -1) {
|
||||
moduleManifest3 = new ModuleManifest(BModuleStatus.corrupt);
|
||||
Object var3_8 = null;
|
||||
if (!bl) return moduleManifest3;
|
||||
break block13;
|
||||
}
|
||||
if (xParser.type() == 1 && xParser.elem().name().equals("module")) {
|
||||
moduleManifest2 = new ModuleManifest(xParser.elem(), xParser);
|
||||
break block14;
|
||||
}
|
||||
moduleManifest = new ModuleManifest(BModuleStatus.corrupt);
|
||||
break block15;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
ModuleManifest moduleManifest4 = new ModuleManifest(BModuleStatus.corrupt);
|
||||
Object var3_11 = null;
|
||||
if (!bl) return moduleManifest4;
|
||||
try {
|
||||
inputStream.close();
|
||||
return moduleManifest4;
|
||||
}
|
||||
catch (IOException iOException) {}
|
||||
return moduleManifest4;
|
||||
}
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var3_12 = null;
|
||||
if (!bl) throw throwable;
|
||||
try {}
|
||||
catch (IOException iOException) {
|
||||
throw throwable;
|
||||
}
|
||||
inputStream.close();
|
||||
throw throwable;
|
||||
}
|
||||
}
|
||||
try {}
|
||||
catch (IOException iOException) {}
|
||||
inputStream.close();
|
||||
return moduleManifest3;
|
||||
}
|
||||
Object var3_9 = null;
|
||||
if (!bl) return moduleManifest2;
|
||||
try {}
|
||||
catch (IOException iOException) {}
|
||||
inputStream.close();
|
||||
return moduleManifest2;
|
||||
}
|
||||
Object var3_10 = null;
|
||||
if (!bl) return moduleManifest;
|
||||
try {}
|
||||
catch (IOException iOException) {}
|
||||
inputStream.close();
|
||||
return moduleManifest;
|
||||
}
|
||||
|
||||
public void write(OutputStream outputStream) throws Exception {
|
||||
this.write(this.getModuleContent(), outputStream);
|
||||
}
|
||||
|
||||
public void write(BModuleContent bModuleContent, OutputStream outputStream) {
|
||||
try {
|
||||
Object object;
|
||||
BModuleContent bModuleContent2;
|
||||
Object object2;
|
||||
XWriter xWriter = new XWriter(outputStream);
|
||||
xWriter.prolog();
|
||||
XElem xElem = this.moduleElement.copy();
|
||||
xElem.addAttr("archiveDate", String.valueOf(new Date()));
|
||||
xElem.addAttr("archiveInstall", bModuleContent.getTag());
|
||||
try {
|
||||
xElem.addAttr("archiveHost", Sys.getLocalHost().getHostName());
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
XElem xElem2 = new XElem("dependencies");
|
||||
XElem xElem3 = null;
|
||||
XElem xElem4 = null;
|
||||
XElem xElem5 = this.dependencyByName.values().iterator();
|
||||
while (xElem5.hasNext()) {
|
||||
try {
|
||||
object2 = (BDependency)((Object)xElem5.next());
|
||||
if (((BDependency)((Object)object2)).getPartTypeSpec().equals((Object)BModulePart.TYPE.getTypeSpec())) {
|
||||
xElem2.addContent((XContent)((BDependency)((Object)object2)).getXml());
|
||||
continue;
|
||||
}
|
||||
if (xElem3 == null) {
|
||||
xElem3 = new XElem("installation");
|
||||
}
|
||||
if (xElem4 == null) {
|
||||
xElem4 = new XElem("dependencies");
|
||||
xElem3.addContent((XContent)xElem4);
|
||||
}
|
||||
xElem4.addContent((XContent)((BDependency)((Object)object2)).getXml());
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
xElem.addContent((XContent)xElem2);
|
||||
if (this.noRunningStation) {
|
||||
if (xElem3 == null) {
|
||||
xElem3 = new XElem("installation");
|
||||
}
|
||||
xElem3.addAttr("noRunningStation", "true");
|
||||
}
|
||||
if (this.exclElement != null) {
|
||||
if (xElem3 == null) {
|
||||
xElem3 = new XElem("installation");
|
||||
}
|
||||
xElem3.addContent((XContent)this.exclElement.copy());
|
||||
}
|
||||
if (xElem3 != null) {
|
||||
xElem.addContent((XContent)xElem3);
|
||||
}
|
||||
xElem5 = null;
|
||||
object2 = this.moduleContentByPath.keySet().iterator();
|
||||
while (object2.hasNext()) {
|
||||
try {
|
||||
String string = (String)object2.next();
|
||||
bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string));
|
||||
object = new XElem("dir");
|
||||
object.addAttr("name", string);
|
||||
object.addAttr("install", bModuleContent2.getTag());
|
||||
if (bModuleContent.getOrdinal() < bModuleContent2.getOrdinal()) {
|
||||
object.addAttr("stripped", "true");
|
||||
}
|
||||
if (xElem5 == null) {
|
||||
xElem5 = new XElem("dirs");
|
||||
}
|
||||
xElem5.addContent((XContent)object);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (xElem5 != null) {
|
||||
xElem.addContent(xElem5);
|
||||
}
|
||||
object2 = null;
|
||||
int n = 0;
|
||||
while (n < this.types.size()) {
|
||||
bModuleContent2 = (XElem)this.types.get(n);
|
||||
object = bModuleContent2.get("class").replace('.', '/');
|
||||
if (this.includePath((String)(object = ((String)object).substring(0, ((String)object).lastIndexOf(47))), bModuleContent)) {
|
||||
if (object2 == null) {
|
||||
object2 = new XElem("types");
|
||||
}
|
||||
object2.addContent((XContent)bModuleContent2.copy());
|
||||
}
|
||||
++n;
|
||||
}
|
||||
if (object2 != null) {
|
||||
xElem.addContent((XContent)object2);
|
||||
}
|
||||
ListIterator listIterator = this.unknownElements.iterator();
|
||||
while (listIterator.hasNext()) {
|
||||
xElem.addContent((XContent)((XElem)listIterator.next()).copy());
|
||||
}
|
||||
xElem.write(xWriter);
|
||||
xWriter.flush();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new LocalizableRuntimeException("platform", "ModulePart.exception.writeXml", (Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
public String getArchiveDate() {
|
||||
return this.moduleElement.get("archiveDate", "");
|
||||
}
|
||||
|
||||
public String getArchiveHost() {
|
||||
return this.moduleElement.get("archiveHost", "");
|
||||
}
|
||||
|
||||
public BAbsTime getBuildAbsTime() {
|
||||
String string = this.moduleElement.get("buildMillis", null);
|
||||
if (string == null) {
|
||||
return BAbsTime.NULL;
|
||||
}
|
||||
long l = Long.parseLong(string);
|
||||
return BAbsTime.make((long)l);
|
||||
}
|
||||
|
||||
public String getBuildDate() {
|
||||
return this.moduleElement.get("buildDate", "");
|
||||
}
|
||||
|
||||
public String getBuildHost() {
|
||||
return this.moduleElement.get("buildHost", "");
|
||||
}
|
||||
|
||||
public BDependency[] getDependencies() {
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
Iterator iterator = this.dependencyByName.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
array.add(iterator.next());
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public BDependency getDependency(String string) {
|
||||
return (BDependency)((Object)this.dependencyByName.get(string));
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.moduleElement.get("description", "");
|
||||
}
|
||||
|
||||
public BDependency[] getExclusions() {
|
||||
if (this.exclElement == null) {
|
||||
return new BDependency[0];
|
||||
}
|
||||
XElem[] xElemArray = this.exclElement.elems();
|
||||
Class clazz = class$com$tridium$install$BDependency;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$BDependency = ModuleManifest.class("[Lcom.tridium.install.BDependency;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
BDependency bDependency = BDependency.make(xElemArray[n]);
|
||||
if (bDependency != null) {
|
||||
array.add((Object)bDependency);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return (BDependency[])array.trim();
|
||||
}
|
||||
|
||||
public BModuleContent getModuleContent() {
|
||||
return BModuleContent.make(this.moduleElement.get("archiveInstall", "doc"));
|
||||
}
|
||||
|
||||
public BModuleContent getModuleContentForPath(String string) {
|
||||
return this.getModuleContentForPath(string, this.getModuleContent());
|
||||
}
|
||||
|
||||
public BModuleContent getModuleContentForPath(String string, BModuleContent bModuleContent) {
|
||||
BModuleContent bModuleContent2 = (BModuleContent)((Object)this.moduleContentByPath.get(string));
|
||||
return bModuleContent2 == null ? bModuleContent : bModuleContent2;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.moduleElement.get("name");
|
||||
}
|
||||
|
||||
public String getPreferredSymbol() {
|
||||
return this.moduleElement.get("preferredSymbol", "");
|
||||
}
|
||||
|
||||
public BModuleStatus getStatus() {
|
||||
return this.status;
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return new BVersion(this.moduleElement.get("vendor", ""), this.moduleElement.get("vendorVersion", this.moduleElement.get("version", "0")));
|
||||
}
|
||||
|
||||
public boolean includePath(String string, BModuleContent bModuleContent) {
|
||||
boolean bl;
|
||||
BModuleContent bModuleContent2 = string.startsWith("doc/") ? BModuleContent.doc : this.getModuleContentForPath(string, null);
|
||||
if (bModuleContent2 == null) {
|
||||
bl = true;
|
||||
} else {
|
||||
boolean bl2 = false;
|
||||
if (bModuleContent.getOrdinal() >= bModuleContent2.getOrdinal()) {
|
||||
bl2 = true;
|
||||
}
|
||||
bl = bl2;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean noRunningStation() {
|
||||
return this.noRunningStation;
|
||||
}
|
||||
|
||||
public void setNoRunningStation(boolean bl) {
|
||||
this.noRunningStation = bl;
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return this.moduleElement.getb("installable", true);
|
||||
}
|
||||
|
||||
public boolean isNreModule() {
|
||||
boolean bl = false;
|
||||
if (this.moduleElement.getb("nre", true) && this.isInstallable()) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
private final boolean loadManifestHeader(XElem xElem) {
|
||||
if (!xElem.name().equals("module")) {
|
||||
this.status = BModuleStatus.misnamed;
|
||||
return false;
|
||||
}
|
||||
this.moduleElement = xElem.copy();
|
||||
this.moduleElement.clearContent();
|
||||
return true;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.moduleElement = null;
|
||||
this.typeByName = new HashMap();
|
||||
Class clazz = class$javax$baja$xml$XElem;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false);
|
||||
}
|
||||
this.types = new Array(clazz);
|
||||
Class clazz2 = class$javax$baja$xml$XElem;
|
||||
if (clazz2 == null) {
|
||||
clazz2 = class$javax$baja$xml$XElem = ModuleManifest.class("[Ljavax.baja.xml.XElem;", false);
|
||||
}
|
||||
this.unknownElements = new Array(clazz2);
|
||||
this.dependencyByName = new HashMap();
|
||||
this.moduleContentByPath = new HashMap();
|
||||
this.exclElement = null;
|
||||
this.status = null;
|
||||
this.noRunningStation = false;
|
||||
}
|
||||
|
||||
private ModuleManifest(XElem xElem) {
|
||||
this.this();
|
||||
if (!this.loadManifestHeader(xElem)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
XElem[] xElemArray = xElem.elems();
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
XElem xElem2;
|
||||
if (xElemArray[n].name().equals("dirs")) {
|
||||
xElem2 = xElemArray[n].elems("dir");
|
||||
int n2 = 0;
|
||||
while (n2 < ((XElem[])xElem2).length) {
|
||||
this.moduleContentByPath.put(xElem2[n2].get("name"), BModuleContent.make(xElem2[n2].get("install", "doc")));
|
||||
++n2;
|
||||
}
|
||||
} else if (xElemArray[n].name().equals("dependencies")) {
|
||||
xElem2 = xElemArray[n].elems("dependency");
|
||||
int n3 = 0;
|
||||
while (n3 < ((XElem[])xElem2).length) {
|
||||
this.dependencyByName.put(xElem2[n3].get("name"), BDependency.make(xElem2[n3]));
|
||||
++n3;
|
||||
}
|
||||
} else if (xElemArray[n].name().equals("types")) {
|
||||
xElem2 = xElemArray[n].elems("type");
|
||||
int n4 = 0;
|
||||
while (n4 < ((XElem[])xElem2).length) {
|
||||
this.typeByName.put(xElem2[n4].get("name"), xElem2[n4]);
|
||||
this.types.add((Object)xElem2[n4]);
|
||||
++n4;
|
||||
}
|
||||
} else if (xElemArray[n].name().equals("installation")) {
|
||||
this.noRunningStation = xElemArray[n].getb("noRunningStation", this.getName().equals("baja"));
|
||||
xElem2 = xElemArray[n].elem("dependencies");
|
||||
this.exclElement = xElemArray[n].elem("exclusions");
|
||||
if (xElem2 != null) {
|
||||
XElem[] xElemArray2 = xElem2.elems();
|
||||
int n5 = 0;
|
||||
while (n5 < xElemArray2.length) {
|
||||
BDependency bDependency = BDependency.make(xElemArray2[n5]);
|
||||
if (bDependency != null) {
|
||||
if (bDependency.getPartName().startsWith("nre-core") && xElemArray2[n5].get("solvers", null) == null) {
|
||||
bDependency.setSolverFiltersString("commissioning");
|
||||
}
|
||||
this.dependencyByName.put(bDependency.getPartName(), bDependency);
|
||||
}
|
||||
++n5;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.unknownElements.add((Object)xElemArray[n]);
|
||||
}
|
||||
++n;
|
||||
}
|
||||
this.status = BModuleStatus.ok;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
this.status = BModuleStatus.corrupt;
|
||||
}
|
||||
}
|
||||
|
||||
private ModuleManifest(XElem xElem, XParser xParser) throws Exception {
|
||||
this.this();
|
||||
if (this.loadManifestHeader(xElem)) {
|
||||
while (xParser.next() != -1) {
|
||||
Object object;
|
||||
if (xParser.type() != 1) continue;
|
||||
if (xParser.elem().name().equals("dir")) {
|
||||
this.moduleContentByPath.put(xParser.elem().get("name"), BModuleContent.make(xParser.elem().get("install", "doc")));
|
||||
continue;
|
||||
}
|
||||
if (xParser.elem().name().equals("dependency")) {
|
||||
this.dependencyByName.put(xParser.elem().get("name"), BDependency.make(xParser.elem()));
|
||||
continue;
|
||||
}
|
||||
if (xParser.elem().name().equals("exclusions")) {
|
||||
this.exclElement = xParser.parseCurrent(false);
|
||||
continue;
|
||||
}
|
||||
if (xParser.depth() > 1 && xParser.elem(xParser.depth() - 2).name().equals("dependencies")) {
|
||||
object = BDependency.make(xParser.elem());
|
||||
if (object == null) continue;
|
||||
if (object.getPartName().startsWith("nre-core") && xParser.elem().get("solvers", null) == null) {
|
||||
object.setSolverFiltersString("commissioning");
|
||||
}
|
||||
this.dependencyByName.put(object.getPartName(), object);
|
||||
continue;
|
||||
}
|
||||
if (xParser.elem().name().equals("type")) {
|
||||
object = xParser.parseCurrent(false);
|
||||
this.typeByName.put(xParser.elem().get("name"), object);
|
||||
this.types.add(object);
|
||||
continue;
|
||||
}
|
||||
if (xParser.elem().name().equals("installation")) {
|
||||
this.noRunningStation = xParser.elem().getb("noRunningStation", this.getName().equals("baja"));
|
||||
continue;
|
||||
}
|
||||
if (xParser.elem().name().equals("types") || xParser.elem().name().equals("dependencies") || xParser.elem().name().equals("dirs") || xParser.depth() != 2) continue;
|
||||
this.unknownElements.add((Object)xParser.parseCurrent(false));
|
||||
}
|
||||
this.status = BModuleStatus.ok;
|
||||
}
|
||||
}
|
||||
|
||||
private ModuleManifest(BModuleStatus bModuleStatus) {
|
||||
this.this();
|
||||
this.status = bModuleStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BApplicationPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BApplicationPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BApplicationPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("app")) {
|
||||
System.out.println("make BApplicationPart: " + xElem.get("name") + ' ' + BApplicationPart.getVendorVersion(xElem));
|
||||
return new BApplicationPart(xElem.get("name"), new BVersion("", BApplicationPart.getVendorVersion(xElem)), bInstallable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("app");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
if (this.getVersion().getVendor().trim().length() > 0) {
|
||||
xElem.setAttr("vendor", this.getVersion().getVendor());
|
||||
}
|
||||
if (this.getVersion().getVendorVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("version", this.getVersion().getVendorVersionString());
|
||||
}
|
||||
if (this.getDescription().trim().length() > 0) {
|
||||
xElem.setAttr("description", this.getDescription());
|
||||
}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "App Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion());
|
||||
}
|
||||
|
||||
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 BApplicationPart() {
|
||||
}
|
||||
|
||||
public BApplicationPart(String string, String string2) {
|
||||
this.setPartName(string);
|
||||
this.setVersion(new BVersion(string2));
|
||||
}
|
||||
|
||||
public BApplicationPart(String string, BVersion bVersion) {
|
||||
this.setPartName(string);
|
||||
this.setVersion(bVersion);
|
||||
}
|
||||
|
||||
public BApplicationPart(String string, BVersion bVersion, BInstallable bInstallable) {
|
||||
this(string, bVersion);
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BApplicationPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BApplicationPart = BApplicationPart.class("[Lcom.tridium.install.part.BApplicationPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BArchPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BArchPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BArchPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
return new BArchPart(xElem.get("name"), bInstallable);
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("arch");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return this.getPartName().equals("nullarch");
|
||||
}
|
||||
|
||||
public static BArchPart makeNull() {
|
||||
return new BArchPart("nullarch", null);
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Arch Part: " + this.getPartName();
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BArchPart() {
|
||||
}
|
||||
|
||||
public BArchPart(String string, BInstallable bInstallable) {
|
||||
this.setPartName(string);
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BArchPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BArchPart = BArchPart.class("[Lcom.tridium.install.part.BArchPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BBrandPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
public static final String NO_BRAND = "noBrand";
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BBrandPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && (this.isNull() || this.matchesName(bDependency.getPartName()))) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BBrandPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("brand")) {
|
||||
String string = xElem.get("name", NO_BRAND);
|
||||
if (string.trim().length() == 0) {
|
||||
string = NO_BRAND;
|
||||
}
|
||||
return new BBrandPart(string, bInstallable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("brand");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Brand Part: " + this.getPartName();
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
boolean bl = false;
|
||||
if (this.getPartName().equals(NO_BRAND) || this.getPartName().equals("disabled") || this.getPartName().equals("nullos")) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BBrandPart makeNull() {
|
||||
return new BBrandPart(NO_BRAND, null);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BBrandPart() {
|
||||
}
|
||||
|
||||
public BBrandPart(String string, BInstallable bInstallable) {
|
||||
this.setPartName(string);
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BBrandPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BBrandPart = BBrandPart.class("[Lcom.tridium.install.part.BBrandPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BGenericPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BGenericPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BGenericPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("part")) {
|
||||
return new BGenericPart(xElem.get("name"), xElem.get("description", ""), bInstallable, new BVersion(BGenericPart.getVendorVersion(xElem)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Part: " + this.getPartName();
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BGenericPart() {
|
||||
}
|
||||
|
||||
public BGenericPart(String string, String string2) {
|
||||
this(string, string2, null, BVersion.makeZero());
|
||||
}
|
||||
|
||||
public BGenericPart(String string, String string2, BInstallable bInstallable) {
|
||||
this(string, string2, bInstallable, BVersion.makeZero());
|
||||
}
|
||||
|
||||
public BGenericPart(String string, String string2, BInstallable bInstallable, BVersion bVersion) {
|
||||
this.setPartName(string);
|
||||
this.setDescription(string2);
|
||||
this.setInstallable(bInstallable);
|
||||
this.setVersion(bVersion);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BGenericPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BGenericPart = BGenericPart.class("[Lcom.tridium.install.part.BGenericPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BGenericPart;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BModelPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BModelPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (!this.isNull() && (bDependency.getPartType().is(TYPE) || bDependency.getPartType().is(BGenericPart.TYPE)) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BModelPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("model")) {
|
||||
return new BModelPart(xElem.get("name"), bInstallable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Model Part: " + this.getPartName();
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return this.getPartName().equals("");
|
||||
}
|
||||
|
||||
public static BModelPart makeNull() {
|
||||
return new BModelPart("", null);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BModelPart() {
|
||||
}
|
||||
|
||||
public BModelPart(String string, BInstallable bInstallable) {
|
||||
this.setPartName(string);
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BModelPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BModelPart = BModelPart.class("[Lcom.tridium.install.part.BModelPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,747 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.sys.registry.NModuleInfo
|
||||
* javax.baja.file.BFileSystem
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.file.FileUtil
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.BajaRuntimeException
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.LocalizableRuntimeException
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDaemonPlatform;
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BRemoteDaemonPlatform;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.ClassCondenser;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.installable.BModuleInstallable;
|
||||
import com.tridium.install.installable.ModuleManifest;
|
||||
import com.tridium.install.part.BModuleStatus;
|
||||
import com.tridium.install.part.BPart;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.BModuleContent;
|
||||
import com.tridium.platform.daemon.DaemonFileUtil;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.sys.registry.NModuleInfo;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
import javax.baja.file.BFileSystem;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.file.FileUtil;
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.platform.install.BVersionRelation;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.LocalizableRuntimeException;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BModulePart
|
||||
extends BPart {
|
||||
public static final Property status = BModulePart.newProperty((int)1, (BValue)BModuleStatus.ok, null);
|
||||
public static final Property buildDate = BModulePart.newProperty((int)1, (String)"", null);
|
||||
public static final Property buildAbsTime = BModulePart.newProperty((int)1, (BValue)BAbsTime.NULL, null);
|
||||
public static final Property buildHost = BModulePart.newProperty((int)1, (String)"", null);
|
||||
public static final Property archiveDate = BModulePart.newProperty((int)1, (String)"", null);
|
||||
public static final Property archiveHost = BModulePart.newProperty((int)1, (String)"", null);
|
||||
public static final Property archiveContent = BModulePart.newProperty((int)1, (BValue)BModuleContent.doc, null);
|
||||
public static final Property preferredSymbol = BModulePart.newProperty((int)1, (String)"", null);
|
||||
public static final Property fileSize = BModulePart.newProperty((int)1, (int)-1, null);
|
||||
public static final Property synthetic = BModulePart.newProperty((int)1, (boolean)false, null);
|
||||
public static final Property exclusions = BModulePart.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property isNre = BModulePart.newProperty((int)1, (boolean)true, null);
|
||||
public static final Property isInstallable = BModulePart.newProperty((int)1, (boolean)true, null);
|
||||
public static final Type TYPE;
|
||||
public static final FilePath MODULES_PATH;
|
||||
public static final FilePath LIB_PATH;
|
||||
private static final BIcon icon;
|
||||
private BIFile file;
|
||||
private boolean localInstance;
|
||||
private boolean summaryInitialized;
|
||||
private boolean dependsInitialized;
|
||||
private ModuleManifest manifest;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BModulePart;
|
||||
|
||||
public BModuleStatus getStatus() {
|
||||
return (BModuleStatus)this.get(status);
|
||||
}
|
||||
|
||||
public void setStatus(BModuleStatus bModuleStatus) {
|
||||
this.set(status, (BValue)bModuleStatus, null);
|
||||
}
|
||||
|
||||
public String getBuildDate() {
|
||||
return this.getString(buildDate);
|
||||
}
|
||||
|
||||
public void setBuildDate(String string) {
|
||||
this.setString(buildDate, string, null);
|
||||
}
|
||||
|
||||
public BAbsTime getBuildAbsTime() {
|
||||
return (BAbsTime)this.get(buildAbsTime);
|
||||
}
|
||||
|
||||
public void setBuildAbsTime(BAbsTime bAbsTime) {
|
||||
this.set(buildAbsTime, (BValue)bAbsTime, null);
|
||||
}
|
||||
|
||||
public String getBuildHost() {
|
||||
return this.getString(buildHost);
|
||||
}
|
||||
|
||||
public void setBuildHost(String string) {
|
||||
this.setString(buildHost, string, null);
|
||||
}
|
||||
|
||||
public String getArchiveDate() {
|
||||
return this.getString(archiveDate);
|
||||
}
|
||||
|
||||
public void setArchiveDate(String string) {
|
||||
this.setString(archiveDate, string, null);
|
||||
}
|
||||
|
||||
public String getArchiveHost() {
|
||||
return this.getString(archiveHost);
|
||||
}
|
||||
|
||||
public void setArchiveHost(String string) {
|
||||
this.setString(archiveHost, string, null);
|
||||
}
|
||||
|
||||
public BModuleContent getArchiveContent() {
|
||||
return (BModuleContent)this.get(archiveContent);
|
||||
}
|
||||
|
||||
public void setArchiveContent(BModuleContent bModuleContent) {
|
||||
this.set(archiveContent, (BValue)bModuleContent, null);
|
||||
}
|
||||
|
||||
public String getPreferredSymbol() {
|
||||
return this.getString(preferredSymbol);
|
||||
}
|
||||
|
||||
public void setPreferredSymbol(String string) {
|
||||
this.setString(preferredSymbol, string, null);
|
||||
}
|
||||
|
||||
public long getFileSize() {
|
||||
return this.getLong(fileSize);
|
||||
}
|
||||
|
||||
public void setFileSize(long l) {
|
||||
this.setLong(fileSize, l, null);
|
||||
}
|
||||
|
||||
public boolean getSynthetic() {
|
||||
return this.getBoolean(synthetic);
|
||||
}
|
||||
|
||||
public void setSynthetic(boolean bl) {
|
||||
this.setBoolean(synthetic, bl, null);
|
||||
}
|
||||
|
||||
public BVector getExclusions() {
|
||||
return (BVector)this.get(exclusions);
|
||||
}
|
||||
|
||||
public void setExclusions(BVector bVector) {
|
||||
this.set(exclusions, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public boolean getIsNre() {
|
||||
return this.getBoolean(isNre);
|
||||
}
|
||||
|
||||
public void setIsNre(boolean bl) {
|
||||
this.setBoolean(isNre, bl, null);
|
||||
}
|
||||
|
||||
public boolean getIsInstallable() {
|
||||
return this.getBoolean(isInstallable);
|
||||
}
|
||||
|
||||
public void setIsInstallable(boolean bl) {
|
||||
this.setBoolean(isInstallable, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static BModulePart make(BIFile bIFile) {
|
||||
BModuleInstallable bModuleInstallable = BModuleInstallable.make(bIFile, true);
|
||||
return bModuleInstallable == null ? null : bModuleInstallable.getModulePart();
|
||||
}
|
||||
|
||||
public static BModulePart make(BIFile bIFile, boolean bl) {
|
||||
BModuleInstallable bModuleInstallable = BModuleInstallable.make(bIFile, bl);
|
||||
return bModuleInstallable == null ? null : bModuleInstallable.getModulePart();
|
||||
}
|
||||
|
||||
public static BModulePart make(String string, XElem xElem) {
|
||||
if (string == null) {
|
||||
return null;
|
||||
}
|
||||
BModulePart bModulePart = new BModulePart();
|
||||
bModulePart.setPartName(string);
|
||||
if (xElem == null) {
|
||||
bModulePart.setStatus(BModuleStatus.nomanifest);
|
||||
} else {
|
||||
bModulePart.loadManifest(xElem);
|
||||
}
|
||||
return bModulePart;
|
||||
}
|
||||
|
||||
public static BModulePart make(BIFile bIFile, BInstallable bInstallable) {
|
||||
try {
|
||||
InputStream inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml"));
|
||||
if (inputStream == null) {
|
||||
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("meta-inf/module.xml"));
|
||||
}
|
||||
if (inputStream == null) {
|
||||
inputStream = DaemonFileUtil.getZipStream(bIFile, new FilePath("META-INF/module.xml"));
|
||||
}
|
||||
if (inputStream == null) {
|
||||
return null;
|
||||
}
|
||||
return new BModulePart(bIFile, inputStream, bInstallable);
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "ModulePart.exception.manifestRead", new Object[]{bIFile.getFilePath()}, (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
this.initSummary();
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public BVector getDependencies() {
|
||||
if (!this.dependsInitialized) {
|
||||
this.init();
|
||||
}
|
||||
return super.getDependencies();
|
||||
}
|
||||
|
||||
public void initSummary() {
|
||||
if (!this.summaryInitialized) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
if (this.manifest != null || !this.localInstance || !this.getInstallable().getIsValid()) {
|
||||
return;
|
||||
}
|
||||
if (this.file != null) {
|
||||
try {
|
||||
InputStream inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("META-INF/module.xml"));
|
||||
if (inputStream == null) {
|
||||
inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("meta-inf/module.xml"));
|
||||
}
|
||||
if (inputStream == null) {
|
||||
inputStream = DaemonFileUtil.getZipStream(this.file, new FilePath("META-INF/module.xml"));
|
||||
}
|
||||
this.loadManifest(inputStream);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException((Throwable)exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BDependency getDependency(String string) {
|
||||
return (BDependency)this.getDependencies().get(SlotPath.escape((String)string));
|
||||
}
|
||||
|
||||
public FilePath getDestinationPath() {
|
||||
if (!this.getSynthetic()) {
|
||||
return MODULES_PATH.merge(this.getPartName() + ".jar");
|
||||
}
|
||||
return MODULES_PATH.merge(this.getPartName() + ".sjar");
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModulePart");
|
||||
}
|
||||
try {
|
||||
return this.file.getInputStream();
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "LocalModulePart.exception.notFound", new Object[]{this.file.getFilePath()}, (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
public ModuleManifest getManifest() {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModulePart");
|
||||
}
|
||||
this.init();
|
||||
return this.manifest;
|
||||
}
|
||||
|
||||
public BVersion getVersionRequired(String string) {
|
||||
BDependency bDependency = this.getDependency(string);
|
||||
return bDependency == null ? BVersion.ZERO : bDependency.getVersion();
|
||||
}
|
||||
|
||||
public Set getRequiredModuleNames() {
|
||||
Property[] propertyArray = this.getDependencies().getPropertiesArray();
|
||||
HashSet<String> hashSet = new HashSet<String>();
|
||||
int n = 0;
|
||||
while (n < propertyArray.length) {
|
||||
hashSet.add(propertyArray[n].getName());
|
||||
++n;
|
||||
}
|
||||
return hashSet;
|
||||
}
|
||||
|
||||
public boolean isUpgradeFor(BModulePart bModulePart) {
|
||||
this.initSummary();
|
||||
if (bModulePart.getVersion().meetsVersionRequirement(this.getVersion(), BVersionRelation.minimum)) {
|
||||
return bModulePart.getBuildAbsTime() != null && this.getBuildAbsTime() != null && this.getBuildAbsTime().compareTo((Object)bModulePart.getBuildAbsTime()) > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isUpdateFor(BModulePart bModulePart) {
|
||||
return this.isUpdateFor(bModulePart, null);
|
||||
}
|
||||
|
||||
public boolean isUpdateFor(BModulePart bModulePart, BDaemonPlatform bDaemonPlatform) {
|
||||
this.initSummary();
|
||||
if (bDaemonPlatform != null && bDaemonPlatform.getModuleContent() != bModulePart.getArchiveContent()) {
|
||||
return true;
|
||||
}
|
||||
if (bModulePart.getVersion().equivalent((Object)this.getVersion())) {
|
||||
return bModulePart.getBuildAbsTime() == null || this.getBuildAbsTime() == null || !this.getBuildAbsTime().equals((Object)bModulePart.getBuildAbsTime());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Module: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion());
|
||||
}
|
||||
|
||||
public void writePackageArchive(BDaemonPlatform bDaemonPlatform, ZipOutputStream zipOutputStream) throws Exception {
|
||||
this.writePackageArchive(bDaemonPlatform.getModuleContent(), bDaemonPlatform.getStripLineNumbers(), zipOutputStream);
|
||||
}
|
||||
|
||||
public void writePackageArchive(BModuleContent bModuleContent, boolean bl, ZipOutputStream zipOutputStream) throws Exception {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModulePart");
|
||||
}
|
||||
this.init();
|
||||
try {
|
||||
ZipEntry zipEntry;
|
||||
ZipInputStream zipInputStream = new ZipInputStream(this.getInputStream());
|
||||
ClassCondenser classCondenser = new ClassCondenser();
|
||||
while ((zipEntry = zipInputStream.getNextEntry()) != null) {
|
||||
Object object;
|
||||
if (zipEntry.getName().equalsIgnoreCase("meta-inf/module.xml")) {
|
||||
object = new ByteArrayOutputStream();
|
||||
this.getManifest().write(bModuleContent, (OutputStream)object);
|
||||
ZipEntry zipEntry2 = new ZipEntry(zipEntry.getName());
|
||||
zipEntry2.setSize(((ByteArrayOutputStream)object).size());
|
||||
zipEntry2.setTime(System.currentTimeMillis());
|
||||
zipOutputStream.putNextEntry(zipEntry2);
|
||||
zipOutputStream.write(((ByteArrayOutputStream)object).toByteArray(), 0, ((ByteArrayOutputStream)object).size());
|
||||
zipOutputStream.closeEntry();
|
||||
continue;
|
||||
}
|
||||
if (!this.getManifest().includePath(this.getDirectoryName(zipEntry), bModuleContent)) continue;
|
||||
if (bl && zipEntry.getName().endsWith(".class")) {
|
||||
zipOutputStream.putNextEntry(new ZipEntry(zipEntry.getName()));
|
||||
classCondenser.condense(zipInputStream, zipOutputStream, false);
|
||||
} else {
|
||||
zipOutputStream.putNextEntry(new ZipEntry(zipEntry));
|
||||
object = new byte[65000];
|
||||
int n = zipInputStream.read((byte[])object);
|
||||
while (n >= 0) {
|
||||
zipOutputStream.write((byte[])object, 0, n);
|
||||
n = zipInputStream.read((byte[])object);
|
||||
}
|
||||
}
|
||||
zipOutputStream.closeEntry();
|
||||
}
|
||||
zipInputStream.close();
|
||||
}
|
||||
catch (IOException iOException) {
|
||||
throw new LocalizableRuntimeException("platform", "ModulePart.exception.writePackageArchive", new Object[]{this.getPartName()}, (Throwable)iOException);
|
||||
}
|
||||
}
|
||||
|
||||
private final void loadManifest(XElem xElem) {
|
||||
this.loadManifest(ModuleManifest.make(xElem));
|
||||
}
|
||||
|
||||
private final void loadManifest(InputStream inputStream) {
|
||||
this.loadManifest(inputStream, true);
|
||||
}
|
||||
|
||||
private final void loadManifest(InputStream inputStream, boolean bl) {
|
||||
this.loadManifest(ModuleManifest.make(inputStream, bl));
|
||||
}
|
||||
|
||||
private final void loadManifest(ModuleManifest moduleManifest) {
|
||||
this.manifest = moduleManifest;
|
||||
this.setStatus(moduleManifest.getStatus());
|
||||
if (!this.summaryInitialized) {
|
||||
this.setPartName(moduleManifest.getName());
|
||||
this.setBuildAbsTime(moduleManifest.getBuildAbsTime());
|
||||
this.setVersion((BVersion)moduleManifest.getVersion().newCopy());
|
||||
this.setDescription(moduleManifest.getDescription());
|
||||
this.setArchiveContent(moduleManifest.getModuleContent());
|
||||
this.summaryInitialized = true;
|
||||
}
|
||||
if (!this.dependsInitialized) {
|
||||
BVector bVector = (BVector)this.get(dependencies);
|
||||
bVector.removeAll();
|
||||
BDependency[] bDependencyArray = moduleManifest.getDependencies();
|
||||
int n = 0;
|
||||
while (n < bDependencyArray.length) {
|
||||
bVector.add(SlotPath.escape((String)bDependencyArray[n].getPartName()), bDependencyArray[n].newCopy());
|
||||
++n;
|
||||
}
|
||||
BDependency[] bDependencyArray2 = moduleManifest.getExclusions();
|
||||
bVector = (BVector)this.get(exclusions);
|
||||
bVector.removeAll();
|
||||
int n2 = 0;
|
||||
while (n2 < bDependencyArray2.length) {
|
||||
bVector.add("excl?", (BValue)bDependencyArray2[n2]);
|
||||
++n2;
|
||||
}
|
||||
this.dependsInitialized = true;
|
||||
}
|
||||
this.setBuildDate(moduleManifest.getBuildDate());
|
||||
this.setBuildHost(moduleManifest.getBuildHost());
|
||||
this.setArchiveDate(moduleManifest.getArchiveDate());
|
||||
this.setArchiveHost(moduleManifest.getArchiveHost());
|
||||
this.setPreferredSymbol(moduleManifest.getPreferredSymbol());
|
||||
this.setIsNre(moduleManifest.isNreModule());
|
||||
this.setIsInstallable(moduleManifest.isInstallable());
|
||||
}
|
||||
|
||||
private final String getDirectoryName(ZipEntry zipEntry) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModulePart");
|
||||
}
|
||||
if (zipEntry.isDirectory()) {
|
||||
return zipEntry.getName();
|
||||
}
|
||||
int n = zipEntry.getName().lastIndexOf(47);
|
||||
if (n < 0) {
|
||||
return "";
|
||||
}
|
||||
return zipEntry.getName().substring(0, n);
|
||||
}
|
||||
|
||||
public long getFilteredFileSize(BDaemonPlatform bDaemonPlatform) {
|
||||
return this.getFilteredFileSize(bDaemonPlatform.getModuleContent(), bDaemonPlatform.getStripLineNumbers());
|
||||
}
|
||||
|
||||
public long getFilteredFileSize(BModuleContent bModuleContent, boolean bl) {
|
||||
if (this.localInstance && bModuleContent != BModuleContent.doc) {
|
||||
try {
|
||||
ByteCounter byteCounter = new ByteCounter();
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(byteCounter);
|
||||
this.writePackageArchive(bModuleContent, bl, zipOutputStream);
|
||||
zipOutputStream.closeEntry();
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
byteCounter.flush();
|
||||
byteCounter.close();
|
||||
return byteCounter.size();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
return this.getInstallable().getInstallableFileSize();
|
||||
}
|
||||
|
||||
public boolean canMakeTransferElements() {
|
||||
return this.localInstance;
|
||||
}
|
||||
|
||||
public FileTransferMessageElement makeTransferElement(BDaemonPlatform bDaemonPlatform) {
|
||||
if (!this.localInstance) {
|
||||
throw new IllegalStateException("illegal call on proxy instance of BModuleInstallable");
|
||||
}
|
||||
return new ModuleFileTransferElement(this, bDaemonPlatform.getDaemonSession());
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.file = null;
|
||||
this.localInstance = false;
|
||||
this.summaryInitialized = false;
|
||||
this.dependsInitialized = false;
|
||||
this.manifest = null;
|
||||
}
|
||||
|
||||
public BModulePart() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BModulePart(BIFile bIFile, NModuleInfo nModuleInfo, BInstallable bInstallable) {
|
||||
this.this();
|
||||
this.file = bIFile;
|
||||
this.localInstance = true;
|
||||
this.setInstallable(bInstallable);
|
||||
this.setStatus(BModuleStatus.ok);
|
||||
this.setFileSize(bIFile.getSize());
|
||||
this.setPartName(nModuleInfo.getModuleName());
|
||||
this.setBuildAbsTime(BAbsTime.make((long)nModuleInfo.getBuildTime()));
|
||||
this.getVersion().setVendor(nModuleInfo.getVendor());
|
||||
this.getVersion().setVendorVersion(nModuleInfo.getVendorVersion());
|
||||
this.setDescription(nModuleInfo.getDescription());
|
||||
this.setArchiveContent(BModuleContent.make(nModuleInfo.getModuleContent()));
|
||||
this.setSynthetic(bIFile.getExtension().equals("sjar"));
|
||||
this.summaryInitialized = true;
|
||||
}
|
||||
|
||||
public BModulePart(BIFile bIFile, InputStream inputStream, BInstallable bInstallable) {
|
||||
this(bIFile, inputStream, bInstallable, true);
|
||||
}
|
||||
|
||||
public BModulePart(BIFile bIFile, InputStream inputStream, BInstallable bInstallable, boolean bl) {
|
||||
this.this();
|
||||
this.file = bIFile;
|
||||
this.localInstance = true;
|
||||
this.setInstallable(bInstallable);
|
||||
if (inputStream == null) {
|
||||
this.setStatus(BModuleStatus.nomanifest);
|
||||
if (bInstallable != null) {
|
||||
bInstallable.setIsValid(false);
|
||||
}
|
||||
} else {
|
||||
this.setStatus(BModuleStatus.ok);
|
||||
}
|
||||
this.setFileSize(bIFile.getSize());
|
||||
if (bIFile.getExtension().equals("jar")) {
|
||||
this.setPartName(bIFile.getFileName().substring(0, bIFile.getFileName().length() - 4));
|
||||
} else if (bIFile.getExtension().equals("sjar")) {
|
||||
this.setPartName(bIFile.getFileName().substring(0, bIFile.getFileName().length() - 5));
|
||||
this.setSynthetic(true);
|
||||
}
|
||||
if (inputStream != null) {
|
||||
this.loadManifest(inputStream, bl);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BModulePart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BModulePart = BModulePart.class("[Lcom.tridium.install.part.BModulePart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
MODULES_PATH = new FilePath("!modules");
|
||||
LIB_PATH = new FilePath("!lib");
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ByteCounter
|
||||
extends OutputStream {
|
||||
private long size;
|
||||
|
||||
public void write(byte[] byArray) throws IOException {
|
||||
this.size += (long)byArray.length;
|
||||
}
|
||||
|
||||
public void write(byte[] byArray, int n, int n2) {
|
||||
this.size += (long)n2;
|
||||
}
|
||||
|
||||
public void write(int n) {
|
||||
++this.size;
|
||||
}
|
||||
|
||||
public long size() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.size = 0L;
|
||||
}
|
||||
|
||||
private ByteCounter() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private static class ModuleFileTransferElement
|
||||
extends FileTransferMessageElement {
|
||||
private static final BIcon icon = BIcon.std((String)"module.png");
|
||||
private BModulePart sourceModule;
|
||||
private BDaemonSession session;
|
||||
private byte[] buf;
|
||||
|
||||
public InputStream getStream() throws IOException {
|
||||
try {
|
||||
if (this.modifyContents()) {
|
||||
byte[] byArray = this.getModifiedBuf();
|
||||
if ("true".equals(System.getProperty("niagara.install.copyProcessedModule", "false"))) {
|
||||
BIFile bIFile = BFileSystem.INSTANCE.makeFile(new FilePath("!moduleCopies/" + this.sourceModule.getDestinationPath().getName()));
|
||||
FileUtil.pipe((InputStream)new ByteArrayInputStream(byArray), (OutputStream)bIFile.getOutputStream());
|
||||
}
|
||||
return new ByteArrayInputStream(byArray);
|
||||
}
|
||||
return this.sourceModule.getInputStream();
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new LocalizableRuntimeException("platform", "ModuleFileTransferElement.exception.read", (Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
if (this.modifyContents()) {
|
||||
return this.getModifiedBuf().length;
|
||||
}
|
||||
return this.sourceModule.getFileSize();
|
||||
}
|
||||
|
||||
private final BDaemonPlatform getDaemonPlatform() {
|
||||
try {
|
||||
return BRemoteDaemonPlatform.make(this.session, null);
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException((Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean modifyContents() {
|
||||
boolean bl = false;
|
||||
if (this.getDaemonPlatform().getModuleContent() != BModuleContent.doc) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
/*
|
||||
* WARNING - Removed back jump from a try to a catch block - possible behaviour change.
|
||||
* Enabled aggressive block sorting
|
||||
* Enabled unnecessary exception pruning
|
||||
* Enabled aggressive exception aggregation
|
||||
*/
|
||||
private final byte[] getModifiedBuf() {
|
||||
if (this.buf != null) return this.buf;
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream);
|
||||
try {
|
||||
try {
|
||||
this.sourceModule.writePackageArchive(this.getDaemonPlatform(), zipOutputStream);
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
Object var4_4 = null;
|
||||
try {
|
||||
zipOutputStream.closeEntry();
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
throw throwable;
|
||||
}
|
||||
catch (Exception exception) {}
|
||||
throw throwable;
|
||||
}
|
||||
{
|
||||
Object var4_5 = null;
|
||||
}
|
||||
try {}
|
||||
catch (Exception exception) {}
|
||||
zipOutputStream.closeEntry();
|
||||
zipOutputStream.flush();
|
||||
zipOutputStream.close();
|
||||
this.buf = byteArrayOutputStream.toByteArray();
|
||||
return this.buf;
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.buf = null;
|
||||
}
|
||||
|
||||
public ModuleFileTransferElement(BModulePart bModulePart, BDaemonSession bDaemonSession) {
|
||||
super(bModulePart.getDestinationPath(), bDaemonSession.getFileSpace());
|
||||
this.this();
|
||||
this.sourceModule = bModulePart;
|
||||
this.session = bDaemonSession;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFrozenEnum
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import javax.baja.sys.BFrozenEnum;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BModuleStatus
|
||||
extends BFrozenEnum {
|
||||
public static final int OK = 0;
|
||||
public static final int CORRUPT = 1;
|
||||
public static final int NOMANIFEST = 2;
|
||||
public static final int MISNAMED = 3;
|
||||
public static final BModuleStatus ok = new BModuleStatus(0);
|
||||
public static final BModuleStatus corrupt = new BModuleStatus(1);
|
||||
public static final BModuleStatus nomanifest = new BModuleStatus(2);
|
||||
public static final BModuleStatus misnamed = new BModuleStatus(3);
|
||||
public static final Type TYPE;
|
||||
public static final BModuleStatus DEFAULT;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BModuleStatus;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static final BModuleStatus make(int n) {
|
||||
return (BModuleStatus)ok.getRange().get(n, false);
|
||||
}
|
||||
|
||||
public static final BModuleStatus make(String string) {
|
||||
return (BModuleStatus)ok.getRange().get(string);
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private BModuleStatus(int n) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BModuleStatus;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BModuleStatus = BModuleStatus.class("[Lcom.tridium.install.part.BModuleStatus;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = ok;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BNrePart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BNrePart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BNrePart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("nre")) {
|
||||
return new BNrePart(xElem.get("name", ""), xElem.get("description", ""), new BVersion(xElem.get("bajaVersion", ""), BNrePart.getVendorVersion(xElem)), bInstallable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("nre");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
if (this.getVersion().getVendor().trim().length() > 0) {
|
||||
xElem.setAttr("vendor", this.getVersion().getVendor());
|
||||
}
|
||||
if (this.getVersion().getBajaVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString());
|
||||
}
|
||||
if (this.getVersion().getVendorVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("version", this.getVersion().getVendorVersionString());
|
||||
}
|
||||
if (this.getDescription().trim().length() > 0) {
|
||||
xElem.setAttr("description", this.getDescription());
|
||||
}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "Nre Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion());
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return this.getPartName().equals("nullnre");
|
||||
}
|
||||
|
||||
public static BNrePart makeNull() {
|
||||
return new BNrePart("nullnre", "", BVersion.makeZero(), null);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BNrePart() {
|
||||
}
|
||||
|
||||
public BNrePart(String string, String string2, BVersion bVersion, BInstallable bInstallable) {
|
||||
this.setPartName(string);
|
||||
this.setDescription(string2);
|
||||
this.setVersion(bVersion);
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BNrePart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BNrePart = BNrePart.class("[Lcom.tridium.install.part.BNrePart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BOsPart
|
||||
extends BPart {
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
boolean isInstallable;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BOsPart;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BOsPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("os")) {
|
||||
String string = xElem.get("name");
|
||||
boolean bl = string.startsWith("qnx");
|
||||
return new BOsPart(string, xElem.get("description", ""), new BVersion("", BOsPart.getVendorVersion(xElem)), bInstallable, xElem.getb("installable", bl));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("os");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
if (this.getVersion().getVendor().trim().length() > 0) {
|
||||
xElem.setAttr("vendor", this.getVersion().getVendor());
|
||||
}
|
||||
if (this.getVersion().getBajaVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString());
|
||||
}
|
||||
if (this.getVersion().getVendorVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("version", this.getVersion().getVendorVersionString());
|
||||
}
|
||||
if (this.getDescription().trim().length() > 0) {
|
||||
xElem.setAttr("description", this.getDescription());
|
||||
}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "OS Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion());
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return this.getPartName().equals("nullos");
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return this.isInstallable;
|
||||
}
|
||||
|
||||
public boolean allowGlobalFileAccess() {
|
||||
return this.getPartName().startsWith("qnx");
|
||||
}
|
||||
|
||||
public static BOsPart makeNull() {
|
||||
return new BOsPart("nullos", "", BVersion.makeZero(), null, false);
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.isInstallable = false;
|
||||
}
|
||||
|
||||
public BOsPart() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BOsPart(String string, String string2, BVersion bVersion, BInstallable bInstallable, boolean bl) {
|
||||
this.this();
|
||||
this.setPartName(string);
|
||||
this.setDescription(string2);
|
||||
this.setVersion(bVersion);
|
||||
this.setInstallable(bInstallable);
|
||||
this.isInstallable = bl;
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BOsPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BOsPart = BOsPart.class("[Lcom.tridium.install.part.BOsPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BComplex
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
* javax.baja.util.Lexicon
|
||||
* javax.baja.util.PatternFilter
|
||||
* javax.baja.util.Version
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.PartSpec;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BApplicationPart;
|
||||
import com.tridium.install.part.BArchPart;
|
||||
import com.tridium.install.part.BBrandPart;
|
||||
import com.tridium.install.part.BGenericPart;
|
||||
import com.tridium.install.part.BModelPart;
|
||||
import com.tridium.install.part.BModulePart;
|
||||
import com.tridium.install.part.BNrePart;
|
||||
import com.tridium.install.part.BOsPart;
|
||||
import com.tridium.install.part.BVmPart;
|
||||
import javax.baja.platform.install.BPlatformPartType;
|
||||
import javax.baja.platform.install.PlatformPart;
|
||||
import javax.baja.sys.BComplex;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
import javax.baja.util.Lexicon;
|
||||
import javax.baja.util.PatternFilter;
|
||||
import javax.baja.util.Version;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BPart
|
||||
extends BComponent {
|
||||
public static final Property dependencies = BPart.newProperty((int)1, (BValue)new BVector(), null);
|
||||
public static final Property partName = BPart.newProperty((int)1, (String)"unknown", null);
|
||||
public static final Property version = BPart.newProperty((int)1, (BValue)BVersion.makeZero(), null);
|
||||
public static final Property description = BPart.newProperty((int)1, (String)"", null);
|
||||
public static final Type TYPE;
|
||||
private BInstallable installable;
|
||||
private PartSpec spec;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BPart;
|
||||
|
||||
public BVector getDependencies() {
|
||||
return (BVector)this.get(dependencies);
|
||||
}
|
||||
|
||||
public void setDependencies(BVector bVector) {
|
||||
this.set(dependencies, (BValue)bVector, null);
|
||||
}
|
||||
|
||||
public String getPartName() {
|
||||
return this.getString(partName);
|
||||
}
|
||||
|
||||
public void setPartName(String string) {
|
||||
this.setString(partName, string, null);
|
||||
}
|
||||
|
||||
public BVersion getVersion() {
|
||||
return (BVersion)this.get(version);
|
||||
}
|
||||
|
||||
public void setVersion(BVersion bVersion) {
|
||||
this.set(version, (BValue)bVersion, null);
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.getString(description);
|
||||
}
|
||||
|
||||
public void setDescription(String string) {
|
||||
this.setString(description, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean equivalent(Object object) {
|
||||
if (object instanceof BPart) {
|
||||
BPart bPart = (BPart)((Object)object);
|
||||
boolean bl = false;
|
||||
if (this.getPartName().equals(bPart.getPartName()) && this.getType().equals(bPart.getType()) && this.getVersion().equivalent((Object)bPart.getVersion())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract boolean meets(BDependency var1);
|
||||
|
||||
public BInstallable getInstallable() {
|
||||
if (this.installable == null) {
|
||||
BComplex bComplex = this.getParent();
|
||||
while (bComplex != null) {
|
||||
if (bComplex instanceof BInstallable) {
|
||||
this.installable = (BInstallable)bComplex;
|
||||
break;
|
||||
}
|
||||
bComplex = bComplex.getParent();
|
||||
}
|
||||
}
|
||||
return this.installable;
|
||||
}
|
||||
|
||||
public void setInstallable(BInstallable bInstallable) {
|
||||
this.installable = bInstallable;
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static String getVendorVersion(XElem xElem) {
|
||||
return xElem.get("vendorVersion", xElem.get("version", "0"));
|
||||
}
|
||||
|
||||
public static final BPart makePart(XElem xElem, BInstallable bInstallable) {
|
||||
BPart bPart = null;
|
||||
if (xElem.name().equals("os")) {
|
||||
bPart = BOsPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("vm")) {
|
||||
bPart = BVmPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("arch")) {
|
||||
bPart = BArchPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("brand")) {
|
||||
bPart = BBrandPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("nre")) {
|
||||
bPart = BNrePart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("part")) {
|
||||
bPart = BGenericPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("model")) {
|
||||
bPart = BModelPart.make(xElem, bInstallable);
|
||||
} else if (xElem.name().equals("app")) {
|
||||
bPart = BApplicationPart.make(xElem, bInstallable);
|
||||
}
|
||||
return bPart;
|
||||
}
|
||||
|
||||
public PartSpec getPartSpec() {
|
||||
if (this.spec == null) {
|
||||
this.spec = new PartSpec(this.getPartName(), this.getType());
|
||||
}
|
||||
return this.spec;
|
||||
}
|
||||
|
||||
public PlatformPart asPlatformPart() {
|
||||
if (this.isNull()) {
|
||||
return null;
|
||||
}
|
||||
return new PlatformPart(){
|
||||
|
||||
public final String getPartName() {
|
||||
return BPart.this.getPartName();
|
||||
}
|
||||
|
||||
public final BPlatformPartType getPartType() {
|
||||
return BPart.getPlatformPartType(BPart.this.getType().getTypeSpec());
|
||||
}
|
||||
|
||||
public final Version getPartVersion() {
|
||||
return BPart.this.getVersion().getVendorVersion();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static BPlatformPartType getPlatformPartType(BTypeSpec bTypeSpec) {
|
||||
if (bTypeSpec.equals((Object)BArchPart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.arch;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BBrandPart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.brand;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BModelPart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.model;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BModulePart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.module;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BNrePart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.nre;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BOsPart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.os;
|
||||
}
|
||||
if (bTypeSpec.equals((Object)BVmPart.TYPE.getTypeSpec())) {
|
||||
return BPlatformPartType.vm;
|
||||
}
|
||||
return BPlatformPartType.other;
|
||||
}
|
||||
|
||||
public static String getPartTypeName(Type type) {
|
||||
Lexicon lexicon = type.getModule().getLexicon();
|
||||
String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeName");
|
||||
if (string == null) {
|
||||
if (type.getSuperType() == null) {
|
||||
return TYPE.getModule().getLexicon().getText("Unknown.typeName");
|
||||
}
|
||||
return BPart.getPartTypeName(type.getSuperType());
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static BIcon getPartTypeIcon(Type type) {
|
||||
Lexicon lexicon = type.getModule().getLexicon();
|
||||
String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeIcon");
|
||||
if (string == null) {
|
||||
if (type.getSuperType() == null) {
|
||||
string = TYPE.getModule().getLexicon().getText("Unknown.typeIcon");
|
||||
} else {
|
||||
return BPart.getPartTypeIcon(type.getSuperType());
|
||||
}
|
||||
}
|
||||
return BIcon.make((String)string);
|
||||
}
|
||||
|
||||
public static String getPartTypeShortName(Type type) {
|
||||
Lexicon lexicon = type.getModule().getLexicon();
|
||||
String string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeNameShort");
|
||||
if (string == null && (string = BPart.getLexiconText(lexicon, type.getTypeName() + ".typeName")) == null) {
|
||||
if (type.getSuperType() == null) {
|
||||
return TYPE.getModule().getLexicon().getText("Unknown.typeName");
|
||||
}
|
||||
return BPart.getPartTypeShortName(type.getSuperType());
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public BDependency[] getDependencyArray() {
|
||||
Property[] propertyArray = this.getDependencies().getPropertiesArray();
|
||||
BDependency[] bDependencyArray = new BDependency[propertyArray.length];
|
||||
int n = 0;
|
||||
while (n < propertyArray.length) {
|
||||
bDependencyArray[n] = (BDependency)this.getDependencies().get(propertyArray[n]);
|
||||
++n;
|
||||
}
|
||||
return bDependencyArray;
|
||||
}
|
||||
|
||||
public boolean matchesName(String string) {
|
||||
return BPart.matchesName(this.getPartName(), string);
|
||||
}
|
||||
|
||||
public static boolean isWildcardName(String string) {
|
||||
int n = 0;
|
||||
while (n < string.length()) {
|
||||
switch (string.charAt(n)) {
|
||||
case '\t':
|
||||
case ' ':
|
||||
case '*':
|
||||
case ',':
|
||||
case ';':
|
||||
case '?': {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean matchesName(String string, String string2) {
|
||||
if (string2 == null) {
|
||||
return false;
|
||||
}
|
||||
PatternFilter[] patternFilterArray = PatternFilter.parseList((String)string2);
|
||||
int n = 0;
|
||||
while (n < patternFilterArray.length) {
|
||||
if (patternFilterArray[n].accept(string)) {
|
||||
return true;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static final String getLexiconText(Lexicon lexicon, String string) {
|
||||
String string2 = lexicon.getText(string);
|
||||
if (string2.equals(string)) {
|
||||
return null;
|
||||
}
|
||||
return string2;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.installable = null;
|
||||
this.spec = null;
|
||||
}
|
||||
|
||||
public BPart() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BPart = BPart.class("[Lcom.tridium.install.part.BPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Context
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.install.part;
|
||||
|
||||
import com.tridium.install.BDependency;
|
||||
import com.tridium.install.BVersion;
|
||||
import com.tridium.install.installable.BInstallable;
|
||||
import com.tridium.install.part.BPart;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Context;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BVmPart
|
||||
extends BPart {
|
||||
public static final Property unspecified = BVmPart.newProperty((int)1, (boolean)false, null);
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
static /* synthetic */ Class class$com$tridium$install$part$BVmPart;
|
||||
|
||||
public boolean getUnspecified() {
|
||||
return this.getBoolean(unspecified);
|
||||
}
|
||||
|
||||
public void setUnspecified(boolean bl) {
|
||||
this.setBoolean(unspecified, bl, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public boolean meets(BDependency bDependency) {
|
||||
boolean bl = false;
|
||||
if (bDependency.getPartType().is(TYPE) && this.getVersion().meets(bDependency) && this.matchesName(bDependency.getPartName())) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem) {
|
||||
return BVmPart.make(xElem, null);
|
||||
}
|
||||
|
||||
public static BPart make(XElem xElem, BInstallable bInstallable) {
|
||||
if (xElem == null) {
|
||||
return null;
|
||||
}
|
||||
if (xElem.name().equals("vm")) {
|
||||
return new BVmPart(xElem.get("name", null), new BVersion(xElem.get("vendor", ""), BVmPart.getVendorVersion(xElem)), bInstallable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public XElem getXml() {
|
||||
XElem xElem = new XElem("vm");
|
||||
xElem.setAttr("name", this.getPartName());
|
||||
if (this.getVersion().getVendor().trim().length() > 0) {
|
||||
xElem.setAttr("vendor", this.getVersion().getVendor());
|
||||
}
|
||||
if (this.getVersion().getBajaVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("bajaVersion", this.getVersion().getBajaVersionString());
|
||||
}
|
||||
if (this.getVersion().getVendorVersionString().trim().length() > 0) {
|
||||
xElem.setAttr("version", this.getVersion().getVendorVersionString());
|
||||
}
|
||||
if (this.getDescription().trim().length() > 0) {
|
||||
xElem.setAttr("description", this.getDescription());
|
||||
}
|
||||
return xElem;
|
||||
}
|
||||
|
||||
public String toString(Context context) {
|
||||
return "VM Part: " + this.getPartName() + ' ' + (Object)((Object)this.getVersion());
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public boolean isInstallable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isNull() {
|
||||
return this.getPartName().equals("nullvm");
|
||||
}
|
||||
|
||||
public static BVmPart makeNull() {
|
||||
return new BVmPart("nullvm", BVersion.makeZero(), null);
|
||||
}
|
||||
|
||||
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 BVmPart() {
|
||||
this.setPartName(this.getLexicon().getText("unspecifiedVm.vmName"));
|
||||
this.setUnspecified(true);
|
||||
}
|
||||
|
||||
public BVmPart(String string, BVersion bVersion, BInstallable bInstallable) {
|
||||
this.setVersion(bVersion);
|
||||
if (string == null || string.indexOf("Undetermined") != -1) {
|
||||
this.setPartName(this.getLexicon().getText("unspecifiedVm.vmName"));
|
||||
this.setUnspecified(true);
|
||||
} else {
|
||||
this.setPartName(string);
|
||||
this.setUnspecified(false);
|
||||
}
|
||||
this.setInstallable(bInstallable);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$install$part$BVmPart;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$install$part$BVmPart = BVmPart.class("[Lcom.tridium.install.part.BVmPart;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BPart.getPartTypeIcon(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user