2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.cadi.locator;
25 import java.net.URISyntaxException;
27 import org.onap.aaf.cadi.Access;
28 import org.onap.aaf.cadi.LocatorException;
29 import org.onap.aaf.cadi.http.HClient;
30 import org.onap.aaf.cadi.http.HX509SS;
32 public class HClientHotPeerLocator extends HotPeerLocator<HClient> {
33 private final HX509SS ss;
35 public HClientHotPeerLocator(Access access, String urlstr, long invalidateTime, String localLatitude,
36 String localLongitude, HX509SS ss) throws LocatorException {
37 super(access, urlstr, invalidateTime, localLatitude, localLongitude);
43 protected HClient _newClient(String clientInfo) throws LocatorException {
45 int idx = clientInfo.indexOf('/');
46 return new HClient(ss,new URI("https://"+(idx<0?clientInfo:clientInfo.substring(0, idx))),3000);
47 } catch (URISyntaxException e) {
48 throw new LocatorException(e);
53 protected HClient _invalidate(HClient client) {
58 protected void _destroy(HClient client) {