Examples of Secret


Examples of org.libvirt.Secret

                pool.setSourceHost(spd.getSourceHost());
                pool.setSourcePort(spd.getSourcePort());
                pool.setSourceDir(spd.getSourceDir());
                String authUsername = spd.getAuthUserName();
                if (authUsername != null) {
                    Secret secret = conn.secretLookupByUUIDString(spd.getSecretUUID());
                    String secretValue = new String(Base64.encodeBase64(secret.getByteValue()));
                    pool.setAuthUsername(authUsername);
                    pool.setAuthSecret(secretValue);
                }
            }
View Full Code Here

Examples of org.libvirt.Secret

        } catch (LibvirtException e) {
            throw new CloudRuntimeException(e.toString());
        }

        StoragePool sp = null;
        Secret s = null;

        try {
            sp = conn.storagePoolLookupByUUIDString(uuid);
        } catch (LibvirtException e) {
            return true;
        }

        /*
         * Some storage pools, like RBD also have 'secret' information stored in libvirt
         * Destroy them if they exist
        */
        try {
            s = conn.secretLookupByUUIDString(uuid);
        } catch (LibvirtException e) {
        }

        try {
            if (sp.isPersistent() == 1) {
                sp.destroy();
                sp.undefine();
            } else {
                sp.destroy();
            }
            sp.free();
            if (s != null) {
                s.undefine();
                s.free();
            }
            return true;
        } catch (LibvirtException e) {
            // handle ebusy error when pool is quickly destroyed
            if (e.toString().contains("exit status 16")) {
View Full Code Here

Examples of org.libvirt.Secret

        String[] userInfoTemp = userInfo.split(":");
        if (userInfoTemp.length == 2) {
            LibvirtSecretDef sd = new LibvirtSecretDef(usage.CEPH, uuid);

            Secret s = null;

            sd.setCephName(userInfoTemp[0] + "@" + host + ":" + port + "/" + path);

            try {
                s_logger.debug(sd.toString());
                s = conn.secretDefineXML(sd.toString());
                s.setValue(Base64.decodeBase64(userInfoTemp[1]));
            } catch (LibvirtException e) {
                s_logger.error(e.toString());
                if (s != null) {
                    try {
                        s.undefine();
                        s.free();
                    } catch (LibvirtException l) {
                        s_logger.debug("Failed to define secret with: " + l.toString());
                        }
                }
            }
View Full Code Here

Examples of org.libvirt.Secret

                pool.setSourceHost(spd.getSourceHost());
                pool.setSourcePort(spd.getSourcePort());
                pool.setSourceDir(spd.getSourceDir());
                String authUsername = spd.getAuthUserName();
                if (authUsername != null) {
                    Secret secret = conn.secretLookupByUUIDString(spd.getSecretUUID());
                    String secretValue = new String(Base64.encodeBase64(secret.getByteValue()));
                    pool.setAuthUsername(authUsername);
                    pool.setAuthSecret(secretValue);
                }
            }
View Full Code Here

Examples of org.libvirt.Secret

        } catch (LibvirtException e) {
            throw new CloudRuntimeException(e.toString());
        }

        StoragePool sp = null;
        Secret s = null;

        try {
            sp = conn.storagePoolLookupByUUIDString(uuid);
        } catch (LibvirtException e) {
            return true;
        }

        /*
         * Some storage pools, like RBD also have 'secret' information stored in libvirt
         * Destroy them if they exist
        */
        try {
            s = conn.secretLookupByUUIDString(uuid);
        } catch (LibvirtException e) {
        }

        try {
            if (sp.isPersistent() == 1) {
                sp.destroy();
                sp.undefine();
            } else {
                sp.destroy();
            }
            sp.free();
            if (s != null) {
                s.undefine();
                s.free();
            }
            return true;
        } catch (LibvirtException e) {
            // handle ebusy error when pool is quickly destroyed
            if (e.toString().contains("exit status 16")) {
View Full Code Here

Examples of org.platformlayer.core.model.Secret

    super(context);
  }

  public LdapService createLdapServer() throws OpsException, IOException {
    String id = random.randomAlphanumericString(8);
    Secret ldapServerPassword = randomSecret();

    LdapService service = new LdapService();
    service.dnsName = id + ".test.platformlayer.org";
    service.ldapServerPassword = ldapServerPassword;
View Full Code Here

Examples of org.platformlayer.core.model.Secret

  }

  public LdapDomain createLdapDomain(LdapService ldapService, String organizationName) throws OpsException,
      IOException {
    String domainId = "domain-" + ldapService.getId();
    Secret adminPassword = randomSecret();
    LdapDomain domain = new LdapDomain();
    domain.organizationName = organizationName;
    domain.adminPassword = adminPassword;
    domain = context.putItem(domainId, domain);
    domain = context.waitForHealthy(domain);
View Full Code Here

Examples of org.platformlayer.core.model.Secret

      Object provided = ((javax.inject.Provider<?>) obj).get();
      return wrap(provided);
    }

    if (obj instanceof Secret) {
      Secret secret = (Secret) obj;
      String plaintext = secret.plaintext();
      return wrap(plaintext);
    }

    return super.wrap(obj);
  }
View Full Code Here

Examples of org.platformlayer.core.model.Secret

            value = defaultValue;
          } else {
            if (fieldType == Secret.class) {
              Passwords passwords = new Passwords();

              Secret secret = passwords.generateRandomPassword(12);
              value = secret;

            }
          }
View Full Code Here

Examples of org.platformlayer.core.model.Secret

public class IpsecHelpers {
  @Inject
  ProviderHelper providerHelper;

  public Secret getIpsecSecret() throws OpsException {
    Secret secret = null;

    for (ProviderOf<HasIpsecPolicy> ipsecPolicyProvider : providerHelper.listItemsProviding(HasIpsecPolicy.class)) {
      ItemBase item = ipsecPolicyProvider.getItem();

      if (item.getState() != ManagedItemState.ACTIVE) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.