public static ResourceProvider getResourceProvider(Resource.Type type,
                                                     IvoryService service) {
    switch (type.getInternalType()) {
      case DRFeed:
        return new FeedResourceProvider(service);
      case DRTargetCluster:
        return new TargetClusterResourceProvider(service);
      case DRInstance:
        return new InstanceResourceProvider(service);
      default:
        throw new IllegalArgumentException("Unknown type " + type);
    }
  }
Factory method for obtaining a resource provider based on a given Ivory service instance.

@param type         the resource type
@param service      the Ivory service

@return a new resource provider
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractDRResourceProvider.java