@Override
 protected RepoImage getEntity(int index) {
   RepoImage entity = new RepoImage();
   entity.setRepoImageId(GUIDS[index].toString());
   entity.setFileType(ImageFileType.Disk);
   entity.setRepoImageName("RepoImage " + entity.getRepoImageId());
   return entity;
 }
Пример #2
0
  private boolean isRepoImageExists(
      String repoImagePath, Guid storageDomainId, ImageFileType imageFileType) {
    VdcQueryReturnValue ret =
        getBackend()
            .runInternalQuery(
                VdcQueryType.GetImagesList,
                new GetImagesListParameters(storageDomainId, imageFileType));

    if (ret != null && ret.getReturnValue() != null && ret.getSucceeded()) {
      for (RepoImage isoFileMetaData : ret.<List<RepoImage>>getReturnValue()) {
        if (repoImagePath.equals(isoFileMetaData.getRepoImageId())) {
          return true;
        }
      }
    }
    return false;
  }