+++ /dev/null
-/*******************************************************************************\r
- * ============LICENSE_START====================================================\r
- * * org.onap.aaf\r
- * * ===========================================================================\r
- * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
- * * ===========================================================================\r
- * * Licensed under the Apache License, Version 2.0 (the "License");\r
- * * you may not use this file except in compliance with the License.\r
- * * You may obtain a copy of the License at\r
- * * \r
- * * http://www.apache.org/licenses/LICENSE-2.0\r
- * * \r
- * * Unless required by applicable law or agreed to in writing, software\r
- * * distributed under the License is distributed on an "AS IS" BASIS,\r
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * * See the License for the specific language governing permissions and\r
- * * limitations under the License.\r
- * * ============LICENSE_END====================================================\r
- * *\r
- * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
- * *\r
- ******************************************************************************/\r
-package org.onap.aaf.client.test;\r
-\r
-import java.net.URI;\r
-import java.util.Properties;\r
-\r
-import com.att.aft.dme2.api.DME2Client;\r
-import com.att.aft.dme2.api.DME2Manager;\r
-\r
-public class JU_BasicDME2Client {\r
- public static void main(String[] args) {\r
- try {\r
- Properties props = System.getProperties();\r
- \r
- DME2Manager dm = new DME2Manager("DME2Manager TestBasicDME2Client",props);\r
- URI uri = new URI(System.getProperty("aaf_url"));\r
- DME2Client client = new DME2Client(dm,uri,3000);\r
-\r
- System.out.println(props.getProperty("aaf_id"));\r
- client.setCredentials(props.getProperty("aaf_id"),props.getProperty("aaf_password"));\r
- \r
- String path = String.format("/authz/perms/user/%s@csp.att.com",args.length>0?args[0]:"xx9999");\r
- System.out.printf("Path: %s\n",path);\r
- client.addHeader("Accept", "application/Perms+json;q=1.0;charset=utf-8;version=2.0,application/json;q=1.0;version=2.0,*");\r
- client.setMethod("GET");\r
- client.setContext(path);\r
- client.setPayload("");// Note: Even on "GET", you need a String in DME2\r
- \r
- String o = client.sendAndWait(5000); // There are other Asynchronous call options, see DME2 Docs\r
- if(o==null) {\r
- System.out.println('[' + o + ']' + " (blank is good)");\r
- }\r
- \r
- \r
- } catch (Exception e) {\r
- e.printStackTrace();\r
- }\r
- }\r
- \r
-}\r