@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.rightAngleBracket(); if (jid != null) { buf.append("<jid>").append(getJid()).append("</jid>"); } if (name != null) { buf.append("<name>").append(getName()).append("</name>"); } return buf; }
/** * Return the agents name. * * @return - the agents name. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public String getName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.get); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); AgentInfo response = connection.createStanzaCollectorAndSend(agentInfo).nextResultOrThrow(); return response.getName(); }
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">"); if (jid != null) { buf.append("<jid>").append(getJid()).append("</jid>"); } if (name != null) { buf.append("<name>").append(getName()).append("</name>"); } buf.append("</").append(ELEMENT_NAME).append("> "); return buf.toString(); }
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">"); if (jid != null) { buf.append("<jid>").append(getJid()).append("</jid>"); } if (name != null) { buf.append("<name>").append(getName()).append("</name>"); } buf.append("</").append(ELEMENT_NAME).append("> "); return buf.toString(); }
public String getChildElementXML() { StringBuilder buf = new StringBuilder(); buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">"); if (jid != null) { buf.append("<jid>").append(getJid()).append("</jid>"); } if (name != null) { buf.append("<name>").append(getName()).append("</name>"); } buf.append("</").append(ELEMENT_NAME).append("> "); return buf.toString(); }
/** * Return the agents name. * * @return - the agents name. */ public String getName() throws XMPPException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.GET); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID())); // Send the request connection.sendPacket(agentInfo); AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { throw new XMPPException(response.getError()); } return response.getName(); }
/** * Return the agents name. * * @return - the agents name. */ public String getName() throws XMPPException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.GET); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID())); // Send the request connection.sendPacket(agentInfo); AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { throw new XMPPException(response.getError()); } return response.getName(); }
/** * Return the agents name. * * @return - the agents name. */ public String getName() throws XMPPException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.GET); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(agentInfo.getPacketID())); // Send the request connection.sendPacket(agentInfo); AgentInfo response = (AgentInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); // Cancel the collector. collector.cancel(); if (response == null) { throw new XMPPException("No response from server on status set."); } if (response.getError() != null) { throw new XMPPException(response.getError()); } return response.getName(); }