Package org.jasig.portal.utils

Examples of org.jasig.portal.utils.ICounterStore


    /**
     * @param name String
     */
    public void createCounter(String name) throws Exception {
        final ICounterStore counterStore = this.getCounterStore();
        counterStore.createCounter(name);
    }
View Full Code Here


    /**
     * @param name String
     * @return String
     */
    public String getNext(String name) throws Exception {
        final ICounterStore counterStore = this.getCounterStore();
        final int next = counterStore.getIncrementIntegerId(name);
        return Integer.toString(next);
    }
View Full Code Here

    /**
     * @param name String
     * @return int
     */
    public int getNextInt(String name) throws Exception {
        final ICounterStore counterStore = this.getCounterStore();
        return counterStore.getIncrementIntegerId(name);
    }
View Full Code Here

    /**
     * @param name java.lang.String
     * @param newValue int
     */
    public void setCounter(String name, int newValue) throws Exception {
        final ICounterStore counterStore = this.getCounterStore();
        counterStore.setCounter(name, newValue);
    }
View Full Code Here

                   
                    //Use the list of removed ids to re-use IDs before generating new ones
                    if (prefIds.size() > 0) {
                        prefId = ((Integer)prefIds.removeLast()).intValue();
                    } else {
                        final ICounterStore counterStore = CounterStoreFactory.getCounterStoreImpl();
                        prefId = counterStore.getIncrementIntegerId(UP_PORTLET_PREFERENCE_VALUE);
                    }
                   
                    insertPrefNamePstmt.setInt(4, prefId);
                   
                    //Insert the name row
View Full Code Here

                    //Use the list of removed ids to re-use IDs before generating new ones
                    if (prefIds.size() > 0) {
                        prefId = ((Integer)prefIds.removeLast()).intValue();
                    }
                    else {
                        final ICounterStore counterStore = CounterStoreFactory.getCounterStoreImpl();
                       
                        try {
                            prefId = counterStore.getIncrementIntegerId(UP_PORTLET_PREFERENCE_VALUE);
                        }
                        catch (Exception e) {
                            counterStore.createCounter(UP_PORTLET_PREFERENCE_VALUE);
                            prefId = counterStore.getIncrementIntegerId(UP_PORTLET_PREFERENCE_VALUE);
                        }
                    }
                   
                    insertPrefNamePstmt.setInt(5, prefId);
                   
View Full Code Here

     * @see org.danann.cernunnos.Phrase#evaluate(org.danann.cernunnos.TaskRequest, org.danann.cernunnos.TaskResponse)
     */
    public Object evaluate(TaskRequest req, TaskResponse res) {
        final String seqName = (String)this.seqNamePhrase.evaluate(req, res);
       
        final ICounterStore counterStore = CounterStoreLocator.getCounterStore();
        try {
            return counterStore.getNextId(seqName);
        }
        catch (Exception e) {
            throw new RuntimeException("Failed to retrieve next sequence in for sequance '" + seqName + "'", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jasig.portal.utils.ICounterStore

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.