@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { return roomInvitation.getIQChildElementBuilder(xml); } }
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) { return roomTransfer.getIQChildElementBuilder(xml); } }
/** * Creates a depart queue request to the specified workgroup and for the * specified user. * * @param workgroup the workgroup to depart. * @param user the user to make depart from the queue. */ public DepartQueuePacket(EntityBareJid workgroup, EntityJid user) { super("depart-queue", "http://jabber.org/protocol/workgroup"); this.user = user; setTo(workgroup); setType(IQ.Type.set); setFrom(user); }
public boolean hasMonitorPrivileges(XMPPConnection con) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MonitorPacket request = new MonitorPacket(); request.setType(IQ.Type.get); request.setTo(workgroupJID); MonitorPacket response = connection.createStanzaCollectorAndSend(request).nextResultOrThrow(); return response.isMonitor(); }
public void makeRoomOwner(XMPPConnection con, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MonitorPacket request = new MonitorPacket(); request.setType(IQ.Type.set); request.setTo(workgroupJID); request.setSessionID(sessionID); connection.createStanzaCollectorAndSend(request).nextResultOrThrow(); } }
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.append(" jid=\"").append(userID).append("\">"); if (reason != null) { buf.append("<reason>").append(reason).append("</reason>"); } if (sessionID != null) { buf.append(new SessionID(sessionID).toXML(null)); } if (userID != null) { buf.append(new UserID(userID).toXML(null)); } return buf; } }
public static Collection<String> getWorkgroups(Jid serviceJID, Jid agentJID, XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { AgentWorkgroups request = new AgentWorkgroups(agentJID); request.setTo(serviceJID); AgentWorkgroups response = connection.createStanzaCollectorAndSend(request).nextResultOrThrow(); return response.getWorkgroups(); }
/** * Reloads the entire roster from the server. This is an asynchronous operation, * which means the method will return immediately, and the roster will be * reloaded at a later point when the server responds to the reload request. * @throws NotConnectedException * @throws InterruptedException */ public void reload() throws NotConnectedException, InterruptedException { AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendStanza(request); }
@Override public AgentStatusRequest parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException { AgentStatusRequest statusRequest = new AgentStatusRequest(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && "agent".equals(parser.getName())) { statusRequest.agents.add(parseAgent(parser)); } else if (eventType == XmlPullParser.END_TAG && "agent-status-request".equals(parser.getName())) { done = true; } } return statusRequest; }
@Override public OccupantsInfo parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException, SmackException { OccupantsInfo occupantsInfo = new OccupantsInfo(parser.getAttributeValue("", "roomID")); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG && "occupant".equals(parser.getName())) { occupantsInfo.occupants.add(parseOccupantInfo(parser)); } else if (eventType == XmlPullParser.END_TAG && ELEMENT_NAME.equals(parser.getName())) { done = true; } } return occupantsInfo; }
@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; }
@Override public UserID parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException { Jid userID = ParserUtils.getJidAttribute(parser, "id"); // Advance to end of extension. parser.next(); return new UserID(userID); } }
@Override public SessionID parse(XmlPullParser parser, int initialDepth) throws XmlPullParserException, IOException { String sessionID = parser.getAttributeValue("", "id"); // Advance to end of extension. parser.next(); return new SessionID(sessionID); } }
@Override public String toXML(String enclosingNamespace) { StringBuilder buf = new StringBuilder(); buf.append('<').append(ELEMENT_NAME); buf.append(" jid=\"").append(getWorkgroupJID()).append('"'); buf.append(" xmlns=\"").append(NAMESPACE).append("\" />"); return buf.toString(); }
@Override public String toXML(String enclosingNamespace) { StringBuilder buf = new StringBuilder(); buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\" "); buf.append("id=\"").append(this.getUserID()); buf.append("\"/>"); return buf.toString(); }
@Override public String toXML(String enclosingNamespace) { StringBuilder buf = new StringBuilder(); buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\" "); buf.append("id=\"").append(this.getSessionID()); buf.append("\"/>"); return buf.toString(); }
/** * Removes a user from the workgroup queue. This is an administrative action that the * * The agent is not guaranteed of having privileges to perform this action; an exception * denying the request may be thrown. * * @param userID the ID of the user to remove. * @throws XMPPException if an exception occurs. * @throws NotConnectedException * @throws InterruptedException */ public void dequeueUser(EntityJid userID) throws XMPPException, NotConnectedException, InterruptedException { // todo: this method simply won't work right now. DepartQueuePacket departPacket = new DepartQueuePacket(workgroupJID, userID); // PENDING this.connection.sendStanza(departPacket); }
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder buf) { buf.append(" userID=\"") .append(userID) .append("\">"); for (TranscriptSummary transcriptSummary : summaries) { buf.append(transcriptSummary.toXML()); } return buf; }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this)); xml.closeElement(this); return xml; }
@Override public XmlStringBuilder toXML(String enclosingNamespace) { XmlStringBuilder xml = getIQChildElementBuilder(new IQChildElementXmlStringBuilder(this)); xml.closeElement(this); return xml; }