当前位置: 首页>>代码示例>>Java>>正文


Java PrivateDataManager类代码示例

本文整理汇总了Java中org.jivesoftware.smackx.PrivateDataManager的典型用法代码示例。如果您正苦于以下问题:Java PrivateDataManager类的具体用法?Java PrivateDataManager怎么用?Java PrivateDataManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PrivateDataManager类属于org.jivesoftware.smackx包,在下文中一共展示了PrivateDataManager类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSettings

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
/**
 * Returns the specified settings for a Workgroup.
 * @param con the XMPPConnection to use.
 * @param workgroup the name of the workgroup.
 * @param setting the setting to retrieve.
 * @return a map of found settings.  If no settings have been found, it will
 * return null.
 */
public static Map getSettings(XMPPConnection con, String workgroup, String setting) {

    try {
        PrivateDataManager personalPDM = new PrivateDataManager(con, workgroup);

        String namespace = "workgroup:" + workgroup + ":settings:" + setting;
        String elementName = "workgroup_settings";

        PrivateDataManager.addPrivateDataProvider(elementName, namespace, new SettingsDataProvider());
        SettingsPrivateData data = (SettingsPrivateData) personalPDM.getPrivateData(elementName, namespace);
        Map map = data.getMap();
        return map;
    }
    catch (XMPPException e) {
        WebLog.logError("Could not load private data:", e);
    }
    return null;
}
 
开发者ID:igniterealtime,项目名称:Fastpath-webchat,代码行数:27,代码来源:Settings.java

示例2: initializeSession

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
/**
 * Initializes session.
 *
 * @param connection the XMPPConnection used in this session.
 * @param username   the agents username.
 * @param password   the agents password.
 */
public void initializeSession(XMPPConnection connection, String username, String password) {
    this.connection = connection;
    this.username = username;
    this.password = password;
    this.userBareAddress = StringUtils.parseBareAddress(connection.getUser());

    // create workgroup session
    personalDataManager = new PrivateDataManager(getConnection());

    // Discover items
    discoverItems();


    ProviderManager.getInstance().addExtensionProvider("event", "http://jabber.org/protocol/disco#info", new Features.Provider());
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:23,代码来源:SessionManager.java

示例3: getTaskList

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public static Tasks getTaskList(XMPPConnection con) {
    PrivateDataManager manager = new PrivateDataManager(con);

    PrivateDataManager.addPrivateDataProvider("scratchpad", "scratchpad:tasks", new Tasks.Provider());


    Tasks tasks = null;

    try {
        tasks = (Tasks)manager.getPrivateData("scratchpad", "scratchpad:tasks");
    }
    catch (XMPPException e) {
        Log.error(e);
    }

    return tasks;
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:18,代码来源:Tasks.java

示例4: getPrivateNotes

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public static PrivateNotes getPrivateNotes() {
    PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection());

    PrivateDataManager.addPrivateDataProvider("scratchpad", "scratchpad:notes", new PrivateNotes.Provider());

    PrivateNotes notes = null;

    try {
        notes = (PrivateNotes)manager.getPrivateData("scratchpad", "scratchpad:notes");
    }
    catch (XMPPException e) {
        Log.error(e);
    }

    return notes;
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:17,代码来源:PrivateNotes.java

示例5: saveTasks

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public static void saveTasks(Tasks tasks, XMPPConnection con) {
    PrivateDataManager manager = new PrivateDataManager(con);

    PrivateDataManager.addPrivateDataProvider("scratchpad", "scratchpad:tasks", new Tasks.Provider());
    try {
        manager.setPrivateData(tasks);
    }
    catch (XMPPException e) {
        Log.error(e);
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:12,代码来源:Tasks.java

示例6: savePrivateNotes

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public static void savePrivateNotes(PrivateNotes notes) {
    PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection());

    PrivateDataManager.addPrivateDataProvider("scratchpad", "scratchpad:notes", new PrivateNotes.Provider());
    try {
        manager.setPrivateData(notes);
    }
    catch (XMPPException e) {
        Log.error(e);
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:12,代码来源:PrivateNotes.java

示例7: run

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public void run() {
	PrivateDataManager pdm = SparkManager.getSessionManager().getPersonalDataManager();
	gatewayPreferences = null;
	//Re: SPARK-1483 comment the loop as it causes Out Of Memory (infinite loop) if preferences not found
	//If really necessary to try more times, a Thread Pool may be used: java ScheduledThreadPoolExecutor for example            	
    //while (gatewayPreferences == null){
    	try {
            gatewayPreferences = (GatewayPrivateData)pdm.getPrivateData(GatewayPrivateData.ELEMENT, GatewayPrivateData.NAMESPACE);
        }
        catch (XMPPException e) {
            Log.error("Unable to load private data for Gateways", e);
        }
    //}
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:TransportUtils.java

示例8: setAutoJoin

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
public static void setAutoJoin(String serviceName, boolean autoJoin) {
	if (gatewayPreferences != null) {
		gatewayPreferences.addService(serviceName, autoJoin);
		PrivateDataManager pdm = SparkManager.getSessionManager().getPersonalDataManager();
		try {
			pdm.setPrivateData(gatewayPreferences);
		}
		catch (XMPPException e) {
			Log.error(e);
		}
	} else {
		Log.warning("Cannot set privacy data as gatewayPreferences is NULL");
	}
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:TransportUtils.java

示例9: UserSettings

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
private UserSettings() {
    privateDataManager = new PrivateDataManager(SparkManager.getConnection());
    PrivateDataManager.addPrivateDataProvider("personal_settings", "jive:user:settings", new SettingsDataProvider());

    try {
        settingsData = (SettingsData)privateDataManager.getPrivateData("personal_settings", "jive:user:settings");
    }
    catch (XMPPException e) {
        Log.error("Error in User Settings", e);
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:12,代码来源:UserSettings.java

示例10: BookmarkManager

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
/**
 * Default constructor. Registers the data provider with the private data manager in the
 * storage:bookmarks namespace.
 *
 * @param connection the connection for persisting and retrieving bookmarks.
 * @throws XMPPException thrown when the connection is null or has not been authenticated.
 */
private BookmarkManager(Connection connection) throws XMPPException {
    if(connection == null || !connection.isAuthenticated()) {
        throw new XMPPException("Invalid connection.");
    }
    this.privateDataManager = new PrivateDataManager(connection);
}
 
开发者ID:ice-coffee,项目名称:EIM,代码行数:14,代码来源:BookmarkManager.java

示例11: BookmarkManager

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
/**
 * Default constructor. Registers the data provider with the private data
 * manager in the storage:bookmarks namespace.
 * 
 * @param connection
 *            the connection for persisting and retrieving bookmarks.
 * @throws XMPPException
 *             thrown when the connection is null or has not been
 *             authenticated.
 */
private BookmarkManager(Connection connection) throws XMPPException {
	if (connection == null || !connection.isAuthenticated()) {
		throw new XMPPException("Invalid connection.");
	}
	this.privateDataManager = new PrivateDataManager(connection);
}
 
开发者ID:ikantech,项目名称:xmppsupport_v2,代码行数:17,代码来源:BookmarkManager.java

示例12: getPersonalDataManager

import org.jivesoftware.smackx.PrivateDataManager; //导入依赖的package包/类
/**
 * Returns the PrivateDataManager responsible for handling all private data for individual
 * agents.
 *
 * @return the PrivateDataManager responsible for handling all private data for individual
 *         agents.
 */
public PrivateDataManager getPersonalDataManager() {
    return personalDataManager;
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:11,代码来源:SessionManager.java


注:本文中的org.jivesoftware.smackx.PrivateDataManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。