1 /* 2 * $Header: /cvshome/build/org.osgi.service.prefs/src/org/osgi/service/prefs/PreferencesService.java,v 1.10 2006/06/16 16:31:30 hargrave Exp $ 3 * 4 * Copyright (c) OSGi Alliance (2001, 2006). All Rights Reserved. 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 package org.osgi.service.prefs; 19 20 /** 21 * The Preferences Service. 22 * 23 * <p> 24 * Each bundle using this service has its own set of preference trees: one for 25 * system preferences, and one for each user. 26 * 27 * <p> 28 * A <code>PreferencesService</code> object is specific to the bundle which 29 * obtained it from the service registry. If a bundle wishes to allow another 30 * bundle to access its preferences, it should pass its 31 * <code>PreferencesService</code> object to that bundle. 32 * 33 */ 34 public interface PreferencesService { 35 /** 36 * Returns the root system node for the calling bundle. 37 * 38 * @return The root system node for the calling bundle. 39 */ 40 public Preferences getSystemPreferences(); 41 42 /** 43 * Returns the root node for the specified user and the calling bundle. 44 * 45 * @param name The user for which to return the preference root node. 46 * @return The root node for the specified user and the calling bundle. 47 */ 48 public Preferences getUserPreferences(String name); 49 50 /** 51 * Returns the names of users for which node trees exist. 52 * 53 * @return The names of users for which node trees exist. 54 */ 55 public String[] getUsers(); 56 } 57