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.kernel.mobile.device;
016    
017    import java.util.Collections;
018    import java.util.HashSet;
019    import java.util.Map;
020    import java.util.Set;
021    
022    /**
023     * Class represents unknown device
024     *
025     * @author Milen Dyankov
026     * @author Michael C. Han
027     */
028    public class NoKnownDevices implements KnownDevices {
029    
030            public static NoKnownDevices getInstance() {
031                    return _instance;
032            }
033    
034            public Set<VersionableName> getBrands() {
035                    return _brands;
036            }
037    
038            public Set<VersionableName> getBrowsers() {
039                    return _browsers;
040            }
041    
042            public Map<Capability, Set<String>> getDeviceIds() {
043                    return Collections.emptyMap();
044            }
045    
046            public Set<VersionableName> getOperatingSystems() {
047                    return _operatingSystems;
048            }
049    
050            public Set<String> getPointingMethods() {
051                    return _pointingMethods;
052            }
053    
054            public void reload() {
055            }
056    
057            private NoKnownDevices() {
058                    _brands.add(VersionableName.UNKNOWN);
059    
060                    _brands = Collections.unmodifiableSet(_brands);
061    
062                    _browsers.add(VersionableName.UNKNOWN);
063    
064                    _browsers = Collections.unmodifiableSet(_browsers);
065    
066                    _operatingSystems.add(VersionableName.UNKNOWN);
067    
068                    _operatingSystems = Collections.unmodifiableSet(_operatingSystems);
069    
070                    _pointingMethods.add(VersionableName.UNKNOWN.getName());
071    
072                    _pointingMethods = Collections.unmodifiableSet(_pointingMethods);
073            }
074    
075            private static NoKnownDevices _instance = new NoKnownDevices();
076    
077            private Set<VersionableName> _brands = new HashSet<VersionableName>();
078            private Set<VersionableName> _browsers = new HashSet<VersionableName>();
079            private Set<VersionableName> _operatingSystems =
080                    new HashSet<VersionableName>();
081            private Set<String> _pointingMethods = new HashSet<String>();
082    
083    }