@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; }
/** * 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); }
/** * Constructs a new AgentRoster. * * @param connection an XMPP connection. * @throws NotConnectedException * @throws InterruptedException */ AgentRoster(XMPPConnection connection, EntityBareJid workgroupJID) throws NotConnectedException, InterruptedException { this.connection = connection; this.workgroupJID = workgroupJID; // Listen for any roster packets. StanzaFilter rosterFilter = new StanzaTypeFilter(AgentStatusRequest.class); connection.addAsyncStanzaListener(new AgentStatusListener(), rosterFilter); // Listen for any presence packets. connection.addAsyncStanzaListener(new PresencePacketListener(), new StanzaTypeFilter(Presence.class)); // Send request for roster. AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendStanza(request); }
public IQ parseIQ(XmlPullParser parser) throws Exception { AgentStatusRequest statusRequest = new AgentStatusRequest(); if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } 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; }
public IQ parseIQ(XmlPullParser parser) throws Exception { AgentStatusRequest statusRequest = new AgentStatusRequest(); if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } 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; }
public IQ parseIQ(XmlPullParser parser) throws Exception { AgentStatusRequest statusRequest = new AgentStatusRequest(); if (parser.getEventType() != XmlPullParser.START_TAG) { throw new IllegalStateException("Parser not in proper position, or bad XML."); } 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; }
/** * 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. */ public void reload() { AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }
/** * 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. */ public void reload() { AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }
/** * 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. */ public void reload() { AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }
/** * Constructs a new AgentRoster. * * @param connection an XMPP connection. */ AgentRoster(Connection connection, String workgroupJID) { this.connection = connection; this.workgroupJID = workgroupJID; entries = new ArrayList<String>(); listeners = new ArrayList<AgentRosterListener>(); presenceMap = new HashMap<String, Map<String, Presence>>(); // Listen for any roster packets. PacketFilter rosterFilter = new PacketTypeFilter(AgentStatusRequest.class); connection.addPacketListener(new AgentStatusListener(), rosterFilter); // Listen for any presence packets. connection.addPacketListener(new PresencePacketListener(), new PacketTypeFilter(Presence.class)); // Send request for roster. AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }
/** * Constructs a new AgentRoster. * * @param connection an XMPP connection. */ AgentRoster(Connection connection, String workgroupJID) { this.connection = connection; this.workgroupJID = workgroupJID; entries = new ArrayList<String>(); listeners = new ArrayList<AgentRosterListener>(); presenceMap = new HashMap<String, Map<String, Presence>>(); // Listen for any roster packets. PacketFilter rosterFilter = new PacketTypeFilter(AgentStatusRequest.class); connection.addPacketListener(new AgentStatusListener(), rosterFilter); // Listen for any presence packets. connection.addPacketListener(new PresencePacketListener(), new PacketTypeFilter(Presence.class)); // Send request for roster. AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }
/** * Constructs a new AgentRoster. * * @param connection an XMPP connection. */ AgentRoster(Connection connection, String workgroupJID) { this.connection = connection; this.workgroupJID = workgroupJID; entries = new ArrayList<String>(); listeners = new ArrayList<AgentRosterListener>(); presenceMap = new HashMap<String, Map<String, Presence>>(); // Listen for any roster packets. PacketFilter rosterFilter = new PacketTypeFilter(AgentStatusRequest.class); connection.addPacketListener(new AgentStatusListener(), rosterFilter); // Listen for any presence packets. connection.addPacketListener(new PresencePacketListener(), new PacketTypeFilter(Presence.class)); // Send request for roster. AgentStatusRequest request = new AgentStatusRequest(); request.setTo(workgroupJID); connection.sendPacket(request); }