001package ca.uhn.fhir.rest.gclient;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2022 Smile CDR, Inc.
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 org.hl7.fhir.instance.model.api.IBaseResource;
024import org.hl7.fhir.instance.model.api.IIdType;
025
026public interface IBaseOn<T> {
027
028        /**
029         * Perform the operation across all versions of all resources of all types on the server
030         */
031        T onServer();
032        
033        /**
034         * Perform the operation across all versions of all resources of the given type on the server
035         */
036        T onType(Class<? extends IBaseResource> theResourceType);
037
038        /**
039         * Perform the operation across all versions of all resources of the given type on the server
040         *
041         * @param theResourceType The resource type name, e.g. "ValueSet"
042         */
043        T onType(String theResourceType);
044
045        /**
046         * Perform the operation across all versions of a specific resource (by ID and type) on the server.
047         * Note that <code>theId</code> must be populated with both a resource type and a resource ID at
048         * a minimum.
049         * 
050         * @throws IllegalArgumentException If <code>theId</code> does not contain at least a resource type and ID 
051         */
052        T onInstance(IIdType theId);
053
054        /**
055         * Perform the operation across all versions of a specific resource (by ID and type) on the server.
056         * Note that <code>theId</code> must be populated with both a resource type and a resource ID at
057         * a minimum.
058         *
059         * @throws IllegalArgumentException If <code>theId</code> does not contain at least a resource type and ID
060         */
061        T onInstance(String theId);
062
063}