001    /**
002     * Copyright (c) 2000-2013 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.DeviceCapabilityFilter;
021    import com.liferay.portal.kernel.mobile.device.DeviceRecognitionProvider;
022    import com.liferay.portal.kernel.mobile.device.KnownDevices;
023    import com.liferay.portal.kernel.mobile.device.NoKnownDevices;
024    import com.liferay.portal.kernel.mobile.device.UnknownDevice;
025    
026    import javax.servlet.http.HttpServletRequest;
027    
028    /**
029     * @author Milen Dyankov
030     */
031    public class DefaultDeviceRecognitionProvider
032            implements DeviceRecognitionProvider {
033    
034            public Device detectDevice(HttpServletRequest request) {
035                    if (_log.isWarnEnabled()) {
036                            _log.warn("Device recognition provider is not available");
037                    }
038    
039                    return UnknownDevice.getInstance();
040            }
041    
042            public KnownDevices getKnownDevices() {
043                    if (_log.isWarnEnabled()) {
044                            _log.warn("Device recognition provider is not available");
045                    }
046    
047                    return NoKnownDevices.getInstance();
048            }
049    
050            public void reload() {
051            }
052    
053            public void setDeviceCapabilityFilter(
054                    DeviceCapabilityFilter deviceCapabilityFilter) {
055            }
056    
057            private static Log _log = LogFactoryUtil.getLog(
058                    DefaultDeviceRecognitionProvider.class);
059    
060    }