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            @Override
035            public Device detectDevice(HttpServletRequest request) {
036                    if (_log.isWarnEnabled()) {
037                            _log.warn("Device recognition provider is not available");
038                    }
039    
040                    return UnknownDevice.getInstance();
041            }
042    
043            @Override
044            public KnownDevices getKnownDevices() {
045                    if (_log.isWarnEnabled()) {
046                            _log.warn("Device recognition provider is not available");
047                    }
048    
049                    return NoKnownDevices.getInstance();
050            }
051    
052            @Override
053            public void reload() {
054            }
055    
056            @Override
057            public void setDeviceCapabilityFilter(
058                    DeviceCapabilityFilter deviceCapabilityFilter) {
059            }
060    
061            private static Log _log = LogFactoryUtil.getLog(
062                    DefaultDeviceRecognitionProvider.class);
063    
064    }