private GlusterVolumeEntity getMultiBrickVolume(Guid volumeId) {
   GlusterVolumeEntity volume = getGlusterVolume(volumeId);
   volume.setStatus(GlusterStatus.UP);
   volume.setBricks(getBricks(volumeId, 2));
   volume.setClusterId(CLUSTER_ID);
   return volume;
 }
  private GlusterVolumeEntity getNewVolume() {
    GlusterVolumeEntity volume = new GlusterVolumeEntity();
    volume.setName(NEW_VOL_NAME);
    volume.setClusterId(CLUSTER_ID);
    volume.setId(NEW_VOL_ID);
    volume.setVolumeType(GlusterVolumeType.DISTRIBUTE);
    volume.addTransportType(TransportType.TCP);
    volume.setReplicaCount(0);
    volume.setStripeCount(0);
    volume.setStatus(GlusterStatus.UP);
    volume.setOption("auth.allow", "*");
    volume.addAccessProtocol(AccessProtocol.GLUSTER);
    volume.addAccessProtocol(AccessProtocol.NFS);

    GlusterBrickEntity brick = new GlusterBrickEntity();
    brick.setVolumeId(NEW_VOL_ID);
    brick.setServerId(existingServer1.getId());
    brick.setServerName(existingServer1.getHostName());
    brick.setBrickDirectory("/export/testvol1");
    brick.setStatus(GlusterStatus.UP);
    brick.setBrickOrder(0);
    volume.addBrick(brick);

    return volume;
  }
 private GlusterVolumeEntity createVolume(String volName, Guid id) {
   GlusterVolumeEntity vol = new GlusterVolumeEntity();
   vol.setId(id);
   vol.setName(volName);
   vol.setClusterId(CLUSTER_ID);
   vol.setStatus(GlusterStatus.UP);
   return vol;
 }
 private GlusterVolumeEntity getDistributedVolume(Guid volumeId) {
   GlusterVolumeEntity volume = getVolume(volumeId);
   volume.setStatus((volumeId == volumeId1) ? GlusterStatus.UP : GlusterStatus.DOWN);
   volume.setBricks(getBricks(volumeId, "distrib", 2));
   volume.setVolumeType(GlusterVolumeType.DISTRIBUTED_REPLICATE);
   volume.setClusterId(clusterId);
   return volume;
 }
 private GlusterVolumeEntity getReplicatedVolume(Guid volumeId, int brickCount) {
   GlusterVolumeEntity volume = getVolume(volumeId);
   volume.setStatus(GlusterStatus.UP);
   volume.setBricks(getBricks(volumeId, "repl", brickCount));
   volume.setVolumeType(GlusterVolumeType.REPLICATE);
   volume.setReplicaCount(brickCount);
   volume.setClusterId(clusterId);
   return volume;
 }
 private void addVolumeToDb(final GlusterVolumeEntity createdVolume) {
   // volume fetched from VDSM doesn't contain cluster id as
   // GlusterFS is not aware of multiple clusters
   createdVolume.setClusterId(getVdsGroupId());
   DbFacade.getInstance().getGlusterVolumeDao().save(createdVolume);
 }