gpt4 book ai didi

org.zstack.header.zone.ZoneInventory类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 23:17:31 34 4
gpt4 key购买 nike

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

ZoneInventory介绍

暂无

代码示例

代码示例来源:origin: zstackio/zstack

@Override
  public String call(ZoneInventory arg) {
    return arg.getUuid();
  }
});

代码示例来源:origin: zstackio/zstack

public static List<ZoneInventory> valueOf(Collection<ZoneVO> vos) {
  List<ZoneInventory> invs = new ArrayList<ZoneInventory>(vos.size());
  for (ZoneVO vo : vos) {
    invs.add(ZoneInventory.valueOf(vo));
  }
  return invs;
}

代码示例来源:origin: zstackio/zstack

public static APIUpdateZoneEvent __example__() {
  APIUpdateZoneEvent event = new APIUpdateZoneEvent();
  ZoneInventory zone = new ZoneInventory();
  zone.setName("TestZone");
  zone.setUuid(uuid());
  zone.setDescription("Test");
  zone.setState(ZoneState.Enabled.toString());
  zone.setType("zstack");
  zone.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  zone.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  event.setInventory(zone);
  return event;
}

代码示例来源:origin: zstackio/zstack

void preDelete(ZoneInventory zinv) throws ZoneException {
  for (ZoneDeleteExtensionPoint extp : delExts) {
    try {
      extp.preDeleteZone(zinv);
    } catch (ZoneException ze) {
      logger.debug(String.format("extension[%s] refused to delete zone[name: %s, uuid:%s] because %s", extp.getClass().getName(), zinv.getName(), zinv.getUuid(), ze.getMessage()));
      throw ze;
    } catch (Exception e) {
      logger.warn("Exception happened while calling " + extp.getClass().getCanonicalName() + ".preDelete, " + "zone name: " + zinv.getName()
          + " uuid: " + zinv.getUuid(), e);
    }
  }
}

代码示例来源:origin: zstackio/zstack

void preChange(ZoneVO vo, ZoneStateEvent event) throws ZoneException {
  ZoneInventory zinv = ZoneInventory.valueOf(vo);
  ZoneState next = AbstractZone.getNextState(vo.getState(), event);
  for (ZoneChangeStateExtensionPoint extp : changeExts) {
    try {
      extp.preChangeZoneState(zinv, event, next);
    } catch (ZoneException ze) {
      logger.debug(String.format("Extension: %s refused zone change state operation[ZoneStateEvent:%s] because %s", extp.getClass()
          .getCanonicalName(), event, ze.getMessage()));
      throw ze;
    } catch (Exception e) {
      logger.warn("Exception happened while calling " + extp.getClass().getCanonicalName() + ".preChangeZoneState(), " + "zone name: " + zinv.getName()
          + " uuid: " + zinv.getUuid(), e);
    }
  }
}

代码示例来源:origin: zstackio/zstack

ZoneInventory z = new ZoneInventory();
z.setName("zone");
z.setUuid(zoneUuid);

代码示例来源:origin: zstackio/zstack

@Override
  public void after(APIEvent evt) {
    ntfy("changed zone state to %s",((APIChangeZoneStateEvent)evt).getInventory().getState())
        .resource(uuid,ZoneVO.class.getSimpleName())
        .messageAndEvent(that, evt).done();
  }
};

代码示例来源:origin: zstackio/zstack

@Override
  public void run(List<MessageReply> replies) {
    if (!action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE)) {
      for (MessageReply r : replies) {
        if (!r.isSuccess()) {
          completion.fail(r.getError());
          return;
        }
      }
    }
    List<String> uuids = new ArrayList<String>();
    for (MessageReply r : replies) {
      ZoneInventory inv = zones.get(replies.indexOf(r));
      uuids.add(inv.getUuid());
      logger.debug(String.format("delete zone[uuid:%s, name:%s]", inv.getUuid(), inv.getName()));
    }
    dbf.removeByPrimaryKeys(uuids, ZoneVO.class);
    completion.success();
  }
});

代码示例来源:origin: zstackio/zstack

public static APICreateZoneEvent __example__() {
  APICreateZoneEvent event = new APICreateZoneEvent();
  ZoneInventory zone = new ZoneInventory();
  zone.setName("TestZone");
  zone.setUuid(uuid());
  zone.setDescription("Test");
  zone.setState(ZoneState.Enabled.toString());
  zone.setType("zstack");
  zone.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  zone.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  event.setInventory(zone);
  return event;
}

代码示例来源:origin: zstackio/zstack

@Override
  public String call(ZoneInventory arg) {
    return arg.getUuid();
  }
});

代码示例来源:origin: zstackio/zstack

List<ClusterVO> vos = findClusterUnderZone(inventory.getUuid());
if (!vos.isEmpty()) {
  ClusterStateEvent clusterEvent = ClusterStateEvent.valueOf(event.toString());
  logger.debug("Changing state of clusters in zone: " + inventory.getName() + " uuid: " + inventory.getUuid() + " by event: " + clusterEvent);
  List<MessageReply> replies = bus.call(msgs);
  for (MessageReply r : replies) {

代码示例来源:origin: zstackio/zstack

void afterChange(ZoneVO vo, final ZoneStateEvent event, final ZoneState previousState) {
  final ZoneInventory zinv = ZoneInventory.valueOf(vo);
  CollectionUtils.safeForEach(changeExts, new ForEachFunction<ZoneChangeStateExtensionPoint>() {
    @Override
    public void run(ZoneChangeStateExtensionPoint arg) {
      arg.afterChangeZoneState(zinv, event, previousState);
    }
  });
}

代码示例来源:origin: zstackio/zstack

public static APIChangeZoneStateEvent __example__() {
  APIChangeZoneStateEvent event = new APIChangeZoneStateEvent();
  ZoneInventory zone = new ZoneInventory();
  zone.setName("TestZone");
  zone.setUuid(uuid());
  zone.setDescription("Test");
  zone.setState(ZoneState.Enabled.toString());
  zone.setType("zstack");
  zone.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  zone.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  event.setInventory(zone);
  return event;
}

代码示例来源:origin: zstackio/zstack

@Override
  public String call(ZoneInventory arg) {
    return arg.getUuid();
  }
});

代码示例来源:origin: zstackio/zstack

void beforeChange(ZoneVO vo, final ZoneStateEvent event) {
  final ZoneInventory zinv = ZoneInventory.valueOf(vo);
  final ZoneState next = AbstractZone.getNextState(vo.getState(), event);
  CollectionUtils.safeForEach(changeExts, new ForEachFunction<ZoneChangeStateExtensionPoint>() {
    @Override
    public void run(ZoneChangeStateExtensionPoint arg) {
      arg.beforeChangeZoneState(zinv, event, next);
    }
  });
}

代码示例来源:origin: zstackio/zstack

public static APIGetZoneReply __example__() {
  APIGetZoneReply reply = new APIGetZoneReply();
  ZoneInventory zone = new ZoneInventory();
  zone.setName("TestZone");
  zone.setUuid(uuid());
  zone.setDescription("Test");
  zone.setState(ZoneState.Enabled.toString());
  zone.setType("zstack");
  zone.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  zone.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));
  reply.setInventories(asList(zone));
  reply.setSuccess(true);
  return reply;
}

代码示例来源:origin: zstackio/zstack

@Override
  public String call(ZoneInventory arg) {
    return arg.getUuid();
  }
});

代码示例来源:origin: zstackio/zstack

private void handle(APIGetZoneMsg msg) {
  APIGetZoneReply reply = new APIGetZoneReply();
  if (msg.getUuid() != null) {
    ZoneVO vo = dbf.findByUuid(msg.getUuid(), ZoneVO.class);
    reply.setInventories(asList(ZoneInventory.valueOf(vo)));
  } else {
    reply.setInventories(ZoneInventory.valueOf(dbf.listAll(ZoneVO.class)));
  }
  bus.reply(msg, reply);
}

代码示例来源:origin: zstackio/zstack

public static APIQueryZoneReply __example__() {
    APIQueryZoneReply reply = new APIQueryZoneReply();
    ZoneInventory zone = new ZoneInventory();
    zone.setName("TestZone");
    zone.setUuid(uuid());
    zone.setDescription("Test");
    zone.setState(ZoneState.Enabled.toString());
    zone.setType("zstack");
    zone.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));
    zone.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));
    reply.setSuccess(true);
    reply.setInventories(asList(zone));
    return reply;
  }
}

代码示例来源:origin: zstackio/zstack

@Override
  public Result audit(APIMessage msg, APIEvent rsp) {
    return new Result(rsp.isSuccess() ? ((APICreateZoneEvent)rsp).getInventory().getUuid() : "", ZoneVO.class);
  }
}

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com