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.4KB

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.VoIP;
  17. /**
  18. *
  19. * @author Normal
  20. */
  21. public class CommandInvite implements CommandInterface
  22. {
  23. private static final Logger lginvite = OhmLogger.getLogger();
  24. private VoIP model;
  25. private Hauptfenster view;
  26. public CommandInvite(VoIP model, Hauptfenster view)
  27. {
  28. this.model = model;
  29. this.view = view;
  30. }
  31. @Override
  32. public void execute()
  33. {
  34. try
  35. { view.getTxtArea().append("Einladung an " + view.getTxtServerIP().getText() + " gesendet\n");
  36. model.sendInvitation(view.getTxtcallIP().getText(), 5078);
  37. }
  38. catch (ParseException|InvalidArgumentException|SdpException|SipException ex)
  39. {
  40. view.getTxtArea().append("Einladung fehlgeschlagen");
  41. lginvite.getLogger(CommandInvite.class.getName()).log(Level.SEVERE, null, ex);
  42. }
  43. }
  44. @Override
  45. public void undo()
  46. {
  47. }
  48. @Override
  49. public Boolean isundoable()
  50. {
  51. return false;
  52. }
  53. }