001package ca.uhn.fhir.rest.server; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2016 University Health Network 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import ca.uhn.fhir.context.FhirContext; 024 025public interface IRestfulServerDefaults { 026 027 /** 028 * Gets the {@link FhirContext} associated with this server. For efficient processing, resource providers and plain providers should generally use this context if one is needed, as opposed to 029 * creating their own. 030 */ 031 FhirContext getFhirContext(); 032 033 /** 034 * Should the server "pretty print" responses by default (requesting clients can always override this default by supplying an <code>Accept</code> header in the request, or a <code>_pretty</code> 035 * parameter in the request URL. 036 * <p> 037 * The default is <code>false</code> 038 * </p> 039 * 040 * @return Returns the default pretty print setting 041 */ 042 boolean isDefaultPrettyPrint(); 043 044 /** 045 * @return Returns the server support for ETags (will not be <code>null</code>). Default is {@link RestfulServer#DEFAULT_ETAG_SUPPORT} 046 */ 047 ETagSupportEnum getETagSupport(); 048 049 /** 050 * @return Returns the setting for automatically adding profile tags 051 */ 052 AddProfileTagEnum getAddProfileTag(); 053 054 /** 055 * @return Returns the default encoding to return (XML/JSON) if an incoming request does not specify a preference (either with the <code>_format</code> URL parameter, or with an <code>Accept</code> header 056 * in the request. The default is {@link EncodingEnum#XML}. Will not return null. 057 */ 058 EncodingEnum getDefaultResponseEncoding(); 059 060 /** 061 * @return If <code>true</code> the server will use browser friendly content-types (instead of standard FHIR ones) when it detects that the request is coming from a browser 062 * instead of a FHIR 063 */ 064 boolean isUseBrowserFriendlyContentTypes(); 065 066}