本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
//}
}
示例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);
}
}