public class BlueprintUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
APP_SVC_GROUP |
static String |
GENERATED_PREFIX |
static String |
SRVR_GROUP |
| Constructor and Description |
|---|
BlueprintUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
applyJrfResourcesToAllClusters(Domain domain)
Targets resources in JRF-MAN-SVR ServerGroup to all the clusters
in the given domain
|
static List<AppSvcGroup> |
getAppSvcGroupsContainingResource(Blueprint bp,
String resourceName,
Class<? extends AppSvcResource> resourceClass)
Gets the list of AppSvcGroups that contain the given resource
|
static <T extends AppSvcResource> |
getFilteredResourceOfType(Blueprint bp,
Class<T> resourceType,
String resourceName)
Gets a filtered list of resources of the given resourceType.
|
static List<AppSvcResource> |
getFilteredResourcesOfAllTypes(Blueprint bp,
List<String> resourceNames,
boolean exclude)
Gets a filtered list of resources from the blueprint.
|
static <T extends AppSvcResource> |
getFilteredResourcesOfType(Blueprint bp,
Class<T> resourceType,
List<String> resourceNames,
boolean exclude)
Gets a filtered list of resources of the given resourceType.
|
static String |
getGeneratedAppSvcGroupId(String targetName)
Generate a AppSvcGroup id given a cluster/server name
|
static String |
getGeneratedServerGroupId(String targetName)
Generate a ServerGroup id given a cluster/server name
|
static List<AppSvcGroup> |
getNonTargetedAppSvcGroups(Blueprint bp,
DomainProfile dp,
boolean recurseDP)
Gets the list of AppSvcGroups in the given blueprint that are not targeted in the domainProfile.
|
static void |
removeResourceFromAppSvcGroups(Blueprint bp,
AppSvcResource resource)
Remove the given resource from containing AppSvcGroups
|
static void |
removeResourceFromAppSvcGroups(Blueprint bp,
String resourceName,
Class<? extends AppSvcResource> resourceClass)
Remove the given resource from containing AppSvcGroups
|
static void |
removeResourceFromBlueprint(Blueprint bp,
Class<? extends AppSvcResource> resourceType,
String resourceName)
Removes/Deletes a given resource from the blueprint.
|
static void |
targetApplicationToClusters(Blueprint bp,
AppSvcResource resource,
List<String> clusterNames,
boolean replace)
Target the given Application to list of clusters
|
static void |
targetApplicationToClusters(Blueprint bp,
String resourceName,
List<String> clusterNames,
boolean replace)
Target the given Application to list of clusters
|
static void |
targetLibraryToClusters(Blueprint bp,
Library resource,
List<String> clusterNames,
boolean replace)
Target the given Library to list of clusters
|
static void |
targetLibraryToClusters(Blueprint bp,
String resourceName,
List<String> clusterNames,
boolean replace)
Target the given Library to list of clusters
|
static <T extends AppSvcResource> |
targetResourceToClusters(Blueprint bp,
AppSvcResource resource,
List<String> clusterNames,
boolean replace)
Target the given resource to list of clusters
|
static <T extends AppSvcResource> |
targetResourceToClusters(Blueprint bp,
String resourceName,
Class<T> resourceClass,
List<String> clusterNames,
boolean replace)
Target the given resource to list of clusters
|
public static final String GENERATED_PREFIX
public static final String SRVR_GROUP
public static final String APP_SVC_GROUP
public static <T extends AppSvcResource> List<T> getFilteredResourcesOfType(Blueprint bp, Class<T> resourceType, List<String> resourceNames, boolean exclude)
T - type that extends AppSvcResourcebp - the blueprint whose resources to filterresourceType - the type of resources we want to selectresourceNames - the names of the resources to matchexclude - if true, excludes the resources that match the given list of names. if false, includes only the resources
that match.public static <T extends AppSvcResource> T getFilteredResourceOfType(Blueprint bp, Class<T> resourceType, String resourceName)
T - type that extends AppSvcResourcebp - the blueprint whose resources to filterresourceType - the type of resource we want to selectresourceName - the name of the resource to matchpublic static List<AppSvcResource> getFilteredResourcesOfAllTypes(Blueprint bp, List<String> resourceNames, boolean exclude)
bp - the blueprint whose resources to filterresourceNames - list of resource namesexclude - if true the return list will exclude the resources that match given resourceNames. if false, returns the
list of resources that match given resourceNamespublic static List<AppSvcGroup> getNonTargetedAppSvcGroups(Blueprint bp, DomainProfile dp, boolean recurseDP)
bp - blueprint whose AppSvcGroups to identifydp - domainProfile that defines the targetingrecurseDP - if true, looks through all the child domainProfilespublic static String getGeneratedServerGroupId(String targetName)
targetName - cluster / server namepublic static String getGeneratedAppSvcGroupId(String targetName)
targetName - cluster / server namepublic static void targetApplicationToClusters(Blueprint bp, String resourceName, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresourceName - name of the resourceclusterNames - clusters to targetreplace - replace existing targets if truepublic static void targetApplicationToClusters(Blueprint bp, AppSvcResource resource, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresource - the resourceclusterNames - clusters to targetreplace - replace existing targets if truepublic static void targetLibraryToClusters(Blueprint bp, String resourceName, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresourceName - name of the resourceclusterNames - clusters to targetreplace - replace existing targets if truepublic static void targetLibraryToClusters(Blueprint bp, Library resource, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresource - resource being targetedclusterNames - clusters to targetreplace - replace existing targets if truepublic static <T extends AppSvcResource> void targetResourceToClusters(Blueprint bp, String resourceName, Class<T> resourceClass, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresourceName - name of the resourceresourceClass - the type of the resource to be targetedclusterNames - clusters to targetreplace - replace existing targets if truepublic static <T extends AppSvcResource> void targetResourceToClusters(Blueprint bp, AppSvcResource resource, List<String> clusterNames, boolean replace)
bp - blueprint to modifyresource - resource being targetedclusterNames - clusters to targetreplace - replace existing targets if truepublic static List<AppSvcGroup> getAppSvcGroupsContainingResource(Blueprint bp, String resourceName, Class<? extends AppSvcResource> resourceClass)
bp - blueprint to searchresourceName - name of the resource to findresourceClass - type of the resource to findpublic static void removeResourceFromAppSvcGroups(Blueprint bp, String resourceName, Class<? extends AppSvcResource> resourceClass)
bp - blueprint to lookresourceName - name of the resource to findresourceClass - type of the resourcepublic static void removeResourceFromAppSvcGroups(Blueprint bp, AppSvcResource resource)
bp - blueprint to lookresource - resource being removedpublic static void removeResourceFromBlueprint(Blueprint bp, Class<? extends AppSvcResource> resourceType, String resourceName)
bp - bluprint containing all the resourcesresourceType - type of resource to removeresourceName - name of the resource to removepublic static void applyJrfResourcesToAllClusters(Domain domain)
domain - domain containing the clusters