/** * Create a new instance of the RegistrationStatusManager using the provided connection * string and https as the transport protocol. * * @param contractApiHttp is the class that cares the Http connection. * @return The {@code RegistrationStatusManager} with the new instance of this class. * @throws IllegalArgumentException if the {@link ContractApiHttp} is {@code null}. */ public static RegistrationStatusManager createFromContractApiHttp(ContractApiHttp contractApiHttp) { /* SRS_REGISTRATION_STATUS_MANAGER_21_004: [The factory shall create a new instance of this.] */ return new RegistrationStatusManager(contractApiHttp); }
/** * Create a new instance of the EnrollmentGroupManager using the provided connection * string and https as the transport protocol. * * @param contractApiHttp is the class that cares the Http connection. * @return The {@code EnrollmentGroupManager} with the new instance of this class. * @throws IllegalArgumentException if the {@link ContractApiHttp} is {@code null}. */ static EnrollmentGroupManager createFromContractApiHttp(ContractApiHttp contractApiHttp) { /* SRS_ENROLLMENT_GROUP_MANAGER_21_004: [The factory shall create a new instance of this.] */ return new EnrollmentGroupManager(contractApiHttp); }
/** * Create a new instance of the IndividualEnrollmentManager using the provided connection * string and https as the transport protocol. * * @param contractApiHttp is the class that cares the Http communication. * @return The {@code IndividualEnrollmentManager} with the new instance of this class. * @throws IllegalArgumentException if the {@link ContractApiHttp} is {@code null}. */ static IndividualEnrollmentManager createFromContractApiHttp(ContractApiHttp contractApiHttp) { /* SRS_INDIVIDUAL_ENROLLMENT_MANAGER_21_004: [The factory shall create a new instance of this.] */ return new IndividualEnrollmentManager(contractApiHttp); }
/** * Return the next page of result for the query using a new continuationToken. * * @param continuationToken the {@code String} with the previous continuationToken. It cannot be {@code null} or empty. * @return A {@link QueryResult} with the next page of items for the query. * @throws NoSuchElementException if the query does no have more pages to return. */ public QueryResult next(String continuationToken) { /* SRS_QUERY_21_018: [The next shall throw NoSuchElementException if the provided continuationToken is null or empty.] */ if(Tools.isNullOrEmpty(continuationToken)) { throw new NoSuchElementException("There is no Continuation Token to get pending elements,"); } /* SRS_QUERY_21_019: [The next shall store the provided continuationToken.] */ this.continuationToken = continuationToken; /* SRS_QUERY_21_020: [The next shall return the next page of results by calling the next().] */ return next(); }
private void setSubjectName(String subjectName) { if(Tools.isNullOrEmpty(subjectName)) { throw new IllegalArgumentException("subjectName on X509 info cannot be null or empty"); } this.subjectName = subjectName; }
/** * @deprecated As of release 1.0.0, replaced by {@link #deleteDeviceRegistrationState(DeviceRegistrationState)} ()} * @param deviceRegistrationState the {@link DeviceRegistrationState} that identifies the deviceRegistrationState. It cannot be {@code null}. * @throws ProvisioningServiceClientException if the Provisioning Device Service was not able to delete the * registration status information for the provided DeviceRegistrationState. */ @Deprecated public void deleteDeviceRegistrationStatus(DeviceRegistrationState deviceRegistrationState) throws ProvisioningServiceClientException { /* SRS_PROVISIONING_SERVICE_CLIENT_21_024: [The deleteDeviceRegistrationStatus shall delete the deviceRegistrationState for the provided DeviceRegistrationState by calling the delete in the registrationStatusManager.] */ registrationStatusManager.delete(deviceRegistrationState); }
/** * Factory to create a registration status query. * * <p> This method will create a new registration status query for a specific enrollment group on the Device * Provisioning Service and return it as a {@link Query} iterator. * * <p> The Device Provisioning Service expects a SQL query in the {@link QuerySpecification}, for instance * {@code "SELECT * FROM enrollments"}. * * @param querySpecification the {@link QuerySpecification} with the SQL query. It cannot be {@code null}. * @param enrollmentGroupId the {@code String} that identifies the enrollmentGroup. It cannot be {@code null} or empty. * @return The {@link Query} iterator. */ public Query createEnrollmentGroupRegistrationStateQuery(QuerySpecification querySpecification, String enrollmentGroupId) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_027: [The createEnrollmentGroupRegistrationStateQuery shall create a new deviceRegistrationState query by calling the createQuery in the registrationStatusManager.] */ return registrationStatusManager.createEnrollmentGroupQuery(querySpecification, enrollmentGroupId,0); }
/** * Factory to create a individualEnrollment query. * * <p> This method will create a new individualEnrollment query for Device Provisioning Service and return it * as a {@link Query} iterator. * * <p> The Device Provisioning Service expects a SQL query in the {@link QuerySpecification}, for instance * {@code "SELECT * FROM enrollments"}. * * @param querySpecification the {@link QuerySpecification} with the SQL query. It cannot be {@code null}. * @return The {@link Query} iterator. * @throws IllegalArgumentException if the provided parameter is not correct. */ public Query createIndividualEnrollmentQuery(QuerySpecification querySpecification) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_014: [The createIndividualEnrollmentQuery shall create a new individual enrolment query by calling the createQuery in the individualEnrollmentManager.] */ return individualEnrollmentManager.createQuery(querySpecification, 0); }
/** * Create a new instance of the {@code DeviceProvisioningServiceClient} that exposes * the API to the Device Provisioning Service. * * <p> The Device Provisioning Service Client is created based on a <b>Provisioning Connection String</b>. * <p> Once you create a Device Provisioning Service on Azure, you can get the connection string on the Azure portal. * * @see <a href="http://portal.azure.com/">Azure portal</a> * * @param connectionString the {@code String} that cares the connection string of the Device Provisioning Service. * @return The {@code ProvisioningServiceClient} with the new instance of this object. * @throws IllegalArgumentException if the connectionString is {@code null} or empty. */ public static ProvisioningServiceClient createFromConnectionString(String connectionString) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_001: [The createFromConnectionString shall create a new instance of this class using the provided connectionString.] */ return new ProvisioningServiceClient(connectionString); }
/** * Factory to create an enrollmentGroup query. * * <p> This method will create a new enrollment group query on Device Provisioning Service and return it as * a {@link Query} iterator. * * <p> The Device Provisioning Service expects a SQL query in the {@link QuerySpecification}, for instance * {@code "SELECT * FROM enrollments"}. * * @param querySpecification the {@link QuerySpecification} with the SQL query. It cannot be {@code null}. * @return The {@link Query} iterator. * @throws IllegalArgumentException if the provided parameter is not correct. */ public Query createEnrollmentGroupQuery(QuerySpecification querySpecification) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_021: [The createEnrollmentGroupQuery shall create a new enrolmentGroup query by calling the createQuery in the enrollmentGroupManager.] */ return enrollmentGroupManager.createQuery(querySpecification, 0); }
private void setSha1Thumbprint(String sha1Thumbprint) { if(Tools.isNullOrEmpty(sha1Thumbprint)) { throw new IllegalArgumentException("sha1Thumbprint on X509 info cannot be null or empty"); } this.sha1Thumbprint = sha1Thumbprint; }
/** * @deprecated As of release 1.0.0, replaced by {@link #deleteDeviceRegistrationState(String)} ()} * @param id the {@code String} that identifies the deviceRegistrationState. It cannot be {@code null} or empty. * @throws ProvisioningServiceClientException if the Provisioning Device Service was not able to delete the * deviceRegistrationState information for the provided registrationId. */ @Deprecated public void deleteDeviceRegistrationStatus(String id) throws ProvisioningServiceClientException { /* SRS_PROVISIONING_SERVICE_CLIENT_21_025: [The deleteDeviceRegistrationStatus shall delete the deviceRegistrationState for the provided id by calling the delete in the registrationStatusManager.] */ registrationStatusManager.delete(id, null); }
/** * @deprecated As of release 1.0.0, replaced by {@link #createEnrollmentGroupRegistrationStateQuery(QuerySpecification, String)} ()} * @param querySpecification the {@link QuerySpecification} with the SQL query. It cannot be {@code null}. * @param enrollmentGroupId the {@code String} that identifies the enrollmentGroup. It cannot be {@code null} or empty. * @return The {@link Query} iterator. */ @Deprecated public Query createEnrollmentGroupRegistrationStatusQuery(QuerySpecification querySpecification, String enrollmentGroupId) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_027: [The createEnrollmentGroupRegistrationStatusQuery shall create a new deviceRegistrationState query by calling the createQuery in the registrationStatusManager.] */ return registrationStatusManager.createEnrollmentGroupQuery(querySpecification, enrollmentGroupId,0); }
/** * Factory to create a individualEnrollment query. * * <p> This method will create a new individualEnrollment query for Device Provisioning Service and return it * as a {@link Query} iterator. * * <p> The Device Provisioning Service expects a SQL query in the {@link QuerySpecification}, for instance * {@code "SELECT * FROM enrollments"}. * * <p> For each iteration, the Query will return a List of objects correspondent to the query result. The maximum * number of items per iteration can be specified by the pageSize. It is optional, you can provide <b>0</b> for * default pageSize or use the API {@link #createIndividualEnrollmentQuery(QuerySpecification)}. * * @param querySpecification the {@link QuerySpecification} with the SQL query. 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 The {@link Query} iterator. * @throws IllegalArgumentException if the provided parameters are not correct. */ public Query createIndividualEnrollmentQuery(QuerySpecification querySpecification, int pageSize) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_015: [The createIndividualEnrollmentQuery shall create a new individual enrolment query by calling the createQuery in the individualEnrollmentManager.] */ return individualEnrollmentManager.createQuery(querySpecification, pageSize); }
private void setIssuerName(String issuerName) { if(Tools.isNullOrEmpty(issuerName)) { throw new IllegalArgumentException("issuerName on X509 info cannot be null or empty"); } this.issuerName = issuerName; }
/** * @deprecated As of release 1.0.0, replaced by {@link #deleteDeviceRegistrationState(String, String)} ()} * @param id the {@code String} that identifies the deviceRegistrationState. It cannot be {@code null} or empty. * @param eTag the {@code String} with the deviceRegistrationState eTag. It can be {@code null} or empty. * The Device Provisioning Service will ignore it in all of these cases. * @throws ProvisioningServiceClientException if the Provisioning Device Service was not able to delete the * deviceRegistrationState information for the provided registrationId and eTag. */ @Deprecated public void deleteDeviceRegistrationStatus(String id, String eTag) throws ProvisioningServiceClientException { /* SRS_PROVISIONING_SERVICE_CLIENT_21_026: [The deleteDeviceRegistrationStatus shall delete the deviceRegistrationState for the provided id and eTag by calling the delete in the registrationStatusManager.] */ registrationStatusManager.delete(id, eTag); }
/** * @deprecated As of release 1.0.0, replaced by {@link #createEnrollmentGroupRegistrationStateQuery(QuerySpecification, String, int)} ()} * @param querySpecification the {@link QuerySpecification} with the SQL query. It cannot be {@code null}. * @param enrollmentGroupId the {@code String} that identifies the enrollmentGroup. It cannot be {@code null} or empty. * @param pageSize the {@code int} with the maximum number of items per iteration. It can be 0 for default, but not negative. * @return The {@link Query} iterator. * @throws IllegalArgumentException if the provided parameters are not correct. */ @Deprecated public Query createEnrollmentGroupRegistrationStatusQuery(QuerySpecification querySpecification, String enrollmentGroupId, int pageSize) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_028: [The createEnrollmentGroupRegistrationStatusQuery shall create a new deviceRegistrationState query by calling the createQuery in the registrationStatusManager.] */ return registrationStatusManager.createEnrollmentGroupQuery(querySpecification, enrollmentGroupId, pageSize); } }
private void setEndorsementKey(String endorsementKey) { if(Tools.isNullOrEmpty(endorsementKey)) { throw new IllegalArgumentException("endorsementKey cannot be null or empty."); } this.endorsementKey = endorsementKey; }
private void setSha256Thumbprint(String sha256Thumbprint) { if(Tools.isNullOrEmpty(sha256Thumbprint)) { throw new IllegalArgumentException("sha256Thumbprint on X509 info cannot be null or empty"); } this.sha256Thumbprint = sha256Thumbprint; }
private void setSerialNumber(String serialNumber) { if(Tools.isNullOrEmpty(serialNumber)) { throw new IllegalArgumentException("serialNumber on X509 info cannot be null or empty"); } this.serialNumber = serialNumber; }