Tabnine Logo
ImpersonationInfo.getPrincipal
Code IndexAdd Tabnine to your IDE (free)

How to use
getPrincipal
method
in
co.cask.cdap.security.impersonation.ImpersonationInfo

Best Java code snippets using co.cask.cdap.security.impersonation.ImpersonationInfo.getPrincipal (Showing top 3 results out of 315)

origin: cdapio/cdap

 public Map<String, String> getSystemProperties(Id.Program id) throws IOException, NamespaceNotFoundException {
  Map<String, String> systemArgs = Maps.newHashMap();
  systemArgs.put(Constants.CLUSTER_NAME, cConf.get(Constants.CLUSTER_NAME, ""));
  systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE, queueResolver.getQueue(id.getNamespace()));
  if (SecurityUtil.isKerberosEnabled(cConf)) {
   ImpersonationInfo impersonationInfo = SecurityUtil.createImpersonationInfo(ownerAdmin, cConf, id.toEntityId());
   systemArgs.put(ProgramOptionConstants.PRINCIPAL, impersonationInfo.getPrincipal());
   systemArgs.put(ProgramOptionConstants.APP_PRINCIPAL_EXISTS,
           String.valueOf(ownerAdmin.exists(id.toEntityId().getParent())));
  }
  return systemArgs;
 }
}
origin: co.cask.cdap/cdap-app-fabric

 public Map<String, String> getSystemProperties(Id.Program id) throws IOException, NamespaceNotFoundException {
  Map<String, String> systemArgs = Maps.newHashMap();
  systemArgs.put(Constants.CLUSTER_NAME, cConf.get(Constants.CLUSTER_NAME, ""));
  systemArgs.put(Constants.AppFabric.APP_SCHEDULER_QUEUE, queueResolver.getQueue(id.getNamespace()));
  if (SecurityUtil.isKerberosEnabled(cConf)) {
   ImpersonationInfo impersonationInfo = SecurityUtil.createImpersonationInfo(ownerAdmin, cConf, id.toEntityId());
   systemArgs.put(ProgramOptionConstants.PRINCIPAL, impersonationInfo.getPrincipal());
   systemArgs.put(ProgramOptionConstants.APP_PRINCIPAL_EXISTS,
           String.valueOf(ownerAdmin.exists(id.toEntityId().getParent())));
  }
  return systemArgs;
 }
}
origin: cdapio/cdap

@Override
public final UGIWithPrincipal getConfiguredUGI(ImpersonationRequest impersonationRequest) throws IOException {
 try {
  UGIWithPrincipal ugi = impersonationRequest.getImpersonatedOpType().equals(ImpersonatedOpType.EXPLORE) ||
   impersonationRequest.getPrincipal() == null ?
   null : ugiCache.getIfPresent(new UGICacheKey(impersonationRequest));
  if (ugi != null) {
   return ugi;
  }
  boolean isCache = checkExploreAndDetermineCache(impersonationRequest);
  ImpersonationInfo info = getPrincipalForEntity(impersonationRequest);
  ImpersonationRequest newRequest = new ImpersonationRequest(impersonationRequest.getEntityId(),
                                impersonationRequest.getImpersonatedOpType(),
                                info.getPrincipal(), info.getKeytabURI());
  return isCache ? ugiCache.get(new UGICacheKey(newRequest)) : createUGI(newRequest);
 } catch (ExecutionException e) {
  Throwable cause = e.getCause();
  // Propagate if the cause is an IOException or RuntimeException
  Throwables.propagateIfPossible(cause, IOException.class);
  // Otherwise always wrap it with IOException
  throw new IOException(cause);
 }
}
co.cask.cdap.security.impersonationImpersonationInfogetPrincipal

Popular methods of ImpersonationInfo

  • <init>
    Creates ImpersonationInfo using the specified principal and keytab path.
  • getKeytabURI

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setScale (BigDecimal)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Reference (javax.naming)
  • Best IntelliJ 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