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


Java PrivateDataManager.getPrivateData方法代码示例

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


在下文中一共展示了PrivateDataManager.getPrivateData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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


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