215 lines
6.3 KiB
Java
215 lines
6.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.sys.transfer.TransferListener
|
|
* javax.baja.net.NotConnectedException
|
|
* javax.baja.security.BIProtected
|
|
* javax.baja.security.BPermissions
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BIcon
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
*/
|
|
package com.tridium.fox.sys;
|
|
|
|
import com.tridium.fox.message.FoxMessage;
|
|
import com.tridium.fox.session.FoxCircuit;
|
|
import com.tridium.fox.session.FoxRequest;
|
|
import com.tridium.fox.session.FoxResponse;
|
|
import com.tridium.fox.session.InvalidCommandException;
|
|
import com.tridium.fox.sys.BFoxClientConnection;
|
|
import com.tridium.fox.sys.BFoxConnection;
|
|
import com.tridium.fox.sys.BFoxServerConnection;
|
|
import com.tridium.fox.sys.BFoxSession;
|
|
import com.tridium.fox.sys.spy.FoxLog;
|
|
import com.tridium.sys.transfer.TransferListener;
|
|
import javax.baja.net.NotConnectedException;
|
|
import javax.baja.security.BIProtected;
|
|
import javax.baja.security.BPermissions;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BIcon;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public abstract class BFoxChannel
|
|
extends BComponent {
|
|
public static final Type TYPE;
|
|
private static final BIcon icon;
|
|
public final FoxLog log;
|
|
static /* synthetic */ Class class$com$tridium$fox$sys$BFoxChannel;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void sessionOpened() throws Exception {
|
|
}
|
|
|
|
public void sessionClosed(Throwable throwable) throws Exception {
|
|
}
|
|
|
|
public abstract FoxResponse process(FoxRequest var1) throws Throwable;
|
|
|
|
public void circuitOpened(FoxCircuit foxCircuit) throws Throwable {
|
|
throw new InvalidCommandException(foxCircuit.command);
|
|
}
|
|
|
|
public final FoxRequest makeRequest(String string) {
|
|
return new FoxRequest(this.getName(), string);
|
|
}
|
|
|
|
public final FoxCircuit openCircuit(String string) throws Exception {
|
|
return this.getConnection().session().openCircuit(this.getName(), string);
|
|
}
|
|
|
|
public final FoxResponse sendSync(FoxRequest foxRequest) throws Exception {
|
|
try {
|
|
return this.getConnection().sendSync(foxRequest);
|
|
}
|
|
catch (NullPointerException nullPointerException) {
|
|
if (this.getConnection() == null) {
|
|
throw new NotConnectedException();
|
|
}
|
|
throw nullPointerException;
|
|
}
|
|
}
|
|
|
|
public final void sendAsync(FoxRequest foxRequest) throws Exception {
|
|
try {
|
|
this.getConnection().sendAsync(foxRequest);
|
|
}
|
|
catch (NullPointerException nullPointerException) {
|
|
if (this.getConnection() == null) {
|
|
throw new NotConnectedException();
|
|
}
|
|
throw nullPointerException;
|
|
}
|
|
}
|
|
|
|
public BIcon getIcon() {
|
|
return icon;
|
|
}
|
|
|
|
public final BFoxConnection getConnection() {
|
|
try {
|
|
return (BFoxConnection)this.getParent().getParent();
|
|
}
|
|
catch (NullPointerException nullPointerException) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final BFoxClientConnection getClientConnection() {
|
|
try {
|
|
return (BFoxClientConnection)this.getParent().getParent();
|
|
}
|
|
catch (NullPointerException nullPointerException) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final BFoxServerConnection getServerConnection() {
|
|
try {
|
|
return (BFoxServerConnection)this.getParent().getParent();
|
|
}
|
|
catch (NullPointerException nullPointerException) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public final Context getSessionContext() {
|
|
return this.getServerConnection().getSessionContext();
|
|
}
|
|
|
|
public final BPermissions getPermissionsFor(Object object) {
|
|
return this.getPermissionsFor(object, true);
|
|
}
|
|
|
|
public final BPermissions getPermissionsFor(Object object, boolean bl) {
|
|
block3: {
|
|
try {
|
|
if (object instanceof BIProtected) {
|
|
return ((BIProtected)object).getPermissions(this.getSessionContext());
|
|
}
|
|
}
|
|
catch (Exception exception) {
|
|
if (!bl) break block3;
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
return BPermissions.all;
|
|
}
|
|
|
|
public final BFoxSession getFoxSession() {
|
|
return this.getClientConnection().getFoxSession();
|
|
}
|
|
|
|
public boolean isTraceOn() {
|
|
return this.log.isTraceOn();
|
|
}
|
|
|
|
public void trace(String string) {
|
|
System.out.print("-- ");
|
|
System.out.print(this.log.getLogName());
|
|
System.out.print(" ");
|
|
System.out.println(string);
|
|
this.log.logRecOnly(0, 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());
|
|
}
|
|
}
|
|
|
|
protected BFoxChannel(String string) {
|
|
this.log = FoxLog.make("fox." + string);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$fox$sys$BFoxChannel;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$fox$sys$BFoxChannel = BFoxChannel.class("[Lcom.tridium.fox.sys.BFoxChannel;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
icon = BIcon.std((String)"bookmark.png");
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class TransferStatusPipe
|
|
implements TransferListener {
|
|
FoxCircuit circuit;
|
|
|
|
public void updateStatus(String string) {
|
|
try {
|
|
FoxMessage foxMessage = new FoxMessage();
|
|
foxMessage.add("s", string);
|
|
this.circuit.writeMessage(foxMessage);
|
|
}
|
|
catch (Exception exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public TransferStatusPipe(FoxCircuit foxCircuit) {
|
|
this.circuit = foxCircuit;
|
|
}
|
|
}
|
|
}
|
|
|