Esempio n. 1
0
 /** Returns true if the given container is a java or process child container */
 public static boolean isJavaOrProcessContainer(FabricService fabric, Container container) {
   if (container != null) {
     CreateContainerMetadata<?> metadata = container.getMetadata();
     if (metadata != null) {
       CreateContainerOptions createOptions = metadata.getCreateOptions();
       if (createOptions instanceof CreateContainerBasicOptions) {
         return isJavaOrProcessContainer(fabric, (CreateContainerBasicOptions) createOptions);
       }
     }
   }
   return false;
 }
Esempio n. 2
0
 private ContainerProvider getProvider(Container container, boolean returnNull) {
   CreateContainerMetadata metadata = container.getMetadata();
   String type = metadata != null ? metadata.getCreateOptions().getProviderType() : null;
   if (type == null) {
     if (returnNull) {
       return null;
     }
     throw new UnsupportedOperationException(
         "Container " + container.getId() + " has not been created using Fabric");
   }
   ContainerProvider provider = getProvider(type);
   if (provider == null) {
     if (returnNull) {
       return null;
     }
     throw new UnsupportedOperationException("Container provider " + type + " not supported");
   }
   return provider;
 }