Tabnine Logo
CredentialsStore.addDomain
Code IndexAdd Tabnine to your IDE (free)

How to use
addDomain
method
in
com.cloudbees.plugins.credentials.CredentialsStore

Best Java code snippets using com.cloudbees.plugins.credentials.CredentialsStore.addDomain (Showing top 9 results out of 315)

origin: org.jenkins-ci.plugins/credentials

/**
 * Adds a new {@link Domain} with seed credentials.
 *
 * @param domain      the domain.
 * @param credentials the initial credentials with which to populate the domain.
 * @return {@code true} if the {@link CredentialsStore} was modified.
 * @throws java.io.IOException if the change could not be persisted.
 */
public final boolean addDomain(@NonNull Domain domain, Credentials... credentials) throws IOException {
  return addDomain(domain, Arrays.asList(credentials));
}
origin: jenkinsci/credentials-plugin

/**
 * Adds a new {@link Domain} with seed credentials.
 *
 * @param domain      the domain.
 * @param credentials the initial credentials with which to populate the domain.
 * @return {@code true} if the {@link CredentialsStore} was modified.
 * @throws java.io.IOException if the change could not be persisted.
 */
public final boolean addDomain(@NonNull Domain domain, Credentials... credentials) throws IOException {
  return addDomain(domain, Arrays.asList(credentials));
}
origin: jenkinsci/ghprb-plugin

private static String createCredentials(String serverAPIUrl, StandardCredentials credentials) throws Exception {
  List<DomainSpecification> specifications = new ArrayList<DomainSpecification>(2);
  URI serverUri = new URI(serverAPIUrl);
  if (serverUri.getPort() > 0) {
    specifications.add(new HostnamePortSpecification(serverUri.getHost() + ":" + serverUri.getPort(), null));
  } else {
    specifications.add(new HostnameSpecification(serverUri.getHost(), null));
  }
  specifications.add(new SchemeSpecification(serverUri.getScheme()));
  String path = serverUri.getPath();
  if (StringUtils.isEmpty(path)) {
    path = "/";
  }
  specifications.add(new PathSpecification(path, null, false));
  Domain domain = new Domain(serverUri.getHost(), "Auto generated credentials domain", specifications);
  CredentialsStore provider = new SystemCredentialsProvider.StoreImpl();
  provider.addDomain(domain, credentials);
  return credentials.getId();
}
origin: org.jenkins-ci.plugins/credentials

  /**
   * {@inheritDoc}
   */
  @Override
  protected int run() throws Exception {
    store.checkPermission(CredentialsProvider.MANAGE_DOMAINS);

    Domain domain = (Domain) Items.XSTREAM.unmarshal(safeXmlStreamReader(stdin));
    if (store.addDomain(domain)) {
      return 0;
    }
    stderr.println("No change");
    return 1;
  }
}
origin: jenkinsci/credentials-plugin

  /**
   * {@inheritDoc}
   */
  @Override
  protected int run() throws Exception {
    store.checkPermission(CredentialsProvider.MANAGE_DOMAINS);

    Domain domain = (Domain) Items.XSTREAM.unmarshal(safeXmlStreamReader(stdin));
    if (store.addDomain(domain)) {
      return 0;
    }
    stderr.println("No change");
    return 1;
  }
}
origin: jenkinsci/credentials-plugin

@Override
protected int run() throws Exception {
  store.checkPermission(CredentialsProvider.CREATE);
  store.checkPermission(CredentialsProvider.MANAGE_DOMAINS);
  List<DomainCredentials> replacement = (List<DomainCredentials>) Items.XSTREAM.unmarshal(safeXmlStreamReader(stdin));
  for (DomainCredentials domain : replacement) {
    for (Credentials credentials : domain.getCredentials()) {
      store.addDomain(domain.getDomain(), credentials);
    }
  }
  return 0;
}
origin: org.jenkins-ci.plugins/credentials

if (getStore().addDomain(domain)) {
  return HttpResponses.ok();
} else {
Domain domain = req.bindJSON(Domain.class, data);
String domainName = domain.getName();
if (domainName != null && getStore().addDomain(domain)) {
  return HttpResponses.redirectTo("./domain/" + Util.rawEncode(domainName));
origin: jenkinsci/credentials-plugin

if (getStore().addDomain(domain)) {
  return HttpResponses.ok();
} else {
Domain domain = req.bindJSON(Domain.class, data);
String domainName = domain.getName();
if (domainName != null && getStore().addDomain(domain)) {
  return HttpResponses.redirectTo("./domain/" + Util.rawEncode(domainName));
origin: jenkinsci/subversion-plugin

if (store.addDomain(domain, credential)) {
  return credential;
com.cloudbees.plugins.credentialsCredentialsStoreaddDomain

Javadoc

Adds a new Domain with seed credentials.

Popular methods of CredentialsStore

  • addCredentials
    Adds the specified Credentials within the specified Domain for this CredentialsStore.
  • getDomains
    Returns all the com.cloudbees.plugins.credentials.domains.Domains that this credential provider has.
  • getContext
    Returns the context within which this store operates. Credentials in this store will be available to
  • getProvider
    Returns the CredentialsProvider.
  • getCredentials
    Returns an unmodifiable list of credentials for the specified domain.
  • isDomainsModifiable
    Identifies whether this CredentialsStore supports making changes to the list of domains or whether i
  • updateCredentials
    Updates the specified Credentials from the specified Domain for this CredentialsStore with the suppl
  • _isApplicable
    CredentialsStore subtypes can override this method to veto some Descriptors from being available fro
  • checkPermission
    Checks if the current security principal has this permission. Note: This is just a convenience funct
  • getACL
  • getContextDisplayName
    Returns the display name of the #getContext() of this CredentialsStore. The default implementation c
  • getCredentialsDescriptors
    Returns the list of CredentialsDescriptor instances that are applicable within this CredentialsStore
  • getContextDisplayName,
  • getCredentialsDescriptors,
  • getRelativeLinkToAction,
  • getRelativeLinkToContext,
  • getScopes,
  • getStoreAction,
  • hasPermission,
  • isOverridden,
  • removeCredentials

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • Menu (java.awt)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • 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