link start!
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class ByteArrayFileTransferElement
|
||||
extends FileTransferMessageElement {
|
||||
private byte[] bytes;
|
||||
|
||||
public InputStream getStream() throws IOException {
|
||||
return new ByteArrayInputStream(this.bytes);
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.bytes.length;
|
||||
}
|
||||
|
||||
public ByteArrayFileTransferElement(FilePath filePath, byte[] byArray, BDaemonFileSpace bDaemonFileSpace) {
|
||||
super(filePath, bDaemonFileSpace);
|
||||
this.bytes = byArray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class DaemonDebugMessage
|
||||
extends XmlResponseMessage {
|
||||
String messageString;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.messageString;
|
||||
}
|
||||
|
||||
public DaemonDebugMessage() {
|
||||
this.messageString = "debug";
|
||||
}
|
||||
|
||||
public DaemonDebugMessage(boolean bl) {
|
||||
this.messageString = "debug?update=true&daemonDebug=" + bl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import java.io.OutputStream;
|
||||
|
||||
public abstract class DaemonMessage {
|
||||
public abstract String getMessageString();
|
||||
|
||||
public void write(OutputStream outputStream) {
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return "GET";
|
||||
}
|
||||
|
||||
public int getConnectionFlags() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class DeleteAppMessage
|
||||
extends XmlResponseMessage {
|
||||
private StringBuffer path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path.toString();
|
||||
}
|
||||
|
||||
public DeleteAppMessage(String string, String string2) {
|
||||
this.path = new StringBuffer(string);
|
||||
this.path.append("?action=delete");
|
||||
this.path.append('&').append(string).append('=').append(HttpUtil.encodeUrl((String)string2));
|
||||
}
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import java.util.Set;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class DeleteFileTransferMessageElement
|
||||
extends FileTransferMessageElement {
|
||||
int completed;
|
||||
|
||||
public String getRequestMethod() {
|
||||
return "DELETE";
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public void initProgress() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public void updateProgress(int n) {
|
||||
this.completed = 100;
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return this.completed;
|
||||
}
|
||||
|
||||
public void updateTransferInfo(Set set, Set set2) {
|
||||
if (!set2.contains(this.getFilePath())) {
|
||||
set.add(this.getFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
protected String getProgressLexiconKey() {
|
||||
return "DeleteFileTransferMessageElement.progress";
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public DeleteFileTransferMessageElement(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
super(filePath, bDaemonFileSpace);
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.DeleteAppMessage;
|
||||
|
||||
public class DeleteR2StationMessage
|
||||
extends DeleteAppMessage {
|
||||
public DeleteR2StationMessage(String string) {
|
||||
super("r2station", string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.DeleteAppMessage;
|
||||
|
||||
public class DeleteStationMessage
|
||||
extends DeleteAppMessage {
|
||||
public DeleteStationMessage(String string) {
|
||||
super("station", string);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class FileFileTransferElement
|
||||
extends FileTransferMessageElement {
|
||||
private BIFile file;
|
||||
|
||||
public InputStream getStream() throws IOException {
|
||||
return this.file.getInputStream();
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.file.getSize();
|
||||
}
|
||||
|
||||
public FileFileTransferElement(BIFile bIFile, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(bIFile.getFilePath(), bIFile, bDaemonFileSpace);
|
||||
}
|
||||
|
||||
public FileFileTransferElement(FilePath filePath, BIFile bIFile, BDaemonFileSpace bDaemonFileSpace) {
|
||||
super(filePath, bDaemonFileSpace);
|
||||
this.file = bIFile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class FileHeaderMessage
|
||||
extends DaemonMessage {
|
||||
private StringBuffer path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path.toString();
|
||||
}
|
||||
|
||||
public String getMethod() {
|
||||
return "HEAD";
|
||||
}
|
||||
|
||||
public FileHeaderMessage(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(filePath, bDaemonFileSpace, false);
|
||||
}
|
||||
|
||||
public FileHeaderMessage(FilePath filePath, BDaemonFileSpace bDaemonFileSpace, boolean bl) {
|
||||
this.path = new StringBuffer(bDaemonFileSpace.filePathToUri(filePath));
|
||||
this.path.append("?sendCrc=");
|
||||
this.path.append(bl);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.BIFile
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.BajaRuntimeException
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.file.FilePathComparator;
|
||||
import com.tridium.platform.daemon.file.StoreCache;
|
||||
import com.tridium.platform.daemon.message.DeleteFileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.message.FileFileTransferElement;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.message.MkDirFileTransferMessageElement;
|
||||
import com.tridium.platform.daemon.message.RenameFileTransferMessageElement;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import javax.baja.file.BIFile;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.BajaRuntimeException;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class FileTransferMessage {
|
||||
private Map deletesByFilePath;
|
||||
private Array posts;
|
||||
private boolean autoCommit;
|
||||
private String transactionId;
|
||||
private long transferTotal;
|
||||
private long transferComplete;
|
||||
private StoreCache cache;
|
||||
private BDaemonFileSpace fileSpace;
|
||||
static /* synthetic */ Class class$com$tridium$platform$daemon$message$FileTransferMessageElement;
|
||||
static /* synthetic */ Class class$javax$baja$file$FilePath;
|
||||
|
||||
public static FileTransferMessage make(BIFile bIFile, BDaemonFileSpace bDaemonFileSpace) throws IOException {
|
||||
FileTransferMessage fileTransferMessage = new FileTransferMessage(bDaemonFileSpace);
|
||||
fileTransferMessage.addFile(bIFile);
|
||||
return fileTransferMessage;
|
||||
}
|
||||
|
||||
public static FileTransferMessage make(BIFile bIFile, FilePath filePath, BDaemonFileSpace bDaemonFileSpace) throws IOException {
|
||||
FileTransferMessage fileTransferMessage = new FileTransferMessage(bDaemonFileSpace);
|
||||
fileTransferMessage.addFile(bIFile, filePath);
|
||||
return fileTransferMessage;
|
||||
}
|
||||
|
||||
public static FileTransferMessage makeDelete(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
FileTransferMessage fileTransferMessage = new FileTransferMessage(bDaemonFileSpace);
|
||||
fileTransferMessage.addElement(new DeleteFileTransferMessageElement(filePath, bDaemonFileSpace));
|
||||
return fileTransferMessage;
|
||||
}
|
||||
|
||||
public static FileTransferMessage makeMkDir(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
FileTransferMessage fileTransferMessage = new FileTransferMessage(bDaemonFileSpace);
|
||||
fileTransferMessage.addElement(new MkDirFileTransferMessageElement(filePath, bDaemonFileSpace));
|
||||
return fileTransferMessage;
|
||||
}
|
||||
|
||||
public static FileTransferMessage makeRename(FilePath filePath, String string, BDaemonFileSpace bDaemonFileSpace) {
|
||||
FileTransferMessage fileTransferMessage = new FileTransferMessage(bDaemonFileSpace);
|
||||
fileTransferMessage.addElement(new RenameFileTransferMessageElement(filePath, string, bDaemonFileSpace));
|
||||
return fileTransferMessage;
|
||||
}
|
||||
|
||||
public StoreCache getCache() {
|
||||
return this.cache;
|
||||
}
|
||||
|
||||
public void addElement(InputStream inputStream, FilePath filePath, long l) {
|
||||
this.addElement(new FileTransferMessageElement(filePath, inputStream, l, this.fileSpace));
|
||||
}
|
||||
|
||||
public void addFile(BIFile bIFile, FilePath filePath) throws IOException {
|
||||
this.addElement(new FileFileTransferElement(filePath, bIFile, this.fileSpace));
|
||||
}
|
||||
|
||||
public void addElement(FileTransferMessageElement fileTransferMessageElement) {
|
||||
if (fileTransferMessageElement.getRequestMethod().equals("DELETE")) {
|
||||
FilePath filePath = fileTransferMessageElement.getFilePath();
|
||||
while (filePath != null) {
|
||||
if (this.deletesByFilePath.containsKey(filePath)) {
|
||||
return;
|
||||
}
|
||||
filePath = filePath.getParent();
|
||||
}
|
||||
Class clazz = class$javax$baja$file$FilePath;
|
||||
if (clazz == null) {
|
||||
clazz = class$javax$baja$file$FilePath = FileTransferMessage.class("[Ljavax.baja.file.FilePath;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
String string = fileTransferMessageElement.getFilePath().getBody() + '/';
|
||||
Iterator iterator = this.deletesByFilePath.keySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
FilePath filePath2 = (FilePath)iterator.next();
|
||||
if (!filePath2.getBody().startsWith(string)) continue;
|
||||
array.add((Object)filePath2);
|
||||
}
|
||||
int n = 0;
|
||||
while (n < array.size()) {
|
||||
this.deletesByFilePath.remove(array.get(n));
|
||||
++n;
|
||||
}
|
||||
this.deletesByFilePath.put(fileTransferMessageElement.getFilePath(), fileTransferMessageElement);
|
||||
} else {
|
||||
this.posts.add((Object)fileTransferMessageElement);
|
||||
}
|
||||
}
|
||||
|
||||
public void addDelete(FilePath filePath) {
|
||||
this.addElement(new DeleteFileTransferMessageElement(filePath, this.fileSpace));
|
||||
}
|
||||
|
||||
public void addFile(BIFile bIFile) throws IOException {
|
||||
this.addFile(bIFile, bIFile.getFilePath());
|
||||
}
|
||||
|
||||
public String getCommitUri() {
|
||||
if (this.autoCommit || this.transactionId == null) {
|
||||
return null;
|
||||
}
|
||||
return "/niagara/?transaction=commit&transactionId=" + this.transactionId;
|
||||
}
|
||||
|
||||
public String getAbortUri() {
|
||||
if (this.autoCommit || this.transactionId == null) {
|
||||
return null;
|
||||
}
|
||||
return "/niagara/?transaction=abort&transactionId=" + this.transactionId;
|
||||
}
|
||||
|
||||
public boolean isAutoCommit() {
|
||||
return this.autoCommit;
|
||||
}
|
||||
|
||||
public BDaemonFileSpace getTargetFileSpace() {
|
||||
return this.fileSpace;
|
||||
}
|
||||
|
||||
public Array getElements(BDaemonSession bDaemonSession) throws ConnectException, AuthenticationException {
|
||||
try {
|
||||
Class clazz = class$com$tridium$platform$daemon$message$FileTransferMessageElement;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$daemon$message$FileTransferMessageElement = FileTransferMessage.class("[Lcom.tridium.platform.daemon.message.FileTransferMessageElement;", false);
|
||||
}
|
||||
Array array = new Array(clazz);
|
||||
array.addAll(this.deletesByFilePath.values());
|
||||
array.addAll(this.posts);
|
||||
return array.sort((Comparator)new ElementComparator(bDaemonSession));
|
||||
}
|
||||
catch (BajaRuntimeException bajaRuntimeException) {
|
||||
Throwable throwable = bajaRuntimeException.getCause();
|
||||
if (throwable instanceof ConnectException) {
|
||||
throw (ConnectException)throwable;
|
||||
}
|
||||
if (throwable instanceof AuthenticationException) {
|
||||
throw (AuthenticationException)throwable;
|
||||
}
|
||||
throw bajaRuntimeException;
|
||||
}
|
||||
}
|
||||
|
||||
public void setTransactionId(String string) {
|
||||
this.transactionId = string;
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
return this.transactionId;
|
||||
}
|
||||
|
||||
public void initProgress() {
|
||||
this.transferTotal = 0L;
|
||||
this.transferComplete = 0L;
|
||||
int n = 0;
|
||||
while (n < this.posts.size()) {
|
||||
FileTransferMessageElement fileTransferMessageElement = (FileTransferMessageElement)this.posts.get(n);
|
||||
this.transferTotal += fileTransferMessageElement.getSize();
|
||||
fileTransferMessageElement.initProgress();
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProgress(FileTransferMessageElement fileTransferMessageElement, int n) {
|
||||
fileTransferMessageElement.updateProgress(n);
|
||||
this.transferComplete += (long)n;
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return this.transferTotal == 0L ? 100 : (int)(100.0 * (double)this.transferComplete / (double)this.transferTotal);
|
||||
}
|
||||
|
||||
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.transactionId = null;
|
||||
this.transferTotal = 0L;
|
||||
this.transferComplete = 0L;
|
||||
}
|
||||
|
||||
public FileTransferMessage(StoreCache storeCache, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(false, storeCache, bDaemonFileSpace);
|
||||
}
|
||||
|
||||
public FileTransferMessage(BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(false, bDaemonFileSpace);
|
||||
}
|
||||
|
||||
public FileTransferMessage(boolean bl, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(bl, new StoreCache(), bDaemonFileSpace);
|
||||
}
|
||||
|
||||
public FileTransferMessage(boolean bl, StoreCache storeCache, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this.this();
|
||||
this.autoCommit = bl;
|
||||
this.deletesByFilePath = new TreeMap(FilePathComparator.INSTANCE);
|
||||
Class clazz = class$com$tridium$platform$daemon$message$FileTransferMessageElement;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$daemon$message$FileTransferMessageElement = FileTransferMessage.class("[Lcom.tridium.platform.daemon.message.FileTransferMessageElement;", false);
|
||||
}
|
||||
this.posts = new Array(clazz);
|
||||
this.cache = storeCache;
|
||||
this.fileSpace = bDaemonFileSpace;
|
||||
}
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
private class ElementComparator
|
||||
implements Comparator {
|
||||
private BDaemonSession session;
|
||||
|
||||
public int compare(Object object, Object object2) {
|
||||
try {
|
||||
FileTransferMessageElement fileTransferMessageElement = (FileTransferMessageElement)object;
|
||||
FileTransferMessageElement fileTransferMessageElement2 = (FileTransferMessageElement)object2;
|
||||
if (fileTransferMessageElement.getRequestMethod().equals(fileTransferMessageElement2.getRequestMethod())) {
|
||||
long l;
|
||||
long l2 = fileTransferMessageElement.getSizeDelta(this.session, FileTransferMessage.this);
|
||||
if (l2 == (l = fileTransferMessageElement.getSizeDelta(this.session, FileTransferMessage.this))) {
|
||||
return fileTransferMessageElement.getUri().compareTo(fileTransferMessageElement2.getUri());
|
||||
}
|
||||
if (l2 < l) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (fileTransferMessageElement.getRequestMethod().equals("DELETE")) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
catch (RuntimeException runtimeException) {
|
||||
throw runtimeException;
|
||||
}
|
||||
catch (Exception exception) {
|
||||
throw new BajaRuntimeException((Throwable)exception);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(Object object) {
|
||||
boolean bl = false;
|
||||
if (object == this) {
|
||||
bl = true;
|
||||
}
|
||||
return bl;
|
||||
}
|
||||
|
||||
public ElementComparator(BDaemonSession bDaemonSession) {
|
||||
this.session = bDaemonSession;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.file.BIFileStore
|
||||
* javax.baja.file.FilePath
|
||||
* javax.baja.security.AuthenticationException
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.util.Lexicon
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.file.BDaemonDirectoryStore;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.util.Set;
|
||||
import javax.baja.file.BIFileStore;
|
||||
import javax.baja.file.FilePath;
|
||||
import javax.baja.security.AuthenticationException;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.util.Lexicon;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class FileTransferMessageElement {
|
||||
private static final BIcon icon = BIcon.std((String)"file.png");
|
||||
private static final Lexicon lex = Sys.loadModule((String)"platform").getLexicon();
|
||||
private InputStream stream;
|
||||
private long size;
|
||||
private long existingSize;
|
||||
private String shortUri;
|
||||
private long transferTotal;
|
||||
private long transferComplete;
|
||||
private FilePath path;
|
||||
private BDaemonFileSpace space;
|
||||
|
||||
public String getRequestMethod() {
|
||||
return "POST";
|
||||
}
|
||||
|
||||
public String getFullUri(FileTransferMessage fileTransferMessage, boolean bl) {
|
||||
StringBuffer stringBuffer = new StringBuffer(this.getUri());
|
||||
if (fileTransferMessage.isAutoCommit()) {
|
||||
stringBuffer.append("?transaction=standalone");
|
||||
} else if (bl) {
|
||||
stringBuffer.append("?transaction=new");
|
||||
} else {
|
||||
if (fileTransferMessage.getTransactionId() == null) {
|
||||
throw new IllegalStateException("program error: missing transaction id");
|
||||
}
|
||||
stringBuffer.append("?transaction=current&transactionId=");
|
||||
stringBuffer.append(fileTransferMessage.getTransactionId());
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return this.shortUri;
|
||||
}
|
||||
|
||||
public FilePath getFilePath() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public InputStream getStream() throws IOException {
|
||||
return this.stream;
|
||||
}
|
||||
|
||||
protected BDaemonFileSpace getDaemonFileSpace() {
|
||||
return this.space;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public void initProgress() {
|
||||
this.transferComplete = 0L;
|
||||
this.transferTotal = this.getSize();
|
||||
}
|
||||
|
||||
public void updateProgress(int n) {
|
||||
this.transferComplete += (long)n;
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return this.transferTotal == 0L ? 100 : (int)(100.0 * (double)this.transferComplete / (double)this.transferTotal);
|
||||
}
|
||||
|
||||
public void updateTransferInfo(Set set, Set set2) {
|
||||
set.remove(this.getFilePath());
|
||||
set2.add(this.getFilePath());
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.getRequestMethod() + ' ' + this.getUri();
|
||||
}
|
||||
|
||||
protected String getProgressLexiconKey() {
|
||||
return "FileTransferMessageElement.progress";
|
||||
}
|
||||
|
||||
public String getProgressText() {
|
||||
return lex.getText(this.getProgressLexiconKey(), new Object[]{HttpUtil.decodeUrl((String)this.getUri())});
|
||||
}
|
||||
|
||||
public long getSizeDelta(BDaemonSession bDaemonSession, FileTransferMessage fileTransferMessage) throws AuthenticationException, ConnectException {
|
||||
return this.getSize() - this.getExistingSize(bDaemonSession, fileTransferMessage);
|
||||
}
|
||||
|
||||
public long getExistingSize(BDaemonSession bDaemonSession, FileTransferMessage fileTransferMessage) throws AuthenticationException, ConnectException {
|
||||
if (this.existingSize == (long)-1) {
|
||||
Object object;
|
||||
int n = fileTransferMessage.getCache().getCacheStatus(this.getFilePath());
|
||||
if (n == 0) {
|
||||
object = fileTransferMessage.getCache().getStore(this.getFilePath());
|
||||
this.existingSize = object.isDirectory() ? 0L : object.getSize();
|
||||
} else if (n == 1) {
|
||||
this.existingSize = 0L;
|
||||
}
|
||||
if (this.existingSize < 0L) {
|
||||
object = BDaemonDirectoryStore.make(bDaemonSession.getFileSpace(), this.getFilePath().getParent(), fileTransferMessage.getCache());
|
||||
if (object == null) {
|
||||
fileTransferMessage.getCache().cacheNotFound(this.getFilePath());
|
||||
this.existingSize = 0L;
|
||||
} else {
|
||||
BIFileStore bIFileStore = object.getChild(this.getFilePath().getName());
|
||||
this.existingSize = bIFileStore == null ? 0L : bIFileStore.getSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.existingSize;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.existingSize = -1;
|
||||
}
|
||||
|
||||
protected FileTransferMessageElement(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this.this();
|
||||
this.shortUri = bDaemonFileSpace.filePathToUri(filePath);
|
||||
this.path = filePath;
|
||||
this.space = bDaemonFileSpace;
|
||||
}
|
||||
|
||||
public FileTransferMessageElement(FilePath filePath, InputStream inputStream, long l, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(filePath, bDaemonFileSpace);
|
||||
this.stream = inputStream;
|
||||
this.size = l;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class GetAppListMessage
|
||||
extends XmlResponseMessage {
|
||||
private String appType;
|
||||
|
||||
public String getMessageString() {
|
||||
if (this.appType == null) {
|
||||
return "applist";
|
||||
}
|
||||
return this.appType + "?action=list";
|
||||
}
|
||||
|
||||
public GetAppListMessage() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public GetAppListMessage(String string) {
|
||||
this.appType = string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class GetDirectoryMessage
|
||||
extends DaemonMessage {
|
||||
private StringBuffer path = new StringBuffer();
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path.toString();
|
||||
}
|
||||
|
||||
public GetDirectoryMessage(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this(filePath, true, false, false, bDaemonFileSpace);
|
||||
}
|
||||
|
||||
public GetDirectoryMessage(FilePath filePath, boolean bl, boolean bl2, boolean bl3, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this.path.append(bDaemonFileSpace.filePathToUri(filePath));
|
||||
this.path.append("?recurse=");
|
||||
this.path.append(bl);
|
||||
this.path.append("&sendCrc=");
|
||||
this.path.append(bl2);
|
||||
this.path.append("&sendPath=");
|
||||
this.path.append(bl3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class GetFileMessage
|
||||
extends DaemonMessage {
|
||||
private String path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public GetFileMessage(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
this.path = bDaemonFileSpace.filePathToUri(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
public class GetJarContentMessage
|
||||
extends DaemonMessage {
|
||||
private StringBuffer path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path.toString();
|
||||
}
|
||||
|
||||
public GetJarContentMessage(FilePath filePath, FilePath filePath2) {
|
||||
if (!filePath.isSysHomeAbsolute()) {
|
||||
throw new IllegalArgumentException("Cannot retrieve jar contents: not system home absolute '" + filePath.getBody() + '\'');
|
||||
}
|
||||
this.path = new StringBuffer("/jars/niagara");
|
||||
int n = 0;
|
||||
while (n < filePath.depth()) {
|
||||
this.path.append('/');
|
||||
this.path.append(HttpUtil.encodeUrl((String)filePath.nameAt(n)));
|
||||
++n;
|
||||
}
|
||||
n = 0;
|
||||
while (n < filePath2.depth()) {
|
||||
this.path.append('/');
|
||||
this.path.append(HttpUtil.encodeUrl((String)filePath2.nameAt(n)));
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.GetAppListMessage;
|
||||
|
||||
public class GetStationListMessage
|
||||
extends GetAppListMessage {
|
||||
public GetStationListMessage() {
|
||||
super("station");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class GetTimeMessage
|
||||
extends XmlResponseMessage {
|
||||
private static GetTimeMessage INSTANCE = new GetTimeMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "time";
|
||||
}
|
||||
|
||||
public static GetTimeMessage getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private GetTimeMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessage;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import java.util.Set;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class MkDirFileTransferMessageElement
|
||||
extends FileTransferMessageElement {
|
||||
int completed;
|
||||
|
||||
public String getRequestMethod() {
|
||||
return "GET";
|
||||
}
|
||||
|
||||
public String getFullUri(FileTransferMessage fileTransferMessage, boolean bl) {
|
||||
return super.getFullUri(fileTransferMessage, bl) + "&mkdir=true";
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getSizeDelta(BDaemonSession bDaemonSession, FileTransferMessage fileTransferMessage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public void initProgress() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public void updateProgress(int n) {
|
||||
this.completed = 100;
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return this.completed;
|
||||
}
|
||||
|
||||
public void updateTransferInfo(Set set, Set set2) {
|
||||
if (!set2.contains(this.getFilePath())) {
|
||||
set.add(this.getFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
protected String getProgressLexiconKey() {
|
||||
return "MkDirFileTransferMessageElement.progress";
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public MkDirFileTransferMessageElement(FilePath filePath, BDaemonFileSpace bDaemonFileSpace) {
|
||||
super(filePath, bDaemonFileSpace);
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class OSUpdateMessage
|
||||
extends XmlResponseMessage {
|
||||
private static OSUpdateMessage instance = new OSUpdateMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "osupdate";
|
||||
}
|
||||
|
||||
public static OSUpdateMessage getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private OSUpdateMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class QnxInetdMessage
|
||||
extends XmlResponseMessage {
|
||||
private static QnxInetdMessage instance = new QnxInetdMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "qnxinetd";
|
||||
}
|
||||
|
||||
public static QnxInetdMessage getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private QnxInetdMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class QnxSshdMessage
|
||||
extends XmlResponseMessage {
|
||||
private static QnxSshdMessage instance = new QnxSshdMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "qnxsshd";
|
||||
}
|
||||
|
||||
public static QnxSshdMessage getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private QnxSshdMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class RefreshDaemonBinariesMessage
|
||||
extends XmlResponseMessage {
|
||||
private static RefreshDaemonBinariesMessage instance = new RefreshDaemonBinariesMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "updatedaemon?refreshSoftware=true";
|
||||
}
|
||||
|
||||
public static RefreshDaemonBinariesMessage getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private RefreshDaemonBinariesMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.file.FilePath
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.BDaemonSession;
|
||||
import com.tridium.platform.daemon.file.BDaemonFileSpace;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessage;
|
||||
import com.tridium.platform.daemon.message.FileTransferMessageElement;
|
||||
import java.util.Set;
|
||||
import javax.baja.file.FilePath;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class RenameFileTransferMessageElement
|
||||
extends FileTransferMessageElement {
|
||||
int completed;
|
||||
String newName;
|
||||
|
||||
public String getRequestMethod() {
|
||||
return "GET";
|
||||
}
|
||||
|
||||
public String getFullUri(FileTransferMessage fileTransferMessage, boolean bl) {
|
||||
return super.getFullUri(fileTransferMessage, bl) + "&rename=" + HttpUtil.encodeUrl((String)this.newName);
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public long getSizeDelta(BDaemonSession bDaemonSession, FileTransferMessage fileTransferMessage) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public void initProgress() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public void updateProgress(int n) {
|
||||
this.completed = 100;
|
||||
}
|
||||
|
||||
public int getProgress() {
|
||||
return this.completed;
|
||||
}
|
||||
|
||||
public void updateTransferInfo(Set set, Set set2) {
|
||||
FilePath filePath;
|
||||
if (!set2.contains(this.getFilePath())) {
|
||||
set.add(this.getFilePath());
|
||||
}
|
||||
if (!set.contains(filePath = this.getFilePath().getParent().merge(this.newName))) {
|
||||
set2.add(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getProgressLexiconKey() {
|
||||
return "RenameFileTransferMessageElement.progress";
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.completed = 0;
|
||||
}
|
||||
|
||||
public RenameFileTransferMessageElement(FilePath filePath, String string, BDaemonFileSpace bDaemonFileSpace) {
|
||||
super(filePath, bDaemonFileSpace);
|
||||
this.this();
|
||||
filePath.merge(string);
|
||||
this.newName = string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.sys.Sys
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
import javax.baja.sys.Sys;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class ReportStatusMessage
|
||||
extends XmlResponseMessage {
|
||||
private StringBuffer path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path == null ? null : this.path.toString();
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.path = null;
|
||||
}
|
||||
|
||||
public ReportStatusMessage(String[] stringArray, String[] stringArray2) {
|
||||
this.this();
|
||||
if (stringArray != null && stringArray2 != null) {
|
||||
this.path = new StringBuffer("report");
|
||||
this.path.append("?station=").append(HttpUtil.encodeUrl((String)Sys.getStationHome().getName()));
|
||||
this.path.append("&displayname=").append(HttpUtil.encodeUrl((String)Sys.getStation().getStationName()));
|
||||
int n = 0;
|
||||
while (n < stringArray.length) {
|
||||
this.path.append("&" + stringArray[n] + '=').append(stringArray2[n]);
|
||||
++n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class RequestGarbageCollectionMessage
|
||||
extends XmlResponseMessage {
|
||||
private static RequestGarbageCollectionMessage instance = new RequestGarbageCollectionMessage();
|
||||
|
||||
public String getMessageString() {
|
||||
return "updatedaemon?garbageCollection=true";
|
||||
}
|
||||
|
||||
public static RequestGarbageCollectionMessage getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private RequestGarbageCollectionMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* com.tridium.nre.util.LegacyStorageUtil
|
||||
* javax.baja.security.BPassword
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.nre.util.LegacyStorageUtil;
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
import javax.baja.security.BPassword;
|
||||
|
||||
public class SystemPasswordMessageAX
|
||||
extends XmlResponseMessage {
|
||||
private String oldPasswordEncoding;
|
||||
private String newPasswordEncoding;
|
||||
private boolean checkIfValid;
|
||||
|
||||
public String getMessageString() {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("systempwax");
|
||||
if (this.checkIfValid) {
|
||||
stringBuffer.append("?check=true");
|
||||
if (this.oldPasswordEncoding != null) {
|
||||
stringBuffer.append("&oldSystemPassword=").append(HttpUtil.encodeUrl((String)this.oldPasswordEncoding));
|
||||
} else if (this.newPasswordEncoding != null) {
|
||||
stringBuffer.append("&systemPassword=").append(HttpUtil.encodeUrl((String)this.newPasswordEncoding));
|
||||
}
|
||||
} else if (this.newPasswordEncoding != null && this.oldPasswordEncoding != null) {
|
||||
stringBuffer.append("?update=true");
|
||||
stringBuffer.append("&oldSystemPassword=").append(HttpUtil.encodeUrl((String)this.oldPasswordEncoding));
|
||||
stringBuffer.append("&systemPassword=").append(HttpUtil.encodeUrl((String)this.newPasswordEncoding));
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public SystemPasswordMessageAX() {
|
||||
}
|
||||
|
||||
public SystemPasswordMessageAX(BPassword bPassword, BPassword bPassword2, boolean bl) throws Exception {
|
||||
this.oldPasswordEncoding = bPassword2 == null ? null : LegacyStorageUtil.encode((String)bPassword2.getValue());
|
||||
this.newPasswordEncoding = bPassword == null ? null : LegacyStorageUtil.encode((String)bPassword.getValue());
|
||||
this.checkIfValid = bl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
|
||||
public class UpdateAppMessage
|
||||
extends XmlResponseMessage {
|
||||
private StringBuffer path;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.path.toString();
|
||||
}
|
||||
|
||||
public UpdateAppMessage(String string) {
|
||||
this.path = new StringBuffer(string + "?action=update");
|
||||
}
|
||||
|
||||
public UpdateAppMessage(String string, String string2, boolean bl, boolean bl2, boolean bl3, boolean bl4) {
|
||||
this.path = new StringBuffer(string);
|
||||
this.path.append("?action=update");
|
||||
this.path.append('&').append(string).append('=').append(HttpUtil.encodeUrl((String)string2));
|
||||
this.path.append("&isdisabled=").append(bl);
|
||||
this.path.append("&isautostart=").append(bl2);
|
||||
this.path.append("&isautorestart=").append(bl3);
|
||||
if (bl4) {
|
||||
this.path.append("&save=true");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
|
||||
public class UpdateInetMessage
|
||||
extends DaemonMessage {
|
||||
private StringBuffer buf = new StringBuffer("qnxinetd?update=true&fp=");
|
||||
|
||||
public String getMessageString() {
|
||||
return this.buf.toString();
|
||||
}
|
||||
|
||||
public UpdateInetMessage(boolean bl, int n, boolean bl2, int n2) {
|
||||
if (bl) {
|
||||
this.buf.append(n);
|
||||
} else {
|
||||
this.buf.append("-1");
|
||||
}
|
||||
this.buf.append("&tp=");
|
||||
if (bl2) {
|
||||
this.buf.append(n2);
|
||||
} else {
|
||||
this.buf.append("-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.UpdateAppMessage;
|
||||
|
||||
public class UpdateR2StationMessage
|
||||
extends UpdateAppMessage {
|
||||
public UpdateR2StationMessage() {
|
||||
super("r2station");
|
||||
}
|
||||
|
||||
public UpdateR2StationMessage(String string, boolean bl, boolean bl2, boolean bl3, boolean bl4) {
|
||||
super("r2station", string, bl, bl2, bl3, bl4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
|
||||
public class UpdateSshdMessage
|
||||
extends DaemonMessage {
|
||||
private StringBuffer buf = new StringBuffer("qnxsshd?update=true&port=");
|
||||
|
||||
public String getMessageString() {
|
||||
return this.buf.toString();
|
||||
}
|
||||
|
||||
public UpdateSshdMessage(boolean bl, int n) {
|
||||
if (bl) {
|
||||
this.buf.append(n);
|
||||
} else {
|
||||
this.buf.append("-1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.UpdateAppMessage;
|
||||
|
||||
public class UpdateStationMessage
|
||||
extends UpdateAppMessage {
|
||||
public UpdateStationMessage() {
|
||||
super("station");
|
||||
}
|
||||
|
||||
public UpdateStationMessage(String string, boolean bl, boolean bl2, boolean bl3, boolean bl4) {
|
||||
super("station", string, bl, bl2, bl3, bl4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* com.tridium.net.HttpUtil
|
||||
* javax.baja.sys.BAbsTime
|
||||
* javax.baja.timezone.BTimeZone
|
||||
* javax.baja.timezone.DstRule
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.net.HttpUtil;
|
||||
import com.tridium.platform.daemon.message.XmlResponseMessage;
|
||||
import javax.baja.sys.BAbsTime;
|
||||
import javax.baja.timezone.BTimeZone;
|
||||
import javax.baja.timezone.DstRule;
|
||||
|
||||
public class UpdateTimeMessage
|
||||
extends XmlResponseMessage {
|
||||
private StringBuffer message;
|
||||
|
||||
public String getMessageString() {
|
||||
return this.message.toString();
|
||||
}
|
||||
|
||||
public UpdateTimeMessage(BAbsTime bAbsTime, String string) {
|
||||
this(bAbsTime, string, null);
|
||||
}
|
||||
|
||||
public UpdateTimeMessage(BAbsTime bAbsTime, String string, BTimeZone bTimeZone) {
|
||||
long l = System.currentTimeMillis();
|
||||
this.message = new StringBuffer("time?update=true");
|
||||
if (bAbsTime != null) {
|
||||
this.message.append("&time=" + bAbsTime.getMillis());
|
||||
}
|
||||
if (string != null) {
|
||||
this.message.append("&bajaTzId=");
|
||||
this.message.append(HttpUtil.encodeUrl((String)string));
|
||||
}
|
||||
if (bTimeZone != null) {
|
||||
this.message.append("&tzId=");
|
||||
this.message.append(HttpUtil.encodeUrl((String)bTimeZone.getId()));
|
||||
this.message.append("&tzUtcOffset=");
|
||||
if (bAbsTime != null) {
|
||||
this.message.append(String.valueOf(bTimeZone.getUtcOffset(bAbsTime.getMillis()) / 60000));
|
||||
} else {
|
||||
this.message.append(String.valueOf(bTimeZone.getUtcOffset(l) / 60000));
|
||||
}
|
||||
this.message.append("&dstOffset=");
|
||||
if (bAbsTime != null) {
|
||||
this.message.append(String.valueOf(bTimeZone.getDaylightAdjustment(bAbsTime.getMillis()) / 60000));
|
||||
} else {
|
||||
this.message.append(String.valueOf(bTimeZone.getDaylightAdjustment(l) / 60000));
|
||||
}
|
||||
DstRule dstRule = null;
|
||||
dstRule = bAbsTime != null ? DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightStartRule(bAbsTime.getMillis()), (int)0, (BTimeZone)bTimeZone) : DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightStartRule(l), (int)0, (BTimeZone)bTimeZone);
|
||||
if (dstRule != null) {
|
||||
this.message.append("&dstStartHour=");
|
||||
this.message.append(String.valueOf(dstRule.getTime().getHour()));
|
||||
this.message.append("&dstStartMinute=");
|
||||
this.message.append(String.valueOf(dstRule.getTime().getMinute()));
|
||||
this.message.append("&dstStartMonth=");
|
||||
this.message.append(String.valueOf(dstRule.getMonth().getOrdinal()));
|
||||
this.message.append("&dstStartDay=");
|
||||
this.message.append(String.valueOf(dstRule.getDay()));
|
||||
this.message.append("&dstStartDayMode=");
|
||||
this.message.append(String.valueOf(dstRule.getDayMode()));
|
||||
this.message.append("&dstStartWeek=");
|
||||
this.message.append(String.valueOf(dstRule.getWeek()));
|
||||
if (dstRule.getWeekday() != null) {
|
||||
this.message.append("&dstStartWeekDay=");
|
||||
this.message.append(String.valueOf(dstRule.getWeekday().getOrdinal()));
|
||||
}
|
||||
}
|
||||
DstRule dstRule2 = null;
|
||||
dstRule2 = bAbsTime != null ? DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightEndRule(bAbsTime.getMillis()), (int)1, (BTimeZone)bTimeZone) : DstRule.getWallTimeRule((DstRule)bTimeZone.getDaylightEndRule(l), (int)1, (BTimeZone)bTimeZone);
|
||||
if (dstRule2 != null) {
|
||||
this.message.append("&dstEndHour=");
|
||||
this.message.append(String.valueOf(dstRule2.getTime().getHour()));
|
||||
this.message.append("&dstEndMinute=");
|
||||
this.message.append(String.valueOf(dstRule2.getTime().getMinute()));
|
||||
this.message.append("&dstEndMonth=");
|
||||
this.message.append(String.valueOf(dstRule2.getMonth().getOrdinal()));
|
||||
this.message.append("&dstEndDay=");
|
||||
this.message.append(String.valueOf(dstRule2.getDay()));
|
||||
this.message.append("&dstEndDayMode=");
|
||||
this.message.append(String.valueOf(dstRule2.getDayMode()));
|
||||
this.message.append("&dstEndWeek=");
|
||||
this.message.append(String.valueOf(dstRule2.getWeek()));
|
||||
if (dstRule2.getWeekday() != null) {
|
||||
this.message.append("&dstEndWeekDay=");
|
||||
this.message.append(String.valueOf(dstRule2.getWeekday().getOrdinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.util.Lexicon
|
||||
* javax.baja.xml.XElem
|
||||
*/
|
||||
package com.tridium.platform.daemon.message;
|
||||
|
||||
import com.tridium.platform.daemon.message.DaemonMessage;
|
||||
import java.text.MessageFormat;
|
||||
import javax.baja.util.Lexicon;
|
||||
import javax.baja.xml.XElem;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class XmlResponseMessage
|
||||
extends DaemonMessage {
|
||||
public static final int STATUS_SUCCESS = 0;
|
||||
public static final int STATUS_INCOMPLETE = 1;
|
||||
public static final int STATUS_ERROR = 2;
|
||||
private XElem response;
|
||||
private String errorMessage;
|
||||
|
||||
public final String getMethod() {
|
||||
return "GET";
|
||||
}
|
||||
|
||||
public XElem getResponse() {
|
||||
return this.response;
|
||||
}
|
||||
|
||||
public void setResponse(XElem xElem) {
|
||||
this.response = xElem;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String string) {
|
||||
this.errorMessage = string;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
if (this.errorMessage == null) {
|
||||
if (this.response == null) {
|
||||
throw new IllegalStateException("no response to check");
|
||||
}
|
||||
XElem xElem = this.response;
|
||||
if (xElem.name().equals("error")) {
|
||||
if (xElem.elem("message") != null) {
|
||||
xElem = xElem.elem("message");
|
||||
}
|
||||
String string = null;
|
||||
XElem xElem2 = xElem.elem("localized");
|
||||
if (xElem2 != null) {
|
||||
XElem[] xElemArray = xElem2.elems("lexArg");
|
||||
Object[] objectArray = new String[xElemArray.length];
|
||||
int n = 0;
|
||||
while (n < xElemArray.length) {
|
||||
objectArray[n] = xElemArray[n].get("value");
|
||||
++n;
|
||||
}
|
||||
string = Lexicon.make((String)xElem2.get("module")).get(xElem2.get("key"), null);
|
||||
if (string != null && objectArray.length > 0) {
|
||||
string = MessageFormat.format(string, objectArray);
|
||||
}
|
||||
}
|
||||
if (string == null && (xElem2 = xElem.elem("nonlocalized")) != null) {
|
||||
string = xElem2.get("text");
|
||||
}
|
||||
if (string != null) {
|
||||
this.errorMessage = string;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
if (this.errorMessage == null) {
|
||||
if (this.response == null) {
|
||||
return 1;
|
||||
}
|
||||
if (this.response.name().equals("error")) {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private final /* synthetic */ void this() {
|
||||
this.response = null;
|
||||
this.errorMessage = null;
|
||||
}
|
||||
|
||||
public XmlResponseMessage() {
|
||||
this.this();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user