Package org.skife.config

Examples of org.skife.config.TimeSpan


        return this;
    }

    public ServiceConfig overrideDefaultMaxTTL(String periodDesc) {
        try {
            cfgDefaultMaxTTL = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid max TTL definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here


        return this;
    }
   
    public ServiceConfig overrideDefaultSinceAccessTTL(String periodDesc) {
        try {
            cfgDefaultSinceAccessTTL = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid min TTL definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here

        }
        // Let's use bit of heuristics; pure number == seconds; otherwise, TimeSpan
        char c = value.charAt(value.length() - 1);
        try {
            if (c <= '9' && c >= '0') {
                return new TimeSpan(Integer.parseInt(value), TimeUnit.SECONDS);
            }
            return new TimeSpan(value);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid value for '"+key+"': \""+value
                    +"\": needs to be either number (seconds), or valid TimeSpan expression (like \"7d\")");
        }
    }
View Full Code Here

    /**********************************************************************
     */

    public ServiceConfig overrideSyncGracePeriod(String periodDesc) {
        try {
            cfgSyncGracePeriod = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid delay definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here

        return this;
    }

    public ServiceConfig overrideMaxLongPollTime(String periodDesc) {
        try {
            cfgSyncMaxLongPollTime = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid max setting definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here

        return this;
    }

    public ServiceConfig overrideDefaultMaxTTL(String periodDesc) {
        try {
            cfgDefaultMaxTTL = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid max TTL definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here

        return this;
    }
   
    public ServiceConfig overrideDefaultSinceAccessTTL(String periodDesc) {
        try {
            cfgDefaultSinceAccessTTL = new TimeSpan(periodDesc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid min TTL definition '"+periodDesc+"': "+e.getMessage());
        }
        return this;
    }
View Full Code Here

     */
    public TimeSpan queueMaxDelayMsecs;

    public DeferredDeleteConfig() {
        this(5, 100, DEFAULT_TARGET_DELAY,
                new TimeSpan(2500, TimeUnit.MILLISECONDS)
                // !!! TEST
//        new TimeSpan(1000, TimeUnit.MILLISECONDS)
            );
    }
View Full Code Here

    {
        super.init(stuff, stores, cluster, shutdown);
        _fileManager = stuff.getFileManager();
        // let's use max-TTL-plus-one-day
        _maxTimeToLiveMsecs = stuff.getServiceConfig().cfgMaxMaxTTL.getMillis()
                + new TimeSpan("1d").getMillis();
    }
View Full Code Here

    {
        final int checksum = _decodeInt(request.getQueryParameter(ClusterMateConstants.QUERY_PARAM_CHECKSUM), 0);
        String paramKey = null, paramValue = null;
        paramKey = ClusterMateConstants.QUERY_PARAM_MIN_SINCE_ACCESS_TTL;
        paramValue = request.getQueryParameter(paramKey);
        TimeSpan minTTL = _isEmpty(paramValue) ? null : new TimeSpan(paramValue);
        paramKey = ClusterMateConstants.QUERY_PARAM_MAX_TTL;
        paramValue = request.getQueryParameter(paramKey);
        TimeSpan maxTTL = _isEmpty(paramValue) ? null : new TimeSpan(paramValue);

        return putEntry(request, response, key, checksum, dataIn,
                minTTL, maxTTL, metadata);
    }  
View Full Code Here

TOP

Related Classes of org.skife.config.TimeSpan

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.