01: /* Licensed to the Apache Software Foundation (ASF) under one or more
02: * contributor license agreements. See the NOTICE file distributed with
03: * this work for additional information regarding copyright ownership.
04: * The ASF licenses this file to You under the Apache License, Version 2.0
05: * (the "License"); you may not use this file except in compliance with
06: * the License. You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package java.net;
18:
19: /**
20: * This class is used to hold information about failed name lookups
21: */
22: class NegCacheElement {
23:
24: // we need the time to figure out when the entry is stale
25: long timeAdded = System.currentTimeMillis();
26:
27: // holds the name of the host for which the lookup failed
28: String hostName;
29:
30: /**
31: * default constructor
32: */
33: public NegCacheElement() {
34: super ();
35: }
36:
37: /**
38: * Constructor used to set the hostname for the failed entry
39: *
40: * @param hostName
41: * name of the host on which the lookup failed
42: */
43: public NegCacheElement(String hostName) {
44: this .hostName = hostName;
45: }
46:
47: /**
48: * Answers the hostname for the cache element
49: *
50: * @return hostName name of the host on which the lookup failed
51: */
52: String hostName() {
53: return hostName;
54: }
55: }
|