Refactor Email functionality

revert-70aa11f8
manoj 10 years ago
parent 03b4f41a2e
commit 3e51415a64

@ -18,6 +18,8 @@
package org.wso2.carbon.device.mgt.core.config;
import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.device.mgt.core.config.email.EmailConfigurations;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -25,9 +27,10 @@ import javax.xml.bind.annotation.XmlRootElement;
* Class for holding management repository data.
*/
@XmlRootElement(name = "ManagementRepository")
public class DeviceManagementRepository {
public class DeviceManagementConfigRepository {
private DataSourceConfig dataSourceConfig;
private EmailConfigurations emailConfigurations;
@XmlElement(name = "DataSourceConfiguration", required = true)
public DataSourceConfig getDataSourceConfig() {
@ -37,5 +40,13 @@ public class DeviceManagementRepository {
public void setDataSourceConfig(DataSourceConfig dataSourceConfig) {
this.dataSourceConfig = dataSourceConfig;
}
@XmlElement(name = "EmailClientConfiguration", required = true)
public EmailConfigurations getEmailConfigurations() {
return emailConfigurations;
}
public void setEmailConfigurations(EmailConfigurations emailConfigurations) {
this.emailConfigurations = emailConfigurations;
}
}

@ -0,0 +1,66 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.core.config.email;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "EmailClientConfiguration")
public class EmailConfigurations {
private int minNumOfThread;
private int maxNumOfThread;
private int keepAliveTime;
private int threadQueueCapacity;
@XmlElement(name = "minimumThread", required = true)
public int getMinNumOfThread() {
return minNumOfThread;
}
public void setMinNumOfThread(int minNumOfThread) {
this.minNumOfThread = minNumOfThread;
}
@XmlElement(name = "maximumThread", required = true)
public int getMaxNumOfThread() {
return maxNumOfThread;
}
public void setMaxNumOfThread(int maxNumOfThread) {
this.maxNumOfThread = maxNumOfThread;
}
@XmlElement(name = "maximumThread", required = true)
public int getKeepAliveTime() {
return keepAliveTime;
}
@XmlElement(name = "keepAliveTime", required = true)
public void setKeepAliveTime(int keepAliveTime) {
this.keepAliveTime = keepAliveTime;
}
@XmlElement(name = "ThreadQueueCapacity", required = true)
public int getThreadQueueCapacity() {
return threadQueueCapacity;
}
public void setThreadQueueCapacity(int threadQueueCapacity) {
this.threadQueueCapacity = threadQueueCapacity;
}
}

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.device.mgt.core.config;
package org.wso2.carbon.device.mgt.core.config.email;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@ -56,6 +56,7 @@ public class EnrolmentNotifications {
public void setFooter(String footer) {
this.footer = footer;
}
@XmlElement(name = "Subject", required = true)
public String getSubject() {
return subject;
@ -64,6 +65,7 @@ public class EnrolmentNotifications {
public void setSubject(String subject) {
this.subject = subject;
}
@XmlElement(name = "Url", required = true)
public String getUrl() {
return url;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.device.mgt.core.config;
package org.wso2.carbon.device.mgt.core.config.email;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -0,0 +1,29 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.device.mgt.core.email;
public final class EmailConstants {
public static final class EnrolmentEmailConstants {
public static final String TITLE = "title";
public static final String USERNAME = "user-name";
public static final String DOwN_LOAD_URL = "downloadUrl";
public static final String ENCODED_SCHEME = "UTF-8";
}
}

@ -1,67 +0,0 @@
/*
* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.wso2.carbon.device.mgt.core.email.sender;
public class EmailConfig {
private String subject;
private String firstName;
private String address;
private String enrollmentUrl;
public EmailConfig(String subject, String firstName, String address, String enrollmentUrl) {
this.subject = subject;
this.firstName = firstName;
this.address = address;
this.enrollmentUrl = enrollmentUrl;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getEnrollmentUrl() {
return enrollmentUrl;
}
public void setEnrollmentUrl(String enrollmentUrl) {
this.enrollmentUrl = enrollmentUrl;
}
}
Loading…
Cancel
Save