194 lines
6.2 KiB
Java
194 lines
6.2 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.util.ContextThread
|
|
* javax.baja.security.AuditEvent
|
|
* javax.baja.sys.Action
|
|
* javax.baja.sys.BAbsTime
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.user.BUser
|
|
*/
|
|
package com.tridium.fox.sys;
|
|
|
|
import com.tridium.fox.session.FoxSession;
|
|
import com.tridium.fox.sys.BFoxConnection;
|
|
import com.tridium.fox.sys.BFoxService;
|
|
import com.tridium.fox.sys.BServerConnections;
|
|
import com.tridium.fox.sys.NiagaraStation;
|
|
import com.tridium.util.ContextThread;
|
|
import javax.baja.security.AuditEvent;
|
|
import javax.baja.sys.Action;
|
|
import javax.baja.sys.BAbsTime;
|
|
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.user.BUser;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BFoxServerConnection
|
|
extends BFoxConnection {
|
|
public static final Property lastLoginTime = BFoxServerConnection.newProperty((int)3, (BValue)BAbsTime.NULL, null);
|
|
public static final Property lastLoginAddress = BFoxServerConnection.newProperty((int)3, (String)"-", null);
|
|
public static final Property lastLoginUsername = BFoxServerConnection.newProperty((int)3, (String)"-", null);
|
|
public static final Property lastLoginApp = BFoxServerConnection.newProperty((int)3, (String)"-", null);
|
|
public static final Action forceDisconnect = BFoxServerConnection.newAction((int)0, null);
|
|
public static final Type TYPE;
|
|
static /* synthetic */ Class class$com$tridium$fox$sys$BFoxServerConnection;
|
|
|
|
public BAbsTime getLastLoginTime() {
|
|
return (BAbsTime)this.get(lastLoginTime);
|
|
}
|
|
|
|
public void setLastLoginTime(BAbsTime bAbsTime) {
|
|
this.set(lastLoginTime, (BValue)bAbsTime, null);
|
|
}
|
|
|
|
public String getLastLoginAddress() {
|
|
return this.getString(lastLoginAddress);
|
|
}
|
|
|
|
public void setLastLoginAddress(String string) {
|
|
this.setString(lastLoginAddress, string, null);
|
|
}
|
|
|
|
public String getLastLoginUsername() {
|
|
return this.getString(lastLoginUsername);
|
|
}
|
|
|
|
public void setLastLoginUsername(String string) {
|
|
this.setString(lastLoginUsername, string, null);
|
|
}
|
|
|
|
public String getLastLoginApp() {
|
|
return this.getString(lastLoginApp);
|
|
}
|
|
|
|
public void setLastLoginApp(String string) {
|
|
this.setString(lastLoginApp, string, null);
|
|
}
|
|
|
|
public void forceDisconnect() {
|
|
this.invoke(forceDisconnect, null, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void stopped() throws Exception {
|
|
if (this.session() != null) {
|
|
this.session().close(null);
|
|
}
|
|
}
|
|
|
|
public final BUser getUser() {
|
|
FoxSession foxSession = this.session();
|
|
if (foxSession != null) {
|
|
return foxSession.getUser();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final Context getSessionContext() {
|
|
FoxSession foxSession = this.session();
|
|
if (foxSession != null) {
|
|
return foxSession.getSessionContext();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void sessionOpened(FoxSession foxSession) {
|
|
if (this.session() != null) {
|
|
this.session().close(new Exception("Reconnect while still server still connected"));
|
|
}
|
|
super.sessionOpened(foxSession);
|
|
NiagaraStation niagaraStation = this.getParentStation();
|
|
if (niagaraStation != null) {
|
|
niagaraStation.serverOpened();
|
|
}
|
|
}
|
|
|
|
public void sessionClosed(FoxSession foxSession, Throwable throwable) {
|
|
Object object;
|
|
if (BFoxService.auditConnection(foxSession)) {
|
|
try {
|
|
object = Sys.getAuditor();
|
|
if (object != null && foxSession.getUser() != null) {
|
|
object.audit(new AuditEvent("Logout", this.toPathString(), foxSession.getRemoteHost(), "", "", foxSession.getUser().getUsername()));
|
|
}
|
|
}
|
|
catch (Throwable throwable2) {
|
|
throwable2.printStackTrace();
|
|
}
|
|
}
|
|
if (this.session() != foxSession) {
|
|
this.log.warning("Closing session [" + foxSession + " doesn't match opened session [" + this.session() + ']');
|
|
if (this.getParent() instanceof BServerConnections) {
|
|
this.getParent().asComponent().remove(this.getPropertyInParent());
|
|
}
|
|
return;
|
|
}
|
|
super.sessionClosed(foxSession, throwable);
|
|
object = this.getParentStation();
|
|
if (object != null) {
|
|
object.serverClosed();
|
|
} else if (this.getParent() instanceof BServerConnections) {
|
|
this.getParent().asComponent().remove(this.getPropertyInParent());
|
|
}
|
|
}
|
|
|
|
public Thread makeThread(ThreadGroup threadGroup, Runnable runnable, String string) {
|
|
return new FoxServerThread(threadGroup, runnable, string);
|
|
}
|
|
|
|
public void doForceDisconnect() throws Exception {
|
|
this.close();
|
|
}
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$fox$sys$BFoxServerConnection;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$fox$sys$BFoxServerConnection = BFoxServerConnection.class("[Lcom.tridium.fox.sys.BFoxServerConnection;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
class FoxServerThread
|
|
extends Thread
|
|
implements ContextThread {
|
|
public Context getContext() {
|
|
return BFoxServerConnection.this.getSessionContext();
|
|
}
|
|
|
|
FoxServerThread(ThreadGroup threadGroup, Runnable runnable, String string) {
|
|
super(threadGroup, runnable, string);
|
|
}
|
|
}
|
|
}
|
|
|