1 /*******************************************************************************
\r
2 * ============LICENSE_START====================================================
\r
4 * * ===========================================================================
\r
5 * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * * ===========================================================================
\r
7 * * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * * you may not use this file except in compliance with the License.
\r
9 * * You may obtain a copy of the License at
\r
11 * * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * * Unless required by applicable law or agreed to in writing, software
\r
14 * * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * * See the License for the specific language governing permissions and
\r
17 * * limitations under the License.
\r
18 * * ============LICENSE_END====================================================
\r
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
23 package org.onap.aaf.client.test;
\r
25 import java.net.URI;
\r
26 import java.util.Properties;
\r
28 import org.onap.aaf.cadi.Access;
\r
29 import org.onap.aaf.cadi.client.Future;
\r
30 import org.onap.aaf.cadi.dme2.DME2ClientSS;
\r
31 import org.onap.aaf.cadi.dme2.DRcli;
\r
33 import com.att.aft.dme2.api.DME2Manager;
\r
35 public class JU_TestDME2RcliClient {
\r
36 public static void main(String[] args) {
\r
38 Properties props = System.getProperties();
\r
39 props.put("AFT_LATITUDE","32.780140");
\r
40 props.put("AFT_LONGITUDE","-96.800451");
\r
41 props.put("AFT_ENVIRONMENT","AFTUAT");
\r
42 // props.put("DME2_EP_REGISTRY_CLASS","DME2FS");
\r
43 // props.put("AFT_DME2_EP_REGISTRY_FS_DIR","/Volumes/Data/src/authz/dme2reg");
\r
45 props.put("cadi_keystore","/Volumes/Data/src/authz/common/aaf.att.jks");
\r
46 props.put("cadi_keystore_password","enc:???");
\r
47 props.put("cadi_truststore","/Volumes/Data/src/authz/common/truststore.jks");
\r
48 props.put("cadi_truststore_password","enc:???");
\r
49 props.put("cadi_keyfile", "/Volumes/Data/src/authz/common/keyfile");
\r
51 // Local Testing on dynamic IP PC ***ONLY***
\r
52 // props.put("cadi_trust_all_x509", "true");
\r
56 URI uri = new URI("https://DME2RESOLVE/service=com.att.authz.AuthorizationService/version=2.0/envContext=DEV/routeOffer=BAU_SE");
\r
58 Access access = new JU_TestAccess();
\r
59 DME2Manager dm = new DME2Manager("DME2Manager TestHClient",props);
\r
60 DRcli client = new DRcli(
\r
62 new DME2ClientSS(access,"XX@NS","enc:???"));
\r
64 client.setManager(dm)
\r
68 Future<String> ft = client.read("/authz/nss/com.att.aaf","text/json");
\r
70 System.out.println("Hurray,\n"+ft.body());
\r
72 System.out.println("not quite: " + ft.code());
\r
74 } catch (Exception e) {
\r
75 e.printStackTrace();
\r