Package com.vmware.bdd.entity

Examples of com.vmware.bdd.entity.ClusterEntity


   }

   @Override
   @Transactional
   public void updateLastStatus(String clusterName, ClusterStatus status) {
      ClusterEntity cluster = findByName(clusterName);
      AuAssert.check(cluster != null);
      cluster.setLastStatus(status);
   }
View Full Code Here


   @Test
   public void testGetAppManagerByClusterName_OK() {
      testCreateAppManager_Success();

      ClusterEntity fooClusterEntity = new ClusterEntity("fooCluster");
      fooClusterEntity.setAppManager(defaultAppManagerAdd.getName());

      Mockito.when(clusterEntityManager.findByName(Matchers.anyString())).thenReturn(fooClusterEntity);

      SoftwareManager defaultSWMgr = softwareManagerCollector.getSoftwareManagerByClusterName("fooCluster");
View Full Code Here

      MockTmScheduler.cleanFlag();
      MockVcCache.setGetFlag(false);
   }

   private void cleanUpData() {
      ClusterEntity cluster = clusterEntityMgr.findByName(TEST_CLUSTER_NAME);
      if (cluster != null) {
         clusterEntityMgr.delete(cluster);
      }
   }
View Full Code Here

      return buff.toString();
   }

   @Test(groups = { "TestClusterManager" }, dependsOnMethods = "testWriteClusterSpecFileWithUTF8")
   public void testAsyncSetParamIoPriorityFailed() throws Exception {
      ClusterEntity cluster =
            TestClusterEntityManager.assembleClusterEntity(TEST_CLUSTER_NAME);
      cluster.setStatus(ClusterStatus.RUNNING);
      clusterEntityMgr.insert(cluster);
      MockTmScheduler.setFlag(VmOperation.RECONFIGURE_VM, false);
      try {
         clusterMgr.asyncSetParam(TEST_CLUSTER_NAME, 3, 1, 4, true,
               Priority.HIGH);
View Full Code Here

      }
   }

   @Test(groups = { "TestClusterManager" }, dependsOnMethods = "testAsyncSetParamIoPriorityFailed")
   public void testAsyncSetParamAutoElasticityFailed() throws Exception {
      ClusterEntity cluster =
            TestClusterEntityManager.assembleClusterEntity(TEST_CLUSTER_NAME);
      cluster.setStatus(ClusterStatus.RUNNING);
      cluster.setVhmMasterMoid("vm-001");
      int i = 0;
      List<NodeGroupEntity> groups = cluster.getNodeGroups();
      for (NodeGroupEntity group : groups) {
         List<NodeEntity> nodes = group.getNodes();
         for (NodeEntity node : nodes) {
            i++;
            node.setMoId("vm-00" + i);
View Full Code Here

      }
   }

   @Test(groups = { "TestClusterManager" }, dependsOnMethods = "testAsyncSetParamAutoElasticityFailed")
   public void testAsyncSetParamAutoElasticitySuccess() throws Exception {
      ClusterEntity cluster =
            TestClusterEntityManager.assembleClusterEntity(TEST_CLUSTER_NAME);
      cluster.setStatus(ClusterStatus.RUNNING);
      cluster.setVhmMasterMoid("vm-001");
      int i = 0;
      List<NodeGroupEntity> groups = cluster.getNodeGroups();
      for (NodeGroupEntity group : groups) {
         List<NodeEntity> nodes = group.getNodes();
         for (NodeEntity node : nodes) {
            i++;
            node.setMoId("vm-00" + i);
View Full Code Here

         }
      }
   }

   private void deleteClusterNodes(ChunkContext chunkContext, String clusterName) {
      ClusterEntity cluster = getClusterEntityMgr().findByName(clusterName);
      AuAssert.check(cluster != null);
      releaseIp(cluster);
      lockClusterEntityMgr.getLock(clusterName).lock();
      putIntoJobExecutionContext(chunkContext,
            JobConstants.CLUSTER_EXCLUSIVE_WRITE_LOCKED, true);
View Full Code Here

   }

   private boolean disableAutoElasticity(String clusterName) {
      AuAssert.check(clusteringService != null);
      AuAssert.check(getClusterEntityMgr() != null);
      ClusterEntity clusterEntity = getClusterEntityMgr().findByName(clusterName);
      if (clusterEntity.getAutomationEnable() == null || !clusterEntity.getAutomationEnable()) {
         return true;
      }
      clusterEntity.setAutomationEnable(false);
      getClusterEntityMgr().update(clusterEntity);
      return clusteringService.setAutoElasticity(clusterName, false);
   }
View Full Code Here

         clusteringService.commitReservation(reservationId);
      }
   }

   private void setAutoFlag(boolean isReset) {
      ClusterEntity clusterEntity = clusterEntityMgr.findByName(clusterName);
      Boolean value = null;

      if (!isReset) {
         preAutoFlag = clusterEntity.getAutomationEnable();
         if (preAutoFlag == null || !preAutoFlag) {
            return;
         }
         value = false;
         logger.info("will set auto flag to false");
      } else {
         if (clusterEntity.getAutomationEnable() == preAutoFlag) {
            return;
         }
         value = preAutoFlag;
         logger.info("will recover auto flag to " + preAutoFlag);
      }

      clusterEntity.setAutomationEnable(value);
      clusterEntityMgr.update(clusterEntity);
      if (!clusteringService.setAutoElasticity(clusterName, false)) {
         throw TaskException.EXECUTION_FAILED("failed to update auto flag for cluster " + clusterName);
      }
   }
View Full Code Here

      } else if (!success && failureStatus != null) {
         status = ClusterStatus.valueOf(failureStatus);
      }

      logger.info("set cluster " + clusterName + " status to " + status);
      ClusterEntity cluster = clusterEntityMgr.findByName(clusterName);
      if (cluster != null && status != null) {
         clusterEntityMgr.updateClusterStatus(clusterName, status);
      }
   }
View Full Code Here

TOP

Related Classes of com.vmware.bdd.entity.ClusterEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.