Resolve comments

fixes http://roadmap.entgra.net/issues/9939
mutual-tls-auth
osh 2 years ago
parent 0f28d318ed
commit d2bc463284

@ -70,6 +70,7 @@ public final class DeviceManagementConfig {
private EnrollmentNotificationConfiguration enrollmentNotificationConfiguration; private EnrollmentNotificationConfiguration enrollmentNotificationConfiguration;
private DefaultRoles defaultRoles; private DefaultRoles defaultRoles;
private OperationTimeoutConfiguration operationTimeoutConfiguration; private OperationTimeoutConfiguration operationTimeoutConfiguration;
private String enrollmentGuideMail;
@XmlElement(name = "ManagementRepository", required = true) @XmlElement(name = "ManagementRepository", required = true)
public DeviceManagementConfigRepository getDeviceManagementConfigRepository() { public DeviceManagementConfigRepository getDeviceManagementConfigRepository() {
@ -265,5 +266,14 @@ public final class DeviceManagementConfig {
public void setOperationTimeoutConfiguration(OperationTimeoutConfiguration operationTimeoutConfiguration) { public void setOperationTimeoutConfiguration(OperationTimeoutConfiguration operationTimeoutConfiguration) {
this.operationTimeoutConfiguration = operationTimeoutConfiguration; this.operationTimeoutConfiguration = operationTimeoutConfiguration;
} }
@XmlElement(name = "EnrollmentGuideMail", required = true)
public String getEnrollmentGuideMail() {
return enrollmentGuideMail;
}
public void setEnrollmentGuideMail(String enrollmentGuideMail) {
this.enrollmentGuideMail = enrollmentGuideMail;
}
} }

@ -1559,17 +1559,18 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
@Override @Override
public void sendEnrolmentGuide(String enrolmentGuide) throws DeviceManagementException { public void sendEnrolmentGuide(String enrolmentGuide) throws DeviceManagementException {
DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
String recipientMail = config.getEnrollmentGuideMail();
Properties props = new Properties(); Properties props = new Properties();
props.setProperty("mail-subject", "[Enrollment Guide Triggered] (#" + ++count + ")"); props.setProperty("mail-subject", "[Enrollment Guide Triggered] (#" + ++count + ")");
props.setProperty("enrollment-guide", enrolmentGuide); props.setProperty("enrollment-guide", enrolmentGuide);
try { try {
EmailMetaInfo metaInfo = new EmailMetaInfo("support-dev-group@entgra.io", props); EmailMetaInfo metaInfo = new EmailMetaInfo(recipientMail, props);
sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.ENROLLMENT_GUIDE_TEMPLATE, metaInfo); sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.ENROLLMENT_GUIDE_TEMPLATE, metaInfo);
} catch (ConfigurationManagementException e) { } catch (ConfigurationManagementException e) {
String msg = "Error occurred while sending the mail."; String msg = "Error occurred while sending the mail.";
log.error(msg); log.error(msg, e);
throw new DeviceManagementException(msg, e); throw new DeviceManagementException(msg, e);
} }
} }

@ -187,5 +187,6 @@
<OperationTimeouts> <OperationTimeouts>
</OperationTimeouts> </OperationTimeouts>
</OperationTimeoutConfigurations> </OperationTimeoutConfigurations>
<EnrollmentGuideMail>support-dev-group@entgra.io</EnrollmentGuideMail>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -322,7 +322,7 @@
</Role> </Role>
</Roles> </Roles>
</DefaultRoles> </DefaultRoles>
<OperationTimeoutConfigurations> <OperationTimeoutConfigurations>
<OperationTimeouts> <OperationTimeouts>
<!--<OperationTimeout>--> <!--<OperationTimeout>-->
<!--<DeviceTypes>--> <!--<DeviceTypes>-->
@ -350,6 +350,11 @@
{% endfor %} {% endfor %}
{% endif%} {% endif%}
</OperationTimeouts> </OperationTimeouts>
</OperationTimeoutConfigurations> </OperationTimeoutConfigurations>
{% if device_mgt_conf.enrollment_guide_mail is defined %}
<EnrollmentGuideMail>{{device_mgt_conf.enrollment_guide_mail}}</EnrollmentGuideMail>
{% else %}
<EnrollmentGuideMail>support-dev-group@entgra.io</EnrollmentGuideMail>
{% endif %}
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

Loading…
Cancel
Save