});
MenuItem serviceDiscoveryMenuItem = new MenuItem("Discover Info");
serviceDiscoveryMenuItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getExtensionManager(ServiceDiscoveryManager.class);
try {
Jid jid = new Jid(item.contact.get().getJid().getLocal(), item.contact.get().getJid().getDomain());
InfoNode infoNode = serviceDiscoveryManager.discoverInformation(null);
int i = 0;
} catch (XmppException e) {
e.printStackTrace();
}
}
});
MenuItem vCardItem = new MenuItem("Get VCard");
vCardItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
VCardManager vCardManager = xmppSession.getExtensionManager(VCardManager.class);
try {
Jid jid = new Jid(item.contact.get().getJid().getLocal(), item.contact.get().getJid().getDomain());
VCard vCard = vCardManager.getVCard(jid);
int i = 0;
} catch (XmppException e) {
e.printStackTrace();
}
}
});
MenuItem storeAnnotationsItems = new MenuItem("Store annotations");
storeAnnotationsItems.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
PrivateDataManager privateDataManager = xmppSession.getExtensionManager(PrivateDataManager.class);
try {
List<Annotation.Note> notes = new ArrayList<>();
notes.add(new Annotation.Note("Hallo", item.contact.get().getJid()));
privateDataManager.storeData(new Annotation(notes));
} catch (XmppException e) {
e.printStackTrace();
}
}
});
MenuItem getAnnotationsItems = new MenuItem("Get annotations");
getAnnotationsItems.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
PrivateDataManager privateDataManager = xmppSession.getExtensionManager(PrivateDataManager.class);
try {
Annotation annotations = privateDataManager.getData(Annotation.class);
int i = 0;
} catch (XmppException e) {
e.printStackTrace();
}
}
});
MenuItem pubSubItem = new MenuItem("PubSub");
pubSubItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
PubSubManager pubSubManager = xmppSession.getExtensionManager(PubSubManager.class);
ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getExtensionManager(ServiceDiscoveryManager.class);
try {
ItemNode infoNode = serviceDiscoveryManager.discoverItems(null);
int i = 0;
} catch (XmppException e) {
e.printStackTrace();
}
}