1 /* 2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.net.www.protocol.http; 27 28 /** 29 * @author Michael McMahon 30 * 31 * Interface provided by internal http authentication cache. 32 * NB. This API will be replaced in a future release, and should 33 * not be made public. 34 */ 35 36 public interface AuthCache { 37 38 /** 39 * Put an entry in the cache. pkey is a string specified as follows: 40 * 41 * A:[B:]C:D:E[:F] Between 4 and 6 fields separated by ":" 42 * where the fields have the following meaning: 43 * A is "s" or "p" for server or proxy authentication respectively 44 * B is optional and is the {@link AuthScheme}, e.g. BASIC, DIGEST, NTLM, etc 45 * C is either "http" or "https" 46 * D is the hostname 47 * E is the port number 48 * F is optional and if present is the realm 49 * 50 * Generally, two entries are created for each AuthCacheValue, 51 * one including the realm and one without the realm. 52 * Also, for some schemes (digest) multiple entries may be created 53 * with the same pkey, but with a different path value in 54 * the AuthCacheValue. 55 */ put(String pkey, AuthCacheValue value)56 public void put (String pkey, AuthCacheValue value); 57 58 /** 59 * Get an entry from the cache based on pkey as described above, but also 60 * using a pathname (skey) and the cache must return an entry 61 * if skey is a sub-path of the AuthCacheValue.path field. 62 */ get(String pkey, String skey)63 public AuthCacheValue get (String pkey, String skey); 64 65 /** 66 * remove the entry from the cache whose pkey is specified and 67 * whose path is equal to entry.path. If entry is null then 68 * all entries with the same pkey should be removed. 69 */ remove(String pkey, AuthCacheValue entry)70 public void remove (String pkey, AuthCacheValue entry); 71 } 72