001package ca.uhn.fhir.rest.server;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2017 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 java.util.Collection;
024import java.util.List;
025
026import ca.uhn.fhir.context.FhirContext;
027import ca.uhn.fhir.rest.method.BaseMethodBinding;
028import ca.uhn.fhir.util.VersionUtil;
029
030public class RestulfulServerConfiguration {
031    
032    private Collection<ResourceBinding> resourceBindings;
033    private List<BaseMethodBinding<?>> serverBindings;
034    private String implementationDescription;
035    private String serverVersion = VersionUtil.getVersion();
036    private String serverName = "HAPI FHIR";
037    private FhirContext fhirContext;
038    private IServerAddressStrategy serverAddressStrategy;
039    private String conformanceDate;
040    
041    /**
042     * Constructor
043     */
044    public RestulfulServerConfiguration() {
045       super();
046    }
047    
048    /**
049     * Get the resourceBindings
050     * @return the resourceBindings
051     */
052    public Collection<ResourceBinding> getResourceBindings() {
053        return resourceBindings;
054    }
055
056    /**
057     * Set the resourceBindings
058     * @param resourceBindings the resourceBindings to set
059     */
060    public RestulfulServerConfiguration setResourceBindings(Collection<ResourceBinding> resourceBindings) {
061        this.resourceBindings = resourceBindings;
062        return this;
063    }
064
065    /**
066     * Get the serverBindings
067     * @return the serverBindings
068     */
069    public List<BaseMethodBinding<?>> getServerBindings() {
070        return serverBindings;
071    }
072
073    /**
074     * Set the serverBindings
075     * @param serverBindings the serverBindings to set
076     */
077    public RestulfulServerConfiguration setServerBindings(List<BaseMethodBinding<?>> serverBindings) {
078        this.serverBindings = serverBindings;
079        return this;
080    }
081
082    /**
083     * Get the implementationDescription
084     * @return the implementationDescription
085     */
086    public String getImplementationDescription() {
087        return implementationDescription;
088    }
089
090    /**
091     * Set the implementationDescription
092     * @param implementationDescription the implementationDescription to set
093     */
094    public RestulfulServerConfiguration setImplementationDescription(String implementationDescription) {
095        this.implementationDescription = implementationDescription;
096        return this;
097    }
098
099    /**
100     * Get the serverVersion
101     * @return the serverVersion
102     */
103    public String getServerVersion() {
104        return serverVersion;
105    }
106
107    /**
108     * Set the serverVersion
109     * @param serverVersion the serverVersion to set
110     */
111    public RestulfulServerConfiguration setServerVersion(String serverVersion) {
112        this.serverVersion = serverVersion;
113        return this;
114    }
115
116    /**
117     * Get the serverName
118     * @return the serverName
119     */
120    public String getServerName() {
121        return serverName;
122    }
123
124    /**
125     * Set the serverName
126     * @param serverName the serverName to set
127     */
128    public RestulfulServerConfiguration setServerName(String serverName) {
129        this.serverName = serverName;
130        return this;
131    }
132
133    /**
134     * 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
135     * creating their own.
136     */
137    public FhirContext getFhirContext() {
138        return this.fhirContext;
139    }
140    
141    /**
142     * Set the fhirContext
143     * @param fhirContext the fhirContext to set
144     */
145    public RestulfulServerConfiguration setFhirContext(FhirContext fhirContext) {
146        this.fhirContext = fhirContext;
147        return this;
148    }
149    
150    /**
151     * Get the serverAddressStrategy
152     * @return the serverAddressStrategy
153     */
154    public IServerAddressStrategy getServerAddressStrategy() {
155        return serverAddressStrategy;
156    }
157
158    /**
159     * Set the serverAddressStrategy
160     * @param serverAddressStrategy the serverAddressStrategy to set
161     */
162    public void setServerAddressStrategy(IServerAddressStrategy serverAddressStrategy) {
163        this.serverAddressStrategy = serverAddressStrategy;
164    }    
165
166    
167    /**
168     * Get the conformanceDate
169     * @return the conformanceDate
170     */
171    public String getConformanceDate() {
172        return conformanceDate;
173    }
174
175    /**
176     * Set the conformanceDate
177     * @param conformanceDate the conformanceDate to set
178     */
179    public void setConformanceDate(String conformanceDate) {
180        this.conformanceDate = conformanceDate;
181    }
182    
183}