Package org.apache.abdera.protocol.server

Examples of org.apache.abdera.protocol.server.ResponseContext


        }

        WorkspaceManager wm = getWorkspaceManager(request);
        CollectionAdapter adapter = wm.getCollectionAdapter(request);
        Transactional transaction = adapter instanceof Transactional ? (Transactional)adapter : null;
        ResponseContext response = null;
        try {
            transactionStart(transaction, request);
            response = processor.process(request, wm, adapter);
            response = response != null ? response : processExtensionRequest(request, adapter);
        } catch (Throwable e) {
View Full Code Here


                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.getMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.postMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.putMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.deleteMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.headMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.optionsMedia(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processMedia(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                                   WorkspaceManager workspaceManager,
                                   CollectionAdapter collectionAdapter) {
        String method = requestContext.getMethod();
        if (method.equalsIgnoreCase("GET")) {
            OpenSearchDescription description = this.openSearchInfo.asOpenSearchDescriptionElement(requestContext);
            ResponseContext response = new BaseResponseContext(description);
            response.setContentType(OpenSearchConstants.OPENSEARCH_DESCRIPTION_CONTENT_TYPE);
            return response;
        } else {
            return null;
        }
    }
View Full Code Here

        return options;

    }

    public ResponseContext filter(RequestContext request, FilterChain chain) {
        ResponseContext response = super.filter(request, chain);
        DHContext context = getDHContext(request);
        response.setHeader(Constants.CONTENT_ENCRYPTED, context.getResponseString());
        return response;
    }
View Full Code Here

    public void bootstrap(RequestContext request) {
    }

    public ResponseContext filter(RequestContext request, FilterChain chain) {
        ResponseContext response = super.filter(request, chain);
        String method = request.getMethod();
        // include a Accept-Encryption header in the response to GET, HEAD and OPTIONS requests
        // the header will specify all the information the client needs to construct
        // it's own DH context and encrypt the request
        if ("GET".equalsIgnoreCase(method) || "HEAD".equalsIgnoreCase(method) || "OPTIONS".equalsIgnoreCase(method)) {
            DHContext context = (DHContext)request.getAttribute(Scope.SESSION, "dhcontext");
            if (context == null) {
                context = new DHContext();
                request.setAttribute(Scope.SESSION, "dhcontext", context);
            }
            response.setHeader(Constants.ACCEPT_ENCRYPTION, context.getRequestString());
        }
        return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.ResponseContext

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.