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.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            @Override
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            @Override
043            public KnownDevices getKnownDevices() {
044                    if (_log.isWarnEnabled()) {
045                            _log.warn("Device recognition provider is not available");
046                    }
047    
048                    return NoKnownDevices.getInstance();
049            }
050    
051            @Override
052            public void reload() {
053            }
054    
055            private static Log _log = LogFactoryUtil.getLog(
056                    DefaultDeviceRecognitionProvider.class);
057    
058    }