1c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath/*
22231db3e6bb54447a9b14cf004a6cb03c373651cjwilson * Copyright (C) 2012 Square, Inc.
3c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath *
4c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * Licensed under the Apache License, Version 2.0 (the "License");
5c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * you may not use this file except in compliance with the License.
6c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * You may obtain a copy of the License at
7c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath *
8c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath *      http://www.apache.org/licenses/LICENSE-2.0
9c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath *
10c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * Unless required by applicable law or agreed to in writing, software
11c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * distributed under the License is distributed on an "AS IS" BASIS,
12c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * See the License for the specific language governing permissions and
14c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath * limitations under the License.
15c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath */
162231db3e6bb54447a9b14cf004a6cb03c373651cjwilsonpackage com.squareup.okhttp.internal;
17c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath
182231db3e6bb54447a9b14cf004a6cb03c373651cjwilsonimport java.net.InetAddress;
192231db3e6bb54447a9b14cf004a6cb03c373651cjwilsonimport java.net.UnknownHostException;
20c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath
212231db3e6bb54447a9b14cf004a6cb03c373651cjwilson/**
222231db3e6bb54447a9b14cf004a6cb03c373651cjwilson * Domain name service. Prefer this over {@link InetAddress#getAllByName} to
232231db3e6bb54447a9b14cf004a6cb03c373651cjwilson * make code more testable.
242231db3e6bb54447a9b14cf004a6cb03c373651cjwilson */
252231db3e6bb54447a9b14cf004a6cb03c373651cjwilsonpublic interface Dns {
2654cf3446000fdcf88a9e62724f7deb0282e98da1jwilson  Dns DEFAULT = new Dns() {
2754cf3446000fdcf88a9e62724f7deb0282e98da1jwilson    @Override public InetAddress[] getAllByName(String host) throws UnknownHostException {
2854cf3446000fdcf88a9e62724f7deb0282e98da1jwilson      return InetAddress.getAllByName(host);
2954cf3446000fdcf88a9e62724f7deb0282e98da1jwilson    }
3054cf3446000fdcf88a9e62724f7deb0282e98da1jwilson  };
31c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath
3254cf3446000fdcf88a9e62724f7deb0282e98da1jwilson  InetAddress[] getAllByName(String host) throws UnknownHostException;
33c3f6f16bd4a2338e88275641b9f2f56e816ca377Narayan Kamath}
34