Package org.jasig.portal

Examples of org.jasig.portal.ChannelCacheKey


     *
     * @return
     */
    private ChannelCacheKey initKey(String id)
    {
        ChannelCacheKey key = new ChannelCacheKey();
        key.setKeyScope(ChannelCacheKey.INSTANCE_KEY_SCOPE);
        key.setKey(this.getClass().getName()+":"+id);

        try
        {
            File contentFile = ResourceLoader.getResourceAsFile(this.getClass(),
                    CONTENT_FILE);
            long contentModified = contentFile.lastModified();
            File stylesheetFile = ResourceLoader.getResourceAsFile(this.getClass(),
                    STYLESHEET_FILE);
            long stylesheetModified = stylesheetFile.lastModified();
            if (contentModified > stylesheetModified)
                key.setKeyValidity("" + contentModified);
            else
                key.setKeyValidity("" + stylesheetModified);
        } catch (ResourceMissingException e)
        {
            // if we can't tell when the file was modified then it will
            // force rendering everytime. This should never happen but
            // handles that scenario if it does occur.
            key.setKeyValidity("1");
        }
        return key;
    }
View Full Code Here


     *
     * @see org.jasig.portal.ICacheable#generateKey()
     */
    public ChannelCacheKey generateKey()
    {
        ChannelCacheKey key = (ChannelCacheKey) this.cacheKeys
                .get(currentSection);
        if (key == null) // haven't asked for this section yet
            key = initKey(currentSection);

        return key;
View Full Code Here

     *
     * @see org.jasig.portal.channels.jsp.IController#getJspToRender()
     */
    public void setStaticData(ChannelStaticData csd)
    {
        mCacheKey = new ChannelCacheKey();
        mCacheKey.setKey(csd.getChannelSubscribeId());
        mCacheKey.setKeyValidity(new Object());
       
        // this "events" list will appear on the request object for the jsp
        jspBeans.put("events", events);
View Full Code Here

  }

  // ICachable methods...

  public ChannelCacheKey generateKey() {
    ChannelCacheKey key = new ChannelCacheKey();
    key.setKey(getKey());
    key.setKeyScope(ChannelCacheKey.SYSTEM_KEY_SCOPE);
    key.setKeyValidity(null);
    return key;
  }
View Full Code Here

        // generate key
        if (this.runtimeData != null && this.runtimeData.getParameter("action") != null) {
            return null;
        }

        ChannelCacheKey k = new ChannelCacheKey();
        StringBuilder sbKey = new StringBuilder(1024);

        // assume that errors can be cached system-wide
        k.setKeyScope(ChannelCacheKey.SYSTEM_KEY_SCOPE);

        sbKey.append(this.getClass().getName()).append(": errorDocument=").append(this.errorDocument);
        sbKey.append(" strace=").append(Boolean.toString(this.showStackTrace));
        sbKey.append(", mode=").append(this.ssTitle);
        sbKey.append(", locales=").append(LocaleManager.stringValueOf(this.runtimeData.getLocales()));
        k.setKey(sbKey.toString());
        return k;
    }
View Full Code Here

        final HttpSession session = httpServletRequest.getSession(false);
        if (session != null) {
            key.put("HttpSession.id", session.getId());
        }

        final ChannelCacheKey cacheKey = new ChannelCacheKey();
        cacheKey.setKeyScope(ChannelCacheKey.INSTANCE_KEY_SCOPE);
        cacheKey.setKey(key.toString());
        cacheKey.setKeyValidity(System.currentTimeMillis());
       
        return cacheKey;
    }
View Full Code Here

    /**
     * put your documentation comment here
     * @return a <code>ChannelCacheKey</code> used to lookup Channels from the cache
     */
    public ChannelCacheKey generateKey () {
        ChannelCacheKey cck;
        if (session.servant == null) {
            cck = new ChannelCacheKey();
            cck.setKey(session.staticData.getChannelPublishId()+"-"+session.staticData.getChannelSubscribeId() + "-" + String.valueOf(session.staticData.getPerson().getID()));
            cck.setKeyValidity(session.runtimeData.getParameter("prmView"));
            log.debug("CPermissionsManager.generateKey() : set validity to "
                    + session.runtimeData.getParameter("prmView"));
        }
        else {
            cck = ((ICacheable)session.servant).generateKey();
View Full Code Here

    // check cache-control, no-cache, must-revalidate, max-age,
    // Date & Expires, expiry in past
    // for 1.0 check pragma for no-cache
    // add a warning to docs about not a full http 1.1 impl.

    ChannelCacheKey k = new ChannelCacheKey();
    StringBuffer sbKey = new StringBuffer(1024);

    // Only INSTANCE scope is currently supported.
    k.setKeyScope(ChannelCacheKey.INSTANCE_KEY_SCOPE);

    sbKey.append("sslUri:").append(state.sslUri).append(", ");

    // xslUri may either be specified as a parameter to this channel
    // or we will get it by looking in the stylesheet list file
    String xslUriForKey = state.xslUri;
    try {
      if (xslUriForKey == null) {
        String sslUri = ResourceLoader.getResourceAsURLString(this.getClass(), state.sslUri);
        xslUriForKey = XSLT.getStylesheetURI(sslUri, state.runtimeData.getBrowserInfo());
      }
    } catch (Exception e) {
      xslUriForKey = "Not attainable: " + e;
    }

    sbKey.append("xslUri:").append(xslUriForKey).append(", ");
    sbKey.append("key:").append(state.key).append(", ");
    sbKey.append("passThrough:").append(state.passThrough).append(", ");
    sbKey.append("tidy:").append(state.tidy).append(", ");
    sbKey.append("person:").append(state.person);
    k.setKey(sbKey.toString());
    k.setKeyValidity(new Long(System.currentTimeMillis()));
    //log.debug("CWebProxy:generateKey("
    //      + uid + ") : cachekey=\"" + sbKey.toString() + "\"");
    return k;
  }
View Full Code Here

    return new TitledChannelRuntimeProperties(title);
  }
*/

  public ChannelCacheKey generateKey() {
    ChannelCacheKey k = null;
    k = new ChannelCacheKey();
    k.setKeyScope(ChannelCacheKey.SYSTEM_KEY_SCOPE);
    k.setKey("RSS:xmlUri:"+xmlUri + ",limit:"+  limit);
    k.setKeyValidity(new Long(System.currentTimeMillis()));
    return k;
  }
View Full Code Here

  }

  // IMultithreadedCachable methods...

  public ChannelCacheKey generateKey() {
    ChannelCacheKey key = new ChannelCacheKey();
    key.setKey(getKey());
    key.setKeyScope(ChannelCacheKey.SYSTEM_KEY_SCOPE);
    key.setKeyValidity(null);
    return key;
  }
View Full Code Here

TOP

Related Classes of org.jasig.portal.ChannelCacheKey

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.