001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }