public String getConsistencyGroupName(BlockObject bo) {
   if (bo.getConsistencyGroup() == null) {
     return null;
   }
   final BlockConsistencyGroup group =
       _dbClient.queryObject(BlockConsistencyGroup.class, bo.getConsistencyGroup());
   return getConsistencyGroupName(group, bo);
 }
  /** {@inheritDoc} */
  @Override
  public List<BlockObject> getAllSourceObjectsForFullCopyRequest(BlockObject fcSourceObj) {

    // Treats full copies of snapshots as is done in base class.
    if (URIUtil.isType(fcSourceObj.getId(), BlockSnapshot.class)) {
      return super.getAllSourceObjectsForFullCopyRequest(fcSourceObj);
    }

    // By default, if the passed volume is in a consistency group
    // all volumes in the consistency group should be copied.
    List<BlockObject> fcSourceObjList = new ArrayList<BlockObject>();
    URI cgURI = fcSourceObj.getConsistencyGroup();
    if (!NullColumnValueGetter.isNullURI(cgURI)) {
      BlockConsistencyGroup cg = _dbClient.queryObject(BlockConsistencyGroup.class, cgURI);
      // If there is no corresponding native CG for the VPLEX
      // CG, then this is a CG created prior to 2.2 and in this
      // case we want full copies treated like snapshots, which
      // is only create a copy of the passed object.
      if (!cg.checkForType(Types.LOCAL)) {
        fcSourceObjList.add(fcSourceObj);
      } else {
        fcSourceObjList.addAll(getActiveCGVolumes(cg));
      }
    } else {
      fcSourceObjList.add(fcSourceObj);
    }

    return fcSourceObjList;
  }
  /**
   * Verify the migration for BlockObjects. Ensure the consistencyGroups field has been collapsed
   * into the consistencyGroup field.
   *
   * @param blockObjects
   */
  private void verifyBlockObjects(List<BlockObject> blockObjects) {
    for (BlockObject blockObject : blockObjects) {
      log.info("Verifying BlockObject migration for " + blockObject.getLabel());

      // For RP+VPlex migrations, the BlockObjects will have a null consistencyGroups reference.
      // For non-RP+VPlex migrations, the BlockObjects will have an empty null consistencyGroups
      // reference.
      // Both conditions indicate the field is no longer being used
      Assert.assertTrue(
          "BlockObject.consistencyGroups field should be empty.",
          blockObject.getConsistencyGroups() == null
              || blockObject.getConsistencyGroups().isEmpty());
      Assert.assertNotNull(
          "BlockObject.consistencyGroup field should not be null.",
          blockObject.getConsistencyGroup());
    }
  }