Package org.apache.roller.presentation

Examples of org.apache.roller.presentation.WeblogFeedRequest


        mLogger.debug("entering");
       
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
       
        WeblogFeedRequest feedRequest = null;
        try {
            feedRequest = new WeblogFeedRequest(request);
        } catch(Exception e) {
            mLogger.error("error creating feed request", e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        String key = this.CACHE_ID+":"+this.generateKey(feedRequest);
       
        Date updateTime = null;
        try {
            long lastExpiration = 0;
           
            // first, we need to determine the last time the specified feed was expired.
            // if this is a weblog specific feed then ask the CacheManager for
            // the last expired time of the weblog.  otherwise this is a main feed and we
            // keep that last expired time ourselves
            if(feedRequest.getWeblogHandle() != null) {
                Date lastExpirationDate =
                        (Date) CacheManager.getLastExpiredDate(feedRequest.getWeblogHandle());
                if(lastExpirationDate != null)
                    lastExpiration = lastExpirationDate.getTime();
            } else {
                lastExpiration = this.mainLastExpiredDate.getTime();
            }
           
            LazyExpiringCacheEntry entry =
                    (LazyExpiringCacheEntry) this.mCache.get(key);
            if(entry != null) {
                updateTime = (Date) entry.getValue(lastExpiration);
               
                if(updateTime == null)
                    mLogger.debug("HIT-INVALID "+key);
            }
           
            if (updateTime == null) {
                mLogger.debug("MISS "+key);
               
                if(feedRequest.getWeblogHandle() != null) {
                    Roller roller = RollerFactory.getRoller();
                    UserManager umgr = roller.getUserManager();
                    WeblogManager wmgr = roller.getWeblogManager();
                   
                    updateTime = wmgr.getWeblogLastPublishTime(
                            umgr.getWebsiteByHandle(feedRequest.getWeblogHandle()),
                            feedRequest.getWeblogCategory());
                   
                    this.mCache.put(key, new LazyExpiringCacheEntry(updateTime));
                   
                } else {
                    this.mCache.put(key, new LazyExpiringCacheEntry(new Date()));
View Full Code Here


        mLogger.debug("entering");
       
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
       
        WeblogFeedRequest feedRequest = null;
        try {
            feedRequest = new WeblogFeedRequest(request);
        } catch(Exception e) {
            // some kind of error parsing the request
            mLogger.error("error creating weblog feed request", e);
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
            return;
        }
       
        String key = this.CACHE_ID+":"+this.generateKey(feedRequest);
       
        try {
            ResponseContent respContent = null;
            long lastExpiration = 0;
           
            // first, we need to determine the last time the specified feed was expired.
            // if this is a weblog specific feed then ask the CacheManager for
            // the last expired time of the weblog.  otherwise this is a main feed and we
            // keep that last expired time ourselves
            if(feedRequest.getWeblogHandle() != null) {
                Date lastExpirationDate =
                        (Date) CacheManager.getLastExpiredDate(feedRequest.getWeblogHandle());
                if(lastExpirationDate != null)
                    lastExpiration = lastExpirationDate.getTime();
            } else {
                lastExpiration = this.mainLastExpiredDate.getTime();
            }
View Full Code Here

TOP

Related Classes of org.apache.roller.presentation.WeblogFeedRequest

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.