/** * Create a new enrollmentGroup query. * * @see ProvisioningServiceClient#createEnrollmentGroupQuery(QuerySpecification) * @see ProvisioningServiceClient#createEnrollmentGroupQuery(QuerySpecification, int) * * @param querySpecification is a {@code String} with the SQL query specification. It cannot be {@code null}. * @param pageSize the {@code int} with the maximum number of items per iteration. It can be 0 for default, but not negative. * @return A {@link Query} iterator. * @throws IllegalArgumentException if the provided parameter is not correct. */ Query createQuery(QuerySpecification querySpecification, int pageSize) { /* SRS_ENROLLMENT_GROUP_MANAGER_21_038: [The createQuery shall throw IllegalArgumentException if the provided querySpecification is null.] */ if(querySpecification == null) { throw new IllegalArgumentException("querySpecification cannot be null."); } /* SRS_ENROLLMENT_GROUP_MANAGER_21_039: [The createQuery shall throw IllegalArgumentException if the provided pageSize is negative.] */ if(pageSize < 0) { throw new IllegalArgumentException("pageSize cannot be negative."); } /* SRS_ENROLLMENT_GROUP_MANAGER_21_040: [The createQuery shall create Query iterator with a Http path `enrollmentGroups`.] */ String targetPath = EnrollmentGroupManager.getEnrollmentGroupsPath(); /* SRS_ENROLLMENT_GROUP_MANAGER_21_041: [The createQuery shall create and return a new instance of the Query iterator.] */ return new Query(contractApiHttp, targetPath, querySpecification, pageSize); }
/** * Create a new individualEnrollment query. * * @see ProvisioningServiceClient#createIndividualEnrollmentQuery(QuerySpecification) * @see ProvisioningServiceClient#createIndividualEnrollmentQuery(QuerySpecification, int) * * @param querySpecification is a {@code String} with the SQL query specification. It cannot be {@code null}. * @param pageSize the {@code int} with the maximum number of items per iteration. It can be 0 for default, but not negative. * @return A {@link Query} iterator. * @throws IllegalArgumentException if the provided parameter is not correct. */ Query createQuery(QuerySpecification querySpecification, int pageSize) { /* SRS_INDIVIDUAL_ENROLLMENT_MANAGER_21_038: [The createQuery shall throw IllegalArgumentException if the provided querySpecification is null.] */ if(querySpecification == null) { throw new IllegalArgumentException("querySpecification cannot be null."); } /* SRS_INDIVIDUAL_ENROLLMENT_MANAGER_21_039: [The createQuery shall throw IllegalArgumentException if the provided pageSize is negative.] */ if(pageSize < 0) { throw new IllegalArgumentException("pageSize cannot be negative."); } /* SRS_INDIVIDUAL_ENROLLMENT_MANAGER_21_040: [The createQuery shall create Query iterator with a Http path `enrollments`.] */ String targetPath = IndividualEnrollmentManager.getEnrollmentsPath(); /* SRS_INDIVIDUAL_ENROLLMENT_MANAGER_21_041: [The createQuery shall create and return a new instance of the Query iterator.] */ return new Query(contractApiHttp, targetPath, querySpecification, pageSize); }
return new Query(contractApiHttp, targetPath, querySpecification, pageSize);