001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.mobile.device;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.mobile.device.Device;
020    import com.liferay.portal.kernel.mobile.device.DeviceRecognitionProvider;
021    import com.liferay.portal.kernel.mobile.device.KnownDevices;
022    import com.liferay.portal.kernel.mobile.device.NoKnownDevices;
023    import com.liferay.portal.kernel.mobile.device.UnknownDevice;
024    
025    import javax.servlet.http.HttpServletRequest;
026    
027    /**
028     * @author Milen Dyankov
029     */
030    public class DefaultDeviceRecognitionProvider
031            implements DeviceRecognitionProvider {
032    
033            public Device detectDevice(HttpServletRequest request) {
034                    if (_log.isWarnEnabled()) {
035                            _log.warn("Device recognition provider is not available");
036                    }
037    
038                    return UnknownDevice.getInstance();
039            }
040    
041            public KnownDevices getKnownDevices() {
042                    if (_log.isWarnEnabled()) {
043                            _log.warn("Device recognition provider is not available");
044                    }
045    
046                    return NoKnownDevices.getInstance();
047            }
048    
049            public void reload() {
050            }
051    
052            private static Log _log = LogFactoryUtil.getLog(
053                    DefaultDeviceRecognitionProvider.class);
054    
055    }