Package com.cloud.utils.db

Examples of com.cloud.utils.db.Filter


        }
        return jobs.get(0);
    }

    private UsageJobVO getNextRecurringJob() {
        Filter filter = new Filter(UsageJobVO.class, "id", false, Long.valueOf(0), Long.valueOf(1));
        SearchCriteria<UsageJobVO> sc = createSearchCriteria();
        sc.addAnd("endMillis", SearchCriteria.Op.EQ, Long.valueOf(0));
        sc.addAnd("jobType", SearchCriteria.Op.EQ, Integer.valueOf(UsageJobVO.JOB_TYPE_RECURRING));
        List<UsageJobVO> jobs = search(sc, filter);
View Full Code Here


        return jobs.get(0);
    }

    @Override
    public UsageJobVO getNextImmediateJob() {
        Filter filter = new Filter(UsageJobVO.class, "id", false, Long.valueOf(0), Long.valueOf(1));
        SearchCriteria<UsageJobVO> sc = createSearchCriteria();
        sc.addAnd("endMillis", SearchCriteria.Op.EQ, Long.valueOf(0));
        sc.addAnd("jobType", SearchCriteria.Op.EQ, Integer.valueOf(UsageJobVO.JOB_TYPE_SINGLE));
        sc.addAnd("scheduled", SearchCriteria.Op.EQ, Integer.valueOf(0));
        List<UsageJobVO> jobs = search(sc, filter);
View Full Code Here

        return jobs.get(0);
    }

    @Override
    public Date getLastHeartbeat() {
        Filter filter = new Filter(UsageJobVO.class, "heartbeat", false, Long.valueOf(0), Long.valueOf(1));
        SearchCriteria<UsageJobVO> sc = createSearchCriteria();
        List<UsageJobVO> jobs = search(sc, filter);

        if ((jobs == null) || jobs.isEmpty()) {
            return null;
View Full Code Here

       _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false);
       Long domainId = domainIdRecursiveListProject.first();
       Boolean isRecursive = domainIdRecursiveListProject.second();
       ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();

        Filter searchFilter = new Filter(SnapshotVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal());
        SearchBuilder<SnapshotVO> sb = _snapshotDao.createSearchBuilder();
        _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);

        sb.and("statusNEQ", sb.entity().getState(), SearchCriteria.Op.NEQ); //exclude those Destroyed snapshot, not showing on UI
        sb.and("volumeId", sb.entity().getVolumeId(), SearchCriteria.Op.EQ);
View Full Code Here

  public List<SAclVO> listGrants(String target, long targetId) {
      SearchBuilder<SAclVO> SearchByTarget = createSearchBuilder();
      SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ);
      SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ);
      SearchByTarget.done();
      Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
      Transaction txn = Transaction.open( Transaction.AWSAPI_DB);
      try {
    txn.start();
    SearchCriteria<SAclVO> sc = SearchByTarget.create();
    sc.setParameters("Target", target);
View Full Code Here

  public List<SAclVO> listGrants(String target, long targetId, String userCanonicalId) {
      SearchBuilder<SAclVO> SearchByAcl = createSearchBuilder();
      SearchByAcl.and("Target", SearchByAcl.entity().getTarget(), SearchCriteria.Op.EQ);
      SearchByAcl.and("TargetID", SearchByAcl.entity().getTargetId(), SearchCriteria.Op.EQ);
      SearchByAcl.and("GranteeCanonicalID", SearchByAcl.entity().getGranteeCanonicalId(), SearchCriteria.Op.EQ);
      Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null);
      Transaction txn = Transaction.open( Transaction.AWSAPI_DB);
      try {
        txn.start();
        SearchCriteria<SAclVO> sc = SearchByAcl.create();
        sc.setParameters("Target", target);
View Full Code Here

       
        SearchBuilder<MultiPartPartsVO> ByUploadID = createSearchBuilder();
        ByUploadID.and("UploadID", ByUploadID.entity().getUploadid(), SearchCriteria.Op.EQ);
        ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.GT);
        ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.LT);
        Filter filter = new Filter(MultiPartPartsVO.class, "partNumber", Boolean.TRUE, null, null);
       
        Transaction txn = Transaction.currentTxn()// Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
        try {
            txn.start();
            SearchCriteria<MultiPartPartsVO> sc = ByUploadID.create();
View Full Code Here

        if (null != uploadIdMarker)
            byBucket.and("NameKey", byBucket.entity().getNameKey(), SearchCriteria.Op.GT);
        if (null != uploadIdMarker)
            byBucket.and("ID", byBucket.entity().getId(), SearchCriteria.Op.GT);
       
       Filter filter = new Filter(MultiPartUploadsVO.class, "nameKey", Boolean.TRUE, null, null);
       filter.addOrderBy(MultiPartUploadsVO.class, "createTime", Boolean.TRUE);
      
       Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
       try {
           txn.start();
           SearchCriteria<MultiPartUploadsVO> sc = byBucket.create();
View Full Code Here

 
  @Override
  public List<SBucketVO> listBuckets(String canonicalId) {
      SearchBuilder<SBucketVO> ByCanonicalID = createSearchBuilder();
      ByCanonicalID.and("OwnerCanonicalID", ByCanonicalID.entity().getOwnerCanonicalId(), SearchCriteria.Op.EQ);
      Filter filter = new Filter(SBucketVO.class, "createTime", Boolean.TRUE, null, null);
      Transaction txn = Transaction.currentTxn()// Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true);
      try {
            txn.start();
            SearchCriteria<SBucketVO> sc = ByCanonicalID.create();
            sc.setParameters("OwnerCanonicalID", canonicalId);
View Full Code Here

        txn.start();
        SearchCriteria<EngineHostVO> sc = UnmanagedDirectConnectSearch.create();
        sc.setParameters("lastPinged", lastPingSecondsAfter);
        //sc.setParameters("resourceStates", ResourceState.ErrorInMaintenance, ResourceState.Maintenance, ResourceState.PrepareForMaintenance, ResourceState.Disabled);
        sc.setJoinParameters("ClusterManagedSearch", "managed", Managed.ManagedState.Managed);
        List<EngineHostVO> hosts = lockRows(sc, new Filter(EngineHostVO.class, "clusterId", true, 0L, limit), true);

        for (EngineHostVO host : hosts) {
            host.setManagementServerId(managementServerId);
            update(host.getId(), host);
        }
View Full Code Here

TOP

Related Classes of com.cloud.utils.db.Filter

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.