/** * Returns the full conversation transcript of a given session. * * @param sessionID the id of the session to get the full transcript. * @param workgroupJID the JID of the workgroup that will process the request. * @return the full conversation transcript of a given session. * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */ public Transcript getTranscript(EntityBareJid workgroupJID, String sessionID) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { Transcript request = new Transcript(sessionID); request.setTo(workgroupJID); Transcript response = connection.createStanzaCollectorAndSend(request).nextResultOrThrow(); return response; }
/** * Returns the full conversation transcript of a given session. * * @param sessionID the id of the session to get the full transcript. * @param workgroupJID the JID of the workgroup that will process the request. * @return the full conversation transcript of a given session. * @throws XMPPException if an error occurs while getting the information. */ public Transcript getTranscript(String workgroupJID, String sessionID) throws XMPPException { Transcript request = new Transcript(sessionID); request.setTo(workgroupJID); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID())); // Send the request connection.sendPacket(request); Transcript response = (Transcript) 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; }
public class Driver { public void test() { Transcript t = new Transcript (); t.addCourse("CS200", 100); } }
@Override public Transcript parse(XmlPullParser parser, int initialDepth) throws Exception { String sessionID = parser.getAttributeValue("", "sessionID"); List<Stanza> packets = new ArrayList<>(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("message")) { packets.add(PacketParserUtils.parseMessage(parser)); } else if (parser.getName().equals("presence")) { packets.add(PacketParserUtils.parsePresence(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals("transcript")) { done = true; } } } return new Transcript(sessionID, packets); } }
/** * Returns the full conversation transcript of a given session. * * @param sessionID the id of the session to get the full transcript. * @param workgroupJID the JID of the workgroup that will process the request. * @return the full conversation transcript of a given session. * @throws XMPPException if an error occurs while getting the information. */ public Transcript getTranscript(String workgroupJID, String sessionID) throws XMPPException { Transcript request = new Transcript(sessionID); request.setTo(workgroupJID); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID())); // Send the request connection.sendPacket(request); Transcript response = (Transcript) 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; }
public class Driver { public Driver() { Transcript t = new Transcript (); t.addCourse("CS200", 100); } }
public class Driver { Transcript t = new Transcript (); t.addCourse("CS200", 100); }
/** * Returns the full conversation transcript of a given session. * * @param sessionID the id of the session to get the full transcript. * @param workgroupJID the JID of the workgroup that will process the request. * @return the full conversation transcript of a given session. * @throws XMPPException if an error occurs while getting the information. */ public Transcript getTranscript(String workgroupJID, String sessionID) throws XMPPException { Transcript request = new Transcript(sessionID); request.setTo(workgroupJID); PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID())); // Send the request connection.sendPacket(request); Transcript response = (Transcript) 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; }
public class Driver { Transcript t = new Transcript (); public Driver(){ t.addCourse("CS200", 100); } }
public class Driver { Transcript t = new Transcript (); t.addCourse("CS200", 100); }
public class Driver { static Transcript t = new Transcript (); static{ t.addCourse("CS200", 100); } }
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sessionID"); List<Packet> packets = new ArrayList<Packet>(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("message")) { packets.add(PacketParserUtils.parseMessage(parser)); } else if (parser.getName().equals("presence")) { packets.add(PacketParserUtils.parsePresence(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals("transcript")) { done = true; } } } return new Transcript(sessionID, packets); } }
public class Driver { public static void main(String[] args) { Transcript t = new Transcript (); t.addCourse("CS200", 100); } }
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sessionID"); List<Packet> packets = new ArrayList<Packet>(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("message")) { packets.add(PacketParserUtils.parseMessage(parser)); } else if (parser.getName().equals("presence")) { packets.add(PacketParserUtils.parsePresence(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals("transcript")) { done = true; } } } return new Transcript(sessionID, packets); } }
Transcript t = new Transcript(); Course matematik = new Course(1, 2, "Matematik"); t.addCourse(matematik); Course turkce = new Course(1, 4, "Türkçe"); t.addCourse(turkce);
public IQ parseIQ(XmlPullParser parser) throws Exception { String sessionID = parser.getAttributeValue("", "sessionID"); List<Packet> packets = new ArrayList<Packet>(); boolean done = false; while (!done) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { if (parser.getName().equals("message")) { packets.add(PacketParserUtils.parseMessage(parser)); } else if (parser.getName().equals("presence")) { packets.add(PacketParserUtils.parsePresence(parser)); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals("transcript")) { done = true; } } } return new Transcript(sessionID, packets); } }