link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,244 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.SortUtil
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import javax.baja.io.net.IClientSocketFactory;
import javax.baja.naming.BISession;
import javax.baja.naming.BLocalHost;
import javax.baja.naming.BOrd;
import javax.baja.nav.BINavNode;
import javax.baja.nav.BNavContainer;
import javax.baja.nav.BNavRoot;
import javax.baja.nre.util.SortUtil;
import javax.baja.nre.util.TextUtil;
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 BHost
extends BNavContainer {
static final BIcon iconConnected = BIcon.std("host.png");
static final BIcon iconDisconnected = BIcon.std("hostDisconnected.png");
public static final Type TYPE;
static final HashMap cache;
static int cachedLocalHostCount;
String hostname;
static /* synthetic */ Class class$javax$baja$naming$BHost;
public static BHost getHost(String string) {
if (string.length() == 0) {
return BLocalHost.INSTANCE;
}
String string2 = TextUtil.toLowerCase((String)string);
return (BHost)cache.get(string2);
}
public static BHost[] getAllHosts() {
BHost[] bHostArray = BHost.getRemoteHosts();
BHost[] bHostArray2 = new BHost[bHostArray.length + 1];
bHostArray2[0] = BLocalHost.INSTANCE;
System.arraycopy(bHostArray, 0, bHostArray2, 1, bHostArray.length);
return bHostArray2;
}
public static BHost[] getRemoteHosts() {
Object[] objectArray = new BHost[cache.size() - cachedLocalHostCount];
Object[] objectArray2 = new String[objectArray.length];
Iterator iterator = cache.values().iterator();
int n = 0;
while (iterator.hasNext()) {
BHost bHost = (BHost)iterator.next();
if (bHost == BLocalHost.INSTANCE) continue;
objectArray[n] = bHost;
objectArray2[n] = bHost.hostname;
++n;
}
SortUtil.sort((Object[])objectArray2, (Object[])objectArray);
return objectArray;
}
public static void mount(BHost bHost) {
String string = TextUtil.toLowerCase((String)bHost.getHostname());
if (cache.get(string) != null) {
throw new IllegalArgumentException("Already mounted " + string);
}
cache.put(string, bHost);
BNavRoot.INSTANCE.addNavChild(bHost);
}
public static void unmount(BHost bHost) {
String string = TextUtil.toLowerCase((String)bHost.getHostname());
cache.remove(string);
BNavRoot.INSTANCE.removeNavChild(bHost);
}
public String getHostname() {
return this.hostname;
}
public BISession[] getChildSessions() {
ArrayList<BINavNode> arrayList = new ArrayList<BINavNode>();
BINavNode[] bINavNodeArray = this.getNavChildren();
int n = 0;
while (n < bINavNodeArray.length) {
if (bINavNodeArray[n] instanceof BISession) {
arrayList.add(bINavNodeArray[n]);
}
++n;
}
return arrayList.toArray(new BISession[arrayList.size()]);
}
public abstract Socket openSocket(int var1) throws IOException;
public Socket openSocket(int n, int n2) throws IOException {
return this.openSocket(n);
}
public abstract Socket openSocket(int var1, IClientSocketFactory var2) throws IOException;
public abstract Socket openSocket(int var1, IClientSocketFactory var2, int var3) throws IOException;
public abstract DatagramSocket openDatagramSocket(int var1) throws IOException;
public String toString(Context context) {
return this.hostname;
}
public boolean isConnected() {
boolean bl = false;
if (this.getConnectedSessionCount() > 0) {
bl = true;
}
return bl;
}
public int getConnectedSessionCount() {
int n = 0;
BINavNode[] bINavNodeArray = this.getNavChildren();
int n2 = 0;
while (n2 < bINavNodeArray.length) {
if (bINavNodeArray[n2] instanceof BISession && ((BISession)bINavNodeArray[n2]).isConnected()) {
++n;
}
++n2;
}
return n;
}
public final void disconnect() {
this.disconnectAllSessions();
this.doDisconnect();
}
protected void doDisconnect() {
}
public void disconnectAllSessions() {
BISession[] bISessionArray = this.getChildSessions();
int n = 0;
while (n < bISessionArray.length) {
bISessionArray[n].disconnect();
++n;
}
}
public final void close() {
this.closeAllSessions();
this.doClose();
BHost.unmount(this);
}
protected void doClose() {
}
public void closeAllSessions() {
BISession[] bISessionArray = this.getChildSessions();
int n = 0;
while (n < bISessionArray.length) {
bISessionArray[n].close();
++n;
}
}
public abstract BOrd getAbsoluteOrd();
public BOrd getNavOrd() {
return this.getAbsoluteOrd();
}
public void addNavChild(BINavNode bINavNode) {
super.addNavChild(bINavNode);
this.sortNavChildren();
}
public void removeNavChild(BINavNode bINavNode) {
super.removeNavChild(bINavNode);
this.sortNavChildren();
}
void sortNavChildren() {
Object[] objectArray = this.getNavChildren();
Object[] objectArray2 = new String[objectArray.length];
int n = 0;
while (n < objectArray.length) {
Object object = objectArray[n];
objectArray2[n] = object instanceof BISession ? object.getType().getTypeName() : "";
++n;
}
SortUtil.sort((Object[])objectArray2, (Object[])objectArray);
this.reorderNavChildren((BINavNode[])objectArray);
}
public BIcon getIcon() {
return this.isConnected() ? iconConnected : iconDisconnected;
}
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 BHost(String string) {
super(string);
this.hostname = string;
}
static {
Class clazz = class$javax$baja$naming$BHost;
if (clazz == null) {
clazz = class$javax$baja$naming$BHost = BHost.class("[Ljavax.baja.naming.BHost;", false);
}
TYPE = Sys.loadType(clazz);
cache = new HashMap();
cachedLocalHostCount = 0;
}
}
@@ -0,0 +1,25 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BOrd;
import javax.baja.sys.BInterface;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
public interface BIAlias
extends BInterface {
public static final Type TYPE;
public BOrd getOrd();
static {
Class clazz = 1.class$javax$baja$naming$BIAlias;
if (clazz == null) {
clazz = 1.class$javax$baja$naming$BIAlias = 1.class("[Ljavax.baja.naming.BIAlias;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,41 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BHost;
import javax.baja.naming.BOrd;
import javax.baja.nav.BINavNode;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
public interface BISession
extends BINavNode {
public static final Type TYPE;
public boolean isConnected();
public void connect() throws Exception;
public void disconnect();
public void close();
public BHost getHost();
public BOrd getAbsoluteOrd();
public BOrd getOrdInHost();
public Context getSessionContext();
static {
Class clazz = 1.class$javax$baja$naming$BISession;
if (clazz == null) {
clazz = 1.class$javax$baja$naming$BISession = 1.class("[Ljavax.baja.naming.BISession;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,175 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.nre.util.IPAddressUtil
*/
package javax.baja.naming;
import com.tridium.io.net.BasicClientSocketFactory;
import com.tridium.nre.util.IPAddressUtil;
import com.tridium.util.IFoxSession;
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.Socket;
import javax.baja.io.net.IClientSocketFactory;
import javax.baja.naming.BHost;
import javax.baja.naming.BOrd;
import javax.baja.nav.BINavNode;
import javax.baja.sys.Clock;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BIpHost
extends BHost {
public static final Type TYPE;
static final int CONNECTION_TIMEOUT;
BOrd ord;
InetAddress inetAddress;
String navDisplayName;
boolean isNumericAddr;
static /* synthetic */ Class class$javax$baja$naming$BIpHost;
public boolean isNumericAddress() {
return this.isNumericAddr;
}
public String getNumericAddress(boolean bl) throws IOException {
if (this.isNumericAddr) {
return this.hostname;
}
if (this.inetAddress != null) {
return this.inetAddress.getHostAddress();
}
if (!bl) {
return null;
}
return this.getInetAddress().getHostAddress();
}
public InetAddress getInetAddress() throws IOException {
if (this.inetAddress == null) {
this.inetAddress = InetAddress.getByName(this.getHostname());
}
return this.inetAddress;
}
public BOrd getAbsoluteOrd() {
return this.ord;
}
public Socket openSocket(int n) throws IOException {
if (!this.isNumericAddr) {
this.inetAddress = null;
this.navDisplayName = null;
}
IClientSocketFactory iClientSocketFactory = BasicClientSocketFactory.getInstance();
return iClientSocketFactory.createSocket(this.getInetAddress(), n);
}
public Socket openSocket(int n, int n2) throws IOException {
if (!this.isNumericAddr) {
this.inetAddress = null;
this.navDisplayName = null;
}
IClientSocketFactory iClientSocketFactory = BasicClientSocketFactory.getInstance();
return iClientSocketFactory.createSocket(this.getInetAddress(), n, n2);
}
public Socket openSocket(int n, IClientSocketFactory iClientSocketFactory) throws IOException {
return iClientSocketFactory.createSocket(this.getInetAddress(), n);
}
public Socket openSocket(int n, IClientSocketFactory iClientSocketFactory, int n2) throws IOException {
return iClientSocketFactory.createSocket(this.getInetAddress(), n, n2);
}
public DatagramSocket openDatagramSocket(int n) throws IOException {
return new DatagramSocket(n, this.getInetAddress());
}
public String getNavDisplayName(Context context) {
if (this.navDisplayName != null) {
return this.appendStationName(this.navDisplayName);
}
if (this.inetAddress == null) {
return this.appendStationName(this.hostname);
}
try {
String string;
String string2;
this.navDisplayName = this.isNumericAddr ? this.hostname : ((string2 = this.inetAddress.getHostName()).equals(string = this.inetAddress.getHostAddress()) ? string2 : string2 + " : " + string);
}
catch (Exception exception) {
this.navDisplayName = this.hostname;
}
return this.appendStationName(this.navDisplayName);
}
String appendStationName(String string) {
try {
BINavNode[] bINavNodeArray = this.getNavChildren();
int n = 0;
while (n < bINavNodeArray.length) {
String string2;
if (bINavNodeArray[n] instanceof IFoxSession && (string2 = ((IFoxSession)((Object)bINavNodeArray[n])).getStationName()) != null) {
return string + " (" + string2 + ')';
}
++n;
}
return string;
}
catch (Exception exception) {
return string;
}
}
public static void main(String[] stringArray) throws Exception {
System.out.println("Testing socket times");
long l = Clock.ticks();
try {
new BIpHost(stringArray[0]).openSocket(1911);
}
catch (Exception exception) {}
long l2 = Clock.ticks();
System.out.println("Opened: " + (l2 - l) + "ms");
}
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 BIpHost(String string) {
super(string);
this.ord = BOrd.make("ip:" + string);
this.isNumericAddr = IPAddressUtil.isNumericAddr((String)string);
}
static {
Class clazz = class$javax$baja$naming$BIpHost;
if (clazz == null) {
clazz = class$javax$baja$naming$BIpHost = BIpHost.class("[Ljavax.baja.naming.BIpHost;", false);
}
TYPE = Sys.loadType(clazz);
CONNECTION_TIMEOUT = Integer.parseInt(System.getProperty("ipHost.connectionTimeout", "15000"));
}
}
@@ -0,0 +1,102 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BHost;
import javax.baja.naming.BIpHost;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BIpScheme
extends BOrdScheme {
public static final BIpScheme INSTANCE = new BIpScheme();
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BIpScheme;
public OrdQuery parse(String string) {
return new IpQuery(string);
}
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
String string = ordQuery.getBody();
BHost bHost = BHost.getHost(string);
if (bHost == null) {
bHost = new BIpHost(string);
BHost.mount(bHost);
}
return new OrdTarget(ordTarget, bHost);
}
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());
}
}
private BIpScheme() {
super("ip");
}
static {
Class clazz = class$javax$baja$naming$BIpScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BIpScheme = BIpScheme.class("[Ljavax.baja.naming.BIpScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
static class IpQuery
implements OrdQuery {
final String hostname;
public boolean isHost() {
return true;
}
public boolean isSession() {
return false;
}
public void normalize(OrdQueryList ordQueryList, int n) {
ordQueryList.trim(n);
}
public String getScheme() {
return "ip";
}
public String getBody() {
return this.hostname;
}
public String toString() {
return "ip:" + this.hostname;
}
IpQuery(String string) {
this.hostname = string;
}
}
}
@@ -0,0 +1,141 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import javax.baja.naming.BHost;
import javax.baja.naming.BISession;
import javax.baja.naming.BIpHost;
import javax.baja.naming.BLocalScheme;
import javax.baja.naming.BOrd;
import javax.baja.naming.BServiceScheme;
import javax.baja.nav.BNavRoot;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BComponent;
import javax.baja.sys.BIcon;
import javax.baja.sys.Context;
import javax.baja.sys.ModuleNotFoundException;
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 BLocalHost
extends BIpHost
implements BISession,
BServiceScheme.ServiceSession {
static final BIcon icon = BIcon.std("localhost.png");
public static final Type TYPE;
public static final BLocalHost INSTANCE;
private String navNameSuffix;
static /* synthetic */ Class class$javax$baja$naming$BLocalHost;
public BOrd getAbsoluteOrd() {
return BLocalScheme.ORD;
}
public boolean isConnected() {
return true;
}
public void connect() throws Exception {
}
public BHost getHost() {
return this;
}
public BOrd getOrdInHost() {
return BOrd.make("");
}
public Context getSessionContext() {
return null;
}
public Object fw(int n, Object object, Object object2, Object object3, Object object4) {
if (n == 404) {
if (object != null) {
try {
return Sys.getRegistry().getModule((String)object).getVendorVersion();
}
catch (ModuleNotFoundException moduleNotFoundException) {
return Version.NULL;
}
}
return Sys.getBajaModule().getVendorVersion();
}
return super.fw(n, object, object2, object3, object4);
}
public BComponent getService(Type type) {
return Sys.getService(type);
}
public String getNavDisplayName(Context context) {
if (this.getLexiconText() == null) {
this.setLexiconText(LexiconText.make("baja", "nav.localHost"));
}
if (this.navNameSuffix == null) {
try {
this.navNameSuffix = " : " + Sys.getLocalHost().getHostName();
}
catch (Exception exception) {
this.navNameSuffix = "";
}
}
return this.appendStationName(this.getLexiconText().getText(context) + this.navNameSuffix);
}
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());
}
}
private BLocalHost() {
super("localhost");
}
static {
Class clazz = class$javax$baja$naming$BLocalHost;
if (clazz == null) {
clazz = class$javax$baja$naming$BLocalHost = BLocalHost.class("[Ljavax.baja.naming.BLocalHost;", false);
}
TYPE = Sys.loadType(clazz);
INSTANCE = new BLocalHost();
BNavRoot.INSTANCE.addNavChild(INSTANCE);
cache.put("localhost", INSTANCE);
++cachedLocalHostCount;
try {
String string = TextUtil.toLowerCase((String)Sys.getLocalHost().getHostName());
if (!string.equals("localhost")) {
cache.put(string, INSTANCE);
++cachedLocalHostCount;
}
}
catch (Exception exception) {}
}
}
@@ -0,0 +1,95 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BLocalHost;
import javax.baja.naming.BOrd;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BLocalScheme
extends BOrdScheme {
static final LocalQuery QUERY = new LocalQuery();
public static final BOrd ORD = BOrd.make("local:");
public static final BLocalScheme INSTANCE = new BLocalScheme();
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BLocalScheme;
public OrdQuery parse(String string) {
return QUERY;
}
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
return new OrdTarget(ordTarget, BLocalHost.INSTANCE);
}
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());
}
}
private BLocalScheme() {
super("local");
}
static {
Class clazz = class$javax$baja$naming$BLocalScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BLocalScheme = BLocalScheme.class("[Ljavax.baja.naming.BLocalScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
static class LocalQuery
implements OrdQuery {
public boolean isHost() {
return true;
}
public boolean isSession() {
return true;
}
public void normalize(OrdQueryList ordQueryList, int n) {
ordQueryList.trim(n);
}
public String getScheme() {
return "local";
}
public String getBody() {
return "";
}
public String toString() {
return "local:";
}
LocalQuery() {
}
}
}
@@ -0,0 +1,167 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import com.tridium.sys.module.BModuleTypesContainer;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.baja.file.BIFile;
import javax.baja.file.FilePath;
import javax.baja.log.Log;
import javax.baja.naming.BOrd;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.sys.BModule;
import javax.baja.sys.BModuleSpace;
import javax.baja.sys.BObject;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BModuleScheme
extends BOrdScheme {
public static final BModuleScheme INSTANCE = new BModuleScheme();
public static final Type TYPE;
public static final String moduleDevPropName = "niagara.module.dev";
public static final String moduleDevFileName = "moduledev.properties";
static /* synthetic */ Class class$javax$baja$naming$BModuleScheme;
public OrdQuery parse(String string) {
return new FilePath("module", string);
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
Object object;
FilePath filePath = (FilePath)ordQuery;
if (filePath.getBody().equals("")) {
return new OrdTarget(ordTarget, BModuleSpace.INSTANCE);
}
if (!filePath.isAuthorityAbsolute()) {
throw new UnresolvedException("Modules must be authority absolute");
}
BModule bModule = Sys.loadModule(filePath.getAuthority());
if (filePath.depth() == 0) {
return new OrdTarget(ordTarget, bModule);
}
if (filePath.depth() == 1) {
if (filePath.getName().equals("types")) {
return new OrdTarget(ordTarget, BModuleTypesContainer.get(bModule));
}
} else if (filePath.depth() == 2 && (object = filePath.getNames())[0].equals("types")) {
return new OrdTarget(ordTarget, (BObject)((Object)BModuleTypesContainer.get(bModule).getNavChild(object[1])));
}
if (System.getProperty(moduleDevPropName, "false").equals("true") && this.isModuleDevSupported(filePath)) {
object = Log.getLog(moduleDevPropName);
InputStream inputStream = null;
try {
block18: {
OrdTarget ordTarget2;
try {
File file = new File(Sys.getBajaHome(), "lib/moduledev.properties");
if (!file.exists()) break block18;
inputStream = new FileInputStream(file);
Properties properties = new Properties();
properties.load(inputStream);
String string = properties.getProperty(filePath.getAuthority());
if (string == null) break block18;
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("/");
stringBuffer.append(string);
stringBuffer.append("/src");
stringBuffer.append(filePath.getBody().substring(filePath.getAuthority().length() + 2, filePath.getBody().length()));
String string2 = stringBuffer.toString();
((Log)object).message("Accessing Module Dev File: " + string2);
BIFile bIFile = (BIFile)((Object)BOrd.make(new FilePath(string2)).get());
ordTarget2 = new OrdTarget(ordTarget, (BObject)((Object)bIFile));
Object var8_16 = null;
}
catch (IOException iOException) {
String string = "Error accessing module dev resource: " + ordQuery;
((Log)object).error(string, iOException);
throw new UnresolvedException(string, iOException);
}
try {
if (inputStream == null) return ordTarget2;
inputStream.close();
return ordTarget2;
}
catch (Exception exception) {}
return ordTarget2;
}
Object var8_18 = null;
}
catch (Throwable throwable) {
Object var8_17 = null;
try {}
catch (Exception exception) {}
if (inputStream == null) throw throwable;
inputStream.close();
throw throwable;
throw throwable;
}
try {}
catch (Exception exception) {}
if (inputStream != null) {
inputStream.close();
}
}
object = bModule.resolveFile(filePath);
return new OrdTarget(ordTarget, (BObject)object);
}
public Type getType() {
return TYPE;
}
private final boolean isModuleDevSupported(FilePath filePath) {
String string = filePath.toString().toLowerCase();
boolean bl = false;
if (string.endsWith(".js") || string.endsWith(".css") || string.endsWith(".vm") || string.endsWith(".htm") || string.endsWith(".html")) {
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 BModuleScheme() {
super("module");
}
static {
Class clazz = class$javax$baja$naming$BModuleScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BModuleScheme = BModuleScheme.class("[Ljavax.baja.naming.BModuleScheme;", false);
}
TYPE = Sys.loadType(clazz);
if (System.getProperty(moduleDevPropName, "false").equals("true")) {
System.out.println("*** Module Dev Mode Enabled: this should NOT be enabled for a release/production environment! ***");
}
}
}
@@ -0,0 +1,545 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import javax.baja.naming.BHost;
import javax.baja.naming.BIAlias;
import javax.baja.naming.BISession;
import javax.baja.naming.BLocalHost;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.BasicQuery;
import javax.baja.naming.NullOrdException;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.Path;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnknownSchemeException;
import javax.baja.naming.UnresolvedException;
import javax.baja.naming.ViewQuery;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.TextUtil;
import javax.baja.space.BISpaceNode;
import javax.baja.space.BSpace;
import javax.baja.sys.BFacets;
import javax.baja.sys.BIComparable;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public final class BOrd
extends BSimple
implements BIComparable,
BIAlias {
public static final BOrd NULL;
public static final BOrd DEFAULT;
public static final Type TYPE;
int hashCode;
String string;
static /* synthetic */ Class class$javax$baja$naming$BOrd;
static /* synthetic */ Class class$java$lang$String;
public static final BOrd make(String string) {
if (string.equals("null")) {
return NULL;
}
return new BOrd(string);
}
public static final BOrd make(BOrd bOrd, BOrd bOrd2) {
if (bOrd.toString().length() == 0) {
return bOrd2;
}
if (bOrd2.toString().length() == 0) {
return bOrd;
}
if (bOrd.isNull()) {
throw new NullOrdException("base");
}
if (bOrd2.isNull()) {
throw new NullOrdException("child");
}
return new BOrd(bOrd.string + '|' + bOrd2.string);
}
public static final BOrd make(BOrd bOrd, String string) {
return BOrd.make(bOrd, BOrd.make(string));
}
public static final BOrd make(BOrd bOrd, OrdQuery ordQuery) {
return BOrd.make(bOrd, BOrd.make(ordQuery));
}
public static final BOrd make(OrdQuery ordQuery) {
return BOrd.make(new OrdQuery[]{ordQuery});
}
public static final BOrd make(OrdQuery[] ordQueryArray) {
return BOrd.make(ordQueryArray, 0, ordQueryArray.length);
}
public static final BOrd make(OrdQuery[] ordQueryArray, int n, int n2) {
if (n > n2) {
throw new IllegalArgumentException("start > end");
}
StringBuffer stringBuffer = new StringBuffer();
int n3 = n;
while (n3 < n2) {
OrdQuery ordQuery = ordQueryArray[n3];
String string = ordQuery.getBody();
if (n3 > n) {
stringBuffer.append('|');
}
stringBuffer.append(ordQuery.getScheme()).append(':').append(ordQuery.getBody());
++n3;
}
return new BOrd(stringBuffer.toString());
}
public final BObject get() {
return this.resolve(BLocalHost.INSTANCE, null).get();
}
public final BObject get(BObject bObject) {
return this.resolve(bObject).get();
}
public final BObject get(BObject bObject, Context context) {
return this.resolve(bObject, context).get();
}
public final OrdTarget resolve() {
return this.resolve(BLocalHost.INSTANCE, null);
}
public final OrdTarget resolve(BObject bObject) {
return this.resolve(bObject, null);
}
public final OrdTarget resolve(BObject bObject, Context context) throws NullOrdException, UnknownSchemeException, SyntaxException, UnresolvedException {
if (bObject == null) {
bObject = BLocalHost.INSTANCE;
}
OrdQuery[] ordQueryArray = this.parse();
if (this.isNull() || ordQueryArray.length == 0) {
throw new NullOrdException();
}
OrdQueryList ordQueryList = new OrdQueryList(ordQueryArray);
while (BOrd.normalize(ordQueryList)) {
}
ordQueryArray = ordQueryList.toArray();
OrdTarget ordTarget = new OrdTarget(context, this, ordQueryArray, bObject);
int n = 0;
while (n < ordQueryArray.length) {
OrdQuery ordQuery = ordQueryArray[n];
BOrdScheme bOrdScheme = BOrdScheme.lookup(ordQuery.getScheme());
ordTarget = bOrdScheme.resolve(ordTarget, ordQuery);
if (ordTarget == null) {
throw new UnresolvedException(this.string);
}
++n;
}
return ordTarget;
}
public static final BHost toHost(BObject bObject) {
if (bObject instanceof BHost) {
return (BHost)bObject;
}
if (bObject instanceof BISession) {
return ((BISession)((Object)bObject)).getHost();
}
if (bObject instanceof BSpace) {
return ((BSpace)bObject).getHost();
}
if (bObject instanceof BISpaceNode) {
return ((BISpaceNode)((Object)bObject)).getHost();
}
return null;
}
public static final BISession toSession(BObject bObject) {
if (bObject instanceof BISession) {
return (BISession)((Object)bObject);
}
if (bObject instanceof BSpace) {
return ((BSpace)bObject).getSession();
}
if (bObject instanceof BISpaceNode) {
return ((BISpaceNode)((Object)bObject)).getSession();
}
return null;
}
public static final BSpace toSpace(BObject bObject) {
if (bObject instanceof BSpace) {
return (BSpace)bObject;
}
if (bObject instanceof BISpaceNode) {
return ((BISpaceNode)((Object)bObject)).getSpace();
}
return null;
}
public final OrdQuery[] parse() {
if (this.isNull()) {
throw new NullOrdException();
}
OrdQuery[] ordQueryArray = new OrdQuery[32];
int n = 0;
String string = this.string;
int n2 = string.length();
int n3 = 0;
int n4 = 0;
int n5 = -1;
int n6 = 0;
while (n6 < n2) {
char c = string.charAt(n6);
if (c < ' ') {
throw new SyntaxException("Invalid ord char 0x" + Integer.toHexString(c));
}
if (c == ' ') {
if (n6 == n3) {
n3 = n6 + 1;
}
} else if (c == '|') {
ordQueryArray[n++] = BOrd.parse(string, n3, n4, n5);
n3 = n6 + 1;
n4 = n6 + 1;
n5 = -1;
} else {
if (c == ':' && n5 < 0) {
n5 = n6;
}
n4 = n6;
}
++n6;
}
if (n3 < n2) {
ordQueryArray[n++] = BOrd.parse(string, n3, n4, n5);
}
OrdQuery[] ordQueryArray2 = new OrdQuery[n];
System.arraycopy(ordQueryArray, 0, ordQueryArray2, 0, n);
return ordQueryArray2;
}
static final OrdQuery parse(String string, int n, int n2, int n3) {
if (n3 < 0) {
throw new SyntaxException("Missing scheme name");
}
String string2 = string.substring(n, n3);
String string3 = string.substring(n3 + 1, n2 + 1);
return BOrd.parse(string2, string3);
}
public static final OrdQuery parse(String string, String string2) {
string = TextUtil.toLowerCase((String)string);
string2 = string2.trim();
try {
return BOrdScheme.lookup(string).parse(string2);
}
catch (UnknownSchemeException unknownSchemeException) {
return new BasicQuery(string, string2);
}
catch (SyntaxException syntaxException) {
throw syntaxException;
}
catch (Throwable throwable) {
throw new SyntaxException(throwable);
}
}
public final BOrd getParent() {
OrdQuery[] ordQueryArray = this.parse();
int n = ordQueryArray.length - 1;
if (n >= ordQueryArray.length || n < 0) {
return null;
}
OrdQuery ordQuery = ordQueryArray[n];
if (ordQuery instanceof ViewQuery) {
if (--n >= ordQueryArray.length || n < 0) {
return null;
}
ordQuery = ordQueryArray[n];
}
if (!(ordQuery instanceof Path)) {
return null;
}
Path path = (Path)((Object)ordQuery);
Path path2 = path.getParentPath();
if (path2 == null) {
return null;
}
ordQueryArray[n] = (OrdQuery)((Object)path2);
return BOrd.make(ordQueryArray, 0, n + 1);
}
public final BOrd normalize() {
OrdQueryList ordQueryList = new OrdQueryList(this.parse());
while (BOrd.normalize(ordQueryList)) {
}
int n = 0;
while (n < ordQueryList.size()) {
BOrdScheme.lookup(ordQueryList.get(n).getScheme());
++n;
}
return BOrd.make(ordQueryList.toArray());
}
public final BOrd relativizeToHost() {
OrdQueryList ordQueryList = new OrdQueryList(this.parse());
while (BOrd.normalize(ordQueryList)) {
}
int n = ordQueryList.size() - 1;
while (n >= 0) {
if (ordQueryList.get(n).isHost()) {
ordQueryList.trim(n + 1);
break;
}
--n;
}
return BOrd.make(ordQueryList.toArray());
}
public final BOrd relativizeToSession() {
OrdQueryList ordQueryList = new OrdQueryList(this.parse());
while (BOrd.normalize(ordQueryList)) {
}
int n = ordQueryList.size() - 1;
while (n >= 0) {
if (ordQueryList.get(n).isHost() || ordQueryList.get(n).isSession()) {
ordQueryList.trim(n + 1);
break;
}
--n;
}
return BOrd.make(ordQueryList.toArray());
}
private static final boolean normalize(OrdQueryList ordQueryList) {
ordQueryList.modified = false;
int n = ordQueryList.size();
int n2 = 0;
while (n2 < n) {
OrdQuery ordQuery = ordQueryList.get(n2);
ordQuery.normalize(ordQueryList, n2);
if (ordQueryList.modified) {
return true;
}
++n2;
}
return false;
}
public final BOrd substitute(BFacets bFacets) throws Exception {
final BFacets bFacets2 = bFacets;
final StringBuffer stringBuffer = new StringBuffer();
this.scanForVariables(new Scanner(){
public final void handleVariable(String string) {
String string2 = bFacets2.gets(string, null);
if (string2 == null) {
stringBuffer.append("$(").append(string).append(")");
} else {
stringBuffer.append(string2);
}
}
public final void appendChar(char c) {
stringBuffer.append(c);
}
});
return BOrd.make(stringBuffer.toString());
}
public final boolean hasVariables() {
final boolean[] blArray = new boolean[]{false};
this.scanForVariables(new Scanner(){
public final void handleVariable(String string) {
blArray[0] = true;
}
public final void appendChar(char c) {
}
});
return blArray[0];
}
public final String[] getVariables() {
Class clazz = class$java$lang$String;
if (clazz == null) {
clazz = class$java$lang$String = BOrd.class("[Ljava.lang.String;", false);
}
final Array array = new Array(clazz);
this.scanForVariables(new Scanner(){
public final void handleVariable(String string) {
array.add((Object)string);
}
public final void appendChar(char c) {
}
});
return (String[])array.trim();
}
private final void scanForVariables(Scanner scanner) {
StringBuffer stringBuffer = new StringBuffer();
int n = this.string.length();
int n2 = 0;
while (n2 < n) {
int n3;
char c = this.string.charAt(n2);
int n4 = n3 = n2 < n - 1 ? (int)this.string.charAt(n2 + 1) : -1;
if (c == '$' && n3 == 40) {
stringBuffer.setLength(0);
if ((n2 += 2) >= n) {
throw new SyntaxException("Missing closing paren");
}
c = this.string.charAt(n2);
while (c != ')') {
if (n2 >= n - 1) {
throw new SyntaxException("Missing closing paren");
}
boolean bl = false;
if (c >= 'A' && c <= 'Z') {
bl = true;
} else if (c >= 'a' && c <= 'z') {
bl = true;
} else if (c >= '0' && c <= '9') {
bl = true;
}
if (!bl) {
throw new SyntaxException("Illegal character in variable name: '" + (char)c + '\'');
}
stringBuffer.append(c);
c = this.string.charAt(++n2);
}
String string = stringBuffer.toString();
if (string.length() == 0) {
throw new SyntaxException("Empty variable name");
}
scanner.handleVariable(string);
} else {
scanner.appendChar(c);
}
++n2;
}
}
public final BOrd getSubOrd(int n) {
OrdQuery[] ordQueryArray = this.parse();
return BOrd.make(ordQueryArray, n, ordQueryArray.length);
}
public final BOrd getSubOrd(int n, int n2) {
OrdQuery[] ordQueryArray = this.parse();
return BOrd.make(ordQueryArray, n, n2);
}
public final BOrd getOrd() {
return this;
}
public final boolean isNull() {
boolean bl = false;
if (this == NULL) {
bl = true;
}
return bl;
}
public final int hashCode() {
if (this.hashCode == -1) {
this.hashCode = TextUtil.toLowerCase((String)this.string).hashCode();
}
return this.hashCode;
}
public final boolean equals(Object object) {
if (object instanceof BOrd) {
return this.string.equals(((BOrd)object).string);
}
return false;
}
public final int compareTo(Object object) {
return this.string.compareTo(((BOrd)object).string);
}
public final String toString(Context context) {
return this.string;
}
public final void encode(DataOutput dataOutput) throws IOException {
dataOutput.writeUTF(this.string);
}
public final BObject decode(DataInput dataInput) throws IOException {
return BOrd.make(dataInput.readUTF());
}
public final String encodeToString() {
return this.string;
}
public final BObject decodeFromString(String string) throws IOException {
return BOrd.make(string);
}
public final 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());
}
}
private final /* synthetic */ void this() {
this.hashCode = -1;
}
private BOrd(String string) {
this.this();
this.string = string;
}
static {
DEFAULT = NULL = new BOrd("null");
Class clazz = class$javax$baja$naming$BOrd;
if (clazz == null) {
clazz = class$javax$baja$naming$BOrd = BOrd.class("[Ljavax.baja.naming.BOrd;", false);
}
TYPE = Sys.loadType(clazz);
}
private static interface Scanner {
public void handleVariable(String var1);
public void appendChar(char var1);
}
}
@@ -0,0 +1,211 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.baja.naming.BOrd;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public final class BOrdList
extends BSimple {
public static final BOrdList NULL;
public static final BOrdList DEFAULT;
public static final Type TYPE;
private int hashCode;
private BOrd[] ords;
private String string;
static /* synthetic */ Class class$javax$baja$naming$BOrdList;
public static final BOrdList make(BOrd bOrd) {
return new BOrdList(new BOrd[]{bOrd}, bOrd.encodeToString());
}
public static final BOrdList make(BOrd[] bOrdArray) {
if (bOrdArray.length == 0) {
return NULL;
}
return new BOrdList((BOrd[])bOrdArray.clone(), null);
}
public static final BOrdList add(BOrdList bOrdList, BOrd bOrd) {
BOrd[] bOrdArray = new BOrd[bOrdList.ords.length + 1];
System.arraycopy(bOrdList.ords, 0, bOrdArray, 0, bOrdList.ords.length);
bOrdArray[bOrdArray.length - 1] = bOrd;
return new BOrdList(bOrdArray, null);
}
public static final BOrdList remove(BOrdList bOrdList, int n) {
BOrd[] bOrdArray = new BOrd[bOrdList.ords.length - 1];
System.arraycopy(bOrdList.ords, 0, bOrdArray, 0, n);
if (n < bOrdList.ords.length) {
System.arraycopy(bOrdList.ords, n + 1, bOrdArray, n, bOrdList.ords.length - n - 1);
}
return new BOrdList(bOrdArray, null);
}
public static final BOrdList make(String string) {
return (BOrdList)DEFAULT.decodeFromString(string);
}
public final BOrd get(int n) {
return this.ords[n];
}
public final int size() {
return this.ords.length;
}
public final boolean isNull() {
boolean bl = false;
if (this.ords.length == 0) {
bl = true;
}
return bl;
}
public final BOrd[] toArray() {
return (BOrd[])this.ords.clone();
}
public final int hashCode() {
if (this.hashCode == -1) {
int n = 11;
int n2 = 0;
while (n2 < this.ords.length) {
n ^= this.ords[n2].hashCode();
++n2;
}
this.hashCode = n;
}
return this.hashCode;
}
public final boolean equals(Object object) {
if (object instanceof BOrdList) {
BOrd[] bOrdArray = this.ords;
BOrd[] bOrdArray2 = ((BOrdList)object).ords;
if (bOrdArray.length != bOrdArray2.length) {
return false;
}
int n = 0;
while (n < bOrdArray.length) {
if (!bOrdArray[n].equals(bOrdArray2[n])) {
return false;
}
++n;
}
return true;
}
return false;
}
public final void encode(DataOutput dataOutput) throws IOException {
dataOutput.writeUTF(this.encodeToString());
}
public final BObject decode(DataInput dataInput) throws IOException {
return this.decodeFromString(dataInput.readUTF());
}
public final String encodeToString() {
if (this.string == null) {
if (this.ords.length == 1) {
this.string = this.ords[0].encodeToString();
} else {
StringBuffer stringBuffer = new StringBuffer();
int n = 0;
while (n < this.ords.length) {
if (n > 0) {
stringBuffer.append('\n');
}
stringBuffer.append(this.ords[n].encodeToString());
++n;
}
this.string = stringBuffer.toString();
}
}
return this.string;
}
public final BObject decodeFromString(String string) {
if (string.length() == 0) {
return DEFAULT;
}
int n = string.indexOf(10);
if (n < 0) {
return new BOrdList(new BOrd[]{BOrd.make(string)}, string);
}
ArrayList<BOrd> arrayList = new ArrayList<BOrd>();
StringTokenizer stringTokenizer = new StringTokenizer(string, "\n");
while (stringTokenizer.hasMoreTokens()) {
arrayList.add(BOrd.make(stringTokenizer.nextToken()));
}
BOrd[] bOrdArray = arrayList.toArray(new BOrd[arrayList.size()]);
return new BOrdList(bOrdArray, string);
}
public final String toString(Context context) {
if (this.ords.length == 1) {
return this.ords[0].toString(context);
}
StringBuffer stringBuffer = new StringBuffer();
int n = 0;
while (n < this.ords.length) {
if (n > 0) {
stringBuffer.append("; ");
}
stringBuffer.append(this.ords[n].toString(context));
++n;
}
return stringBuffer.toString();
}
public final 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());
}
}
private final /* synthetic */ void this() {
this.hashCode = -1;
}
private BOrdList(BOrd[] bOrdArray, String string) {
this.this();
this.ords = bOrdArray;
this.string = string;
}
static {
DEFAULT = NULL = new BOrdList(new BOrd[0], "");
Class clazz = class$javax$baja$naming$BOrdList;
if (clazz == null) {
clazz = class$javax$baja$naming$BOrdList = BOrdList.class("[Ljavax.baja.naming.BOrdList;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,71 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import javax.baja.naming.BasicQuery;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BSingleton;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BOrdScheme
extends BSingleton {
public static final Type TYPE;
private String id;
static /* synthetic */ Class class$javax$baja$naming$BOrdScheme;
public static BOrdScheme lookup(String string) {
return (BOrdScheme)Sys.getRegistry().getOrdScheme(string).getInstance();
}
public final String getId() {
return this.id;
}
public OrdQuery parse(String string) {
return new BasicQuery(this.id, string);
}
public abstract OrdTarget resolve(OrdTarget var1, OrdQuery var2) throws SyntaxException, UnresolvedException;
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());
}
}
protected BOrdScheme(String string) {
this.id = TextUtil.toLowerCase((String)string);
}
static {
Class clazz = class$javax$baja$naming$BOrdScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BOrdScheme = BOrdScheme.class("[Ljavax.baja.naming.BOrdScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,130 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BISession;
import javax.baja.naming.BOrd;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.InvalidOrdBaseException;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.sys.BComponent;
import javax.baja.sys.ModuleNotFoundException;
import javax.baja.sys.ServiceNotFoundException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.sys.TypeNotFoundException;
import javax.baja.util.BTypeSpec;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BServiceScheme
extends BOrdScheme {
public static final BServiceScheme INSTANCE = new BServiceScheme();
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BServiceScheme;
public OrdQuery parse(String string) {
if (string.length() < 3 || string.indexOf(58) <= 0) {
throw new SyntaxException("Not a typespec: \"" + string + '\"');
}
return new ServiceQuery(string);
}
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
BComponent bComponent = null;
try {
BTypeSpec bTypeSpec = BTypeSpec.make(ordQuery.getBody());
Type type = bTypeSpec.getResolvedType();
BISession bISession = BOrd.toSession(ordTarget.get());
if (bISession == null) {
throw new InvalidOrdBaseException("" + ordTarget);
}
if (!(bISession instanceof ServiceSession)) {
throw new InvalidOrdBaseException("Session does not support services");
}
bComponent = ((ServiceSession)((Object)bISession)).getService(type);
}
catch (ModuleNotFoundException moduleNotFoundException) {
}
catch (TypeNotFoundException typeNotFoundException) {
}
catch (ServiceNotFoundException serviceNotFoundException) {}
if (bComponent == null) {
throw new UnresolvedException("Service not found: " + ordQuery.getBody());
}
return new OrdTarget(ordTarget, bComponent);
}
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());
}
}
private BServiceScheme() {
super("service");
}
static {
Class clazz = class$javax$baja$naming$BServiceScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BServiceScheme = BServiceScheme.class("[Ljavax.baja.naming.BServiceScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
static class ServiceQuery
implements OrdQuery {
String body;
public boolean isHost() {
return false;
}
public boolean isSession() {
return false;
}
public void normalize(OrdQueryList ordQueryList, int n) {
ordQueryList.shiftToSession(n);
}
public String getScheme() {
return "service";
}
public String getBody() {
return this.body;
}
public String toString() {
return "service:" + this.body;
}
ServiceQuery(String string) {
this.body = string;
}
}
public static interface ServiceSession {
public BComponent getService(Type var1);
}
}
@@ -0,0 +1,64 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import com.tridium.util.BSessionInfo;
import javax.baja.naming.BISession;
import javax.baja.nav.BNavContainer;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BSession
extends BNavContainer
implements BISession {
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BSession;
public Context getSessionContext() {
return null;
}
public BSessionInfo getSessionInfo() {
return null;
}
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 BSession(String string, LexiconText lexiconText) {
super(string, lexiconText);
}
public BSession(String string) {
super(string);
}
static {
Class clazz = class$javax$baja$naming$BSession;
if (clazz == null) {
clazz = class$javax$baja$naming$BSession = BSession.class("[Ljavax.baja.naming.BSession;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,174 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.InvalidOrdBaseException;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SlotPath;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.space.BComponentSpace;
import javax.baja.sys.BComplex;
import javax.baja.sys.BComponent;
import javax.baja.sys.BIPropertyContainer;
import javax.baja.sys.BObject;
import javax.baja.sys.BValue;
import javax.baja.sys.Property;
import javax.baja.sys.Slot;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.virtual.BVirtualGateway;
import javax.baja.virtual.VirtualPath;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BSlotScheme
extends BOrdScheme {
public static final BSlotScheme INSTANCE = new BSlotScheme();
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BSlotScheme;
public OrdQuery parse(String string) {
return new SlotPath(this.getId(), string);
}
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
BObject bObject;
BObject bObject2 = ordTarget.get();
BIPropertyContainer bIPropertyContainer = null;
SlotPath slotPath = (SlotPath)ordQuery;
boolean bl = slotPath instanceof VirtualPath;
BComponentSpace bComponentSpace = null;
if (bObject2 instanceof BVirtualGateway && bl) {
bComponentSpace = ((BVirtualGateway)bObject2).getVirtualSpace();
bIPropertyContainer = bComponentSpace.getRootComponent();
} else if (bObject2 instanceof BComponentSpace) {
bComponentSpace = (BComponentSpace)bObject2;
bIPropertyContainer = bComponentSpace.getRootComponent();
} else if (bObject2 instanceof BComponent) {
bObject = bObject2.asComponent();
bComponentSpace = ((BComponent)bObject).getComponentSpace();
if (slotPath.isAbsolute()) {
bObject = bComponentSpace.getRootComponent();
}
bIPropertyContainer = bObject;
} else if (bObject2 instanceof BIPropertyContainer) {
bIPropertyContainer = (BIPropertyContainer)((Object)bObject2);
}
if (bl && slotPath.getBody().equals("")) {
return new OrdTarget(ordTarget, bComponentSpace);
}
bObject = (BObject)((Object)bIPropertyContainer);
if (bObject == null) {
if (!(bObject2 instanceof BValue)) {
throw new InvalidOrdBaseException("" + bObject2);
}
bObject = bObject2;
}
BIPropertyContainer bIPropertyContainer2 = bIPropertyContainer;
Slot slot = null;
int n = slotPath.depth();
Property[] propertyArray = null;
int n2 = 0;
int n3 = slotPath.getBackupDepth();
int n4 = 0;
while (n4 < n3) {
bObject = (BObject)((Object)(bIPropertyContainer2 = bIPropertyContainer2 instanceof BComponent ? (BComponent)((BComplex)((Object)bIPropertyContainer2)).getParent() : null));
if (bObject == null) {
throw new UnresolvedException("Cannot walk backup depth" + bObject2);
}
++n4;
}
n4 = 0;
while (n4 < n) {
String string = slotPath.nameAt(n4);
if (bl) {
string = SlotPath.escape(string);
}
boolean bl2 = true;
if (bComponentSpace != null && bObject.isComponent()) {
slot = bComponentSpace.getLoadCallbacks().loadSlot(bObject.asComponent(), string);
boolean bl3 = false;
if (slot == null) {
bl3 = true;
}
bl2 = bl3;
}
boolean bl4 = bObject instanceof BIPropertyContainer;
if (bl2) {
if (bl4) {
((BIPropertyContainer)((Object)bObject)).loadSlots();
slot = ((BIPropertyContainer)((Object)bObject)).getSlot(string);
} else {
bObject.asComplex().loadSlots();
slot = bObject.asComplex().getSlot(string);
}
}
if (slot == null) {
throw new UnresolvedException(slotPath.getBody());
}
if (!(slot instanceof Property)) {
if (n4 != n - 1) {
throw new UnresolvedException(slotPath.getBody());
}
return new OrdTarget(ordTarget, bIPropertyContainer2, null, slot, null);
}
Property property = (Property)slot;
BObject bObject3 = bObject = bl4 ? ((BIPropertyContainer)((Object)bObject)).get(property) : bObject.asComplex().get(property);
if (n2 == 0 && bObject instanceof BIPropertyContainer) {
bIPropertyContainer2 = (BIPropertyContainer)((Object)bObject);
} else {
if (propertyArray == null) {
propertyArray = new Property[32];
}
propertyArray[n2++] = property;
}
++n4;
}
if (n2 == 0) {
return new OrdTarget(ordTarget, (BObject)((Object)bIPropertyContainer2));
}
slot = propertyArray[0];
Property[] propertyArray2 = new Property[n2];
System.arraycopy(propertyArray, 0, propertyArray2, 0, n2);
return new OrdTarget(ordTarget, bIPropertyContainer2, bObject, slot, propertyArray2);
}
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());
}
}
private BSlotScheme() {
super("slot");
}
protected BSlotScheme(String string) {
super(string);
}
static {
Class clazz = class$javax$baja$naming$BSlotScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BSlotScheme = BSlotScheme.class("[Ljavax.baja.naming.BSlotScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,49 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BOrdScheme;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class BStationSessionScheme
extends BOrdScheme {
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BStationSessionScheme;
public abstract int getDefaultPort();
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());
}
}
protected BStationSessionScheme(String string) {
super(string);
}
static {
Class clazz = class$javax$baja$naming$BStationSessionScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BStationSessionScheme = BStationSessionScheme.class("[Ljavax.baja.naming.BStationSessionScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,61 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.BOrdScheme;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SyntaxException;
import javax.baja.naming.UnresolvedException;
import javax.baja.naming.ViewQuery;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BViewScheme
extends BOrdScheme {
public static final BViewScheme INSTANCE = new BViewScheme();
public static final Type TYPE;
static /* synthetic */ Class class$javax$baja$naming$BViewScheme;
public OrdQuery parse(String string) {
return new ViewQuery(this.getId(), string);
}
public OrdTarget resolve(OrdTarget ordTarget, OrdQuery ordQuery) throws SyntaxException, UnresolvedException {
return ordTarget;
}
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());
}
}
private BViewScheme() {
super("view");
}
static {
Class clazz = class$javax$baja$naming$BViewScheme;
if (clazz == null) {
clazz = class$javax$baja$naming$BViewScheme = BViewScheme.class("[Ljavax.baja.naming.BViewScheme;", false);
}
TYPE = Sys.loadType(clazz);
}
}
@@ -0,0 +1,46 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.nre.util.TextUtil;
public class BasicQuery
implements OrdQuery {
protected String scheme;
protected String body;
public String getScheme() {
return this.scheme;
}
public String getBody() {
return this.body;
}
public boolean isHost() {
return false;
}
public boolean isSession() {
return false;
}
public void normalize(OrdQueryList ordQueryList, int n) {
}
public String toString() {
return this.scheme + ':' + this.body;
}
public BasicQuery(String string, String string2) {
this.scheme = TextUtil.toLowerCase((String)string).trim();
this.body = string2.trim();
}
}
@@ -0,0 +1,379 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.Array
*/
package javax.baja.naming;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SlotPath;
import javax.baja.naming.UnresolvedException;
import javax.baja.nre.util.Array;
import javax.baja.space.BComponentSpace;
import javax.baja.sys.BComponent;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.virtual.BVirtualGateway;
import javax.baja.virtual.VirtualPath;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BatchResolve {
BOrd[] ords;
Result[] results;
static /* synthetic */ Class class$javax$baja$naming$BatchResolve$ComponentSpaceItem;
static /* synthetic */ Class class$javax$baja$naming$BatchResolve$ComponentSpaceGroup;
static /* synthetic */ Class class$javax$baja$naming$SlotPath;
public int size() {
return this.ords.length;
}
public BOrd getOrd(int n) {
return this.ords[n];
}
public boolean isResolved(int n) {
boolean bl = false;
if (this.results[n].target != null) {
bl = true;
}
return bl;
}
public Throwable getException(int n) {
return this.results[n].exception;
}
public OrdTarget getTarget(int n) {
Result result = this.results[n];
OrdTarget ordTarget = result.target;
if (ordTarget != null) {
return ordTarget;
}
if (result.exception instanceof RuntimeException) {
throw (RuntimeException)result.exception;
}
throw new UnresolvedException("" + this.ords[n], result.exception);
}
public BObject get(int n) {
return this.getTarget(n).get();
}
public OrdTarget[] getTargets() {
OrdTarget[] ordTargetArray = new OrdTarget[this.results.length];
int n = 0;
while (n < ordTargetArray.length) {
ordTargetArray[n] = this.getTarget(n);
++n;
}
return ordTargetArray;
}
public BObject[] getTargetObjects() {
OrdTarget[] ordTargetArray = this.getTargets();
BObject[] bObjectArray = new BObject[ordTargetArray.length];
int n = 0;
while (n < bObjectArray.length) {
bObjectArray[n] = ordTargetArray[n].get();
++n;
}
return bObjectArray;
}
public BComponent[] getTargetComponents() {
OrdTarget[] ordTargetArray = this.getTargets();
BComponent[] bComponentArray = new BComponent[ordTargetArray.length];
int n = 0;
while (n < bComponentArray.length) {
bComponentArray[n] = (BComponent)ordTargetArray[n].get();
++n;
}
return bComponentArray;
}
public BatchResolve resolve(BObject bObject) {
return this.resolve(bObject, null);
}
public BatchResolve resolve(BObject bObject, Context context) {
try {
this.resolveComponentSpace(bObject, context);
}
catch (Exception exception) {
exception.printStackTrace();
}
int n = 0;
while (n < this.ords.length) {
Result result = this.results[n];
if (result.target == null && result.exception == null) {
try {
result.target = this.ords[n].resolve(bObject, context);
result.exception = null;
}
catch (Throwable throwable) {
result.target = null;
result.exception = throwable;
}
}
++n;
}
return this;
}
private final void resolveComponentSpace(BObject bObject, Context context) {
Object object;
Class clazz = class$javax$baja$naming$BatchResolve$ComponentSpaceItem;
if (clazz == null) {
clazz = class$javax$baja$naming$BatchResolve$ComponentSpaceItem = BatchResolve.class("[Ljavax.baja.naming.BatchResolve$ComponentSpaceItem;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < this.ords.length) {
BOrd bOrd = this.ords[n];
if ((bOrd.toString().indexOf("slot:") >= 0 || bOrd.toString().indexOf("virtual:") >= 0 || bOrd.toString().indexOf("h:") >= 0) && (object = this.makeComponentSpaceItem(bOrd, bObject)) != null) {
array.add(object);
}
++n;
}
if (array.size() == 0) {
return;
}
Class clazz2 = class$javax$baja$naming$BatchResolve$ComponentSpaceGroup;
if (clazz2 == null) {
clazz2 = class$javax$baja$naming$BatchResolve$ComponentSpaceGroup = BatchResolve.class("[Ljavax.baja.naming.BatchResolve$ComponentSpaceGroup;", false);
}
Array array2 = new Array(clazz2);
int n2 = 0;
while (n2 < array.size()) {
object = (ComponentSpaceItem)array.get(n2);
BComponentSpace bComponentSpace = ((ComponentSpaceItem)object).space;
ComponentSpaceGroup componentSpaceGroup = null;
int n3 = 0;
while (n3 < array2.size()) {
ComponentSpaceGroup componentSpaceGroup2 = (ComponentSpaceGroup)array2.get(n3);
if (componentSpaceGroup2.space == bComponentSpace) {
componentSpaceGroup = componentSpaceGroup2;
break;
}
++n3;
}
if (componentSpaceGroup == null) {
componentSpaceGroup = new ComponentSpaceGroup(bComponentSpace);
array2.add((Object)componentSpaceGroup);
}
componentSpaceGroup.items.add(object);
++n2;
}
n2 = 0;
while (n2 < array2.size()) {
object = (ComponentSpaceGroup)array2.get(n2);
this.resolveComponentSpaceGroup((ComponentSpaceGroup)object, bObject, context);
++n2;
}
}
private final ComponentSpaceItem makeComponentSpaceItem(BOrd bOrd, BObject bObject) {
Object object;
Object object2;
ComponentSpaceItem componentSpaceItem = new ComponentSpaceItem(bOrd);
OrdQuery[] ordQueryArray = bOrd.normalize().parse();
int n = -1;
int n2 = 0;
while (n2 < ordQueryArray.length) {
object2 = ordQueryArray[n2];
object = object2.getScheme();
if (((String)object).equals("virtual")) {
n = n2;
componentSpaceItem.slot = object2;
break;
}
if (((String)object).equals("h") && n == -1) {
n = n2;
componentSpaceItem.h = object2;
}
if (((String)object).equals("slot") && n == -1) {
n = n2;
componentSpaceItem.slot = object2;
}
++n2;
}
if (n == -1) {
return null;
}
BObject bObject2 = null;
try {
object2 = BOrd.make(ordQueryArray, 0, n);
if (!((BOrd)object2).isNull()) {
bObject2 = ((BOrd)object2).get(bObject);
}
}
catch (Exception exception) {}
object2 = null;
if (bObject2 instanceof BComponentSpace) {
object2 = (BComponentSpace)bObject2;
} else if (bObject2 instanceof BVirtualGateway) {
object2 = ((BVirtualGateway)bObject2).getVirtualSpace();
} else {
object = BOrd.toSpace(bObject);
if (object instanceof BComponentSpace) {
object2 = (BComponentSpace)object;
}
}
if (object2 == null) {
return null;
}
componentSpaceItem.space = object2;
return componentSpaceItem;
}
private final void resolveComponentSpaceGroup(ComponentSpaceGroup componentSpaceGroup, BObject bObject, Context context) {
Class clazz;
SlotPath[] slotPathArray;
BComponentSpace bComponentSpace = componentSpaceGroup.space;
ComponentSpaceItem[] componentSpaceItemArray = (ComponentSpaceItem[])componentSpaceGroup.items.trim();
Class clazz2 = class$javax$baja$naming$BatchResolve$ComponentSpaceItem;
if (clazz2 == null) {
clazz2 = class$javax$baja$naming$BatchResolve$ComponentSpaceItem = BatchResolve.class("[Ljavax.baja.naming.BatchResolve$ComponentSpaceItem;", false);
}
Array array = new Array(clazz2);
int n = 0;
while (n < componentSpaceItemArray.length) {
slotPathArray = componentSpaceItemArray[n];
if (slotPathArray.slot != null) {
slotPathArray.path = this.toSlotPath(slotPathArray.slot, bObject);
} else {
array.add((Object)slotPathArray);
}
++n;
}
if (array.size() > 0) {
Object[] objectArray = new Object[array.size()];
int n2 = 0;
while (n2 < array.size()) {
ComponentSpaceItem componentSpaceItem = (ComponentSpaceItem)array.get(n2);
objectArray[n2] = componentSpaceItem.h.getBody();
++n2;
}
slotPathArray = bComponentSpace.handlesToSlotPaths(objectArray);
int n3 = 0;
while (n3 < array.size()) {
ComponentSpaceItem componentSpaceItem = (ComponentSpaceItem)array.get(n3);
componentSpaceItem.path = slotPathArray[n3];
++n3;
}
}
if ((clazz = class$javax$baja$naming$SlotPath) == null) {
clazz = class$javax$baja$naming$SlotPath = BatchResolve.class("[Ljavax.baja.naming.SlotPath;", false);
}
Array array2 = new Array(clazz);
int n4 = 0;
while (n4 < componentSpaceItemArray.length) {
ComponentSpaceItem componentSpaceItem = componentSpaceItemArray[n4];
if (componentSpaceItem.path != null) {
array2.add((Object)componentSpaceItem.path);
}
++n4;
}
SlotPath[] slotPathArray2 = (SlotPath[])array2.trim();
bComponentSpace.fw(104, slotPathArray2, null, null, null);
}
SlotPath toSlotPath(OrdQuery ordQuery, BObject bObject) {
SlotPath slotPath = null;
boolean bl = ordQuery.getScheme().equals("virtual");
slotPath = bl ? new VirtualPath(ordQuery.getBody()) : new SlotPath(ordQuery.getBody());
if (slotPath.isAbsolute()) {
return slotPath;
}
if (bObject instanceof BComponent && !bl) {
SlotPath slotPath2 = ((BComponent)bObject).getSlotPath();
return slotPath2.merge(slotPath);
}
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());
}
}
public BatchResolve(BOrd[] bOrdArray) {
this.ords = (BOrd[])bOrdArray.clone();
this.results = new Result[bOrdArray.length];
int n = 0;
while (n < this.results.length) {
this.results[n] = new Result();
++n;
}
}
static class Result {
OrdTarget target;
Throwable exception;
Result() {
}
}
static class ComponentSpaceItem {
BOrd ord;
OrdQuery h;
OrdQuery slot;
BComponentSpace space;
SlotPath path;
ComponentSpaceItem(BOrd bOrd) {
this.ord = bOrd;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
static class ComponentSpaceGroup {
BComponentSpace space;
Array items;
static /* synthetic */ Class class$javax$baja$naming$BatchResolve$ComponentSpaceItem;
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() {
Class clazz = class$javax$baja$naming$BatchResolve$ComponentSpaceItem;
if (clazz == null) {
clazz = class$javax$baja$naming$BatchResolve$ComponentSpaceItem = ComponentSpaceGroup.class("[Ljavax.baja.naming.BatchResolve$ComponentSpaceItem;", false);
}
this.items = new Array(clazz);
}
ComponentSpaceGroup(BComponentSpace bComponentSpace) {
this.this();
this.space = bComponentSpace;
}
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class InvalidOrdBaseException
extends BajaRuntimeException {
public InvalidOrdBaseException(String string, Throwable throwable) {
super(string, throwable);
}
public InvalidOrdBaseException(String string) {
super(string);
}
public InvalidOrdBaseException() {
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class InvalidRootSchemeException
extends BajaRuntimeException {
public InvalidRootSchemeException(String string, Throwable throwable) {
super(string, throwable);
}
public InvalidRootSchemeException(String string) {
super(string);
}
public InvalidRootSchemeException() {
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class NullOrdException
extends BajaRuntimeException {
public NullOrdException(String string, Throwable throwable) {
super(string, throwable);
}
public NullOrdException(String string) {
super(string);
}
public NullOrdException() {
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.naming.OrdQueryList;
public interface OrdQuery {
public String getScheme();
public String getBody();
public boolean isHost();
public boolean isSession();
public void normalize(OrdQueryList var1, int var2);
public String toString();
}
@@ -0,0 +1,173 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import java.util.ArrayList;
import javax.baja.naming.OrdQuery;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public final class OrdQueryList {
ArrayList list;
boolean modified;
public final int size() {
return this.list.size();
}
public final OrdQuery get(int n) {
return (OrdQuery)this.list.get(n);
}
public final OrdQuery[] toArray() {
return this.list.toArray(new OrdQuery[this.list.size()]);
}
public final OrdQuery prev(int n) {
if (n > 0 && this.list.size() > 0) {
return (OrdQuery)this.list.get(n - 1);
}
return null;
}
public final OrdQuery next(int n) {
if (n + 1 < this.list.size()) {
return (OrdQuery)this.list.get(n + 1);
}
return null;
}
public final boolean isSameScheme(int n, int n2) {
if (n >= 0 && n < this.list.size() && n2 >= 0 && n2 < this.list.size()) {
OrdQuery ordQuery = (OrdQuery)this.list.get(n);
OrdQuery ordQuery2 = (OrdQuery)this.list.get(n2);
boolean bl = false;
if (ordQuery.getClass() == ordQuery2.getClass() && ordQuery.getScheme().equals(ordQuery2.getScheme())) {
bl = true;
}
return bl;
}
return false;
}
public final void add(OrdQueryList ordQueryList) {
this.modified = true;
int n = 0;
while (n < ordQueryList.size()) {
this.add(ordQueryList.get(n));
++n;
}
}
public final void add(OrdQuery ordQuery) {
this.modified = true;
this.list.add(this.list.size(), ordQuery);
}
public final void add(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.add(n, ordQuery);
}
public final void replace(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.set(n, ordQuery);
}
public final void remove(int n) {
this.modified = true;
this.list.remove(n);
}
public final void clear() {
this.modified = true;
this.list.clear();
}
public final void trim(int n) {
this.trim(n, this.size());
}
public final void trim(int n, int n2) {
if (n > 0 || n2 < this.list.size()) {
this.modified = true;
int n3 = this.list.size();
int n4 = n2;
while (n4 < n3) {
this.list.remove(n2);
++n4;
}
n4 = 0;
while (n4 < n) {
this.list.remove(0);
++n4;
}
}
}
public final void merge(int n, OrdQuery ordQuery) {
this.modified = true;
this.list.remove(n + 1);
this.list.remove(n);
this.list.add(n, ordQuery);
}
public final void shiftToHost(int n) {
int n2 = n - 1;
while (n2 >= 0) {
if (!this.get(n2).isHost()) {
this.remove(n2);
}
--n2;
}
}
public final void shiftToSession(int n) {
int n2 = n - 1;
while (n2 >= 0) {
OrdQuery ordQuery = this.get(n2);
if (!ordQuery.isHost() && !ordQuery.isSession()) {
this.remove(n2);
}
--n2;
}
}
public final String toString() {
StringBuffer stringBuffer = new StringBuffer();
int n = 0;
while (n < this.list.size()) {
if (n > 0) {
stringBuffer.append('|');
}
stringBuffer.append(this.list.get(n));
++n;
}
return stringBuffer.toString();
}
private final /* synthetic */ void this() {
this.list = new ArrayList();
}
public OrdQueryList(OrdQuery[] ordQueryArray, int n) {
this.this();
this.list.ensureCapacity(n);
int n2 = 0;
while (n2 < n) {
this.list.add(ordQueryArray[n2]);
++n2;
}
}
public OrdQueryList(OrdQuery[] ordQueryArray) {
this(ordQueryArray, ordQueryArray.length);
}
public OrdQueryList() {
this.this();
}
}
@@ -0,0 +1,348 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.file.FilePath;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.ViewQuery;
import javax.baja.security.BIProtected;
import javax.baja.security.BPermissions;
import javax.baja.space.BSpace;
import javax.baja.sys.BComplex;
import javax.baja.sys.BComponent;
import javax.baja.sys.BFacets;
import javax.baja.sys.BIPropertyContainer;
import javax.baja.sys.BObject;
import javax.baja.sys.BasicContext;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Slot;
import javax.baja.user.BUser;
public class OrdTarget
implements Context {
BUser user;
String lang;
BFacets facets;
OrdTarget base;
BOrd ord;
OrdQuery[] queries;
BObject object;
BPermissions permissions;
BIPropertyContainer container;
boolean isTargetReadonly;
Slot slot;
Property[] propertyPath;
boolean mergedSlotFacets;
public static OrdTarget unmounted(BObject bObject) {
return OrdTarget.unmounted(bObject, null);
}
public static OrdTarget unmounted(BObject bObject, Context context) {
return new OrdTarget(context, BOrd.NULL, new OrdQuery[0], bObject);
}
public BUser getUser() {
return this.user;
}
public String getLanguage() {
return this.lang;
}
public BFacets getFacets() {
if (!(this.propertyPath == null && this.slot == null || this.mergedSlotFacets || this.container == null)) {
BFacets bFacets = BFacets.NULL;
if (this.propertyPath != null) {
BObject bObject = (BObject)((Object)this.container);
boolean bl = true;
int n = 0;
while (n < this.propertyPath.length) {
Property property = this.propertyPath[n];
bFacets = BFacets.make(bl ? ((BIPropertyContainer)((Object)bObject)).getSlotFacets(property) : bObject.asComplex().getSlotFacets(property), bFacets);
bObject = bl ? ((BIPropertyContainer)((Object)bObject)).get(property) : bObject.asComplex().get(property);
bl = bObject instanceof BIPropertyContainer;
++n;
}
} else {
bFacets = BFacets.make(this.container.getSlotFacets(this.slot), bFacets);
}
this.facets = BFacets.make(bFacets, this.facets);
this.mergedSlotFacets = true;
}
return this.facets;
}
public BObject getFacet(String string) {
return this.getFacets().get(string);
}
public Context getBase() {
return this.base;
}
public OrdTarget getBaseOrdTarget() {
return this.base;
}
public BOrd getOrd() {
return this.ord;
}
public BSpace getSpace() {
OrdTarget ordTarget = this;
while (ordTarget != null) {
BComponent bComponent;
BSpace bSpace = BOrd.toSpace(this.object);
if (bSpace == null && (bComponent = this.getComponent()) != null) {
bSpace = bComponent.getSpace();
}
if (bSpace != null) {
return bSpace;
}
ordTarget = ordTarget.getBaseOrdTarget();
}
return null;
}
public BObject get() {
return this.object;
}
public BComponent getComponent() {
BComponent bComponent;
if (this.container instanceof BComponent) {
return (BComponent)this.container;
}
if (this.object.isComponent()) {
return this.object.asComponent();
}
if (this.object.isComplex() && (bComponent = this.object.asComplex().getParentComponent()) != null) {
return bComponent;
}
if (this.base != null) {
return this.base.getComponent();
}
return null;
}
public BComplex getParent() {
if (this.container instanceof BComplex && this.propertyPath != null) {
BComplex bComplex = (BComplex)((Object)this.container);
int n = 0;
while (n < this.propertyPath.length - 1) {
bComplex = (BComplex)bComplex.get(this.propertyPath[n]);
++n;
}
return bComplex;
}
if (this.base != null) {
return this.base.getParent();
}
return null;
}
public Slot getSlotInComponent() {
if (this.slot != null) {
return this.slot;
}
if (!(this.base == null || this.container != null || this.object.isComponent() || this.object.isComplex() && this.object.asComplex().getParentComponent() != null)) {
return this.base.getSlotInComponent();
}
return null;
}
public Property[] getPropertyPathInComponent() {
if (this.propertyPath != null) {
return this.propertyPath;
}
if (this.base != null) {
return this.base.getPropertyPathInComponent();
}
return null;
}
public Property getPropertyInParent() {
if (this.propertyPath != null) {
return this.propertyPath[this.propertyPath.length - 1];
}
if (this.base != null) {
return this.base.getPropertyInParent();
}
return null;
}
public BIProtected getSecurityTarget() {
if (this.object instanceof BIProtected) {
return (BIProtected)((Object)this.object);
}
if (this.container instanceof BIProtected) {
return (BIProtected)((Object)this.container);
}
if (this.base != null) {
return this.base.getSecurityTarget();
}
return null;
}
public BPermissions getPermissionsForTarget() {
if (this.permissions == null) {
BIProtected bIProtected = this.getSecurityTarget();
this.permissions = bIProtected != null ? bIProtected.getPermissions(this) : BPermissions.all;
}
return this.permissions;
}
public boolean canRead() {
BIProtected bIProtected = this.getSecurityTarget();
if (bIProtected != null) {
return bIProtected.canRead(this);
}
return true;
}
public boolean canWrite() {
BIProtected bIProtected = this.getSecurityTarget();
if (bIProtected != null) {
return bIProtected.canWrite(this);
}
return true;
}
public boolean canInvoke() {
BIProtected bIProtected = this.getSecurityTarget();
if (bIProtected != null) {
return bIProtected.canInvoke(this);
}
return true;
}
public int depth() {
int n = 0;
if (this.queries != null) {
n = this.queries.length;
}
return n;
}
public OrdQuery queryAt(int n) {
return this.queries[n];
}
public OrdQuery[] getOrdQueries() {
return (OrdQuery[])this.queries.clone();
}
public FilePath getFilePath() {
int n = this.queries.length - 1;
while (n >= 0) {
if (this.queries[n] instanceof FilePath) {
return (FilePath)this.queries[n];
}
--n;
}
return null;
}
public String getFilePathFragment() {
FilePath filePath = this.getFilePath();
if (filePath != null) {
return filePath.getFragment();
}
return null;
}
public ViewQuery getViewQuery() {
int n = this.queries.length - 1;
if (n >= 0 && this.queries[n] instanceof ViewQuery) {
return (ViewQuery)this.queries[n];
}
return null;
}
public String getViewParameter(String string, String string2) {
ViewQuery viewQuery = this.getViewQuery();
if (viewQuery == null) {
return string2;
}
return viewQuery.getParameter(string, string2);
}
public BOrd getOrdWithoutViewQuery() {
if (this.getViewQuery() == null) {
return this.ord;
}
return BOrd.make(this.queries, 0, this.queries.length - 1);
}
public String toString() {
return this.ord + " -> " + this.object;
}
public void dump() {
System.out.println(this.getClass().getName());
System.out.println(" ord: " + this.ord);
System.out.println(" facets: " + this.facets);
System.out.println(" object: " + this.object);
System.out.println(" permissions: " + this.permissions);
System.out.println(" container: " + this.container);
System.out.println(" readonly: " + this.isTargetReadonly);
System.out.println(" slot: " + this.slot);
System.out.println(" propPath: " + (this.propertyPath == null ? "null" : "" + this.propertyPath.length));
System.out.println(" component(): " + this.getComponent());
System.out.println(" slot(): " + this.getSlotInComponent());
System.out.println(" propPath(): " + (this.getPropertyPathInComponent() == null ? "null" : "" + this.getPropertyPathInComponent().length));
if (this.base != null) {
this.base.dump();
}
}
public OrdTarget(OrdTarget ordTarget, BObject bObject) {
this.base = ordTarget;
this.user = ordTarget.user;
this.lang = ordTarget.lang;
this.facets = ordTarget.facets;
this.ord = ordTarget.ord;
this.queries = ordTarget.queries;
if (bObject != null) {
this.object = bObject;
} else {
this.object = ordTarget.object;
this.permissions = ordTarget.permissions;
this.container = ordTarget.container;
this.isTargetReadonly = ordTarget.isTargetReadonly;
this.slot = ordTarget.slot;
this.propertyPath = ordTarget.propertyPath;
}
}
public OrdTarget(OrdTarget ordTarget) {
this(ordTarget, null);
}
OrdTarget(Context context, BOrd bOrd, OrdQuery[] ordQueryArray, BObject bObject) {
BasicContext basicContext = new BasicContext(context);
this.user = basicContext.getUser();
this.lang = basicContext.getLanguage();
this.facets = basicContext.getFacets();
this.ord = bOrd;
this.queries = ordQueryArray;
this.object = bObject;
}
public OrdTarget(OrdTarget ordTarget, BComponent bComponent, BObject bObject, Slot slot, Property[] propertyArray) {
this(ordTarget, (BIPropertyContainer)bComponent, bObject, slot, propertyArray);
}
OrdTarget(OrdTarget ordTarget, BIPropertyContainer bIPropertyContainer, BObject bObject, Slot slot, Property[] propertyArray) {
this(ordTarget, bObject);
this.container = bIPropertyContainer;
this.object = bObject;
this.slot = slot;
this.propertyPath = propertyArray;
}
}
@@ -0,0 +1,15 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
public interface Path {
public Path getParentPath();
public int depth();
public String nameAt(int var1);
public String[] getNames();
}
@@ -0,0 +1,307 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import com.tridium.util.EscUtil;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.Path;
import javax.baja.naming.SyntaxException;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.IllegalNameException;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class SlotPath
implements OrdQuery,
Path {
private static final String[] NO_NAMES = new String[0];
private String scheme;
private String body;
private boolean abs;
private int backupDepth;
private String[] names;
protected SlotPath makeSlotPath(String string, String string2) {
return new SlotPath(string, string2);
}
public boolean isAbsolute() {
return this.abs;
}
public boolean isRelative() {
return this.abs ^ true;
}
public int getBackupDepth() {
return this.backupDepth;
}
public Path getParentPath() {
return this.getParent();
}
public SlotPath getParent() {
int n;
if (this.names.length == 0) {
return null;
}
StringBuffer stringBuffer = new StringBuffer();
if (this.isAbsolute()) {
stringBuffer.append('/');
} else {
n = this.getBackupDepth();
int n2 = 0;
while (n2 < n) {
stringBuffer.append("../");
++n2;
}
}
n = 0;
while (n < this.names.length - 1) {
if (n > 0) {
stringBuffer.append('/');
}
stringBuffer.append(this.names[n]);
++n;
}
return this.makeSlotPath(this.scheme, stringBuffer.toString());
}
public int depth() {
return this.names.length;
}
public String nameAt(int n) {
return this.names[n];
}
public String[] getNames() {
return (String[])this.names.clone();
}
protected boolean isValidPathName(String string) {
return SlotPath.isValidName(string);
}
public static boolean isValidName(String string) {
return EscUtil.slot.isValid(string);
}
public static void verifyValidName(String string) {
if (!SlotPath.isValidName(string)) {
throw new IllegalNameException("baja", "IllegalNameException.name", new Object[]{string});
}
}
public static String escape(String string) {
return EscUtil.slot.escape(string);
}
public static String unescape(String string) {
return EscUtil.slot.unescape(string);
}
public boolean isHost() {
return false;
}
public boolean isSession() {
return false;
}
public String getScheme() {
return this.scheme;
}
public String getBody() {
return this.body;
}
public void normalize(OrdQueryList ordQueryList, int n) {
if (ordQueryList.isSameScheme(n, n + 1)) {
SlotPath slotPath = (SlotPath)ordQueryList.get(n + 1);
ordQueryList.merge(n, this.merge(slotPath));
}
}
public SlotPath merge(SlotPath slotPath) {
int n;
int n2;
if (slotPath.isAbsolute()) {
return slotPath;
}
StringBuffer stringBuffer = new StringBuffer();
if (this.abs) {
stringBuffer.append('/');
}
if (slotPath.getBackupDepth() > 0 && slotPath.getBackupDepth() > this.depth()) {
if (this.abs) {
throw new SyntaxException("Invalid merge " + this + " + " + slotPath);
}
n2 = slotPath.getBackupDepth() - this.depth() + this.getBackupDepth();
n = 0;
while (n < n2) {
stringBuffer.append("../");
++n;
}
}
n2 = 0;
n = 0;
while (n < this.depth() - slotPath.getBackupDepth()) {
if (n2 != 0) {
stringBuffer.append('/');
} else {
n2 = 1;
}
stringBuffer.append(this.nameAt(n));
++n;
}
n = 0;
while (n < slotPath.depth()) {
if (n2 != 0) {
stringBuffer.append('/');
} else {
n2 = 1;
}
stringBuffer.append(slotPath.nameAt(n));
++n;
}
return this.makeSlotPath(this.scheme, stringBuffer.toString());
}
public String toDisplayString() {
return SlotPath.unescape(this.body);
}
public String toString() {
return this.scheme + ':' + this.body;
}
void parse() {
try {
if (this.body.length() == 0) {
return;
}
int n = 0;
char c = this.body.charAt(0);
if (c == '/') {
this.abs = true;
n = 1;
} else if (c == '.') {
n = this.parseBackup();
}
this.parseNames(n);
}
catch (SyntaxException syntaxException) {
throw syntaxException;
}
catch (Throwable throwable) {
throw new SyntaxException(throwable);
}
}
void parseNames(int n) {
String string = this.body;
int n2 = string.length();
if (n >= n2) {
return;
}
if (string.charAt(n2 - 1) == '/') {
throw new SyntaxException("Trailing slash");
}
String[] stringArray = new String[64];
int n3 = 0;
int n4 = n;
while (n4 < n2) {
char c = string.charAt(n4);
if (c == '/') {
if (n4 == n) {
throw new SyntaxException("Illegal double slashes");
}
String string2 = string.substring(n, n4);
if (!this.isValidPathName(string2)) {
throw new SyntaxException("Invalid name in path");
}
stringArray[n3++] = string2;
n = n4 + 1;
}
++n4;
}
String string3 = string.substring(n, n2);
if (!this.isValidPathName(string3)) {
throw new SyntaxException("Invalid name in path");
}
stringArray[n3++] = string3;
this.names = new String[n3];
System.arraycopy(stringArray, 0, this.names, 0, n3);
}
int parseBackup() {
String string = this.body;
int n = string.length();
int n2 = 0;
while (n2 < n) {
int n3;
char c = string.charAt(n2);
int n4 = n2 + 1 < n ? (int)string.charAt(n2 + 1) : -1;
int n5 = n3 = n2 + 2 < n ? (int)string.charAt(n2 + 2) : 47;
if (c != '.') {
return n2;
}
if (n4 != 46 || n3 != 47) {
if (this.isValidPathName(String.valueOf((int)c))) {
return n2;
}
throw new SyntaxException("Expecting ../ backup");
}
++this.backupDepth;
n2 += 3;
}
return n;
}
private final /* synthetic */ void this() {
this.names = NO_NAMES;
}
public SlotPath(String string, String string2) throws SyntaxException {
this.this();
this.scheme = TextUtil.toLowerCase((String)string).trim();
this.body = string2.trim();
this.parse();
}
public SlotPath(String string, String[] stringArray) throws SyntaxException {
this.this();
this.scheme = TextUtil.toLowerCase((String)string).trim();
this.abs = true;
this.backupDepth = 0;
this.names = stringArray;
if (stringArray.length == 0) {
this.body = "/";
} else {
StringBuffer stringBuffer = new StringBuffer();
int n = 0;
while (n < stringArray.length) {
stringBuffer.append('/').append(stringArray[n]);
++n;
}
this.body = stringBuffer.toString();
}
}
public SlotPath(String string) throws SyntaxException {
this.this();
this.scheme = "slot";
this.body = string.trim();
this.parse();
}
}
@@ -0,0 +1,22 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class SyntaxException
extends BajaRuntimeException {
public SyntaxException(String string, Throwable throwable) {
super(string, throwable);
}
public SyntaxException(String string) {
super(string);
}
public SyntaxException(Throwable throwable) {
super(throwable);
}
}
@@ -0,0 +1,22 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class UnknownSchemeException
extends BajaRuntimeException {
public UnknownSchemeException(String string, Throwable throwable) {
super(string, throwable);
}
public UnknownSchemeException(String string) {
super(string);
}
public UnknownSchemeException(Throwable throwable) {
super(throwable);
}
}
@@ -0,0 +1,21 @@
/*
* Decompiled with CFR 0.152.
*/
package javax.baja.naming;
import javax.baja.sys.BajaRuntimeException;
public class UnresolvedException
extends BajaRuntimeException {
public UnresolvedException(String string, Throwable throwable) {
super(string, throwable);
}
public UnresolvedException(String string) {
super(string);
}
public UnresolvedException() {
}
}
@@ -0,0 +1,203 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
*/
package javax.baja.naming;
import java.util.HashMap;
import javax.baja.naming.OrdQuery;
import javax.baja.naming.OrdQueryList;
import javax.baja.naming.SyntaxException;
import javax.baja.nre.util.TextUtil;
public class ViewQuery
implements OrdQuery {
private static final String[] NO_NAMES = new String[0];
private String scheme;
private String body;
private String viewId;
private HashMap parameters;
public String getViewId() {
return this.viewId;
}
public String[] getParameterNames() {
if (this.parameters == null) {
return NO_NAMES;
}
return this.parameters.keySet().toArray(new String[this.parameters.size()]);
}
public String getParameter(String string) {
String string2 = this.getParameter(string, null);
if (string2 == null) {
throw new IllegalArgumentException("Missing parameter \"" + string + '\"');
}
return string2;
}
public String getParameter(String string, String string2) {
String string3;
if (this.parameters != null && (string3 = (String)this.parameters.get(string)) != null) {
return string3;
}
return string2;
}
public boolean isHost() {
return false;
}
public boolean isSession() {
return false;
}
public void normalize(OrdQueryList ordQueryList, int n) {
if (ordQueryList.isSameScheme(n, n + 1)) {
ViewQuery viewQuery = (ViewQuery)ordQueryList.get(n + 1);
ordQueryList.merge(n, this.merge(viewQuery));
} else if (n < ordQueryList.size() - 1) {
ordQueryList.remove(n);
}
}
public ViewQuery merge(ViewQuery viewQuery) {
String[] stringArray;
String string = null;
if (this.viewId != null && viewQuery.viewId == null) {
string = this.viewId;
}
if (viewQuery.viewId != null) {
string = viewQuery.viewId;
}
HashMap hashMap = null;
if (this.parameters != null || viewQuery.parameters != null) {
HashMap hashMap2 = hashMap = this.parameters != null ? this.parameters : new HashMap();
if (viewQuery.parameters != null) {
stringArray = viewQuery.getParameterNames();
int n = 0;
while (n < stringArray.length) {
hashMap.put(stringArray[n], viewQuery.getParameter(stringArray[n]));
++n;
}
}
}
stringArray = new StringBuffer();
if (string != null) {
stringArray.append(string);
}
if (hashMap != null) {
stringArray.append('?');
String[] stringArray2 = hashMap.keySet().toArray(new String[hashMap.size()]);
int n = 0;
while (n < stringArray2.length) {
stringArray.append(stringArray2[n]).append('=').append(hashMap.get(stringArray2[n])).append(';');
++n;
}
}
return new ViewQuery(this.scheme, stringArray.toString());
}
public String getScheme() {
return this.scheme;
}
public String getBody() {
return this.body;
}
public String toString() {
return this.scheme + ':' + this.body;
}
void parse() {
try {
String string = this.body;
int n = string.length();
if (n == 0) {
throw new SyntaxException("no body");
}
int n2 = string.indexOf(63);
if (n2 < 0) {
this.viewId = string;
} else {
this.viewId = string.substring(0, n2).trim();
this.parseParams(n2);
}
int n3 = this.viewId.length();
if (n3 == 0) {
this.viewId = null;
} else {
int n4 = 0;
while (n4 < n3) {
char c = this.viewId.charAt(n4);
if (c == '|' || c == ';' || c == '=') {
throw new SyntaxException("invalid view id char '" + (char)c + '\'');
}
++n4;
}
}
}
catch (SyntaxException syntaxException) {
throw syntaxException;
}
catch (Throwable throwable) {
throw new SyntaxException(throwable);
}
}
private final void parseParams(int n) {
String string = this.body;
int n2 = string.length();
int n3 = -1;
int n4 = n;
int n5 = n + 1;
while (n5 < n2) {
char c = string.charAt(n5);
if (c == ';') {
this.addParam(n4, n3, n5);
n3 = -1;
n4 = n5;
} else if (c == '=') {
n3 = n5;
} else if (c == '%' || c == '|' || c == '?') {
throw new SyntaxException("invalid param char '" + (char)c + '\'');
}
++n5;
}
if (n4 < n2 - 1) {
this.addParam(n4, n3, n2);
}
}
private final void addParam(int n, int n2, int n3) {
if (n2 < 0) {
throw new SyntaxException("invalid param, missing =");
}
String string = this.body.substring(n + 1, n2).trim();
String string2 = this.body.substring(n2 + 1, n3).trim();
if (string.length() == 0) {
throw new SyntaxException("missing name");
}
if (this.parameters == null) {
this.parameters = new HashMap();
}
this.parameters.put(string, string2);
}
public ViewQuery(String string, String string2) throws SyntaxException {
this.scheme = TextUtil.toLowerCase((String)string).trim();
this.body = string2.trim();
this.parse();
}
public ViewQuery(String string) throws SyntaxException {
this.scheme = "view";
this.body = string.trim();
this.parse();
}
}