Java Code Examples for org.apache.http.HttpHeaders#HOST

The following examples show how to use org.apache.http.HttpHeaders#HOST . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FacadeResource.java    From io with Apache License 2.0 5 votes vote down vote up
/**
 * @param cookieAuthValue クッキー内の dc_cookieキーに指定された値
 * @param cookiePeer dc_cookie_peerクエリに指定された値
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param uriInfo UriInfo
 * @param xDcUnitUser X-Dc-UnitUserヘッダ
 * @param httpServletRequest HttpServletRequest
 * @return CellResourceオブジェクトまたはResponseオブジェクト
 */
@Path("{path1}")
public final Object facade(
        @CookieParam(DC_COOKIE_KEY) final String cookieAuthValue,
        @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser,
        @Context final UriInfo uriInfo,
        @Context HttpServletRequest httpServletRequest) {
    Cell cell = ModelFactory.cell(uriInfo);
    AccessContext ac = AccessContext.create(authzHeaderValue,
            uriInfo, cookiePeer, cookieAuthValue, cell, uriInfo.getBaseUri().toString(),
            host, xDcUnitUser);
    if (cell == null) {
        throw DcCoreException.Dav.CELL_NOT_FOUND;
    }

    long cellStatus = CellLockManager.getCellStatus(cell.getId());
    if (cellStatus == CellLockManager.CELL_STATUS_BULK_DELETION) {
        throw DcCoreException.Dav.CELL_NOT_FOUND;
    }

    CellLockManager.incrementReferenceCount(cell.getId());
    httpServletRequest.setAttribute("cellId", cell.getId());
    return new CellResource(ac);
}
 
Example 2
Source File: FacadeResource.java    From io with Apache License 2.0 5 votes vote down vote up
/**
 * @param cookieAuthValue クッキー内の dc_cookieキーに指定された値
 * @param cookiePeer dc_cookie_peerクエリに指定された値
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param xDcUnitUser ヘッダ
 * @param uriInfo UriInfo
 * @return UnitCtlResourceオブジェクト
 */
@Path("__ctl")
public final UnitCtlResource ctl(
        @CookieParam(DC_COOKIE_KEY) final String cookieAuthValue,
        @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser,
        @Context final UriInfo uriInfo) {
    AccessContext ac = AccessContext.create(authzHeaderValue,
            uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(),
            host, xDcUnitUser);
    return new UnitCtlResource(ac, uriInfo);
}
 
Example 3
Source File: FacadeResource.java    From io with Apache License 2.0 5 votes vote down vote up
/**
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param xDcUnitUser ヘッダ
 * @param uriInfo UriInfo
 * @return UnitCtlResourceオブジェクト
 */
@Path("__status")
public final StatusResource status(
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(DcCoreUtils.HttpHeaders.X_DC_UNIT_USER) final String xDcUnitUser,
        @Context final UriInfo uriInfo) {
    return new StatusResource();
}