Package com.cloud.network.security

Examples of com.cloud.network.security.SecurityGroupWorkVO


                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group take: no work found");
                }
                return null;
            }
            SecurityGroupWorkVO work = vos.get(0);
            boolean processing = false;
            if ( findByVmIdStep(work.getInstanceId(), Step.Processing) != null) {
                //ensure that there is no job in Processing state for the same VM
                processing = true;
                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group work take: found a job in Scheduled and Processing  vmid=" + work.getInstanceId());
                }
            }
            work.setServerId(serverId);
            work.setDateTaken(new Date());
            if (processing) {
                //the caller to take() should check the step and schedule another work item to come back
                //and take a look.
                work.setStep(SecurityGroupWork.Step.Done);
            } else {
                work.setStep(SecurityGroupWork.Step.Processing);
            }

            update(work.getId(), work);

            txn.commit();

            return work;
View Full Code Here


        final List<SecurityGroupWorkVO> vos = lockRows(sc, filter, true);
        if (vos.size() == 0) {
          txn.commit();
            return;
        }
        SecurityGroupWorkVO work = vos.get(0);
        work.setStep(step);
        update(work.getId(), work);

        txn.commit();
  }
View Full Code Here

  @DB
  public void updateStep(Long workId, Step step) {
    final Transaction txn = Transaction.currentTxn();
    txn.start();

        SecurityGroupWorkVO work = lockRow(workId, true);
        if (work == null) {
          txn.commit();
          return;
        }
        work.setStep(step);
        update(work.getId(), work);

        txn.commit();

  }
View Full Code Here

      sc.setParameters("taken", timeBefore);
      sc.setParameters("step", Step.Processing);

      List<SecurityGroupWorkVO> result = listIncludingRemovedBy(sc);

      SecurityGroupWorkVO work = createForUpdate();
      work.setStep(Step.Error);
      update(work, sc);

      return result;
  }
View Full Code Here

                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group take: no work found");
                }
                return null;
            }
            SecurityGroupWorkVO work = vos.get(0);
            boolean processing = false;
            if ( findByVmIdStep(work.getInstanceId(), Step.Processing) != null) {
                //ensure that there is no job in Processing state for the same VM
                processing = true;
                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group work take: found a job in Scheduled and Processing  vmid=" + work.getInstanceId());
                }
            }
            work.setServerId(serverId);
            work.setDateTaken(new Date());
            if (processing) {
                //the caller to take() should check the step and schedule another work item to come back
                //and take a look.
                work.setStep(SecurityGroupWork.Step.Done);
            } else {
                work.setStep(SecurityGroupWork.Step.Processing);
            }

            update(work.getId(), work);

            txn.commit();

            return work;
View Full Code Here

        final List<SecurityGroupWorkVO> vos = lockRows(sc, filter, true);
        if (vos.size() == 0) {
          txn.commit();
            return;
        }
        SecurityGroupWorkVO work = vos.get(0);
        work.setStep(step);
        update(work.getId(), work);

        txn.commit();
  }
View Full Code Here

  @DB
  public void updateStep(Long workId, Step step) {
    final Transaction txn = Transaction.currentTxn();
    txn.start();
       
        SecurityGroupWorkVO work = lockRow(workId, true);
        if (work == null) {
          txn.commit();
          return;
        }
        work.setStep(step);
        update(work.getId(), work);

        txn.commit();
   
  }
View Full Code Here

      sc.setParameters("taken", timeBefore);
      sc.setParameters("step", Step.Processing);

      List<SecurityGroupWorkVO> result = listIncludingRemovedBy(sc);

      SecurityGroupWorkVO work = createForUpdate();
      work.setStep(Step.Error);
      update(work, sc);

      return result;
  }
View Full Code Here

                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group take: no work found");
                }
                return null;
            }
            SecurityGroupWorkVO work = vos.get(0);
            boolean processing = false;
            if (findByVmIdStep(work.getInstanceId(), Step.Processing) != null) {
                //ensure that there is no job in Processing state for the same VM
                processing = true;
                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("Security Group work take: found a job in Scheduled and Processing  vmid=" + work.getInstanceId());
                }
            }
            work.setServerId(serverId);
            work.setDateTaken(new Date());
            if (processing) {
                //the caller to take() should check the step and schedule another work item to come back
                //and take a look.
                work.setStep(SecurityGroupWork.Step.Done);
            } else {
                work.setStep(SecurityGroupWork.Step.Processing);
            }

            update(work.getId(), work);

            txn.commit();

            return work;
View Full Code Here

        final List<SecurityGroupWorkVO> vos = lockRows(sc, filter, true);
        if (vos.size() == 0) {
            txn.commit();
            return;
        }
        SecurityGroupWorkVO work = vos.get(0);
        work.setStep(step);
        update(work.getId(), work);

        txn.commit();
    }
View Full Code Here

TOP

Related Classes of com.cloud.network.security.SecurityGroupWorkVO

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.