link start!
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFrozenEnum
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.platform.ntp;
|
||||
|
||||
import javax.baja.sys.BFrozenEnum;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public final class BNtpMode
|
||||
extends BFrozenEnum {
|
||||
public static final int UNSPECIFIED = 0;
|
||||
public static final int SYMMETRIC_ACTIVE = 1;
|
||||
public static final int SYMMETRIC_PASSIVE = 2;
|
||||
public static final int CLIENT = 3;
|
||||
public static final int SERVER = 4;
|
||||
public static final int BROADCAST = 5;
|
||||
public static final int CONTROL_RESERVED = 6;
|
||||
public static final int PRIVATE_RESERVED = 7;
|
||||
public static final BNtpMode unspecified = new BNtpMode(0);
|
||||
public static final BNtpMode symmetricActive = new BNtpMode(1);
|
||||
public static final BNtpMode symmetricPassive = new BNtpMode(2);
|
||||
public static final BNtpMode client = new BNtpMode(3);
|
||||
public static final BNtpMode server = new BNtpMode(4);
|
||||
public static final BNtpMode broadcast = new BNtpMode(5);
|
||||
public static final BNtpMode controlReserved = new BNtpMode(6);
|
||||
public static final BNtpMode privateReserved = new BNtpMode(7);
|
||||
public static final Type TYPE;
|
||||
public static final BNtpMode DEFAULT;
|
||||
static /* synthetic */ Class class$com$tridium$platform$ntp$BNtpMode;
|
||||
|
||||
public final Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public static final BNtpMode make(int n) {
|
||||
return (BNtpMode)unspecified.getRange().get(n, false);
|
||||
}
|
||||
|
||||
public static final BNtpMode make(String string) {
|
||||
return (BNtpMode)unspecified.getRange().get(string);
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private BNtpMode(int n) {
|
||||
super(n);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$platform$ntp$BNtpMode;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$ntp$BNtpMode = BNtpMode.class("[Lcom.tridium.platform.ntp.BNtpMode;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
DEFAULT = unspecified;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BIcon
|
||||
* javax.baja.sys.BRelTime
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.units.BDimension
|
||||
* javax.baja.units.BUnit
|
||||
*/
|
||||
package com.tridium.platform.ntp;
|
||||
|
||||
import com.tridium.platform.BPlatformService;
|
||||
import com.tridium.platform.ntp.BNtpServerVector;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BIcon;
|
||||
import javax.baja.sys.BRelTime;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.units.BDimension;
|
||||
import javax.baja.units.BUnit;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public abstract class BNtpPlatformService
|
||||
extends BPlatformService {
|
||||
public static final Property enabled = BNtpPlatformService.newProperty((int)3, (boolean)false, null);
|
||||
public static final Property timeServers = BNtpPlatformService.newProperty((int)3, (BValue)new BNtpServerVector(), (BFacets)BFacets.make((String)"elementType", (String)"platform:NtpServer"));
|
||||
public static final Type TYPE;
|
||||
private static final BIcon icon;
|
||||
public static final BUnit LOG_2_SEC_UNIT;
|
||||
static /* synthetic */ Class class$com$tridium$platform$ntp$BNtpPlatformService;
|
||||
|
||||
public boolean getEnabled() {
|
||||
return this.getBoolean(enabled);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean bl) {
|
||||
this.setBoolean(enabled, bl, null);
|
||||
}
|
||||
|
||||
public BNtpServerVector getTimeServers() {
|
||||
return (BNtpServerVector)this.get(timeServers);
|
||||
}
|
||||
|
||||
public void setTimeServers(BNtpServerVector bNtpServerVector) {
|
||||
this.set(timeServers, (BValue)bNtpServerVector, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public BRelTime getPollFrequency() {
|
||||
return BRelTime.makeSeconds((int)10);
|
||||
}
|
||||
|
||||
protected boolean startPollTimerOnSubscribe() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Type[] getServiceTypes() {
|
||||
return new Type[]{TYPE};
|
||||
}
|
||||
|
||||
public BIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
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 BNtpPlatformService() {
|
||||
this.setPlatformServiceDescription(this.getLexicon().getText("NtpPlatformService.description"));
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$platform$ntp$BNtpPlatformService;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$ntp$BNtpPlatformService = BNtpPlatformService.class("[Lcom.tridium.platform.ntp.BNtpPlatformService;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
icon = BIcon.std((String)"clock.png");
|
||||
LOG_2_SEC_UNIT = BUnit.make((String)"log2 seconds", (String)"log2 s", (BDimension)BDimension.NULL, (double)1.0, (double)0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.naming.SlotPath
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
*/
|
||||
package com.tridium.platform.ntp;
|
||||
|
||||
import javax.baja.naming.SlotPath;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BNtpServer
|
||||
extends BComponent {
|
||||
public static final Property address = BNtpServer.newProperty((int)3, (String)"", null);
|
||||
public static final Type TYPE;
|
||||
static /* synthetic */ Class class$com$tridium$platform$ntp$BNtpServer;
|
||||
|
||||
public String getAddress() {
|
||||
return this.getString(address);
|
||||
}
|
||||
|
||||
public void setAddress(String string) {
|
||||
this.setString(address, string, null);
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public String getServerString() {
|
||||
return this.getAddress();
|
||||
}
|
||||
|
||||
public void updateServerString(String string) {
|
||||
this.setAddress(string);
|
||||
}
|
||||
|
||||
public String getPropertyName(String string) {
|
||||
return SlotPath.escape((String)string);
|
||||
}
|
||||
|
||||
public BNtpServer makeServer(String string) {
|
||||
return new BNtpServer(string);
|
||||
}
|
||||
|
||||
static /* synthetic */ Class class(String string, boolean bl) {
|
||||
try {
|
||||
Class<?> clazz = Class.forName(string);
|
||||
if (!bl) {
|
||||
clazz = clazz.getComponentType();
|
||||
}
|
||||
return clazz;
|
||||
}
|
||||
catch (ClassNotFoundException classNotFoundException) {
|
||||
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public BNtpServer() {
|
||||
}
|
||||
|
||||
public BNtpServer(String string) {
|
||||
this.setAddress(string);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$platform$ntp$BNtpServer;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$ntp$BNtpServer = BNtpServer.class("[Lcom.tridium.platform.ntp.BNtpServer;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Decompiled with CFR 0.152.
|
||||
*
|
||||
* Could not load the following classes:
|
||||
* javax.baja.nre.util.Array
|
||||
* javax.baja.registry.TypeInfo
|
||||
* javax.baja.sys.BComponent
|
||||
* javax.baja.sys.BComponentEvent
|
||||
* javax.baja.sys.BFacets
|
||||
* javax.baja.sys.BString
|
||||
* javax.baja.sys.BValue
|
||||
* javax.baja.sys.BVector
|
||||
* javax.baja.sys.Property
|
||||
* javax.baja.sys.Slot
|
||||
* javax.baja.sys.SlotCursor
|
||||
* javax.baja.sys.Subscriber
|
||||
* javax.baja.sys.Sys
|
||||
* javax.baja.sys.Type
|
||||
* javax.baja.util.BTypeSpec
|
||||
*/
|
||||
package com.tridium.platform.ntp;
|
||||
|
||||
import com.tridium.platform.ntp.BNtpPlatformService;
|
||||
import com.tridium.platform.ntp.BNtpServer;
|
||||
import javax.baja.nre.util.Array;
|
||||
import javax.baja.registry.TypeInfo;
|
||||
import javax.baja.sys.BComponent;
|
||||
import javax.baja.sys.BComponentEvent;
|
||||
import javax.baja.sys.BFacets;
|
||||
import javax.baja.sys.BString;
|
||||
import javax.baja.sys.BValue;
|
||||
import javax.baja.sys.BVector;
|
||||
import javax.baja.sys.Property;
|
||||
import javax.baja.sys.Slot;
|
||||
import javax.baja.sys.SlotCursor;
|
||||
import javax.baja.sys.Subscriber;
|
||||
import javax.baja.sys.Sys;
|
||||
import javax.baja.sys.Type;
|
||||
import javax.baja.util.BTypeSpec;
|
||||
|
||||
/*
|
||||
* Illegal identifiers - consider using --renameillegalidents true
|
||||
*/
|
||||
public class BNtpServerVector
|
||||
extends BVector {
|
||||
public static final Type TYPE;
|
||||
public static final String ELEMENT_TYPE_FACET = "elementType";
|
||||
private TypeInfo elementType;
|
||||
private Subscriber subscriber;
|
||||
static /* synthetic */ Class class$com$tridium$platform$ntp$BNtpServerVector;
|
||||
static /* synthetic */ Class class$com$tridium$platform$ntp$BNtpServer;
|
||||
|
||||
public Type getType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unable to fully structure code
|
||||
*/
|
||||
public void sync(String[] var1_1) {
|
||||
var2_2 = (BNtpServer)this.getElementType().getInstance();
|
||||
var3_3 = new Array();
|
||||
var4_4 = this.getProperties();
|
||||
if (true) ** GOTO lbl8
|
||||
do {
|
||||
var3_3.add((Object)var4_4.property().getName());
|
||||
lbl8:
|
||||
// 2 sources
|
||||
|
||||
if ((v0 = BNtpServerVector.class$com$tridium$platform$ntp$BNtpServer) != null) continue;
|
||||
v0 = BNtpServerVector.class("[Lcom.tridium.platform.ntp.BNtpServer;", false);
|
||||
} while (var4_4.next(v0));
|
||||
var4_4 = new Property[var1_1.length];
|
||||
var5_5 = 0;
|
||||
while (var5_5 < var1_1.length) {
|
||||
var6_6 = var2_2.getPropertyName(var1_1[var5_5]);
|
||||
if (var3_3.contains((Object)var6_6)) {
|
||||
var3_3.remove((Object)var6_6);
|
||||
var7_7 = (BNtpServer)this.get(var6_6);
|
||||
var7_7.updateServerString(var1_1[var5_5]);
|
||||
} else {
|
||||
this.add(var6_6, (BValue)var2_2.makeServer(var1_1[var5_5]), 3);
|
||||
}
|
||||
var4_4[var5_5] = this.getProperty(var6_6);
|
||||
++var5_5;
|
||||
}
|
||||
var5_5 = 0;
|
||||
while (var5_5 < var3_3.size()) {
|
||||
this.remove(var3_3.get(var5_5).toString());
|
||||
++var5_5;
|
||||
}
|
||||
if (var4_4.length > 1) {
|
||||
this.reorder(var4_4);
|
||||
}
|
||||
}
|
||||
|
||||
public void setElementType(Type type) {
|
||||
this.setElementType(type.getTypeSpec().getTypeInfo());
|
||||
}
|
||||
|
||||
public void setElementType(BTypeSpec bTypeSpec) {
|
||||
this.setElementType(bTypeSpec.getTypeInfo());
|
||||
}
|
||||
|
||||
public void setElementType(TypeInfo typeInfo) {
|
||||
SlotCursor slotCursor = this.loadSlots().getProperties();
|
||||
while (slotCursor.next()) {
|
||||
if (slotCursor.property().getType().getTypeInfo().is(typeInfo)) continue;
|
||||
throw new IllegalArgumentException("Existing elements exist which are not of type " + typeInfo);
|
||||
}
|
||||
this.elementType = typeInfo;
|
||||
}
|
||||
|
||||
public TypeInfo getElementType() {
|
||||
BFacets bFacets;
|
||||
BString bString;
|
||||
SlotCursor slotCursor;
|
||||
if (this.elementType == null && (slotCursor = this.loadSlots().getProperties()).next()) {
|
||||
this.elementType = slotCursor.property().getType().getTypeInfo();
|
||||
}
|
||||
if (this.elementType == null && (slotCursor = this.getParent()) != null && (bString = (BString)(bFacets = slotCursor.loadSlots().getSlotFacets((Slot)this.getPropertyInParent())).get(ELEMENT_TYPE_FACET)) != null) {
|
||||
this.elementType = BTypeSpec.make((String)bString.toString()).getTypeInfo();
|
||||
}
|
||||
return this.elementType;
|
||||
}
|
||||
|
||||
public boolean isChildLegal(BComponent bComponent) {
|
||||
if (!this.isRunning() || this.getElementType() == null) {
|
||||
return bComponent instanceof BNtpServer;
|
||||
}
|
||||
return bComponent.getType().getTypeSpec().getTypeInfo().is(this.elementType);
|
||||
}
|
||||
|
||||
public void subscribed() {
|
||||
this.subscriber.subscribe((BComponent)((BNtpPlatformService)this.getParent()));
|
||||
}
|
||||
|
||||
public void unsubscribed() {
|
||||
this.subscriber.unsubscribe((BComponent)((BNtpPlatformService)this.getParent()));
|
||||
}
|
||||
|
||||
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.elementType = null;
|
||||
this.subscriber = new Subscriber(){
|
||||
|
||||
public final void event(BComponentEvent bComponentEvent) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public BNtpServerVector() {
|
||||
this.this();
|
||||
}
|
||||
|
||||
public BNtpServerVector(Type type) {
|
||||
this.this();
|
||||
this.setElementType(type);
|
||||
}
|
||||
|
||||
public BNtpServerVector(BTypeSpec bTypeSpec) {
|
||||
this.this();
|
||||
this.setElementType(bTypeSpec);
|
||||
}
|
||||
|
||||
public BNtpServerVector(TypeInfo typeInfo) {
|
||||
this.this();
|
||||
this.setElementType(typeInfo);
|
||||
}
|
||||
|
||||
static {
|
||||
Class clazz = class$com$tridium$platform$ntp$BNtpServerVector;
|
||||
if (clazz == null) {
|
||||
clazz = class$com$tridium$platform$ntp$BNtpServerVector = BNtpServerVector.class("[Lcom.tridium.platform.ntp.BNtpServerVector;", false);
|
||||
}
|
||||
TYPE = Sys.loadType((Class)clazz);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user