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