You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommandInvite.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package controller.commands;
  7. import controller.CommandInterface;
  8. import gui.Hauptfenster;
  9. import java.text.ParseException;
  10. import java.util.logging.Level;
  11. import java.util.logging.Logger;
  12. import javax.sdp.SdpException;
  13. import javax.sip.InvalidArgumentException;
  14. import javax.sip.SipException;
  15. import logger.OhmLogger;
  16. import model.SIPmodel;
  17. /**
  18. *
  19. * @author Jan
  20. * Fehlende Ergänzungen(timer nach 10 sec für abbruchbedingung + bedingung falls angenommen wurde -> Boolean)
  21. */
  22. public class CommandInvite implements CommandInterface
  23. {
  24. private static final Logger lginvite = OhmLogger.getLogger();
  25. private SIPmodel model;
  26. private Hauptfenster view;
  27. public CommandInvite(SIPmodel model, Hauptfenster view)
  28. {
  29. this.model = model;
  30. this.view = view;
  31. }
  32. @Override
  33. public void execute()
  34. {
  35. try
  36. {
  37. view.getTxtArea().append("Einladung an " + view.getTxtcallIP().getText() + " gesendet\n");
  38. model.sendInvitation(view.getTxtcallIP().getText(),view.getTxtServerIP().getText(), 5078);
  39. }
  40. catch (ParseException|InvalidArgumentException|SdpException|SipException ex)
  41. {
  42. view.getTxtArea().append("Einladung fehlgeschlagen\n");
  43. lginvite.getLogger(CommandInvite.class.getName()).log(Level.SEVERE, null, ex);
  44. }
  45. }
  46. @Override
  47. public void undo()
  48. {
  49. }
  50. @Override
  51. public Boolean isundoable()
  52. {
  53. return false;
  54. }
  55. }