Example usage for org.apache.commons.collections.keyvalue MultiKey MultiKey

List of usage examples for org.apache.commons.collections.keyvalue MultiKey MultiKey

Introduction

In this page you can find the example usage for org.apache.commons.collections.keyvalue MultiKey MultiKey.

Prototype

public MultiKey(Object[] keys, boolean makeClone) 

Source Link

Document

Constructor taking an array of keys, optionally choosing whether to clone.

Usage

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public List<Term> getCurrentTerms() {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_TERMS_PREFIX, "current");
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;//from   w  ww.  ja v a  2s.com
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), "current");
        result = getNextDecorator().getCurrentTerms();
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), "current");
        result = cachedResult.getValue();
    }

    return (List<Term>) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public Term getLastScheduledTerm() {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_TERMS_PREFIX, "lastscheduled");
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;//from w  w w . ja  v  a  2 s  .  c om
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), "lastscheduled");
        result = getNextDecorator().getLastScheduledTerm();
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), "lastscheduled");
        result = cachedResult.getValue();
    }

    return (Term) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public Term getOldestHistoricalTerm() {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_TERMS_PREFIX, "oldesthistorical");
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;//  w  ww  .j  av a2  s.  co  m
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), "oldesthistorical");
        result = getNextDecorator().getOldestHistoricalTerm();
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), "oldesthistorical");
        result = cachedResult.getValue();
    }

    return (Term) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public List<Term> getTermsInAcademicYear(YearTerm yearTerm) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_TERMS_PREFIX, yearTerm);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;/*from w  w  w.j  a v  a2 s .co m*/
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), yearTerm);
        result = getNextDecorator().getTermsInAcademicYear();
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), yearTerm);
        result = cachedResult.getValue();
    }

    return (List<Term>) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public List<Term> getPlanningTerms() {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_TERMS_PREFIX, "planning");
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;/*from   w  w  w.  j a v  a 2 s. c  o m*/
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), "planning");
        result = getNextDecorator().getPlanningTerms();
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), "planning");
        result = cachedResult.getValue();
    }

    return (List<Term>) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

@Override
public boolean isOfficial(String termId) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_STATUS_PREFIX + "isofficial", termId);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;/* ww w  .j  a v  a2 s .  c om*/
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), termId);
        result = getNextDecorator().isOfficial(termId);
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), termId);
        result = cachedResult.getValue();
    }

    return (boolean) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

/**
 * @see org.kuali.student.ap.framework.context.TermHelper#isPlanning(String)
 *//*from w w  w .  j ava 2 s .  c om*/
@Override
public boolean isPlanning(String termId) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_STATUS_PREFIX + "isplanning", termId);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), termId);
        result = getNextDecorator().isPlanning(termId);
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), termId);
        result = cachedResult.getValue();
    }

    return (boolean) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

/**
 * @see org.kuali.student.ap.framework.context.TermHelper#isCompleted(String)
 *//*from ww  w . j ava2 s.co m*/
@Override
public boolean isCompleted(String termId) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_STATUS_PREFIX + "iscompleted", termId);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), termId);
        result = getNextDecorator().isCompleted(termId);
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), termId);
        result = cachedResult.getValue();
    }

    return (boolean) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

/**
 * @see org.kuali.student.ap.framework.context.TermHelper#isInProgress(String)
 *//*from  w w w  . ja v a2 s .  c o m*/
@Override
public boolean isInProgress(String termId) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_STATUS_PREFIX + "isinprogress", termId);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), termId);
        result = getNextDecorator().isInProgress(termId);
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), termId);
        result = cachedResult.getValue();
    }

    return (boolean) result;
}

From source file:org.kuali.student.ap.framework.context.decorators.TermHelperCacheDecorator.java

/**
 * @see org.kuali.student.ap.framework.context.TermHelper#isFutureTerm(String)
 *//* w  ww. java 2s .com*/
@Override
public boolean isFutureTerm(String termId) {
    MultiKey cacheKey = new MultiKey(TERM_HELPER_STATUS_PREFIX + "isfutureterm", termId);
    Cache cache = getCacheManager().getCache(TERM_HELPER_CACHE);
    Element cachedResult = cache.get(cacheKey);
    Object result;
    if (cachedResult == null) {
        LOG.debug("Cache ({}) miss for search of {}", cache.getName(), termId);
        result = getNextDecorator().isFutureTerm(termId);
        cache.put(new Element(cacheKey, result));
    } else {
        LOG.debug("Cache ({}) hit for search of {}", cache.getName(), termId);
        result = cachedResult.getValue();
    }

    return (boolean) result;
}