<p>Find catalog GS by ID.</p>
@param pCatalogs Catalog List
@param pId Catalog ID
@return CatalogGs Catalog
@throws Exception if not found
331674
public final CatalogGs findCatalogGsById(final List<CatalogGs> pCatalogs,
    final Long pId) throws Exception {
    for (CatalogGs cat : pCatalogs) {
      if (cat.getItsId().equals(pId)) {
        return cat;
      }
    }
    throw new Exception("Algorithm error! Can't find catalog #" + pId);
  }
1223329
public static Index getPrimaryKeyIndex(Table catalogTable) throws Exception {

        // We first need to find the pkey constraint
        Constraint catalog_constraint = null;
        for (Constraint c : catalogTable.getConstraints()) {
            if (c.getType() == ConstraintType.PRIMARY_KEY.getValue()) {
                catalog_constraint = c;
                break;
            }
        }
        if (catalog_constraint == null) {
            throw new Exception("ERROR: Table '" + catalogTable.getTypeName() + "' does not have a PRIMARY KEY constraint");
        }

        // And then grab the index that it is using
        return (catalog_constraint.getIndex());
    }
275629
public Set<String> getParents(String pid) throws MelcoeXacmlException {
        logger.debug("Obtaining parents for: {}", pid);

        Set<String> parentPIDs = new HashSet<String>();
        if (pid.equalsIgnoreCase(Constants.FEDORA_REPOSITORY_PID.uri)) {
            return parentPIDs;
        }

        query: for (String relationship : relationships) {
            logger.debug("relationship query: {}, {}", pid, relationship);

            Map<String, Set<String>> mapping;
            try {
                mapping = getRelationships(pid, relationship);
            } catch (MelcoeXacmlException e) {
                Throwable t = e.getCause();
                // An object X, may legitimately declare a parent relation to
                // another object, Y which does not exist. Therefore, we don't
                // want to continue querying for Y's parents.
                if (t != null && t instanceof ObjectNotInLowlevelStorageException) {
                    logger.debug("Parent, {}, not found.", pid);
                    break query;
                } else {
                // Unexpected error, so we throw back the original
                throw e;
            }
            }

            Set<String> parents = mapping.get(relationship);
            if (parents != null) {
                for (String parent : parents) {
                    PID parentPID = PID.getInstance(parent);
                    // we want the parents in demo:123 form, not info:fedora/demo:123
                    parentPIDs.add(parentPID.toString());
                    logger.debug("added parent {}", parentPID.toString());
                }
            }
        }
        return parentPIDs;
    }
6544
@Override
	public List<CPOptionCategory> getCPOptionCategoriesByUuidAndCompanyId(
		String uuid, long companyId) {
		return cpOptionCategoryPersistence.findByUuid_C(uuid, companyId);
	}
379608
@Override
	public List<CommerceDiscount> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
948017
public final MatchForeign getFor(final Map<String, Object> pReqVars,
    final Long pId) throws Exception {
    MatchForeign mf = getSrvOrm().retrieveEntityById(pReqVars,
      MatchForeign.class, pId);
    mf.setItsLines(getSrvOrm().retrieveListWithConditions(pReqVars,
      MatchForeignLine.class, "where ITSOWNER=" + pId));
    return mf;
  }
264364
public final CartLn findCartItemById(final Cart pShoppingCart,
    final Long pCartItemItsId) throws Exception {
    CartLn cartLn = null;
    for (CartLn ci : pShoppingCart.getItems()) {
      if (ci.getItsId().equals(pCartItemItsId)) {
        if (ci.getDisab()) {
          throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
            "requested_item_disabled");
        }
        cartLn = ci;
        break;
      }
    }
    if (cartLn == null) {
      throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
        "requested_item_not_found");
    }
    return cartLn;
  }
114836
@Override
	public List<CPDefinitionSpecificationOptionValue> findByCPOptionCategoryId(
		long CPOptionCategoryId) {
		return findByCPOptionCategoryId(CPOptionCategoryId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
534582
@Override
	public List<CPDefinitionLink> findByCPDefinitionId(long CPDefinitionId) {
		return findByCPDefinitionId(CPDefinitionId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
673141
protected final PrcPurchaseInvoiceLineGfr lazyGetPrcPurchaseInvoiceLineGfr(
    final Map<String, Object> pAddParam) throws Exception {
    @SuppressWarnings("unchecked")
    PrcPurchaseInvoiceLineGfr<RS> proc = (PrcPurchaseInvoiceLineGfr<RS>)
      this.processorsMap.get(PrcPurchaseInvoiceLineGfr.class.getSimpleName());
    if (proc == null) {
      proc = new PrcPurchaseInvoiceLineGfr<RS>();
      @SuppressWarnings("unchecked")
      PrcEntityPbCopy<RS, PurchaseInvoiceLine> procDlg =
        (PrcEntityPbCopy<RS, PurchaseInvoiceLine>)
          this.fctBnEntitiesProcessors
            .lazyGet(pAddParam, PrcEntityPbCopy.class.getSimpleName());
      proc.setPrcAccEntityPbCopy(procDlg);
      //assigning fully initialized object:
      this.processorsMap
        .put(PrcPurchaseInvoiceLineGfr.class.getSimpleName(), proc);
    }
    return proc;
  }
1313679
public Map<String, AtlasVertex> getVerticesForGUIDs(List<String> guids) {

        return getVerticesForPropertyValues(Constants.GUID_PROPERTY_KEY, guids);
    }
1043342
protected final PrcSalesReturnLineGfr lazyGetPrcSalesReturnLineGfr(
    final Map<String, Object> pAddParam) throws Exception {
    @SuppressWarnings("unchecked")
    PrcSalesReturnLineGfr<RS> proc = (PrcSalesReturnLineGfr<RS>)
      this.processorsMap.get(PrcSalesReturnLineGfr.class.getSimpleName());
    if (proc == null) {
      proc = new PrcSalesReturnLineGfr<RS>();
      @SuppressWarnings("unchecked")
      PrcEntityPbCopy<RS, SalesReturnLine> procDlg =
        (PrcEntityPbCopy<RS, SalesReturnLine>) this.fctBnEntitiesProcessors
          .lazyGet(pAddParam, PrcEntityPbCopy.class.getSimpleName());
      proc.setPrcAccEntityPbCopy(procDlg);
      //assigning fully initialized object:
      this.processorsMap.put(PrcSalesReturnLineGfr.class.getSimpleName(), proc);
    }
    return proc;
  }
585866
public static syslog_generic[] get(nitro_service client) throws Exception
	{
		syslog_generic resource = new syslog_generic();
		resource.validate("get");
		return (syslog_generic[]) resource.get_resources(client);
	}
31922
static boolean checkPidPgrpidForMatch(String pidStr, String procfsDir) {
    Integer pId = Integer.parseInt(pidStr);
    // Get information for this process
    ProcessInfo pInfo = new ProcessInfo(pId);
    pInfo = constructProcessInfo(pInfo, procfsDir);
    if (pInfo == null) {
      // process group leader may have finished execution, but we still need to
      // kill the subProcesses in the process group.
      return true;
    }

    //make sure that pId and its pgrpId match
    if (!pInfo.getPgrpId().equals(pId)) {
      LOG.warn("Unexpected: Process with PID " + pId +
               " is not a process group leader.");
      return false;
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug(pId + " is a process group leader, as expected.");
    }
    return true;
  }
523701
@Override
	public List<CommerceNotificationQueueEntry> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
133882
@Override
	public List<CPDefinitionLocalization> findByCPDefinitionId(
		long CPDefinitionId) {
		return findByCPDefinitionId(CPDefinitionId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
347874
@Override
	public List<CommerceWarehouseItem> findByCPI_CPIU(long CProductId,
		String CPInstanceUuid) {
		return findByCPI_CPIU(CProductId, CPInstanceUuid, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}