Package org.apache.cxf.jaxrs.impl

Examples of org.apache.cxf.jaxrs.impl.HttpHeadersImpl


            return issuerId;
        }
    }
   
    protected boolean checkSecurityContext(Message m) {
        HttpHeaders headers = new HttpHeadersImpl(m);
        Map<String, Cookie> cookies = headers.getCookies();
       
        Cookie securityContextCookie = cookies.get(SSOConstants.SECURITY_CONTEXT_TOKEN);
       
        ResponseState responseState = getValidResponseState(securityContextCookie, m);
        if (responseState == null) {
View Full Code Here


   
    protected void copyInputToOutput(InputStream is, OutputStream os,
            MultivaluedMap<String, Object> outHeaders) throws IOException {
        if (isRangeSupported()) {
            Message inMessage = PhaseInterceptorChain.getCurrentMessage().getExchange().getInMessage();
            handleRangeRequest(is, os, new HttpHeadersImpl(inMessage), outHeaders);
        } else {
            IOUtils.copyAndCloseInput(is, os);
        }
    }
View Full Code Here

    }
   
    public static String getProtocolHeader(Message m, String name, String defaultValue, boolean setOnMessage) {
        String value = (String)m.get(name);
        if (value == null) {
            value = new HttpHeadersImpl(m).getRequestHeaders().getFirst(name);
            if (value != null && setOnMessage) {
                m.put(name, value);
            }
        }
        return value == null ? defaultValue : value;
View Full Code Here

        String requestUri = (String)message.getExchange().getInMessage().get(Message.REQUEST_URI);
        if (requestUri.endsWith("/outfault")) {
            throw new WebApplicationException(403);
        }
       
        HttpHeaders requestHeaders = new HttpHeadersImpl(message.getExchange().getInMessage());
        if (!requestHeaders.getRequestHeader("PLAIN-MAP").isEmpty()) {
            Map<String, List<String>> headers = (Map<String, List<String>>)
                message.get(Message.PROTOCOL_HEADERS);
            if (headers == null) {
                headers = new HashMap<String, List<String>>();
                message.put(Message.PROTOCOL_HEADERS, headers);
View Full Code Here

                                             String header,
                                             Class<?> pClass,
                                             Type genericType,
                                             String defaultValue) {
       
        List<String> values = new HttpHeadersImpl(m).getRequestHeader(header);
        if (values != null && values.isEmpty()) {
            values = null;
        }
        return InjectionUtils.createParameterObject(values,
                                                    pClass,
View Full Code Here

       
    }

    private static Object processCookieParam(Message m, String cookieName,
                              Class<?> pClass, Type genericType, String defaultValue) {
        List<String> values = new HttpHeadersImpl(m).getRequestHeader(HttpHeaders.COOKIE);
        String theValue = null;
        for (String s : values) {
            if (s.contains(cookieName + "=")) {
                theValue = s;
                break;
View Full Code Here

   
    private static HttpHeaders createHttpHeaders(Message m) {
        if (MessageUtils.isRequestor(m)) {
            m = m.getExchange() != null ? m.getExchange().getOutMessage() : m;
        }
        return new HttpHeadersImpl(m);
    }
View Full Code Here

                                         parameterAnnotations,
                                         type,
                                         m);
            if (provider != null) {
                try {
                    HttpHeaders headers = new HttpHeadersImpl(m);
                    return provider.readFrom(
                              targetTypeClass, parameterType, parameterAnnotations, contentType,
                              headers.getRequestHeaders(), is);
                } catch (IOException e) {
                    String errorMessage = "Error deserializing input stream into target class "
                                          + targetTypeClass.getSimpleName()
                                           + ", content type : " + contentType;
                    LOG.severe(errorMessage);
View Full Code Here

        sbMain.append(sbResources.toString());
        sbMain.append("</application>");
       
        m.getExchange().put(JAXRSUtils.IGNORE_MESSAGE_WRITERS, ignoreMessageWriters);
       
        HttpHeaders headers = new HttpHeadersImpl(m);
        MediaType type = headers.getAcceptableMediaTypes().contains(MediaType.APPLICATION_XML_TYPE)
                      ? MediaType.APPLICATION_XML_TYPE : WADL_TYPE; 
        return Response.ok().type(type).entity(sbMain.toString()).build();
    }
View Full Code Here

        if (ignoreRequests) {
            return Response.status(404).build();
        }

        HttpHeaders headers = new HttpHeadersImpl(m);
        List<MediaType> accepts = headers.getAcceptableMediaTypes();
        MediaType type = accepts.contains(WADL_TYPE)
            ? WADL_TYPE : accepts.contains(MediaType.APPLICATION_JSON_TYPE)
                ? MediaType.APPLICATION_JSON_TYPE : defaultMediaType;
       
        Response response = getExistingWadl(m, ui, type);
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.impl.HttpHeadersImpl

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.