Package javax.ws.rs.core

Examples of javax.ws.rs.core.CacheControl


        !user.isAdmin() ? (user.getName() + "." + table) : table;
    } else {
      this.actualTableName = table;
    }
    this.tableName = table;
    cacheControl = new CacheControl();
    cacheControl.setNoCache(true);
    cacheControl.setNoTransform(false);
    servlet = RESTServlet.getInstance();
  }
View Full Code Here


  RESTServlet servlet;
  CacheControl cacheControl;

  public RootResource() throws IOException {
    servlet = RESTServlet.getInstance();
    cacheControl = new CacheControl();
    cacheControl.setNoCache(true);
    cacheControl.setNoTransform(false);
  }
View Full Code Here

    this.user = user;
    this.id = id;
    this.generator = generator;
    this.batch = batch;
    servlet = RESTServlet.getInstance();
    cacheControl = new CacheControl();
    cacheControl.setNoCache(true);
    cacheControl.setNoTransform(false);
  }
View Full Code Here

  private RESTServlet servlet;

  public StorageClusterStatusResource(User user) throws IOException {
    this.user = user;
    this.servlet = RESTServlet.getInstance();
    this.cacheControl = new CacheControl();
    this.cacheControl.setNoCache(true);
    this.cacheControl.setNoTransform(false);
  }
View Full Code Here

        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

                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

    }
   
    @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

    }

    @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

    @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

            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

TOP

Related Classes of javax.ws.rs.core.CacheControl

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.