146 lines
5.1 KiB
Java
146 lines
5.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.workbench.auth.BHostCnxHandler
|
|
* com.tridium.workbench.ord.BHostOrdFE
|
|
* javax.baja.data.BIDataValue
|
|
* javax.baja.naming.BOrd
|
|
* javax.baja.naming.OrdQuery
|
|
* javax.baja.security.BICredentials
|
|
* javax.baja.security.BUsernameAndPassword
|
|
* javax.baja.sys.BFacets
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.BString
|
|
* javax.baja.sys.BajaRuntimeException
|
|
* javax.baja.sys.BasicContext
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.util.Lexicon
|
|
*/
|
|
package com.tridium.platform.ui;
|
|
|
|
import com.tridium.platform.daemon.BDaemonScheme;
|
|
import com.tridium.platform.ui.BDaemonSessionOrdFE;
|
|
import com.tridium.workbench.auth.BHostCnxHandler;
|
|
import com.tridium.workbench.ord.BHostOrdFE;
|
|
import javax.baja.data.BIDataValue;
|
|
import javax.baja.naming.BOrd;
|
|
import javax.baja.naming.OrdQuery;
|
|
import javax.baja.security.BICredentials;
|
|
import javax.baja.security.BUsernameAndPassword;
|
|
import javax.baja.sys.BFacets;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BString;
|
|
import javax.baja.sys.BajaRuntimeException;
|
|
import javax.baja.sys.BasicContext;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.util.Lexicon;
|
|
|
|
public class BDaemonCnxHandler
|
|
extends BHostCnxHandler {
|
|
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$platform$ui$BDaemonCnxHandler == null ? (class$com$tridium$platform$ui$BDaemonCnxHandler = BDaemonCnxHandler.class$("com.tridium.platform.ui.BDaemonCnxHandler")) : class$com$tridium$platform$ui$BDaemonCnxHandler));
|
|
private static final String KEY = "open.daemon";
|
|
static /* synthetic */ Class class$com$tridium$platform$ui$BDaemonCnxHandler;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public BDaemonCnxHandler() {
|
|
this(TYPE.getModule().getLexicon(), KEY);
|
|
}
|
|
|
|
public BDaemonCnxHandler(Lexicon lexicon, String string) {
|
|
this(BDaemonScheme.INSTANCE.getId(), 3011, new BDaemonSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), lexicon, string);
|
|
}
|
|
|
|
public BDaemonCnxHandler(String string, int n, BHostOrdFE bHostOrdFE, BICredentials bICredentials, Lexicon lexicon, String string2) {
|
|
super(string, n, bHostOrdFE, bICredentials, lexicon, string2);
|
|
BFacets bFacets = BFacets.make((String)"wbMenu", (BIDataValue)BString.make((String)"true"));
|
|
BasicContext basicContext = new BasicContext((Context)bFacets);
|
|
this.hostOrd = BOrd.make((String)"ip:");
|
|
this.ordFE.loadValue((BObject)this.hostOrd, (Context)basicContext);
|
|
}
|
|
|
|
public BOrd toHyperlink() {
|
|
try {
|
|
this.saveHostAddress();
|
|
}
|
|
catch (Exception exception) {
|
|
throw new BajaRuntimeException(exception.getMessage());
|
|
}
|
|
return super.toHyperlink();
|
|
}
|
|
|
|
public String toAuthenticationRealm() {
|
|
try {
|
|
this.saveHostAddress();
|
|
}
|
|
catch (Exception exception) {
|
|
throw new BajaRuntimeException(exception.getMessage());
|
|
}
|
|
return super.toAuthenticationRealm();
|
|
}
|
|
|
|
public int getPort() {
|
|
return this.port;
|
|
}
|
|
|
|
public String getSessionScheme() {
|
|
return this.sessionScheme;
|
|
}
|
|
|
|
protected void saveHostAddress() throws Exception {
|
|
this.ordFE.setModified();
|
|
this.ordFE.setAutoSaveHistory(false);
|
|
BOrd bOrd = (BOrd)this.ordFE.saveValue();
|
|
OrdQuery[] ordQueryArray = bOrd.parse();
|
|
this.hostOrd = BOrd.make((OrdQuery)ordQueryArray[0]);
|
|
this.port = this.defaultPort;
|
|
if (!bOrd.isNull()) {
|
|
for (int i = 1; i < ordQueryArray.length; ++i) {
|
|
if (!(ordQueryArray[i] instanceof BDaemonScheme.DaemonQuery)) continue;
|
|
BDaemonScheme.DaemonQuery daemonQuery = (BDaemonScheme.DaemonQuery)ordQueryArray[i];
|
|
this.port = daemonQuery.getPort();
|
|
this.tunnelAuthorities = daemonQuery.getTunnelAuthorities();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void doSaveCnx() {
|
|
try {
|
|
this.ordFE.setAutoSaveHistory(true);
|
|
this.ordFE.setModified();
|
|
this.ordFE.saveValue();
|
|
}
|
|
catch (Exception exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public void doClearCnx() {
|
|
BFacets bFacets = BFacets.make((String)"wbMenu", (BIDataValue)BString.make((String)"true"));
|
|
BasicContext basicContext = new BasicContext((Context)bFacets);
|
|
this.hostOrd = BOrd.make((String)"ip:");
|
|
this.ordFE.loadValue((BObject)this.hostOrd, (Context)basicContext);
|
|
this.port = this.defaultPort;
|
|
this.tunnelAuthorities = null;
|
|
this.setCredentials((BICredentials)new BUsernameAndPassword());
|
|
}
|
|
|
|
static /* synthetic */ Class class$(String string) {
|
|
try {
|
|
return Class.forName(string);
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
}
|
|
|