Tabnine Logo
DME2Manager
Code IndexAdd Tabnine to your IDE (free)

How to use
DME2Manager
in
com.att.aft.dme2.api

Best Java code snippets using com.att.aft.dme2.api.DME2Manager (Showing top 20 results out of 315)

origin: org.onap.dmaap.messagerouter.msgrtr/msgrtr

    + "routeOffer=" + routeOffer;
DME2Manager manager = new DME2Manager("testEndpointPublish", props);
manager.setClientCredentials("sh301n", "");
DME2EndpointRegistry svcRegistry = manager.getEndpointRegistry();
origin: org.onap.aaf.cadi/cadi-client

@Override
public void invalidate() throws CadiException {
  try {
    manager.refresh();
  } catch (Exception e) {
    throw new CadiException(e);
  }
}
origin: org.onap.dmaap.messagerouter.msgrtr/msgrtr

/**
 * unpublishing endpoints
 */
  public void unPublishEndPoints() {

    DME2Manager manager;
    try {
      System.setProperty("AFT_LATITUDE", latitude);
      System.setProperty("AFT_LONGITUDE", longitude);
      System.setProperty("AFT_ENVIRONMENT", "AFTUAT");

      manager = DME2Manager.getDefaultInstance();
      DME2EndpointRegistry svcRegistry = manager.getEndpointRegistry();
      svcRegistry.unpublish(serviceURL, hostName, Integer.parseInt(port));
    } catch (DME2Exception e) {
      LOG.error("Failed due to DME2Exception" + e);
    }

  }

origin: org.onap.aaf.cadi/cadi-client

public DME2Locator(Access access, DME2Manager dm, String service, String version, String envContext, String routeOffer, boolean removeSelf) throws DME2Exception, UnknownHostException, LocatorException {
  this.access = access;
  if(dm==null) {
    this.dm = new DME2Manager("DME2Locator created DME2Manager",System.getProperties());
  } else {
    this.dm = dm;
  }
  this.service = service;
  this.version = version;
  this.envContext = envContext;
  this.routeOffer = routeOffer;
  refresh();
  if(thisMachine==null) {
    // Can't get from dm... 
    thisMachine = InetAddress.getLocalHost().getHostName();
    thisPort = 0;
  } else {
    thisPort = dm.getPort();
  }
  this.removeSelf = removeSelf;
}
origin: org.onap.aaf.cadi/cadi-client

@Override
public boolean refresh() {
  try {
    dm.refresh();
    endpoints = dm.findEndpoints(service, version, envContext, routeOffer, true);
    if(removeSelf) {
      for(int i=0;i<endpoints.length;++i) {
        if(endpoints[i].getPort()==thisPort && endpoints[i].getHost().equals(thisMachine))
          endpoints[i]=null;
      }
    }
    return endpoints.length!=0;
  } catch (Exception e) {
    access.log(Level.ERROR, e.getMessage());
  }
  return false;
}
origin: org.onap.aaf.cadi/cadi-aaf

private DME2Manager newManager(PropAccess access) throws CadiException {
  Properties props = access.getDME2Properties();
  // Critical that TLS Settings not ignored
  try {
    return new DME2Manager("AAFCon",props);
  } catch (DME2Exception e) {
    throw new CadiException(e);
  }
}
origin: org.onap.aaf.cadi/cadi-client

    dprops = System.getProperties();
  dm = this.dm = new DME2Manager("DME2Locator created DME2Manager",dprops);
} else {
  this.dm = dm;
thisMachine = dm.getHostname();
if(thisMachine==null) {
  thisPort = 0;
} else {
  thisPort = dm.getPort();
origin: org.onap.aaf.cadi/cadi-client

this.access = access;
if(dm==null) {
  dm = this.dm = new DME2Manager("DME2Locator created DME2Manager",System.getProperties());
} else {
  this.dm = dm;
DME2Server server = dm.getServer(); 
if(server == null) {
  thisMachine = InetAddress.getLocalHost().getHostName();
origin: org.onap.aaf.cadi/cadi-client

  public List<DRcli> all() throws DME2Exception, APIException {
    ArrayList<DRcli> al = new ArrayList<DRcli>();
    
    if(manager == null) {
      manager = DME2Manager.getDefaultInstance();
    }
    try {
      DME2Endpoint[] endp = manager.getEndpoints(new DmeUniformResource(manager.getConfig(),uri));
      // Convert Searchable Endpoints to Direct Endpoints
      for(DME2Endpoint de : endp) {
        al.add(new DRcli(
            new URI(uri.getScheme(),null,de.getHost(),de.getPort(),null,null,null),ss)
//                        new URI(uri.getScheme(),null,de.getHost(),de.getPort(),uri.getPath(),null,null),ss)
        .setManager(manager)
        );
      }
    } catch (MalformedURLException e) {
      throw new APIException("Invalid URL",e);
    } catch (URISyntaxException e) {
      throw new APIException("Invalid URI",e);
    }
    return al;
  }
 
origin: org.onap.aaf.cadi/cadi-aaf

  private static void dme2RawTest(DME2Manager dm, String aafurl, String user, String pass) {
    try { 
      if(dm==null) {
        return;
      }
      URI uri = new URI(aafurl);
      print(true,"DME2 Direct Client Coding Methodology",uri.toString());
      DME2Client client = dm.newClient( uri, 3000);
      client.setMethod("GET"); // FYI, DME2 defaults to "POST"
      client.setContext("/authz/perms/user/"+user); // DME2 direct requires separate setting of Context from URI
      if(pass!=null) { // rely on Cert if no pass
        client.setCredentials(user, pass);
      }
      client.setPayload(""); // DME2  will not send without something
      String resp = client.sendAndWait(7000);
      System.out.println(resp);
    } catch(Throwable e) {
      e.printStackTrace();
    }
  }
}
origin: com.att.ajsc/ajsc-core

    + "/envContext=" + envContext + "/routeOffer=" + routeOffer;
DME2EndpointRegistry svcRegistry = dme2Manager.getEndpointRegistry();
origin: com.att.cadi/cadi-aaf

private DME2Manager newManager(PropAccess access) throws CadiException {
  Properties props = access.getDME2Properties();
  // Critical that TLS Settings not ignored
  try {
    return new DME2Manager("AAFCon",props);
  } catch (DME2Exception e) {
    throw new CadiException(e);
  }
}
origin: org.onap.aaf.cadi/cadi-client

public DME2Locator(Access access, DME2Manager dm, String service, String version, String envContext, String routeOffer, boolean removeSelf) throws DME2Exception, UnknownHostException, LocatorException {
  this.access = access;
  if(dm==null) {
    this.dm = new DME2Manager("DME2Locator created DME2Manager",System.getProperties());
  } else {
    this.dm = dm;
  }
  this.service = service;
  this.version = version;
  this.envContext = envContext;
  this.routeOffer = routeOffer;
  refresh();
  DME2Server server = dm.getServer(); 
  if(server == null) {
    thisMachine = InetAddress.getLocalHost().getHostName();
    thisPort = 0;
  } else {
    try {
      thisMachine = server.getServerProperties().getHostname();
      //thisPort = server.getPort();
      thisPort = server.getServerProperties().getPort();
    } catch(NullPointerException np) { // BAD BOY, DME2...
      access.log(Level.ERROR, "WARNING: DME2 threw a NullPointer Exception getting Server Machine and Port");
      thisMachine = InetAddress.getLocalHost().getHostName();
      thisPort = 0;
    }
  }
  this.removeSelf = removeSelf;
}
origin: com.att.cadi/cadi-aaf

  private static void dme2RawTest(DME2Manager dm, String aafurl, String user, String pass) {
    try { 
      if(dm==null) {
        return;
      }
      URI uri = new URI(aafurl);
      print(true,"DME2 Direct Client Coding Methodology",uri.toString());
      DME2Client client = dm.newClient( uri, 3000);
      client.setMethod("GET"); // FYI, DME2 defaults to "POST"
      client.setContext("/authz/perms/user/"+user); // DME2 direct requires separate setting of Context from URI
      if(pass!=null) { // rely on Cert if no pass
        client.setCredentials(user, pass);
      }
      client.setPayload(""); // DME2  will not send without something
      String resp = client.sendAndWait(7000);
      System.out.println(resp);
    } catch(Throwable e) {
      e.printStackTrace();
    }
  }
}
origin: com.att.ajsc/ajsc-core

DME2EndpointRegistry svcRegistry = dme2Manager.getEndpointRegistry();
String endpointUrlWithoutQueryParam = null;
String serviceType = null;
origin: org.onap.aaf.cadi/cadi-client

public AAFClient(RosettaEnv env) throws Exception {
  this.env = env;
  Access access = new EnvAccess(env);
  String user = access.getProperty(Config.AAF_MECHID,null);
  String password = access.decrypt(access.getProperty(Config.AAF_MECHPASS,null), true);
  
  SecurityInfoC<HttpURLConnection> si = new SecurityInfoC<HttpURLConnection>(access);
  DME2Manager dm = new DME2Manager("APIclient DME2Manager", System.getProperties());
  DME2Locator loc = new DME2Locator(access, dm, access.getProperty(Config.AAF_URL,null));
  int TIMEOUT = Integer.parseInt(access.getProperty(Config.AAF_CONN_TIMEOUT, "30000"));
  hman = new HMangr(access, loc).readTimeout(TIMEOUT).apiVersion("2.0");
  ss = new HBasicAuthSS(user, password, si);
}
origin: org.onap.aaf.cadi/cadi-client

  @Override
  public boolean refresh() {
    try {
      dm.refresh();
      //endpoints = dm.findEndpoints(service, version, envContext, routeOffer, true);
      if(removeSelf) {
//                for(int i=0;i<endpoints.length;++i) {
//                    if(endpoints[i].getPort()==thisPort && endpoints[i].getHost().equals(thisMachine))
//                        endpoints[i]=null;
        }
      //}
      //return endpoints.length!=0;
    } catch (Exception e) {
      access.log(Level.ERROR, e.getMessage());
    }
    return false;
  }
 
origin: org.onap.aaf.cadi/cadi-aaf

connectTest(dl);
dm =  new DME2Manager("DME2Manager",pa.getProperties());
origin: org.onap.aaf.cadi/cadi-aaf

@Override
public <RET> RET best(Retryable<RET> retryable) throws LocatorException, CadiException, APIException {
  // NOTE: DME2 had Retry Logic embedded lower.  
  try {
    return (retryable.code(rclient(initURI,ss)));
  } catch (ConnectException e) {
    // DME2 should catch
    try {
      manager.refresh();
    } catch (Exception e1) {
      throw new CadiException(e1);
    }
    throw new CadiException(e);
  }
}
 
origin: com.att.cadi/cadi-aaf

connectTest(dl);
dm =  new DME2Manager("DME2Manager",pa.getProperties());
com.att.aft.dme2.apiDME2Manager

Most used methods

  • <init>
  • refresh
  • getDefaultInstance
  • getEndpointRegistry
  • newClient
  • findEndpoints
  • getConfig
  • getEndpoints
  • getHostname
  • getPort
  • getServer
  • setClientCredentials
  • getServer,
  • setClientCredentials

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • Menu (java.awt)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now