Added MobileDeviceDAO classes

revert-70aa11f8
harshanL 10 years ago
parent 006b07b399
commit 9f5fb3fb91

@ -25,7 +25,7 @@ import org.wso2.carbon.device.mgt.common.spi.DeviceManagerService;
import java.util.List;
/**
* This represents the Android implementation of DeviceManagerService. *
* This represents the Android implementation of DeviceManagerService.
*/
public class AndroidDeviceManagerService implements DeviceManagerService {

@ -16,8 +16,19 @@
package org.wso2.carbon.device.mgt.mobile.impl.dao;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDevice;
/**
* This class represents the key operations associated with persisting device related information.
* This class represents the key operations associated with persisting mobile-device related information.
*/
public interface MobileDeviceDAO {
MobileDevice getDevice(String deviceId) throws MobileDeviceManagementDAOException;
void addDevice(MobileDevice mobileDevice) throws MobileDeviceManagementDAOException;
void updateDevice(MobileDevice mobileDevice) throws MobileDeviceManagementDAOException;
void deleteDevice(String deviceId) throws MobileDeviceManagementDAOException;
}

@ -1,7 +1,75 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao;
/**
* Created by harshan on 12/12/14.
* Custom exception class for mobile device specific data access related exceptions.
*/
public class MobileDeviceManagementDAOException extends Exception {
private String message;
private static final long serialVersionUID = 2021891706072918865L;
/**
* Constructs a new exception with the specified detail message and nested exception.
*
* @param message error message
* @param nestedException exception
*/
public class MobileDeviceManagementDAOException {
public MobileDeviceManagementDAOException(String message, Exception nestedException) {
super(message, nestedException);
setErrorMessage(message);
}
/**
* Constructs a new exception with the specified detail message and cause.
*
* @param message the detail message.
* @param cause the cause of this exception.
*/
public MobileDeviceManagementDAOException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
/**
* Constructs a new exception with the specified detail message
*
* @param message the detail message.
*/
public MobileDeviceManagementDAOException(String message) {
super(message);
setErrorMessage(message);
}
/**
* Constructs a new exception with the specified and cause.
*
* @param cause the cause of this exception.
*/
public MobileDeviceManagementDAOException(Throwable cause) {
super(cause);
}
public String getMessage() {
return message;
}
public void setErrorMessage(String errorMessage) {
this.message = errorMessage;
}
}

@ -16,8 +16,19 @@
package org.wso2.carbon.device.mgt.mobile.impl.dao;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDeviceModel;
/**
* Created by harshan on 12/12/14.
* This class represents the key operations associated with persisting mobile-device model related
* information.
*/
public interface MobileDeviceModelDAO {
MobileDeviceModel getDeviceModel(String modelId) throws MobileDeviceManagementDAOException;
void addDeviceModel(MobileDeviceModel deviceModel) throws MobileDeviceManagementDAOException;
void updateDeviceModel(MobileDeviceModel deviceModel) throws MobileDeviceManagementDAOException;
void deleteDeviceModel(String modelId) throws MobileDeviceManagementDAOException;
}

@ -1,7 +1,35 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDeviceVendor;
/**
* Created by harshan on 12/12/14.
* This class represents the key operations associated with persisting mobile-device vendor
* related information.
*/
public interface MobileDeviceVendorDAO {
MobileDeviceVendor getDeviceModel(String vendorId) throws MobileDeviceManagementDAOException;
void addDeviceVendor(MobileDeviceVendor deviceVendor) throws MobileDeviceManagementDAOException;
void updateDeviceVendor(MobileDeviceVendor deviceVendor)
throws MobileDeviceManagementDAOException;
void deleteDeviceVendor(String vendorId) throws MobileDeviceManagementDAOException;
}

@ -1,7 +1,34 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileOSVersion;
/**
* Created by harshan on 12/12/14.
* This class represents the key operations associated with persisting mobile-device OS version
* related information.
*/
public interface MobileOSVersionDAO {
MobileOSVersion getMobileOSVersion(String versionId) throws MobileDeviceManagementDAOException;
void addMobileOSVersion(MobileOSVersion osVersion) throws MobileDeviceManagementDAOException;
void updateMobileOSVersion(MobileOSVersion osVersion) throws MobileDeviceManagementDAOException;
void deleteMobileOSVersion(String versionId) throws MobileDeviceManagementDAOException;
}

@ -1,7 +0,0 @@
package org.wso2.carbon.device.mgt.mobile.impl.dao.impl;
/**
* Created by harshan on 12/12/14.
*/
public interface MobileDeviceDAO {
}

@ -1,7 +1,48 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao.impl;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceDAO;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDevice;
/**
* Created by harshan on 12/12/14.
* Implementation of MobileDeviceDAO.
*/
public class MobileDeviceDAOImpl {
public class MobileDeviceDAOImpl implements MobileDeviceDAO {
@Override
public MobileDevice getDevice(String deviceId) throws MobileDeviceManagementDAOException {
return null;
}
@Override
public void addDevice(MobileDevice mobileDevice)
throws MobileDeviceManagementDAOException {
}
@Override
public void updateDevice(MobileDevice mobileDevice)
throws MobileDeviceManagementDAOException {
}
@Override
public void deleteDevice(String deviceId) throws MobileDeviceManagementDAOException {
}
}

@ -1,7 +1,50 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao.impl;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceModelDAO;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDeviceModel;
/**
* Created by harshan on 12/12/14.
* Implementation of MobileDeviceModel.
*/
public class MobileDeviceModelImpl {
public class MobileDeviceModelImpl implements MobileDeviceModelDAO {
@Override
public MobileDeviceModel getDeviceModel(String modelId)
throws MobileDeviceManagementDAOException {
return null;
}
@Override
public void addDeviceModel(MobileDeviceModel deviceModel)
throws MobileDeviceManagementDAOException {
}
@Override
public void updateDeviceModel(MobileDeviceModel deviceModel)
throws MobileDeviceManagementDAOException {
}
@Override
public void deleteDeviceModel(String modelId)
throws MobileDeviceManagementDAOException {
}
}

@ -1,7 +1,50 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao.impl;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceVendorDAO;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileDeviceVendor;
/**
* Created by harshan on 12/12/14.
* Implementation of MobileDeviceVendorDAO.
*/
public class MobileDeviceVendorDAOImpl {
public class MobileDeviceVendorDAOImpl implements MobileDeviceVendorDAO {
@Override
public MobileDeviceVendor getDeviceModel(String vendorId)
throws MobileDeviceManagementDAOException {
return null;
}
@Override
public void addDeviceVendor(MobileDeviceVendor deviceVendor)
throws MobileDeviceManagementDAOException {
}
@Override
public void updateDeviceVendor(MobileDeviceVendor deviceVendor)
throws MobileDeviceManagementDAOException {
}
@Override
public void deleteDeviceVendor(String vendorId)
throws MobileDeviceManagementDAOException {
}
}

@ -1,7 +1,46 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao.impl;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileDeviceManagementDAOException;
import org.wso2.carbon.device.mgt.mobile.impl.dao.MobileOSVersionDAO;
import org.wso2.carbon.device.mgt.mobile.impl.dto.MobileOSVersion;
/**
* Created by harshan on 12/12/14.
* Implementation of MobileOSVersionDAO.
*/
public class MobileOSVersionDAOImpl {
public class MobileOSVersionDAOImpl implements MobileOSVersionDAO {
@Override public MobileOSVersion getMobileOSVersion(String versionId)
throws MobileDeviceManagementDAOException {
return null;
}
@Override public void addMobileOSVersion(MobileOSVersion osVersion)
throws MobileDeviceManagementDAOException {
}
@Override public void updateMobileOSVersion(MobileOSVersion osVersion)
throws MobileDeviceManagementDAOException {
}
@Override public void deleteMobileOSVersion(String versionId)
throws MobileDeviceManagementDAOException {
}
}

@ -1,7 +1,23 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dao.util;
/**
* Created by harshan on 12/12/14.
* Utility method required by MobileDeviceManagement DAO classes.
*/
public class MobileDeviceManagementDAOUtil {
}

@ -1,7 +1,89 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dto;
import java.io.Serializable;
/**
* Created by harshan on 12/12/14.
* DTO of MobileDevice.
*/
public class MobileDevice {
public class MobileDevice implements Serializable {
private String mobileDeviceId;
private String regId;
private String imei;
private String imsi;
private int osVersionId;
private int modelId;
private int vendorId;
public String getMobileDeviceId() {
return mobileDeviceId;
}
public void setMobileDeviceId(String mobileDeviceId) {
this.mobileDeviceId = mobileDeviceId;
}
public String getRegId() {
return regId;
}
public void setRegId(String regId) {
this.regId = regId;
}
public String getImei() {
return imei;
}
public void setImei(String imei) {
this.imei = imei;
}
public String getImsi() {
return imsi;
}
public void setImsi(String imsi) {
this.imsi = imsi;
}
public int getOsVersionId() {
return osVersionId;
}
public void setOsVersionId(int osVersionId) {
this.osVersionId = osVersionId;
}
public int getModelId() {
return modelId;
}
public void setModelId(int modelId) {
this.modelId = modelId;
}
public int getVendorId() {
return vendorId;
}
public void setVendorId(int vendorId) {
this.vendorId = vendorId;
}
}

@ -1,7 +1,44 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dto;
import java.io.Serializable;
/**
* Created by harshan on 12/12/14.
* DTO of MobileDeviceModel.
*/
public class MobileDeviceModel {
public class MobileDeviceModel implements Serializable {
private int modelId;
private String model;
public int getModelId() {
return modelId;
}
public void setModelId(int modelId) {
this.modelId = modelId;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
}

@ -1,7 +1,44 @@
/*
* Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* Licensed 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.mobile.impl.dto;
import java.io.Serializable;
/**
* Created by harshan on 12/12/14.
* DTO of MobileOSVersion.
*/
public class MobileOSVersion {
public class MobileOSVersion implements Serializable {
private int osVersionId;
private String osVersion;
public int getOsVersionId() {
return osVersionId;
}
public void setOsVersionId(int osVersionId) {
this.osVersionId = osVersionId;
}
public String getOsVersion() {
return osVersion;
}
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
}

Loading…
Cancel
Save