org.ovirt.engine.core.compat.Guid.isNullOrEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.ovirt.engine.core.compat.Guid.isNullOrEmpty()方法的一些代码示例,展示了Guid.isNullOrEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Guid.isNullOrEmpty()方法的具体详情如下:
包路径:org.ovirt.engine.core.compat.Guid
类名称:Guid
方法名:isNullOrEmpty

Guid.isNullOrEmpty介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

private Guid getGuid(Guid guid) {
  return Guid.isNullOrEmpty(guid) ? Guid.Empty : guid;
}

代码示例来源:origin: oVirt/ovirt-engine

private void addUuid(PDU pdu, final OID prefix, int suffix, Guid val) {
  if (!Guid.isNullOrEmpty(val)) {
    addString(pdu, prefix, suffix, val.toString(), false);
  }
}

代码示例来源:origin: oVirt/ovirt-engine

private void setIdIfNeeded(DbUser user) {
  if (Guid.isNullOrEmpty(user.getId())) {
    user.setId(Guid.newGuid());
  }
}

代码示例来源:origin: oVirt/ovirt-engine

public Guid getVmIdRef() {
  if (Guid.isNullOrEmpty(vmId) && getVm() != null) {
    vmId = getVm().getId();
  }
  return vmId;
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(DbGroup group) {
  if (Guid.isNullOrEmpty(group.getId())) {
    group.setId(Guid.newGuid());
  }
  insertOrUpdate(group, "InsertGroup");
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
  public ActionParametersBase getParameters(SshPublicKey model, UserProfile entity) {
    UserProfileParameters params = new UserProfileParameters();
    UserProfile profile = map(model, entity);
    profile.setUserId(userId);
    if (Guid.isNullOrEmpty(profile.getSshPublicKeyId())) {
      profile.setSshPublicKeyId(Guid.newGuid());
    }
    params.setUserProfile(profile);
    return params;
  }
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(Bookmark bookmark) {
  Guid id = bookmark.getId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    bookmark.setId(id);
  }
  MapSqlParameterSource parameterSource = new BookmarkSqlParameterSource(
      bookmark);
  getCallsHandler().executeModification("InsertBookmark", parameterSource);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(Cluster cluster) {
  Guid id = cluster.getId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    cluster.setId(id);
  }
  getCallsHandler().executeModification("InsertCluster", getClusterParamSource(cluster));
}

代码示例来源:origin: oVirt/ovirt-engine

public void setDefaultInterface() {
  Guid vmId = getVmId();
  if (Guid.isNullOrEmpty(vmId) || getDisk() == null) {
    boolean virtioScsiEnabled = Boolean.TRUE.equals(getIsVirtioScsiEnabled().getEntity());
    getDiskInterface().setSelectedItem(virtioScsiEnabled ? DiskInterface.VirtIO_SCSI : DiskInterface.VirtIO);
  } else {
    getDiskInterface().setSelectedItem(getDisk().getDiskVmElementForVm(vmId).getDiskInterface());
  }
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(VdsStatic vds) {
  Guid id = vds.getId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    vds.setId(id);
  }
  new SimpleJdbcCall(getJdbcTemplate()).withProcedureName("InsertVdsStatic")
      .execute(getInsertOrUpdateParams(vds));
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(Label label) {
  Guid id = label.getId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    label.setId(id);
  }
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("label_id", label.getId())
      .addValue("label_name", label.getName())
      .addValue("readonly", label.isReadOnly())
      .addValue("vms", createArrayOf("uuid", label.getVms().toArray()))
      .addValue("hosts", createArrayOf("uuid", label.getHosts().toArray()));
  getCallsHandler().executeModification("CreateLabel", parameterSource);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
protected MapSqlParameterSource createFullParametersMapper(CommandEntity entity) {
  return getCustomMapSqlParameterSource().addValue("engine_session_seq_id", entity.getEngineSessionSeqId())
      .addValue("user_id", Guid.isNullOrEmpty(entity.getUserId()) ? Guid.Empty : entity.getUserId())
      .addValue("command_id", Guid.isNullOrEmpty(entity.getId()) ? Guid.Empty : entity.getId())
      .addValue("command_type", entity.getCommandType().getValue())
      .addValue("parent_command_id", entity.getParentCommandId())
      .addValue("root_command_id", Guid.isNullOrEmpty(entity.getRootCommandId()) ? Guid.Empty : entity.getRootCommandId())
      .addValue("command_context", SerializationFactory.getSerializer().serialize(entity.getCommandContext()))
      .addValue("command_parameters", serializeParameters(entity.getCommandParameters()))
      .addValue("command_params_class", entity.getCommandParameters() == null ? null : entity.getCommandParameters().getClass().getName())
      .addValue("created_at", entity.getCreatedAt())
      .addValue("status", entity.getCommandStatus().toString())
      .addValue("executed", entity.isExecuted())
      .addValue("callback_enabled", entity.isCallbackEnabled())
      .addValue("return_value", serializeReturnValue(entity.getReturnValue()))
      .addValue("return_value_class", entity.getReturnValue() == null ? null : entity.getReturnValue().getClass().getName())
      .addValue("data", SerializationFactory.getSerializer().serialize(entity.getData()));
}

代码示例来源:origin: oVirt/ovirt-engine

if (Guid.isNullOrEmpty(vm.getId())) {
  if (getParentModel() instanceof UnitVmModel) {
    UnitVmModel model = (UnitVmModel) getParentModel();

代码示例来源:origin: oVirt/ovirt-engine

if (event.isSetUser() && event.getUser().isSetId()) {
  Guid guid = GuidUtils.asGuid(event.getUser().getId());
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setUserId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setVmId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setStorageDomainId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setVdsId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setVmTemplateId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setClusterId(guid);
  if (!Guid.isNullOrEmpty(guid)) {
    auditLog.setStoragePoolId(guid);

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(Tags tag) {
  Guid id = tag.getTagId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    tag.setTagId(id);
  }
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("description", tag.getDescription())
      .addValue("tag_id", tag.getTagId())
      .addValue("tag_name", tag.getTagName())
      .addValue("parent_id", tag.getParentId())
      .addValue("readonly", tag.getIsReadonly())
      .addValue("type", tag.getType());
  getCallsHandler().executeModification("Inserttags", parameterSource);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(BusinessEntitySnapshot entitySnapshot) {
  Guid id = entitySnapshot.getId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    entitySnapshot.setId(id);
  }
  MapSqlParameterSource parameterSource =
      getCustomMapSqlParameterSource()
          .addValue("id", entitySnapshot.getId())
          .addValue("command_id", entitySnapshot.getCommandId())
          .addValue("command_type", entitySnapshot.getCommandType())
          .addValue("entity_id", entitySnapshot.getEntityId())
          .addValue("entity_type", entitySnapshot.getEntityType())
          .addValue("entity_snapshot", entitySnapshot.getEntitySnapshot())
          .addValue("snapshot_class", entitySnapshot.getSnapshotClass())
          .addValue("snapshot_type", entitySnapshot.getSnapshotType())
          .addValue("insertion_order", entitySnapshot.getInsertionOrder());
  getCallsHandler().executeModification("insert_entity_snapshot", parameterSource);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(VmPool pool) {
  Guid id = pool.getVmPoolId();
  if (Guid.isNullOrEmpty(id)) {
    id = Guid.newGuid();
    pool.setVmPoolId(id);
  }
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
      .addValue("vm_pool_description", pool.getVmPoolDescription())
      .addValue("vm_pool_comment", pool.getComment())
      .addValue("vm_pool_id", pool.getVmPoolId())
      .addValue("vm_pool_name", pool.getName())
      .addValue("vm_pool_type", pool.getVmPoolType())
      .addValue("stateful", pool.isStateful())
      .addValue("parameters", pool.getParameters())
      .addValue("prestarted_vms", pool.getPrestartedVms())
      .addValue("cluster_id", pool.getClusterId())
      .addValue("max_assigned_vms_per_user", pool.getMaxAssignedVmsPerUser())
      .addValue("spice_proxy", pool.getSpiceProxy())
      .addValue("is_being_destroyed", pool.isBeingDestroyed())
      .addValue("is_auto_storage_select", pool.isAutoStorageSelect());
  getCallsHandler().executeModification("InsertVm_pools", parameterSource);
}

代码示例来源:origin: oVirt/ovirt-engine

private MapSqlParameterSource getInsertOrUpdateParams(FenceAgent agent) {
  MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource();
  if (!Guid.isNullOrEmpty(agent.getHostId())) {
    parameterSource.addValue("vds_id", agent.getHostId());

相关文章