001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.http.response; 014 015import static org.apache.juneau.http.response.Processing.*; 016 017import java.net.*; 018import java.util.*; 019 020import org.apache.http.*; 021import org.apache.http.Header; 022import org.apache.juneau.annotation.*; 023import org.apache.juneau.http.*; 024import org.apache.juneau.http.annotation.*; 025import org.apache.juneau.http.header.*; 026import org.apache.juneau.internal.*; 027 028/** 029 * Represents an <c>HTTP 102 Processing</c> response. 030 * 031 * <p> 032 * A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. 033 * This code indicates that the server has received and is processing the request, but no response is available yet. 034 * This prevents the client from timing out and assuming the request was lost. 035 * 036 * <h5 class='section'>See Also:</h5><ul> 037 * <li class='link'><a class="doclink" href="../../../../../index.html#juneau-rest-common">juneau-rest-common</a> 038 * </ul> 039 */ 040@Response 041@StatusCode(STATUS_CODE) 042@Schema(description=REASON_PHRASE) 043@FluentSetters 044public class Processing extends BasicHttpResponse { 045 046 /** HTTP status code */ 047 public static final int STATUS_CODE = 102; 048 049 /** Reason phrase */ 050 public static final String REASON_PHRASE = "Processing"; 051 052 /** Default status line */ 053 private static final BasicStatusLine STATUS_LINE = BasicStatusLine.create(STATUS_CODE, REASON_PHRASE); 054 055 /** Default unmodifiable instance */ 056 public static final Processing INSTANCE = new Processing().setUnmodifiable(); 057 058 /** 059 * Constructor. 060 */ 061 public Processing() { 062 super(STATUS_LINE); 063 } 064 065 /** 066 * Copy constructor. 067 * 068 * @param copyFrom The bean to copy from. 069 */ 070 public Processing(Processing copyFrom) { 071 super(copyFrom); 072 } 073 074 /** 075 * Constructor. 076 * 077 * <p> 078 * This is the constructor used when parsing an HTTP response. 079 * 080 * @param response The HTTP response to copy from. Must not be <jk>null</jk>. 081 * @throws AssertionError If HTTP response status code does not match what was expected. 082 */ 083 public Processing(HttpResponse response) { 084 super(response); 085 assertStatusCode(response); 086 } 087 088 /** 089 * Creates a builder for this class initialized with the contents of this bean. 090 * 091 * @return A new builder bean. 092 */ 093 public Processing copy() { 094 return new Processing(this); 095 } 096 097 // <FluentSetters> 098 099 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 100 public Processing setContent(String value) { 101 super.setContent(value); 102 return this; 103 } 104 105 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 106 public Processing setContent(HttpEntity value) { 107 super.setContent(value); 108 return this; 109 } 110 111 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 112 public Processing setHeader2(Header value) { 113 super.setHeader2(value); 114 return this; 115 } 116 117 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 118 public Processing setHeader2(String name, String value) { 119 super.setHeader2(name, value); 120 return this; 121 } 122 123 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 124 public Processing setHeaders(List<Header> values) { 125 super.setHeaders(values); 126 return this; 127 } 128 129 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 130 public Processing setHeaders(HeaderList value) { 131 super.setHeaders(value); 132 return this; 133 } 134 135 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 136 public Processing setHeaders2(Header...values) { 137 super.setHeaders2(values); 138 return this; 139 } 140 141 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 142 public Processing setLocale2(Locale value) { 143 super.setLocale2(value); 144 return this; 145 } 146 147 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 148 public Processing setLocation(String value) { 149 super.setLocation(value); 150 return this; 151 } 152 153 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 154 public Processing setLocation(URI value) { 155 super.setLocation(value); 156 return this; 157 } 158 159 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 160 public Processing setProtocolVersion(ProtocolVersion value) { 161 super.setProtocolVersion(value); 162 return this; 163 } 164 165 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 166 public Processing setReasonPhrase2(String value) { 167 super.setReasonPhrase2(value); 168 return this; 169 } 170 171 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 172 public Processing setReasonPhraseCatalog(ReasonPhraseCatalog value) { 173 super.setReasonPhraseCatalog(value); 174 return this; 175 } 176 177 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 178 public Processing setStatusCode2(int value) { 179 super.setStatusCode2(value); 180 return this; 181 } 182 183 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 184 public Processing setStatusLine(BasicStatusLine value) { 185 super.setStatusLine(value); 186 return this; 187 } 188 189 @Override /* GENERATED - org.apache.juneau.http.response.BasicHttpResponse */ 190 public Processing setUnmodifiable() { 191 super.setUnmodifiable(); 192 return this; 193 } 194 195 // </FluentSetters> 196}