Examples of CacheControl


Examples of javax.ws.rs.core.CacheControl

        final RestfulResponse<DomainObjectRepresentation> restfulResponse = Util.domainObjectJaxrsResponse(client, "PrimitiveValuedEntities");

        // then
        assertThat(restfulResponse.getStatus(), is(HttpStatusCode.OK));
       
        final CacheControl expected = new CacheControl();
        expected.setNoCache(true);
        assertThat(restfulResponse.getHeader(Header.CACHE_CONTROL), isCacheControl().withNoCache().build());
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

                String value = extPair.length == 2 ? extPair[1] : "";
                extensions.put(extPair[0], value);
            }
        }
       
        CacheControl cc = new CacheControl();
        cc.setMaxAge(maxAge);
        cc.setSMaxAge(sMaxAge);
        cc.setPrivate(isPrivate);
        cc.getPrivateFields().addAll(privateFields);
        cc.setMustRevalidate(mustRevalidate);
        cc.setProxyRevalidate(proxyRevalidate);
        cc.setNoCache(noCache);
        cc.getNoCacheFields().addAll(noCacheFields);
        cc.setNoStore(noStore);
        cc.setNoTransform(noTransform);
        cc.getCacheExtension().putAll(extensions);
       
        return cc;
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

    }
   
    @GET
    @Produces(MediaType.TEXT_HTML)
    public Response getProcessorIndex() throws CODIException {
        CacheControl cc = new CacheControl();
        cc.setMustRevalidate(true);
        cc.setNoCache(true);
        cc.setNoStore(true);
        return Response.status(Status.OK).cacheControl(cc).entity(new Viewable("/processor/index.jsp", getProcessorList())).build();
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

    }

    @GET
    @Produces(MediaType.TEXT_HTML)
    public Response getGraphIndex() throws CODIException {
        CacheControl cc = new CacheControl();
        cc.setMustRevalidate(true);
        cc.setNoCache(true);
        cc.setNoStore(true);
        return Response.status(Status.OK).cacheControl(cc).entity(new Viewable("/graph/index.jsp", getGraphList())).build();
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

    @Test
    public void forCacheControl() {
        final Parser<CacheControl> parser = Parser.forCacheControl();

        final CacheControl cc1 = createCacheControl();
        cc1.setMaxAge(2000);
        final CacheControl cc2 = createCacheControl();
        cc2.setNoCache(true);
        for (final CacheControl v : new CacheControl[] { cc1, cc2 }) {
            final String asString = parser.asString(v);
            final CacheControl valueOf = parser.valueOf(asString);
            assertThat(v.getMaxAge(), is(equalTo(valueOf.getMaxAge())));
            assertThat(v.isNoCache(), is(equalTo(valueOf.isNoCache())));
        }
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

            assertThat(v.isNoCache(), is(equalTo(valueOf.isNoCache())));
        }
    }

    private static CacheControl createCacheControl() {
        final CacheControl cacheControl = new CacheControl();
        cacheControl.getCacheExtension(); // workaround for bug in
                                          // CacheControl's equals() method
        cacheControl.getNoCacheFields(); // workaround for bug in CacheControl's
                                         // equals() method
        return cacheControl;
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

            @Override
            public CacheControl valueOf(final String str) {
                if (str == null) {
                    return null;
                }
                final CacheControl cacheControl = CacheControl.valueOf(str);
                // workaround for bug in CacheControl's equals() method
                cacheControl.getCacheExtension();
                cacheControl.getNoCacheFields();
                return cacheControl;
            }

            @Override
            public String asString(final CacheControl cacheControl) {
                return cacheControl.toString();
            }
        };
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

    this.rowspec = new RowSpec(URLDecoder.decode(rowspec,
      HConstants.UTF8_ENCODING));
    if (versions != null) {
      this.rowspec.setMaxVersions(Integer.valueOf(versions));
    }
    cacheControl = new CacheControl();
    cacheControl.setMaxAge(RESTServlet.getInstance().getMaxAge(table));
    cacheControl.setNoTransform(false);
  }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

                String value = extPair.length == 2 ? extPair[1] : "";
                extensions.put(extPair[0], value);
            }
        }
       
        CacheControl cc = new CacheControl();
        cc.setMaxAge(maxAge);
        cc.setSMaxAge(sMaxAge);
        cc.setPrivate(isPrivate);
        cc.getPrivateFields().addAll(privateFields);
        cc.setMustRevalidate(mustRevalidate);
        cc.setProxyRevalidate(proxyRevalidate);
        cc.setNoCache(noCache);
        cc.getNoCacheFields().addAll(noCacheFields);
        cc.setNoStore(noStore);
        cc.setNoTransform(noTransform);
        cc.getCacheExtension().putAll(extensions);
       
        return cc;
    }
View Full Code Here

Examples of javax.ws.rs.core.CacheControl

    LogFactory.getLog(StorageClusterStatusResource.class);

  private CacheControl cacheControl;

  public StorageClusterStatusResource() {
    cacheControl = new CacheControl();
    cacheControl.setNoCache(true);
    cacheControl.setNoTransform(false);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.