/* * Decompiled with CFR 0.152. * * Could not load the following classes: * javax.baja.data.BIDataValue * javax.baja.naming.SlotPath * javax.baja.sys.BEnumRange * javax.baja.sys.BFacets * javax.baja.sys.BInteger * javax.baja.sys.BValue * javax.baja.sys.Context * javax.baja.sys.Property * javax.baja.sys.Sys * javax.baja.sys.Type */ package com.tridium.platform.qnx; import com.tridium.platform.ntp.BNtpPlatformService; import com.tridium.platform.ntp.BNtpServer; import com.tridium.platform.posix.BNtpModePosix; import java.util.StringTokenizer; import javax.baja.data.BIDataValue; import javax.baja.naming.SlotPath; import javax.baja.sys.BEnumRange; import javax.baja.sys.BFacets; import javax.baja.sys.BInteger; import javax.baja.sys.BValue; import javax.baja.sys.Context; import javax.baja.sys.Property; import javax.baja.sys.Sys; import javax.baja.sys.Type; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BNtpServerQnx extends BNtpServer { public static final Property useBurst = BNtpServerQnx.newProperty((int)3, (boolean)false, null); public static final Property serverPreferred = BNtpServerQnx.newProperty((int)3, (boolean)false, null); public static final Property minPollInterval = BNtpServerQnx.newProperty((int)3, (int)6, (BFacets)BFacets.make((String[])new String[]{"min", "max", "fieldWidth", "units"}, (BIDataValue[])new BIDataValue[]{BInteger.make((int)4), BInteger.make((int)16), BInteger.make((int)3), BNtpPlatformService.LOG_2_SEC_UNIT})); public static final Property maxPollInterval = BNtpServerQnx.newProperty((int)3, (int)10, (BFacets)BFacets.make((String[])new String[]{"min", "max", "fieldWidth", "units"}, (BIDataValue[])new BIDataValue[]{BInteger.make((int)5), BInteger.make((int)17), BInteger.make((int)3), BNtpPlatformService.LOG_2_SEC_UNIT})); public static final Property peerMode = BNtpServerQnx.newProperty((int)3, (BValue)BNtpModePosix.server, (BFacets)BFacets.make((String)"range", (BIDataValue)BEnumRange.make(null, (int[])new int[]{2, 1, 3, 4}, (String[])new String[]{BNtpModePosix.server.getTag(), BNtpModePosix.peer.getTag(), BNtpModePosix.broadcast.getTag(), BNtpModePosix.manycastclient.getTag()}))); public static final Type TYPE; protected String serverString; static /* synthetic */ Class class$com$tridium$platform$qnx$BNtpServerQnx; public boolean getUseBurst() { return this.getBoolean(useBurst); } public void setUseBurst(boolean bl) { this.setBoolean(useBurst, bl, null); } public boolean getServerPreferred() { return this.getBoolean(serverPreferred); } public void setServerPreferred(boolean bl) { this.setBoolean(serverPreferred, bl, null); } public int getMinPollInterval() { return this.getInt(minPollInterval); } public void setMinPollInterval(int n) { this.setInt(minPollInterval, n, null); } public int getMaxPollInterval() { return this.getInt(maxPollInterval); } public void setMaxPollInterval(int n) { this.setInt(maxPollInterval, n, null); } public BNtpModePosix getPeerMode() { return (BNtpModePosix)this.get(peerMode); } public void setPeerMode(BNtpModePosix bNtpModePosix) { this.set(peerMode, (BValue)bNtpModePosix, null); } public Type getType() { return TYPE; } public BNtpServer makeServer(String string) { return new BNtpServerQnx(string); } public void updateServerString(String string) { this.serverString = string; StringTokenizer stringTokenizer = new StringTokenizer(string); String string2 = stringTokenizer.nextToken(); if (string2.equals("server")) { this.setPeerMode(BNtpModePosix.server); } else if (string2.equals("peer")) { this.setPeerMode(BNtpModePosix.peer); } else if (string2.equals("broadcast")) { this.setPeerMode(BNtpModePosix.broadcast); } else if (string2.equals("manycastclient")) { this.setPeerMode(BNtpModePosix.manycastclient); } this.setAddress(stringTokenizer.nextToken()); this.setUseBurst(false); this.setMaxPollInterval(10); this.setMinPollInterval(6); this.setServerPreferred(false); string2 = null; block5: while (stringTokenizer.hasMoreTokens()) { string2 = stringTokenizer.nextToken(); switch (string2.charAt(0)) { case 'b': { if (!string2.equals("burst")) continue block5; this.setUseBurst(true); break; } case 'm': { if (string2.equals("minpoll")) { this.setMinPollInterval(Integer.valueOf(stringTokenizer.nextToken())); break; } if (!string2.equals("maxpoll")) continue block5; this.setMaxPollInterval(Integer.valueOf(stringTokenizer.nextToken())); break; } case 'p': { if (!string2.equals("prefer")) continue block5; this.setServerPreferred(true); break; } } } } public String getServerString() { if (this.serverString == null) { this.serverString = this.getServerString(this.getPeerMode(), this.getAddress(), this.getUseBurst(), this.getServerPreferred(), this.getMinPollInterval(), this.getMaxPollInterval()); } return this.serverString; } public String getServerString(BNtpModePosix bNtpModePosix, String string, boolean bl, boolean bl2, int n, int n2) { StringBuffer stringBuffer = null; if (bNtpModePosix == BNtpModePosix.server) { stringBuffer = new StringBuffer("server"); } else if (bNtpModePosix == BNtpModePosix.peer) { stringBuffer = new StringBuffer("peer"); } else if (bNtpModePosix == BNtpModePosix.manycastclient) { stringBuffer = new StringBuffer("manycastclient"); } else if (bNtpModePosix == BNtpModePosix.broadcast) { stringBuffer = new StringBuffer("broadcast"); } else { return null; } stringBuffer.append(" " + string); if (bl) { stringBuffer.append(" burst"); } if (bl2 && bNtpModePosix != BNtpModePosix.manycastclient && bNtpModePosix != BNtpModePosix.broadcast) { stringBuffer.append(" prefer"); } if (n != 6 && n >= 4 && n < 17 && n < n2) { stringBuffer.append(" minpoll " + n); } if (n2 != 10 && n2 <= 17 && n2 > 4 && n2 > n) { stringBuffer.append(" maxpoll " + n2); } return stringBuffer.toString(); } public String getPropertyName(String string) { return SlotPath.escape((String)string); } public synchronized boolean equivalent(Object object) { if (object instanceof String) { return this.getServerString().equals(object); } if (object instanceof BNtpServerQnx) { return ((BNtpServerQnx)((Object)object)).getServerString().equals(this.getServerString()); } return false; } public void changed(Property property, Context context) { super.changed(property, context); if (property == address || property == useBurst || property == maxPollInterval || property == minPollInterval || property == serverPreferred || property == peerMode) { this.serverString = 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()); } } private final /* synthetic */ void this() { this.serverString = null; } public BNtpServerQnx() { this.this(); } public BNtpServerQnx(String string) { this.this(); this.updateServerString(string); } static { Class clazz = class$com$tridium$platform$qnx$BNtpServerQnx; if (clazz == null) { clazz = class$com$tridium$platform$qnx$BNtpServerQnx = BNtpServerQnx.class("[Lcom.tridium.platform.qnx.BNtpServerQnx;", false); } TYPE = Sys.loadType((Class)clazz); } }