public long getParameterAsLong(String arg0, long arg1) { return wrappedParameters.getParameterAsLong(arg0, arg1); }
public long getParameterAsLong(String arg0) throws ParameterException { return wrappedParameters.getParameterAsLong(arg0); }
public void refresh(String name, String uri, Parameters parameters) throws SourceException { final long interval = parameters.getParameterAsLong(PARAM_CACHE_INTERVAL, -1); if (uri != null && interval > 0) { addRefreshSource(name, uri, interval, interval); } else { removeRefreshSource(name); } }
/** * Constructor * @param configuration The parameters configuring this session * @param proxy The proxy used to cache the data */ IncludeCacheManagerSession(Parameters configuration, IncludeCacheStorageProxy proxy) { this.expires = configuration.getParameterAsLong("expires", 0); this.purge = configuration.getParameterAsBoolean("purge", false); this.preemptive = configuration.getParameterAsBoolean("preemptive", false); this.parallel = configuration.getParameterAsBoolean("parallel", false); this.storage = proxy; }
this.cacheKeyParList.add(String.valueOf(this.reverse)); this.refreshDelay = par.getParameterAsLong("refreshDelay", 1L) * 1000L; this.cacheKeyParList.add(String.valueOf(this.refreshDelay));
this.cacheKeyParList.add(String.valueOf(this.reverse)); this.refreshDelay = par.getParameterAsLong("refreshDelay", 1L) * 1000L; this.cacheKeyParList.add(String.valueOf(this.refreshDelay));
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.request = ObjectModelHelper.getRequest(objectModel); this.response = ObjectModelHelper.getResponse(objectModel); this.expires = par.getParameterAsLong("expires", this.configuredExpires); this.encoding = par.getParameter("encoding", this.configuredEncoding); try { this.inputSource = resolver.resolveURI(src); } catch (SourceException e) { throw SourceUtil.handle("Error during resolving of '" + src + "'.", e); } setupHeaders(); }
/** * Setup the reader. * The resource is opened to get an <code>InputStream</code>, * the length and the last modification date */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.request = ObjectModelHelper.getRequest(objectModel); this.response = ObjectModelHelper.getResponse(objectModel); this.expires = par.getParameterAsLong("expires", this.configuredExpires); this.quickTest = par.getParameterAsBoolean("quick-modified-test", this.configuredQuickTest); this.bufferSize = par.getParameterAsInteger("buffer-size", this.configuredBufferSize); this.byteRanges = par.getParameterAsBoolean("byte-ranges", this.configuredByteRanges); try { this.inputSource = resolver.resolveURI(src); } catch (SourceException e) { throw SourceUtil.handle("Error during resolving of '" + src + "'.", e); } setupHeaders(); }
/** * Read reader configuration * * @deprecated use property injection instead */ public void configure(Configuration configuration) throws ConfigurationException { // VG Parameters are deprecated as of 2.2.0-Dev/2.1.6-Dev final Parameters parameters = Parameters.fromConfiguration(configuration); this.setExpires(parameters.getParameterAsLong("expires", CONFIGURED_EXPIRES_DEFAULT)); this.setQuickTest(parameters.getParameterAsBoolean("quick-modified-test", CONFIGURED_QUICK_TEST_DEFAULT)); this.setBufferSize(parameters.getParameterAsInteger("buffer-size", CONFIGURED_BUFFER_SIZE_DEFAULT)); this.setByteRanges(parameters.getParameterAsBoolean("byte-ranges", CONFIGURED_BYTE_RANGES_DEFAULT)); // Configuration has precedence over parameters. setExpires(configuration.getChild("expires").getValueAsLong(configuredExpires)); setQuickTest(configuration.getChild("quick-modified-test").getValueAsBoolean(configuredQuickTest)); setBufferSize(configuration.getChild("buffer-size").getValueAsInteger(configuredBufferSize)); setByteRanges(configuration.getChild("byte-ranges").getValueAsBoolean(configuredByteRanges)); }