/** * */ public SU3File(File file) { this(I2PAppContext.getGlobalContext(), file); }
/** * @since 0.7.12 */ public boolean getBooleanPropertyDefaultTrue(String propName) { return getProperty(propName, true); }
/** * @since 0.9.31 */ public boolean getUniversalTheming() { return _context.getBooleanProperty(RC_PROP_UNIVERSAL_THEMING); }
/** * If you have a context, use context.simpleTimer2() instead */ public static SimpleTimer2 getInstance() { return I2PAppContext.getGlobalContext().simpleTimer2(); }
/** * Save memory by not creating stats unless they are required for router operation. * For backward compatibility of any external clients, always returns false if not in router context. * * @param statName ignored * @return true if the stat should be ignored. */ public boolean ignoreStat(String statName) { return _context.isRouterContext() && !_context.getBooleanProperty(PROP_STAT_FULL); }
/** @throws I2PException always */ @Override public void connect(SAMv3Handler handler, String dest, Properties props) throws I2PException { throw new I2PException("master session"); }
/** * Caller MUST schedule. */ DecayEvent() { super(_context.simpleTimer2()); }
/** * Un-deprecated in 0.9.38 */ public HMAC256Generator hmac256() { if (!_hmac256Initialized) initializeHMAC256(); return _hmac256; }
/** * Basic hash map */ public KeyRing keyRing() { if (!_keyRingInitialized) initializeKeyRing(); return _keyRing; }
/** * The statistics component with which we can track various events * over time. */ public StatManager statManager() { if (!_statManagerInitialized) initializeStatManager(); return _statManager; }
/** * Pull up the naming service used in this context. The naming service itself * works by querying the context's properties, so those props should be * specified to customize the naming service exposed. */ public NamingService namingService() { if (!_namingServiceInitialized) initializeNamingService(); return _namingService; }
/** * Ok, I'll admit it. there is no good reason for having a context specific * AES engine. We dont really keep stats on it, since its just too fast to * matter. Though for the crazy people out there, we do expose a way to * disable it. */ public AESEngine aes() { if (!_AESEngineInitialized) initializeAESEngine(); return _AESEngine; }
/** * Use instead of SimpleTimer2.getInstance() * @since 0.9 to replace static instance in the class */ public SimpleTimer2 simpleTimer2() { if (!_simpleTimer2Initialized) initializeSimpleTimer2(); return _simpleTimer2; }
/** * Our DSA engine (see HMAC and SHA above) * */ public DSAEngine dsa() { if (!_dsaInitialized) initializeDSA(); return _dsa; }
/** * [insert snarky comment here] * */ public RandomSource random() { if (!_randomInitialized) initializeRandom(); return _random; }
/** * Component to generate ElGamal, DSA, and Session keys. For why it is in * the appContext, see the DSA, HMAC, and SHA comments above. */ public KeyGenerator keyGenerator() { if (!_keyGeneratorInitialized) initializeKeyGenerator(); return _keyGenerator; }
/** * Constructs a new <code>TrustedUpdate</code> with the default global * context. */ public TrustedUpdate() { this(I2PAppContext.getGlobalContext()); }
/** * Two-letter upper case or "" * @return country in routerconsole.country property, else current locale * @since 0.9.10 */ public static String getCountry(I2PAppContext ctx) { // property may be empty so we don't have a non-default // language and a default country return ctx.getProperty(PROP_COUNTRY, _localeCountry); }
/** * Create a new public/private value pair for the DH exchange. * Only for internal use and unit tests. * Others should get instances from PrecalcRunner.getBuilder() */ DHSessionKeyBuilder() { this(I2PAppContext.getGlobalContext()); }
/** * Uses default m of 23, memory usage is 2 MB. * @param name just for logging / debugging / stats */ public DecayingBloomFilter(I2PAppContext context, int durationMs, int entryBytes, String name) { // this is instantiated in four different places, they may have different // requirements, but for now use this as a gross method of memory reduction. // m == 23 => 1MB each BloomSHA1 (4 pairs = 8MB total) this(context, durationMs, entryBytes, name, context.getProperty("router.decayingBloomFilterM", DEFAULT_M)); }