/** * PRIVATE CONSTRUCTOR * * @param connectionString the {@code String} that contains the connection string for the Provisioning service. * @throws IllegalArgumentException if the connectionString is {@code null}, empty, or invalid. */ private ProvisioningServiceClient(String connectionString) { /* SRS_PROVISIONING_SERVICE_CLIENT_21_002: [The constructor shall throw IllegalArgumentException if the provided connectionString is null or empty.] */ if(Tools.isNullOrEmpty(connectionString)) { throw new IllegalArgumentException("connectionString cannot be null or empty"); } /* SRS_PROVISIONING_SERVICE_CLIENT_21_003: [The constructor shall throw IllegalArgumentException if the ProvisioningConnectionString or one of the inner Managers failed to create a new instance.] */ /* SRS_PROVISIONING_SERVICE_CLIENT_21_004: [The constructor shall create a new instance of the ContractApiHttp class using the provided connectionString.] */ ProvisioningConnectionString provisioningConnectionString = ProvisioningConnectionStringBuilder.createConnectionString(connectionString); ContractApiHttp contractApiHttp = ContractApiHttp.createFromConnectionString(provisioningConnectionString); /* SRS_PROVISIONING_SERVICE_CLIENT_21_005: [The constructor shall create a new instance of the IndividualEnrollmentManger.] */ this.individualEnrollmentManager = IndividualEnrollmentManager.createFromContractApiHttp(contractApiHttp); /* SRS_PROVISIONING_SERVICE_CLIENT_21_006: [The constructor shall create a new instance of the EnrollmentGroupManager.] */ this.enrollmentGroupManager = EnrollmentGroupManager.createFromContractApiHttp(contractApiHttp); /* SRS_PROVISIONING_SERVICE_CLIENT_21_007: [The constructor shall create a new instance of the RegistrationStatusManager.] */ this.registrationStatusManager = RegistrationStatusManager.createFromContractApiHttp(contractApiHttp); }