Package org.cruxframework.crux.core.server.rest.state.ResourceStateHandler

Examples of org.cruxframework.crux.core.server.rest.state.ResourceStateHandler.ResourceState


    if (ret.getCacheInfo() != null && (ret.getCacheInfo().isCacheEnabled() || ret.isEtagGenerationEnabled())) // only GET can declare cache
    {
      long dateModified;
      long expires = 0;
      String etag;
      ResourceState resourceState = resourceStateHandler.get(key);
      if (!ret.getCacheInfo().isCacheEnabled())
      {
        expires = (GET.ONE_DAY*1000)+System.currentTimeMillis();
      }
      if (resourceState != null && !resourceState.isExpired())
      {
        etag = resourceState.getEtag();
        dateModified = resourceState.getDateModified();
        if (ret.getCacheInfo().isCacheEnabled())
        {
          expires = ret.getCacheInfo().defineExpires(System.currentTimeMillis());
        }
      }
View Full Code Here


   * @return
   */
  private MethodReturn handleCacheableOperation()
  {
    ResourceStateHandler resourceStateHandler = ResourceStateConfig.getResourceStateHandler();
    ResourceState resourceState = resourceStateHandler.get(key);
    if (resourceState == null)
    {
      return null;
    }
    else
    {
      if (resourceState.isExpired())
      {
        return null;
      }
      ConditionalResponse conditionalResponse = evaluatePreconditions(resourceState);
      if (conditionalResponse != null)
View Full Code Here

   * @return
   */
  private MethodReturn handleUncacheableOperation()
  {
    ResourceStateHandler resourceStateHandler = ResourceStateConfig.getResourceStateHandler();
    ResourceState resourceState = resourceStateHandler.get(key);
    ConditionalResponse conditionalResponse = evaluatePreconditions(resourceState == null || resourceState.isExpired()?null:resourceState);
    if (conditionalResponse == null)
    {
      return null;
    }
    return new MethodReturn(resourceMethod.hasReturnType, null, null, resourceMethod.cacheInfo, conditionalResponse, resourceMethod.isEtagGenerationEnabled());
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.server.rest.state.ResourceStateHandler.ResourceState

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.