Anexo A: Implementación pasarela SMS/SIP

Size: px
Start display at page:

Download "Anexo A: Implementación pasarela SMS/SIP"

Transcription

1 Anexo A: Implementación pasarela SMS/SIP SMStoSIP.java Anexo A: Implementación pasarela SMS/SIP SMStoSIP.java package com.ericsson; import java.io.file; import java.io.fileinputstream; import java.util.properties; import javax.servlet.sip.sipapplicationsession; import javax.servlet.sip.sipfactory; import javax.servlet.sip.sipservletrequest; public class SMStoSIP extends Thread { Config file_config = new Config("/par.txt"); SipFactory sipf; SMStoSIP(SipFactory sipfact) { sipf = sipfact; public void run() { Properties propiedades; String SMS = "/sms.txt"; / Carga del fichero de propiedades / try { // while (true) { File file = new File(SMS); FileInputStream f = new FileInputStream(file); propiedades = new Properties(); propiedades.load(f); f.close(); // file.delete(); String from = String.valueOf(propiedades.getProperty("From")); String m = String.valueOf(propiedades.getProperty("m")); String s = String.valueOf(propiedades.getProperty("s")); if (!(m.equals("null"))) send_method(from, m, false); else if (!(s.equals("null"))) send_method(from, s, true); // / Buscamos algunos valores / catch (Exception e) { / Manejo de excepciones / public void send_method(string from, String cadena, boolean subs) { try { SipServletRequest messagerequest; SipApplicationSession sipas = sipf.createapplicationsession(); // set the message content if (subs) { messagerequest = sipf.createrequest(sipas, "SUBSCRIBE", "sip:" + from + "@ericsson.com", file_config.service_sip); messagerequest.addheader("expires", "3600"); messagerequest.addheader("event", cadena); else { messagerequest = sipf.createrequest(sipas, "MESSAGE", "sip:" + from + "@ericsson.com", file_config.service_sip); messagerequest.setcontent(cadena, "text/plain"); messagerequest.pushroute(sipf.createsipuri(null, file_config.direccion)); messagerequest.addheader("accept-contact", file_config.ac); messagerequest.addheader("user-agent", file_config.ua); // add p-asserted-identity header for CSCF messagerequest.addheader("p-asserted-identity", 104

2 Anexo A: Implementación pasarela SMS/SIP SIPtoSMS.java file_config.service_sip); // send the request messagerequest.send(); catch (Exception e) { SIPtoSMS.java / / package com.ericsson; import javax.servlet.sip.sipservlet; import javax.servlet.sip.sipfactory; import java.io.ioexception; import javax.servlet.sip.sipservletrequest; import javax.servlet.servletexception; import javax.servlet.servletcontext; import javax.servlet.servletconfig; import java.io.; import java.util.; public class SIPtoSMS extends SipServlet { / The SIP Factory. Can be used to create URI and requests. / private SipFactory sipfactory; / public void init(servletconfig config) throws ServletException { super.init(config); ServletContext context = config.getservletcontext(); sipfactory = (SipFactory) context.getattribute("javax.servlet.sip.sipfactory"); SMStoSIP ss = new SMStoSIP(sipFactory); ss.start(); / protected void domessage(sipservletrequest arg0) throws ServletException, IOException { // TODO: Implement this method arg0.createresponse(200).send(); Date dater = new Date(); String file_name = arg0.getfrom().tostring().substring(5, arg0.getfrom().tostring().indexof('@')); File file = new File("/" + file_name + ".txt"); if (file.createnewfile()) { FileOutputStream fo = new FileOutputStream(file); fo.write("from: ".getbytes()); fo.write(arg0.getfrom().tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("from_smsc: ".getbytes()); fo.write(" ".getbytes()); fo.write("\r\n".getbytes()); Date dates = new Date(); fo.write("sent: ".getbytes()); fo.write(dates.tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("received: ".getbytes()); fo.write(dater.tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("subject: ".getbytes()); fo.write("grupo".getbytes()); fo.write("\r\n".getbytes()); fo.write("alphabet: ".getbytes()); fo.write("iso".getbytes()); fo.write("\r\n".getbytes()); fo.write("udh: ".getbytes()); 105

3 Anexo A: Implementación pasarela SMS/SIP Config.java fo.write("false".getbytes()); fo.write("\r\n".getbytes()); fo.write("\r\n".getbytes()); fo.write("m ".getbytes()); fo.write(arg0.getrawcontent()); fo.close(); / protected void donotify(sipservletrequest arg0) throws ServletException, IOException { // TODO: Implement this method Date dater = new Date(); String file_name = arg0.getto().tostring(); File file = new File(file_name); if (file.createnewfile()) { FileOutputStream fo = new FileOutputStream(file); fo.write("from: ".getbytes()); fo.write(arg0.getfrom().tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("from_smsc: ".getbytes()); fo.write(" ".getbytes()); fo.write("\r\n".getbytes()); Date dates = new Date(); fo.write("sent: ".getbytes()); fo.write(dates.tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("received: ".getbytes()); fo.write(dater.tostring().getbytes()); fo.write("\r\n".getbytes()); fo.write("subject: ".getbytes()); fo.write("grupo".getbytes()); fo.write("\r\n".getbytes()); fo.write("alphabet: ".getbytes()); fo.write("iso".getbytes()); fo.write("\r\n".getbytes()); fo.write("udh: ".getbytes()); fo.write("false".getbytes()); fo.write("\r\n".getbytes()); fo.write("\r\n".getbytes()); fo.write("n ".getbytes()); fo.write(arg0.getrawcontent()); fo.close(); Config.java package com.ericsson; import java.util.properties; import java.io.fileinputstream; / This class read a configuration file and store these Alejandro y Tony. / public class Config { String direccion; // direccion IP y puerto del CSCF String service_sip; // uri del servidor de aplicaciones String ua; // cabecera user agent String ac; // cabecera accept contanct Config(String file) { String FICHERO_CONFIGURACION = file; Properties propiedades; / Carga del fichero de propiedades / try { FileInputStream f = new FileInputStream(FICHERO_CONFIGURACION); 106

4 Anexo A: Implementación pasarela SMS/SIP Config.java propiedades = new Properties(); propiedades.load(f); f.close(); / Imprimimos los pares clave = valor / // propiedades.list(system.out); / Buscamos algunos valores / direccion = String.valueOf(propiedades.getProperty("direccion")); service_sip = String.valueOf(propiedades.getProperty("service_sip")); ua = String.valueOf(propiedades.getProperty("user_agent")); ac = String.valueOf(propiedades.getProperty("accept_contact")); catch (Exception e) { / Manejo de excepciones / 107

5 PLClient.java Anexo B: Implementación del cliente PLClient.java package com.ericsson; import com.ericsson.icp.icpfactory; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This is the main class of the client. Its function is listening to incoming SIP methods. Depending on the incoming method call the apropiate class of the service It's used by all client classes to send the apropiate SIP method to the platform It's used by all client classes to obtain the service app It's used to open the application window. It's an 'Aplicacion' Alejandro y Tony / public class PLClient { private static IService service; private static IPlatform platform; static String cadena; static boolean f = true; private static Aplicacion app; private static Union add; public static void main(string args[]) { int last_loc = 5; try { platform = ICPFactory.createPlatform(Constants.cliente); platform.addlistener(new PlatformAdapter()); service = platform.createservice(constants.gcliente, Constants.cliente, null); app = new Aplicacion(platform, service); add = new Union(platform, service); service.addlistener(new ServiceAdapter() { boolean creado = false; / It handles incoming SIP MESSAGES. It identifies the MESSAGE type among the six possible types and acts correctly. / public void processmessage(string remote, String messagetype, byte[] content, int length) { String message = new String(content); System.out.println("Message: " + message); String addr = (message.substring(message.indexof('<'), message.indexof('>') + 1)); // Peticion para GC de union de usuario fuera banda if (message.charat(0) == 'n') { new FueraB(platform, service, addr); // Has sido invitado a unirte (candidato) else if (message.charat(0) == 'i') { new Invitacion(platform, service, addr, app); // IM difusion (GC y candidatos) else if (message.charat(0) == 's') { System.out.println("IM: " + message); String msg = (message.substring( message.indexof('>') + 2, message.length() - 1)); app.txt.append("\n" + msg); 108

6 PLClient.java // union fuera banda admitida else if (message.charat(0) == 'a') { app.grupo = addr; System.out.println(addr); app.nick = message.substring(2, message.indexof('<') - 1); // nick miembro app.settitle(app.gettitle() + " " + app.grupo); app.run(); // se abre la aplicacion // union fuera banda rechazada else if (message.charat(0) == 'r') { new Aviso(Constants.nounion, true); // mensaje de error que sera mostrado por pantalla else if (message.charat(0) == 'e') { String aviso = message.substring( message.indexof('>') + 2, message.length()); new Aviso(aviso, false); // Método empleado para solicitar un listado de grupos // de provisión cerrada activos. else if (message.charat(0) == 'g') { String grupospc = message.substring(message.indexof('>') + 2, message.length()); int k = 0; if (message.substring(message.indexof('<') + 1, message.indexof('>')).equals("0")) new Aviso(grupospc, false); else { for (int i = 0; i < grupospc.length(); i++) if (grupospc.charat(i) == ',') { add.lista.add(grupospc.substring(k, i)); k = i + 1; / It handles incoming SIP NOTIFY. It identifies the NOTIFY type among the six possible types and acts correctly. / public void processsubscribenotification(string remote, String event, String messagetype, byte[] content, int legth) { String message = new String(content); System.out.println("Notify: " + message); // notificacion al GC de que el grupo ha sido creado if (message.charat(0) == 'c') { // notificacion al GC de que // el grupo ha sido creado if (!creado) { app.nick = "0"; // nick del GC // sip del grupo app.grupo = message.substring(2, message.length()); app.settitle(app.gettitle() + " " + app.grupo); app.add_expulsar(); app.run(); creado = true; // notificacion al cliente de que el grupo ha sido // eliminado por el creador else if (message.charat(0) == 'f') { if (f) { app.dispose(); new Aviso(Constants.grupoeliminadoGC, true); // se le notifica al cliente que ha sido expulsado del // grupo por el GC else if (message.charat(0) == 'e') { app.dispose(); new Aviso(Constants.expulsadoGC, true); // se le comunica su nick al cliente else if (message.charat(0) == 'n') { app.nick = message.substring(2, message.length()); app.run(); // el usuario se ha salido de la zona de cobertura else if (message.charat(0) == 'l') { app.dispose(); f = false; new Aviso(Constants.fueracobert, true); 109

7 Activacion.java // si llega un numero quiere decir el numero de // ususarios que hay actualmente en el grupo, asi que se // refresca el numero de usuarios en la aplicacion else { app.refresh_users(message, true); public void processpublishresult(boolean astatus, String aremote, String aevent) { System.out.println("Resultado del Publish: " + astatus + aremote + aevent); ); new Principal(platform, service, app, add); // wait/notify mechanism could be used as well while (true) { Thread.sleep(2000); // periodicamente actualizar localizacion y notificar a servidor // cuando cambie if (last_loc!= app.actual_loc) { last_loc = app.actual_loc; String location = (new Integer(app.actual_loc)).toString(); String comandol = "l/" + location + "/" + app.grupo + "/" + app.nick; / service.publish(platform.getidentity(), "sip:a@ericsson.com", "grupo", "text/plain", comandol.getbytes(), comandol.getbytes().length, 3600); / service.sendmessage(platform.getidentity(), Constants.sipas, Constants.content_tp, comandol.getbytes(), comandol.getbytes().length); ; catch (Exception e) { e.printstacktrace(); System.out.println(e); Activacion.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class shows the 'union' window and offers the posibility to join a group. The user need to know the uri of an existing group for join Tony / public class Activacion extends Frame { TextArea txt = new TextArea("", 1, 8, 3); Button activar = new Button(Constants.activar); Button cancel = new Button(Constants.cancelar); IPlatform miplatf; IService miserv; public Activacion(IPlatform platf, IService serv) { Label grupo = new Label(Constants.inserturig); grupo.setforeground(color.blue); Font font = Constants.font9; 110

8 Activacion.java Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { txt.setcolumns(12); txt.setrows(1); font = Constants.font12; grupo.setfont(font); txt.setfont(font); Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); miplatf = platf; miserv = serv; settitle(constants.title_act); activar.setactioncommand("click"); activar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { if (txt.gettext()!= null) { ); // se concatena la uri completa del grupo y se envia // el mensaje adecuado al servidor String comando = "e/" + txt.gettext().trim() + "/"; miserv.subscribe(miplatf.getidentity(), Constants.sipas, comando, null, 3600, null); // dispose(); catch (Exception excep) { System.out.println(excep); ; cancel.setactioncommand("click"); cancel.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) // si se pulsa cancel se cierra la ventana y se vuelve a la // pantalla inicial dispose(); ); p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(grupo); p2.add(txt); p3.add(activar); p3.add(cancel); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { 111

9 Aplicacion.java public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); Aplicacion.java package com.ericsson; import java.awt.; import java.awt.event.; import java.text.attributedstring; import java.text.attributedcharacteriterator; import java.util.map; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class shows the main service window. It's composed by 2 text areas and 2 buttons. One text area shows the incoming instant messages and the other one is used to send instant messages to the server using the 'enviar' Alejandro y Tony / public class Aplicacion extends Frame { TextArea txt = new TextArea(7, 20); TextArea msg = new TextArea("", 1, 25, 3); Button enviar = new Button(Constants.enviar); Button salir = new Button(Constants.x); Button loc = new Button(Constants.l); Button expulsar = new Button(Constants.expulsar); Button invitar = new Button(Constants.invitar); IPlatform miplatf; IService miserv; Integer users = new Integer(1); Label numusers = new Label("1"); Label logas = new Label(Constants.nick); String grupo; String nick; Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p22 = new Panel(); Panel p3 = new Panel(); List listusers = new List(5); boolean addlist = false; int actual_loc = 5; public Aplicacion(IPlatform platf, IService serv) { miplatf = platf; 112

10 Aplicacion.java miserv = serv; // boton que solo aparece en la aplicacion del GC. Se usa para expulsar a un // miembro public void add_expulsar() { expulsar.setactioncommand("click"); expulsar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { String user = listusers.getselecteditem(); if (listusers.getselectedindex()!= 0) { String usuario = user.substring(4, user.length()); // se envia la solicitud de expulsion miserv.sendmessage(miplatf.getidentity(), Constants.sipas, Constants.content_tp, ("e/" + grupo + "/" + usuario).getbytes(), ("e/" + grupo + "/" + usuario).length()); txt.append(constants.info1 + listusers.getselecteditem() + "..."); msg.settext(""); else new Aviso(Constants.noexpulsarte, false); catch (Exception ex) { ; ); invitar.setactioncommand("click"); invitar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { new Invitar(miplatf, miserv, grupo, txt); catch (Exception ex) { ; ); // p1.add(expulsar); // p22.add(expulsar); // p1.add(invitar); addlist = true; // p2.add(listusers); // parte de la ventana de aplicacion comun a clientes normales y GC public void run() { Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { txt.setcolumns(60); txt.setrows(15); msg.setcolumns(49); msg.setrows(1); font = Constants.font12; txt.setfont(font); msg.setfont(font); loc.setfont(font); listusers.setfont(font); enviar.setfont(font); salir.setfont(font); expulsar.setfont(font); invitar.setfont(font); numusers.settext(users.tostring()); numusers.setfont(font); 113

11 Aplicacion.java numusers.setforeground(color.red); Label info = new Label(Constants.users); info.setfont(font); Label lnick = new Label("user" + nick); lnick.setfont(font); lnick.setforeground(color.blue); logas.setfont(font); txt.seteditable(false); txt.setbackground(color.white); msg.settext(""); settitle(grupo.substring(grupo.indexof(':') + 1, grupo.indexof('>'))); // boton enviar. Para difusion de mensajeria instantanea enviar.setactioncommand("click"); enviar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { if (msg.gettext()!= "") { // si hay algo se envia String cadena = "s/" + grupo + "/user" + nick + ": " + msg.gettext().tostring() + "/"; System.out.println(cadena); miserv.sendmessage(miplatf.getidentity(), Constants.sipas, Constants.content_tp, cadena.getbytes(), cadena.length()); ); // se muestra en pantalla el nick del usuario String yo = "user" + nick; txt.append("\n" + yo + ": " + msg.gettext()); msg.settext(""); catch (Exception excep) { System.out.println(excep); ; // boton salir. Se abandona el grupo. Si lo pulsa el GC se da de baja al // grupo salir.setactioncommand("click"); salir.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { // se envia el mensaje de baja al servidor miserv.sendmessage(miplatf.getidentity(), Constants.sipas, Constants.content_tp, ("b/" + grupo).getbytes(), ("b/" + grupo).length()); System.exit(0); // se cierra la aplicacion catch (Exception ex) { ; ); loc.setactioncommand("click"); loc.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { actual_loc = actual_loc + 1; catch (Exception ex) { ; ); p1.setlayout(new FlowLayout(FlowLayout.LEFT)); p1.add(logas); p1.add(lnick); p1.add(info); p1.add(numusers); p1.add(salir); p1.add(loc); 114

12 Aplicacion.java GridBagLayout gbl = new GridBagLayout(); p2.setlayout(gbl); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 1; gbc.gridheight = 3; p2.add(txt, gbc); gbc.gridx = 1; gbc.gridy = 0; gbc.gridheight = 1; gbc.gridwidth = 1; listusers.add("user0"); if (addlist) { p2.add(invitar); gbc.gridy = 1; p2.add(listusers, gbc); gbc.gridy = 2; p2.add(expulsar, gbc); p3.setlayout(new FlowLayout(FlowLayout.LEFT)); p3.add(msg); p3.add(enviar); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); // metodo que se encarga de refrescar el numero de usuarios en la ventana de // aplicacion y de informar de las altas y las bajas. public void refresh_users(string texto, boolean show) { Integer numero = new Integer(texto.substring(0, texto.indexof('/'))); String message; String newuser = texto.substring(texto.indexof('/') + 2, texto.length()); Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { font = Constants.font12; if (texto.charat(texto.indexof('/') + 1) == '+') { message = Constants.info2 + newuser + Constants.info3; if (addlist) listusers.add(newuser); else { message = Constants.info2 + newuser + Constants.info4; if (addlist) listusers.remove(newuser); 115

13 Aviso.java numusers.settext(numero.tostring()); txt.setfont(font); if (show) txt.append(message); Aviso.java package com.ericsson; import java.awt.; import java.awt.event.; import java.awt.event.actionlistener; / This class is used to shows messages for users, like a pop-up mitipo Boolean value that represents if the application will be closed when the user click on 'aceptar' Alejandro y Tony / public class Aviso extends Frame { Button ok = new Button(Constants.aceptar); boolean salir; public Aviso(String txt, boolean exit) { Panel p1 = new Panel(); Panel p2 = new Panel(); Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { font = Constants.font12; Label aviso = new Label(txt); aviso.setfont(font); salir = exit; settitle(constants.title_aviso); ok.setactioncommand("click"); ok.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) ); // si el segundo parametro es true se cierra la aplicacion if (salir) System.exit(0); else dispose(); p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(aviso); p2.add(ok); add("north", p1); add("center", p2); addwindowlistener(new WindowListener() { 116

14 Constant.java public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); Constant.java package com.ericsson; import java.awt.; / This class has all the constants that are used on the client, so that if anybody wants to translate the client he only has to change this Alejandro y Tony / public class Constants { // messages to be shown public static final String nounion = "Union no aceptada"; public static final String grupoeliminadogc = "Grupo eliminado por el creador"; public static final String expulsadogc = "Ha sido expulsado por el creador"; public static final String fueracobert = "Se ha salido zona de cobertura"; public static final String noexpulsarte = "No te puedes expulsar a ti mismo"; public static final String info1 = "\ninfo: Expulsando a: "; public static final String info2 = "\ninfo: "; public static final String info3 = " se unio\n"; public static final String info4 = " se fue\n"; public static final String info5 = "\ninfo: Invitando a: "; // text in labels public static final String inserturig = "Introduzca la URI del grupo"; public static final String inserturii = "Introduzca uri invitado"; public static final String ackunion = " Confirmar uniones?"; public static final String insertcand = "Introduzca candidatos"; public static final String telefonos = "Inserte telefonos "; public static final String invitadoa = "Invitado a: "; public static final String deseaunion = " Desea unirse?"; public static final String permitir = " Permitir union de "; 117

15 Constant.java public static final String wellcome = "Bienvenido a Party Line v1.0"; public static final String wellcome2 = " Qué desea hacer?"; public static final String pgpc = "Pulse GruposPC"; public static final String nick = "Nick:"; public static final String users = "Users:"; public static final String si = "Sí"; public static final String no = "No"; // text in buttons public static final String activar = "Activar"; public static final String cancelar = "Cancelar"; public static final String enviar = "Enviar"; public static final String x = "X"; public static final String l = "L"; public static final String expulsar = "Expulsar"; public static final String invitar = "Invitar"; public static final String aceptar = "Aceptar"; public static final String crear = "Crear"; public static final String creacion = "Creacion"; public static final String union = "Union"; public static final String pc = "Activacion PC"; public static final String unir = "Unir"; public static final String grupos = "Grupos PC"; // titles text public static final String title_act = "PLv1.0 Activacion"; public static final String title_aviso = "PLv1.0 Aviso"; public static final String title_crea = "PLv1.0 Creacion"; public static final String title_fb = "PLv1.0 Usuario Fuera de Banda"; public static final String title_inv = "PLv1.0 Invitación"; public static final String title_miembro = "PLv1.0 Invitar a miembro"; // graphics options public static final Font font9 = new Font("Arial", Font.CENTER_BASELINE, 9); public static final Font font12 = new Font("Arial", Font.CENTER_BASELINE, 12); // service configuration public static final String sipas = "sip:a@ericsson.com"; public static final String content_tp = "text/plain"; public static final String dominio = "@ericsson.com"; public static final String dominiog = "@servicio.com"; public static final String cliente = "PLClient"; public static final String gcliente = "+g.plclient.ericsson.com"; 118

16 Creacion.java Creacion.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / Tihs class shows a window to set up a group. To do this it shows a text area where the user has to write the candidate members of the group and a checkbox where the user can choose if he want to be asked for new user Alejandro y Tony / public class Creacion extends Frame { Checkbox ack = new Checkbox(Constants.si, true); TextArea sip = new TextArea("", 1, 20, 3); TextArea tel = new TextArea("", 1, 20, 3); Button crear = new Button(Constants.crear); Button cancel = new Button(Constants.cancelar); IPlatform miplatf; IService miserv; public Creacion(IPlatform platf, IService serv) { Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { sip.setcolumns(30); sip.setrows(3); tel.setcolumns(30); tel.setrows(3); font = Constants.font12; ack.setfont(font); sip.setfont(font); tel.setfont(font); crear.setfont(font); cancel.setfont(font); Label confirmado = new Label(Constants.ackunion); confirmado.setfont(font); Label info = new Label(Constants.insertcand); info.setfont(font); Label info2 = new Label(Constants.telefonos); info2.setfont(font); Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); miplatf = platf; miserv = serv; settitle(constants.title_crea); crear.setactioncommand("click"); crear.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { String comando; boolean vacio = true; String miembros = ""; if (ack.getstate() == true) comando = "c/y/";// si el grupo es confirmado else 119

17 Creacion.java ); comando = "c/n/";// si el grupo es no confirmado // si hay candidatos se comprueba el formato en // trata_cadena // if (txt.gettext()!= null) { if (!(sip.gettext().trim().equals(""))) { miembros = trata_cadena(sip.gettext().trim()); vacio = false; if (!(tel.gettext().trim().equals(""))) { if (vacio) miembros = trata_cadena_tel(tel.gettext().trim()); else miembros = miembros + trata_cadena_tel(tel.gettext().trim()); vacio = false; if (!vacio) { comando = comando + miembros; miserv.subscribe(miplatf.getidentity(), Constants.sipas, comando, null, 3600, null); // si la lista de candidatos esta vacia se crea un // grupo sin candidatos else miserv.subscribe(miplatf.getidentity(), Constants.sipas, comando, null, 3600, null); dispose(); catch (Exception excep) { System.out.println(excep); ; cancel.setactioncommand("click"); cancel.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) dispose(); ); p1.setlayout(new GridLayout(3, 2)); p2.setlayout(new GridLayout(2, 1)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(confirmado); p1.add(ack); p1.add(info); p1.add(new Label("")); p1.add(sip); p2.add(info2); p2.add(tel); p3.add(crear); p3.add(cancel); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { 120

18 FueraB.java ); pack(); show(); // recoge la lista de candidatos separadas por comas y le añade los // caracteres necesarios para formar la sip correcta public String trata_cadena(string texto) { // comand contiene las sip correctas de los candidatos miembros // separadas por '/' String comand = ""; int k = 0; texto = texto + ","; for (int i = 0; i < texto.length(); i++) { if (texto.charat(i) == ',') if (texto.charat(i - 1) == ',') k++; else { comand = comand + "sip:" + texto.substring(k, i).trim() + Constants.dominio + "/"; k = i + 1; return (comand); public String trata_cadena_tel(string texto) { // comand contiene las sip correctas de los candidatos miembros // separadas por '/' String comand = ""; int k = 0; texto = texto + ","; for (int i = 0; i < texto.length(); i++) { if (texto.charat(i) == ',') if (texto.charat(i - 1) == ',') k++; else { comand = comand + "sip:+" + texto.substring(k, i).trim() + Constants.dominio + "/"; k = i + 1; return (comand); FueraB.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class is used to ask for an out of band adding to the Tony / public class FueraB extends Frame { Button si = new Button(Constants.si); Button no = new Button(Constants.no); IPlatform miplatf; IService miserv; String user; public FueraB(IPlatform platf, IService serv, String usuario) { 121

19 FueraB.java Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { font = Constants.font12; Label peticion = new Label(usuario + "?"); peticion.setfont(font); Label permiso = new Label(Constants.permitir); permiso.setfont(font); Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); miplatf = platf; miserv = serv; user = usuario; settitle(constants.title_fb); si.setactioncommand("click"); si.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { ); try { // si se acepta la union del candidato fuera de banda se // envia el mensaje de aceptacion al servidor String orden = "u/" + user + "/y/"; newuser(miserv, miplatf, orden); dispose(); catch (Exception excep) { System.out.println(excep); ; no.setactioncommand("click"); no.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { ); try { // union no aceptada por el GC String orden = "u/" + user + "/n/"; newuser(miserv, miplatf, orden); dispose(); catch (Exception excep) { System.out.println(excep); ; p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(permiso); p2.add(peticion); p3.add(si); p3.add(no); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); 122

20 Invitacion.java public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); // envia el MESSAGE al servidor public static void newuser(iservice servicio, IPlatform platf, String cadena) { try { servicio.sendmessage(platf.getidentity(), Constants.sipas, Constants.content_tp, cadena.getbytes(), cadena.length()); catch (Exception e) { Invitacion.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class shows a window to the candidates asking them if they want to be added to a Tony / public class Invitacion extends Frame { Button si = new Button(Constants.si); Button no = new Button(Constants.no); IPlatform miplatf; IService miserv; String group; Aplicacion miapp; public Invitacion(IPlatform platf, IService serv, String grupo, Aplicacion app) { Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { font = Constants.font12; Label invitado = new Label(Constants.invitadoa + grupo); invitado.setfont(font); Label peticion = new Label(Constants.deseaunion); peticion.setfont(font); Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); miplatf = platf; miserv = serv; group = grupo; // grupo al que hemos sido invitado miapp = app; 123

21 Invitacion.java settitle(constants.title_inv); si.setactioncommand("click"); si.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { ); try { // si el candidato se quiere unir String orden = "u/" + group + "/"; joingroup(miserv, miplatf, orden); miapp.grupo = group; dispose(); catch (Exception excep) { System.out.println(excep); ; no.setactioncommand("click"); no.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { ); try { // si el candidato no se quiere unir no se envia nada dispose(); catch (Exception excep) { System.out.println(excep); ; p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(invitado); p2.add(peticion); p3.add(si); p3.add(no); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); // se crea el SUBSCRIBE correspondiente para unirnos al grupo public static void joingroup(iservice servicio, IPlatform platf, String cadena) { try { servicio.subscribe(platf.getidentity(), Constants.sipas, cadena, null, 3600, null); 124

22 Invitar.java catch (Exception e) { Invitar.java package com.ericsson; import java.awt.button; import java.awt.flowlayout; import java.awt.panel; import java.awt.textarea; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.awt.event.windowevent; import java.awt.event.windowlistener; import java.awt.frame; import java.awt.label; import java.awt.event.; import java.awt.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; public class Invitar extends Frame { TextArea msg = new TextArea("", 1, 30, 3); Button invitar = new Button(Constants.invitar); Button cancelar = new Button(Constants.cancelar); IPlatform miplatf; IService miserv; Aplicacion miapp; TextArea mitxt; String migrupo; Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); Label linvit = new Label(Constants.inserturii); public Invitar(IPlatform platf, IService serv, String grupo, TextArea txt) { miplatf = platf; miserv = serv; mitxt = txt; migrupo = grupo; invitar.setactioncommand("click"); invitar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { String user = msg.gettext(); // comprobacion de formato valido ); // se envia la solicitud de expulsion miserv.sendmessage(miplatf.getidentity(), Constants.sipas, Constants.content_tp, ("i/" + migrupo + "/sip:" + user + Constants.dominio + "/").getbytes(), ("i/" + migrupo + "/sip:" + user + Constants.dominio + "/").length()); mitxt.append(constants.info5 + msg.gettext() + "..."); msg.settext(""); dispose(); catch (Exception ex) { ; 125

23 PlatformAdapter.java cancelar.setactioncommand("click"); cancelar.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) dispose(); ); settitle(constants.title_miembro); p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(linvit); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.add(msg); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p3.add(invitar); p3.add(cancelar); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); PlatformAdapter.java / Copyright (c) Ericsson All Rights Reserved. Reproduction in whole or in part is prohibited without the written consent of the copyright owner. ERICSSON MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. ERICSSON SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. / package com.ericsson; import com.ericsson.icp.iplatformlistener; import com.ericsson.icp.iplatform.state; import com.ericsson.icp.util.errorreason; public class PlatformAdapter implements IPlatformListener { public void processapplicationdata(string aapplication, byte[] adata, int alength) { 126

24 Principal.java public void processevent(string aevent, String asource, ErrorReason areasoncode) { public void processicpstatechanged(state astate) { public void processerror(errorreason aerror) { Principal.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class shows the main windows with two options: Create a gruop or join an existing Tony / public class Principal extends Frame { Button creacion = new Button(Constants.creacion); Button union = new Button(Constants.union); Button pc = new Button(Constants.pc); Button salir = new Button(Constants.x); String cadena; IPlatform miplatf; IService miserv; Aplicacion miapp; Union miadd; public Principal(IPlatform platf, IService servicio, Aplicacion app, Union add) { miplatf = platf; miserv = servicio; miapp = app; miadd = add; Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { font = Constants.font12; Label wellcome = new Label(Constants.wellcome); wellcome.setfont(font); wellcome.setforeground(color.blue); Label wellcome2 = new Label(Constants.wellcome2); wellcome2.setfont(font); wellcome2.setforeground(color.red); Panel p1 = new Panel(); Panel p2 = new Panel(); Panel p3 = new Panel(); settitle("plv1.0"); creacion.setactioncommand("click"); creacion.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { 127

25 Principal.java ); // se llama a la clase de creacion del grupo new Creacion(miplatf, miserv); union.setactioncommand("click"); union.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { // se llama a la clase de union a un grupo miadd.run(); ); pc.setactioncommand("click"); pc.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { // se llama a la clase de creacion del grupo new Activacion(miplatf, miserv); ); salir.setactioncommand("click"); salir.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { System.exit(0); ); p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.CENTER)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); p1.add(wellcome); p1.add(salir); p2.add(wellcome2); p3.add(creacion); p3.add(union); p3.add(pc); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { System.exit(0); public void windowdeactivated(windowevent e) { public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); 128

26 ServiceAdapter.java ServiceAdapter.java / Copyright (c) Ericsson All Rights Reserved. Reproduction in whole or in part is prohibited without the written consent of the copyright owner. ERICSSON MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. ERICSSON SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. / package com.ericsson; import com.ericsson.icp.iservicelistener; import com.ericsson.icp.isession; import com.ericsson.icp.util.errorreason; public class ServiceAdapter implements IServiceListener { public void processincomingsession(isession asession) { public void processsendmessageresult(boolean astatus) { public void processmessage(string aremote, String amsgtype, byte[] amessage, int alength) { public void processsubscriberesult(boolean astatus, String aremote, String aevent) { public void processunsubscriberesult(boolean astatus, String aremote, String aevent) { public void processsubscribenotification(string aremote, String aevent, String atype, byte[] acontent, int alength) { public void processpublishresult(boolean astatus, String aremote, String aevent) { public void processreferresult(boolean astatus, String areferid) { public void processreferended(string areferid) { public void processsubscribeended(string apreferedcontact, String aremote, String aevent) { public void processrefernotification(string areferid, int astate) { public void processrefer(string areferid, String aremote, String athirdparty, String acontenttype, byte[] acontent, int alength) { public void processrefernotifyresult(boolean status, String areferid) { public void processsendoptionsresult(boolean astatus, String apreferedcontact, String aremote, String atype, byte[] acontent, int alength) { public void processoptions(string apreferedcontact, String aremote, String atype, 129

27 Union.java byte[] acontent, int alength) { public void processerror(errorreason aerror) { Union.java package com.ericsson; import java.awt.; import java.awt.event.; import com.ericsson.icp.iplatform; import com.ericsson.icp.iservice; / This class shows the 'union' window and offers the posibility to join a group. The user need to know the uri of an existing group for join Tony / public class Union extends Frame { TextArea txt = new TextArea("", 1, 15, 3); Button unir = new Button(Constants.unir); Button cancel = new Button(Constants.cancelar); Button grupos = new Button(Constants.grupos); Panel p22 = new Panel(); Panel p2 = new Panel(); Panel p1 = new Panel(); Panel p3 = new Panel(); Panel p21 = new Panel(); List lista = new List(3); Label grupo = new Label(Constants.inserturig); IPlatform miplatf; IService miserv; public Union(IPlatform platf, IService serv) { miplatf = platf; miserv = serv; public void run() { Font font = Constants.font9; Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); if (screensize.width >= 640) { txt.setcolumns(5); txt.setrows(1); font = Constants.font12; grupo.setfont(font); txt.setfont(font); lista.setfont(font); settitle("plv1.0 Union"); unir.setactioncommand("click"); unir.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) { try { if (txt.gettext()!= null) { 130

28 Union.java ); // se concatena la uri completa del grupo y se envia // el mensaje adecuado al servidor String comando = "u/sip:" + txt.gettext().trim() + Constants.dominiog + "/"; miserv.subscribe(miplatf.getidentity(), Constants.sipas, comando, null, 3600, null); dispose(); catch (Exception excep) { System.out.println(excep); ; cancel.setactioncommand("click"); cancel.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) // si se pulsa cancel se cierra la ventana y se vuelve a la // pantalla inicial lista.removeall(); dispose(); ); grupos.setactioncommand("click"); grupos.addactionlistener(new ActionListener() { if (Comando.compareTo("CLICK") == 0) try { // p22.add(lista); lista.removeall(); miserv.sendmessage(miplatf.getidentity(), Constants.sipas, Constants.content_tp, "g/<null>/".getbytes(), "g/<null>/".length()); catch (Exception excep) { ; ); p1.setlayout(new FlowLayout(FlowLayout.CENTER)); p2.setlayout(new FlowLayout(FlowLayout.LEFT)); p21.setlayout(new FlowLayout(FlowLayout.CENTER)); p22.setlayout(new FlowLayout(FlowLayout.RIGHT)); p3.setlayout(new FlowLayout(FlowLayout.CENTER)); lista.additemlistener(new ListaAL(lista, txt)); lista.setmultiplemode(false); lista.add(constants.pgpc); p1.add(grupo); p21.add(txt); p22.add(lista); p2.add(p21); p2.add(p22); p3.add(unir); p3.add(grupos); p3.add(cancel); add("north", p1); add("center", p2); add("south", p3); addwindowlistener(new WindowListener() { public void windowactivated(windowevent e) { public void windowclosed(windowevent e) { public void windowclosing(windowevent e) { dispose(); public void windowdeactivated(windowevent e) { 131

29 Union.java public void windowdeiconified(windowevent e) { public void windowiconified(windowevent e) { public void windowopened(windowevent e) { ); pack(); show(); class ListaAL implements ItemListener { List milista; TextArea ta; ListaAL(List lista, TextArea texto) { milista = lista; ta = texto; public void itemstatechanged(itemevent evt) { if (milista.getselecteditem()!= null) { if (!(milista.getselecteditem().equals(constants.pgpc))) ta.append(milista.getselecteditem()); 132

30 Anexo C: Script xml de pruebas PLTest.xml Anexo C: Script xml de pruebas PLTest.xml <?xml version="1.0" encoding="iso "?> <!DOCTYPE ATF-SCRIPT (View Source for full doctype...)> ATF-SCRIPT> ser-agents> ser-agent name="alice"> <public-id> </public-id> </user-agent> ser-agent name="alex"> <public-id> </public-id> </user-agent> ser-agent name="tony"> <public-id> </public-id> </user-agent> ser-agent name="pol"> <public-id> </public-id> </user-agent> </user-agents> asks> ask name="registro Alex, Tony y Pol" description="registro de Alex, Tony y Pol"> equest method="register" uri="sip:ericsson.com" protocol="sip" message-context=""> end user-agent="tony"> equest method="register" uri="sip:ericsson.com" protocol="sip" message-context=""> eceive user-agent="tony"> end user-agent="pol"> equest method="register" uri="sip:ericsson.com" protocol="sip" message-context=""> eceive user-agent="pol"> ask name="registro Alice" description="registro del UA Alice"> end user-agent="alice"> equest method="register" uri="sip:ericsson.com" protocol="sip" message-context=""> eceive user-agent="alice"> ask name="alice GC, Alex y Tony candidatos" description="alice crea el grupo invitando a Alex y Tony"> end user-agent="alice"> equest method="subscribe" uri="sip:a@ericsson.com" protocol="sip" message-context=""> eader name="route"> <![CDATA[<sip:orig@ :5081;lr>]]> eader name="event"> <![CDATA[c/y/sip:alex@ericsson.com/sip:tony@ericsson.com/]]> eader name="expires"> <![CDATA[3600]]> 133

31 Anexo C: Script xml de pruebas PLTest.xml eceive user-agent="alice"> eceive user-agent="alice"> end user-agent="alice"> ask name="alex y Tony invitados y aceptan (servidor)" description="alex y Tony aceptan invitación y notificaciones"> equest method="message" uri="" protocol="sip" message-context=""> eceive user-agent="tony"> equest method="message" uri="" protocol="sip" message-context=""> end user-agent="tony"> equest method="subscribe" uri="sip:a@ericsson.com" protocol="sip" message-context=""> eader name="route"> <![CDATA[<sip:orig@ :5081;lr>]]> eader name="event"> <![CDATA[u/sip:g0@servicio.com/]]> eader name="expires"> <![CDATA[3600]]> eceive user-agent="alice"> end user-agent="alice"> end user-agent="tony"> equest method="subscribe" uri="sip:a@ericsson.com" protocol="sip" message-context=""> eader name="route"> <![CDATA[<sip:orig@ :5081;lr>]]> eader name="event"> <![CDATA[u/sip:g0@servicio.com/]]> eader name="expires"> <![CDATA[3600]]> eceive user-agent="tony"> eceive user-agent="tony"> end user-agent="tony"> eceive user-agent="alice"> end user-agent="alice"> 134

32 Anexo C: Script xml de pruebas PLTest.xml ask name="alex y Tony invitados y aceptan (Cliente GC)" description="alex y Tony aceptan invitación y notificaciones"> equest method="message" uri="" protocol="sip" message-context=""> eceive user-agent="tony"> equest method="message" uri="" protocol="sip" message-context=""> end user-agent="tony"> equest method="subscribe" uri="sip:a@ericsson.com" protocol="sip" message-context=""> eader name="route"> <![CDATA[<sip:orig@ :5081;lr>]]> eader name="event"> <![CDATA[u/sip:g0@servicio.com/]]> eader name="expires"> <![CDATA[3600]]> end user-agent="tony"> equest method="subscribe" uri="sip:a@ericsson.com" protocol="sip" message-context=""> eader name="route"> <![CDATA[<sip:orig@ :5081;lr>]]> eader name="event"> <![CDATA[u/sip:g0@servicio.com/]]> eader name="expires"> <![CDATA[3600]]> eceive user-agent="tony"> eceive user-agent="tony"> end user-agent="tony"> 135

FORMAS DE IMPLEMENTAR LOS OYENTES. A).- El oyente en una clase independiente con el constructor con un argumento y usando el método getactioncommand.

FORMAS DE IMPLEMENTAR LOS OYENTES. A).- El oyente en una clase independiente con el constructor con un argumento y usando el método getactioncommand. FORMAS DE IMPLEMENTAR LOS OYENTES A).- El oyente en una clase independiente con el constructor con un argumento y usando el método getactioncommand. public class VentanaOyente extends Frame{ private Oyente

More information

Graphical Interfaces

Graphical Interfaces Weeks 11&12 Graphical Interfaces All the programs that you have created until now used a simple command line interface, which is not user friendly, so a Graphical User Interface (GUI) should be used. The

More information

1 of :32:42

1 of :32:42 1 2 package oop4_dat4_u; 3 4 /** 5 * 6 * @author Felix Rohrer 7 */ 8 public class Main { 9 10 /** 11 * @param args the command line arguments 12 */ 13 public static void main(string[]

More information

Interacción con GUIs

Interacción con GUIs Interacción con GUIs Delegation Event Model Fuente EVENTO Oyente suscripción Fuente Oyente suscripción EVENTO Adaptador EVENTO java.lang.object java.util.eventobject java.awt.awtevent java.awt.event. ActionEvent

More information

Graphical Interfaces

Graphical Interfaces Weeks 9&11 Graphical Interfaces All the programs that you have created until now used a simple command line interface, which is not user friendly, so a Graphical User Interface (GUI) should be used. The

More information

Java - Applications. The following code sets up an application with a drop down menu, as yet the menu does not do anything.

Java - Applications. The following code sets up an application with a drop down menu, as yet the menu does not do anything. Java - Applications C&G Criteria: 5.3.2, 5.5.2, 5.5.3 Java applets require a web browser to run independently of the Java IDE. The Dos based console applications will run outside the IDE but have no access

More information

Code zum Betreuten Programmieren vom , Blatt 10 Serialisierung und GUI

Code zum Betreuten Programmieren vom , Blatt 10 Serialisierung und GUI SS 2011 Fakultät für Angewandte Informatik Lehrprofessur für Informatik 06.07.2011 Prof. Dr. Robert Lorenz Code zum Betreuten Programmieren vom 06.07.2011, Blatt 10 Serialisierung und GUI 1 Die Klasse

More information

Apéndice A. Código fuente de aplicación desarrollada para probar. implementación de IPv6

Apéndice A. Código fuente de aplicación desarrollada para probar. implementación de IPv6 Apéndice A Código fuente de aplicación desarrollada para probar implementación de IPv6 import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.*; import java.net.*; import java.util.enumeration;

More information

Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing

Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing Java Graphical User Interfaces AWT (Abstract Window Toolkit) & Swing Rui Moreira Some useful links: http://java.sun.com/docs/books/tutorial/uiswing/toc.html http://www.unix.org.ua/orelly/java-ent/jfc/

More information

Documentation for Scanner Tool

Documentation for Scanner Tool Documentation for Scanner Tool Table of Contents Page 2 of 38 Table of Contents Table of Contents Scanner Tool License Scanner tool 2.x compatibility Scanner tool 1.x compatibility Download Requirements

More information

Functors - Objects That Act Like Functions

Functors - Objects That Act Like Functions Steven Zeil October 25, 2013 Contents 1 Functors in Java 2 1.1 Functors............. 2 1.2 Immediate Classes....... 6 2 Functors and GUIs 8 2.1 Java Event Listeners....... 10 3 Functors in C++ 22 3.1 operator()............

More information

Anexos. Diseño y construcción de un puente grúa automatizado de precisión

Anexos. Diseño y construcción de un puente grúa automatizado de precisión Anexos Diseño y construcción de un puente grúa automatizado de precisión Nombre: Daniel Andrade García Especialidad: Ingeniería Electrónica Industrial y Automática Tutor: Inmaculada Martínez Teixidor Cotutor:

More information

Arrays, Exception Handling, Interfaces, Introduction To Swing

Arrays, Exception Handling, Interfaces, Introduction To Swing Arrays, Exception Handling, Interfaces, Introduction To Swing Arrays: Definition An array is an ordered collection of items; an item in an array is called an element of the array. By item we mean a primitive,

More information

File: SimpleB2BUAProxyServlet.java

File: SimpleB2BUAProxyServlet.java 1 package no.ubisafe.sipproxy; 2 3 import javax.annotation.resource; 4 import java.io.bufferedinputstream; 5 import java.io.ioexception; 6 import java.io.inputstream; 7 import java.net.inetaddress; 8 import

More information

Service Development Studio (SDS) 4.1 Tutorial

Service Development Studio (SDS) 4.1 Tutorial Service Development Studio (SDS) 4.1 Tutorial Copyright Copyright Ericsson AB 2009. All rights reserved. Disclaimer No part of this document may be reproduced in any form without the written permission

More information

Example 3-1. Password Validation

Example 3-1. Password Validation Java Swing Controls 3-33 Example 3-1 Password Validation Start a new empty project in JCreator. Name the project PasswordProject. Add a blank Java file named Password. The idea of this project is to ask

More information

University of Cape Town ~ Department of Computer Science. Computer Science 1016S / 1011H ~ November Exam

University of Cape Town ~ Department of Computer Science. Computer Science 1016S / 1011H ~ November Exam Name: Please fill in your Student Number and Name. Student Number : Student Number: University of Cape Town ~ Department of Computer Science Computer Science 1016S / 1011H ~ 2009 November Exam Question

More information

Tema 5. Ejemplo de Lista Genérica

Tema 5. Ejemplo de Lista Genérica Tema 5. Ejemplo de Lista Genérica File: prlista/lista.java package prlista; import java.util.arrays; import java.util.stringjoiner; import java.util.nosuchelementexception; public class Lista { private

More information

Chapter 1 GUI Applications

Chapter 1 GUI Applications Chapter 1 GUI Applications 1. GUI Applications So far we've seen GUI programs only in the context of Applets. But we can have GUI applications too. A GUI application will not have any of the security limitations

More information

Propedéutico de Programación

Propedéutico de Programación Propedéutico de Programación Coordinación de Ciencias Computacionales Semana 4, Segunda Parte Dra. Pilar Gómez Gil Versión 1. 24.06.08 http://ccc.inaoep.mx/~pgomez/cursos/programacion/ Chapter 3 ADT Unsorted

More information

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User

Control Flow: Overview CSE3461. An Example of Sequential Control. Control Flow: Revisited. Control Flow Paradigms: Reacting to the User CSE3461 Control Flow Paradigms: Reacting to the User Control Flow: Overview Definition of control flow: The sequence of execution of instructions in a program. Control flow is determined at run time by

More information

PRÁCTICO 1: MODELOS ESTÁTICOS INGENIERÍA INVERSA DIAGRAMAS DE CLASES

PRÁCTICO 1: MODELOS ESTÁTICOS INGENIERÍA INVERSA DIAGRAMAS DE CLASES PRÁCTICO 1: MODELOS ESTÁTICOS INGENIERÍA INVERSA DIAGRAMAS DE CLASES Una parte importante dentro del proceso de re-ingeniería de un sistema es la ingeniería inversa del mismo, es decir, la obtención de

More information

Program 20: //Design an Applet program to handle Mouse Events. import java.awt.*; import java.applet.*; import java.awt.event.*;

Program 20: //Design an Applet program to handle Mouse Events. import java.awt.*; import java.applet.*; import java.awt.event.*; Program 20: //Design an Applet program to handle Mouse Events. import java.awt.*; import java.applet.*; import java.awt.event.*; /* */ public

More information

OBJECT ORIENTED PROGRAMMING. Java GUI part 1 Loredana STANCIU Room B616

OBJECT ORIENTED PROGRAMMING. Java GUI part 1 Loredana STANCIU Room B616 OBJECT ORIENTED PROGRAMMING Java GUI part 1 Loredana STANCIU loredana.stanciu@upt.ro Room B616 What is a user interface That part of a program that interacts with the user of the program: simple command-line

More information

2018/2/5 话费券企业客户接入文档 语雀

2018/2/5 话费券企业客户接入文档 语雀 1 2 2 1 2 1 1 138999999999 2 1 2 https:lark.alipay.com/kaidi.hwf/hsz6gg/ppesyh#2.4-%e4%bc%81%e4%b8%9a%e5%ae%a2%e6%88%b7%e6%8e%a5%e6%94%b6%e5%85%85%e5 1/8 2 1 3 static IAcsClient client = null; public static

More information

BM214E Object Oriented Programming Lecture 13

BM214E Object Oriented Programming Lecture 13 BM214E Object Oriented Programming Lecture 13 Events To understand how events work in Java, we have to look closely at how we use GUIs. When you interact with a GUI, there are many events taking place

More information

Create Extensions App inventor 2 Build Extensions App Inventor, easy tutorial - Juan Antonio Villalpando

Create Extensions App inventor 2 Build Extensions App Inventor, easy tutorial - Juan Antonio Villalpando 1 von 11 09.01.2019, 10:12 Inicio FOROS Elastix - VoIP B4A (Basic4Android) App inventor 2 PHP - MySQL Estación meteorológica B4J (Basic4Java) ADB Shell - Android Arduino AutoIt (Programación) Visual Basic

More information

sessionx Desarrollo de Aplicaciones en Red EL (2) EL (1) Implicit objects in EL Literals José Rafael Rojano Cáceres

sessionx Desarrollo de Aplicaciones en Red EL (2) EL (1) Implicit objects in EL Literals José Rafael Rojano Cáceres sessionx Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano EL Expression Language Write the code in something else, just let EL call it. EL () EL stand for Expression

More information

Programming Languages and Techniques (CIS120e)

Programming Languages and Techniques (CIS120e) Programming Languages and Techniques (CIS120e) Lecture 29 Nov. 19, 2010 Swing I Event- driven programming Passive: ApplicaHon waits for an event to happen in the environment When an event occurs, the applicahon

More information

An Introduction To Graphical User Interfaces

An Introduction To Graphical User Interfaces An Introduction To Graphical User Interfaces The event-driven model Building simple graphical interfaces in Java Components They are all types of graphical controls and displays available: Button, Canvas,

More information

PROGRAMACIÓN ORIENTADA A OBJETOS

PROGRAMACIÓN ORIENTADA A OBJETOS PROGRAMACIÓN ORIENTADA A OBJETOS TEMA8: Excepciones y Entrada/Salida Manel Guerrero Tipos de Excepciones Checked Exception: The classes that extend Throwable class except RuntimeException and Error are

More information

ECOPETROL BARRANCABERJEJA. INTERFACES AL SERVIDOR PI:

ECOPETROL BARRANCABERJEJA. INTERFACES AL SERVIDOR PI: ECOPETROL BARRANCABERJEJA. INTERFACES AL SERVIDOR PI: Este documento fue creado para apoyar la instalación de la(s) estación(es) que contiene(n) la(s) interface(s) al sistema PI de ECOPETROL-Barrancabermeja.

More information

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os

EDITRAN/XAdES. Installation Manual. XAdES Signing and verification. z/os EDITRAN/XAdES XAdES Signing and verification z/os Installation Manual INDRA April 2018 EDITRAN/XAdES z/os. Installation Manual CONTENTS 1. INTRODUCTION... 1-1 2. INSTALLATION AND REQUIREMENTS... 2-1 2.1.

More information

CSE 8B Intro to CS: Java

CSE 8B Intro to CS: Java CSE 8B Intro to CS: Java Winter, 2006 February 23 (Day 14) Menus Swing Event Handling Inner classes Instructor: Neil Rhodes JMenuBar container for menus Menus associated with a JFrame via JFrame.setMenuBar

More information

Autor: Mary Luz Roa SUPPORT GUIDE FOURTH TERM

Autor: Mary Luz Roa SUPPORT GUIDE FOURTH TERM Autor: Mary Luz Roa SUPPORT GUIDE FOURTH TERM 2017 UNIDAD TEMATICA: PROGRAMACION PARA NIÑOS Logro: Identifica las herramientas básicas del programa Alice en la creación de animaciones en 3D, utilizando

More information

กล ม API ท ใช. Programming Graphical User Interface (GUI) Containers and Components 22/05/60

กล ม API ท ใช. Programming Graphical User Interface (GUI) Containers and Components 22/05/60 กล ม API ท ใช Programming Graphical User Interface (GUI) AWT (Abstract Windowing Toolkit) และ Swing. AWT ม ต งต งแต JDK 1.0. ส วนมากจะเล กใช และแทนท โดยr Swing components. Swing API ปร บปร งความสามารถเพ

More information

Lecture 7. File Processing

Lecture 7. File Processing Lecture 7 File Processing 1 Data (i.e., numbers and strings) stored in variables, arrays, and objects are temporary. They are lost when the program terminates. To permanently store the data created in

More information

Propedéutico de Programación

Propedéutico de Programación Propedéutico de Programación Coordinación de Ciencias Computacionales 5/13 Material preparado por: Dra. Pilar Gómez Gil Chapter 15 Pointers, Dynamic Data, and Reference Types Dale/Weems Recall that in

More information

DM6. User Guide English ( 3 10 ) Guía del usuario Español ( ) Appendix English ( 13 ) DRUM MODULE

DM6. User Guide English ( 3 10 ) Guía del usuario Español ( ) Appendix English ( 13 ) DRUM MODULE DM6 DRUM MODULE User Guide English ( 3 10 ) Guía del usuario Español ( 11 12 ) Appendix English ( 13 ) 2 User Guide (English) Support For the latest information about this product (system requirements,

More information

Detail Json Parse Error - No Json Object Could Be Decoded

Detail Json Parse Error - No Json Object Could Be Decoded Detail Json Parse Error - No Json Object Could Be Decoded message: "JSON parse error - No JSON object could be decoded" type: "error" request_id: chrome.google.com/webstore/detail/advanced-rest-client/.

More information

OCTOBEAM. LED Lighting Effect USER MANUAL / MANUAL DE USUARIO

OCTOBEAM. LED Lighting Effect USER MANUAL / MANUAL DE USUARIO LED Lighting Effect USER MANUAL / MANUAL DE USUARIO PLEASE READ THE INSTRUCTIONS CAREFULLY BEFORE USE / POR FAVOR LEA LAS INSTRUCCIÓNES ANTES DE USAR 1. Overview OctoBeam White is a LED Lighting Bar with

More information

JSP. Common patterns

JSP. Common patterns JSP Common patterns Common JSP patterns Page-centric (client-server) CLIENT JSP or Servlet CLIENT Enterprise JavaBeans SERVER DB Common JSP patterns Page-centric 1 (client-server) Page View request response

More information

dit UPM Tema 3: Concurrencia /clásicos /java Análisis y diseño de software José A. Mañas

dit UPM Tema 3: Concurrencia /clásicos /java Análisis y diseño de software José A. Mañas Análisis y diseño de software dit UPM Tema 3: Concurrencia /clásicos /java José A. Mañas 11.2.2017 método 1. identifique el estado campos privados del monitor 2. identifique métodos de test and set métodos

More information

Example Programs. COSC 3461 User Interfaces. GUI Program Organization. Outline. DemoHelloWorld.java DemoHelloWorld2.java DemoSwing.

Example Programs. COSC 3461 User Interfaces. GUI Program Organization. Outline. DemoHelloWorld.java DemoHelloWorld2.java DemoSwing. COSC User Interfaces Module 3 Sequential vs. Event-driven Programming Example Programs DemoLargestConsole.java DemoLargestGUI.java Demo programs will be available on the course web page. GUI Program Organization

More information

Principles, Models, and Applications for Distributed Systems M

Principles, Models, and Applications for Distributed Systems M Università degli Studi di Bologna Facoltà di Ingegneria Principles, Models, and Applications for Distributed Systems M Exercitation 3 Connected Java Sockets Jacopo De Benedetto Distributed architecture

More information

SNMP traps (simple network management protocol)

SNMP traps (simple network management protocol) SNMP traps (simple network management protocol) Nasser M. Abbasi Nov 25, 2000 page compiled on June 29, 2015 at 3:16am Contents 1 Processing on SNMP messages 2 2 Parsing an SNMP v1 UDP pkt 3 3 Program

More information

GUI Program Organization. Sequential vs. Event-driven Programming. Sequential Programming. Outline

GUI Program Organization. Sequential vs. Event-driven Programming. Sequential Programming. Outline Sequential vs. Event-driven Programming Reacting to the user GUI Program Organization Let s digress briefly to examine the organization of our GUI programs We ll do this in stages, by examining three example

More information

EDITRAN/EA. User and installation manual. Statistics and monitorization. Windows/Unix INDRA 17/03/17

EDITRAN/EA. User and installation manual. Statistics and monitorization. Windows/Unix INDRA 17/03/17 EDITRAN/EA Statistics and monitorization Windows/Unix User and installation manual INDRA 17/03/17 INDEX 1. INTRODUCTION... 1-1 2. EDITRAN/E MANAGEMENT (UNIX)... 2-1 2.1. STATISTICS AND MONITORIZATION...

More information

A sample print out is: is is -11 key entered was: w

A sample print out is: is is -11 key entered was: w Lab 9 Lesson 9-2: Exercise 1, 2 and 3: Note: when you run this you may need to maximize the window. The modified buttonhandler is: private static class ButtonListener implements ActionListener public void

More information

Surix Security Phone Amplificado: User, installation and programming Guide

Surix Security Phone Amplificado: User, installation and programming Guide Surix Security Phone Amplificado: User, installation and programming Guide Made in Argentina Security Phone - Amplificado Introduction General Description Operatoria Installation Connection and configuration

More information

One Port Router. Installation Guide. It s about Quality of life

One Port Router. Installation Guide. It s about Quality of life One Port Router Installation Guide It s about Quality of life 2 This guide details the start up process for your internet connection. You will be able to enjoy the service in an easy, simple, and quick

More information

/* Copyright 2012 Robert C. Ilardi

/* Copyright 2012 Robert C. Ilardi / Copyright 2012 Robert C. Ilardi Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

More information

AGENT MANUAL 2018, PALOSANTO SOLUTIONS

AGENT MANUAL 2018, PALOSANTO SOLUTIONS AGENT MANUAL 2018, PALOSANTO SOLUTIONS todos los derechos reservados. Esta documentación es confidencial y su propiedad intelectual pertenece a PaloSanto Solutions, cualquier uso no autorizado, reproducción,

More information

11/7/12. Discussion of Roulette Assignment. Objectives. Compiler s Names of Classes. GUI Review. Window Events

11/7/12. Discussion of Roulette Assignment. Objectives. Compiler s Names of Classes. GUI Review. Window Events Objectives Event Handling Animation Discussion of Roulette Assignment How easy/difficult to refactor for extensibility? Was it easier to add to your refactored code? Ø What would your refactored classes

More information

Oracle Communications Converged Application Server

Oracle Communications Converged Application Server Oracle Communications Converged Application Server Technical Product Description Release 4.0 August 2008 Server Technical Product Description, Release 4.0 Copyright 2007, 2008, Oracle and/or its affiliates.

More information

INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO

INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO INSTITUTO POLITÉCNICO NACIONAL ESCUELA SUPERIOR DE CÓMPUTO Cryptography Practice 1,2,3 By: Raúl Emmanuel Delgado Díaz de León Professor: M. en C. NIDIA ASUNCIÓN CORTEZ DUARTE February2015 Index Contenido

More information

MainWindow.java. Page 1

MainWindow.java. Page 1 / This project is a demo showing a sound card selector and tester. The UI would look nice and work better, but I've decided that's outside the scope of this demo. Code from this demo will eventually be

More information

Aprovechando el valor de la Tecnología Flash. Fernando Ochoa, Senior System Engineer, EMC

Aprovechando el valor de la Tecnología Flash. Fernando Ochoa, Senior System Engineer, EMC Aprovechando el valor de la Tecnología Flash Fernando Ochoa, Senior System Engineer, EMC 1 CONSTANT Rendimiento = Sigue la Ley de Moore? LEY DE MOORE: 100X POR DÉCADA 100X IMPROVED FLASH 10,000X I M P

More information

CSEN401 Computer Programming Lab. Topics: Graphical User Interface Window Interfaces using Swing

CSEN401 Computer Programming Lab. Topics: Graphical User Interface Window Interfaces using Swing CSEN401 Computer Programming Lab Topics: Graphical User Interface Window Interfaces using Swing Prof. Dr. Slim Abdennadher 22.3.2015 c S. Abdennadher 1 Swing c S. Abdennadher 2 AWT versus Swing Two basic

More information

Prof. Edwar Saliba Júnior

Prof. Edwar Saliba Júnior 1 package Conexao; 2 3 4 * 5 * @author Cynthia Lopes 6 * @author Edwar Saliba Júnior 7 8 import java.io.filenotfoundexception; 9 import java.io.ioexception; 10 import java.sql.sqlexception; 11 import java.sql.statement;

More information

文字エンコーディングフィルタ 1. 更新履歴 2003/07/07 新規作成(第 0.1 版) 版 数 第 0.1 版 ページ番号 1

文字エンコーディングフィルタ 1. 更新履歴 2003/07/07 新規作成(第 0.1 版) 版 数 第 0.1 版 ページ番号 1 1. 2003/07/07 ( 0.1 ) 0.1 1 2. 2.1. 2.1.1. ( ) Java Servlet API2.3 (1) API (javax.servlet.filter ) (2) URL 2.1.2. ( ) ( ) OS OS Windows MS932 Linux EUC_JP 0.1 2 2.1.3. 2.1.2 Web ( ) ( ) Web (Java Servlet

More information

Strut2 jasper report plugin - War deployment

Strut2 jasper report plugin - War deployment Strut2 jasper report plugin - War deployment Hi guys, if you use jasper report in a web app with Struts2 and you deploy it in Tomcat with unpacked option set to true, it doesn't work because it's impossible

More information

Programmi di utilità

Programmi di utilità Programmi di utilità La classe SystemData per il calcolo dei tempi e della occupazione di memoria Per calcolare i tempi e la occupazione di memoria è necessario interagire con il sistema operativo, questo

More information

Quick Installation Guide TK-208K TK-408K

Quick Installation Guide TK-208K TK-408K Quick Installation Guide TK-208K TK-408K Table of of Contents Contents Español... 1. Antes de iniciar... 2. Cómo conectar... 3. Operación... 1 1 2 4 Troubleshooting... 6 Version 03.19.2007 1. Antes de

More information

PTFE Politetrafluoretileno t til sinterizado i / Sintered polytetrafluoroethylene

PTFE Politetrafluoretileno t til sinterizado i / Sintered polytetrafluoroethylene FILMS Ancho (mm m) / width Espesor (mm) / Thickness 1000 1500 0.05 0,11 Peso (Kg./ML) / Weight (Kg./LM) 0.10 0.15 0.2 0.25 0.3 0.4 0.5 0.6 0.8 1 1.5 2 2.5 3 4 0,23 0,34 0,46 0,57 0,69 0,92 1,15 1,37 1,83

More information

SampleApp.java. Page 1

SampleApp.java. Page 1 SampleApp.java 1 package msoe.se2030.sequence; 2 3 /** 4 * This app creates a UI and processes data 5 * @author hornick 6 */ 7 public class SampleApp { 8 private UserInterface ui; // the UI for this program

More information

Course: CMPT 101/104 E.100 Thursday, November 23, 2000

Course: CMPT 101/104 E.100 Thursday, November 23, 2000 Course: CMPT 101/104 E.100 Thursday, November 23, 2000 Lecture Overview: Week 12 Announcements Assignment 6 Expectations Understand Events and the Java Event Model Event Handlers Get mouse and text input

More information

[1]Oracle Communications Converged Application Server. Concepts Release 7.0 E

[1]Oracle Communications Converged Application Server. Concepts Release 7.0 E [1]Oracle Communications Converged Application Server Concepts Release 7.0 E52897-03 May 2016 Oracle Communications Converged Application Server Concepts, Release 7.0 E52897-03 Copyright 2005, 2016, Oracle

More information

Principles, Models, and Applications for Distributed Systems M

Principles, Models, and Applications for Distributed Systems M Università degli Studi di Bologna Facoltà di Ingegneria Principles, Models, and Applications for Distributed Systems M Lab assignment 4 (worked-out) Connection-oriented Java Sockets Luca Foschini Winter

More information

A Simple Text Editor Application

A Simple Text Editor Application CASE STUDY 7 A Simple Text Editor Application To demonstrate the JTextArea component, fonts, menus, and file choosers we present a simple text editor application. This application allows you to create

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Published: December 23, 2013, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

ANEXO D CÓDIGO DE LA APLICACIÓN. El contenido de los archivos de código fuente almacenados en el directorio Nodo desconocido es el siguiente:

ANEXO D CÓDIGO DE LA APLICACIÓN. El contenido de los archivos de código fuente almacenados en el directorio Nodo desconocido es el siguiente: ANEXO D CÓDIGO DE LA APLICACIÓN El contenido de los archivos de código fuente almacenados en el directorio Nodo desconocido es el siguiente: APPLICATIONDEFINITIONS.H #ifndef APPLICATIONDEFINITIONS_H #define

More information

The Design and Implementation of Multimedia Software

The Design and Implementation of Multimedia Software Chapter 3 Programs The Design and Implementation of Multimedia Software David Bernstein Jones and Bartlett Publishers www.jbpub.com David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 1

More information

The XML PDF Access API for Java Technology (XPAAJ)

The XML PDF Access API for Java Technology (XPAAJ) The XML PDF Access API for Java Technology (XPAAJ) Duane Nickull Senior Technology Evangelist Adobe Systems TS-93260 2007 JavaOne SM Conference Session TS-93260 Agenda Using Java technology to manipulate

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Revised: September 17, 2012, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

INTOSAI EXPERTS DATABASE

INTOSAI EXPERTS DATABASE INTOSAI EXPERTS DATABASE User s Manual Version 1.0 Profile: Registrator MU.0001.INTOSAI USER S MANUAL REGISTRATOR PROFILE Experts Database System Author: Daniel Balvis Creation date: May 12th 2015 Last

More information

The AWT Event Model 9

The AWT Event Model 9 The AWT Event Model 9 Course Map This module covers the event-based GUI user input mechanism. Getting Started The Java Programming Language Basics Identifiers, Keywords, and Types Expressions and Flow

More information

Programming with the SCA BB Service Configuration API

Programming with the SCA BB Service Configuration API CHAPTER 3 Programming with the SCA BB Service Configuration API Revised: November 8, 2010, Introduction This chapter is a reference for the main classes and methods of the Cisco SCA BB Service Configuration

More information

Guía de instalación rápida. TE100-S16Eg 1.01

Guía de instalación rápida. TE100-S16Eg 1.01 Guía de instalación rápida TE100-S16Eg 1.01 Table of Contents Español 1 1. Antes de iniciar 1 2. Instalación del Hardware 2 3. LEDs 3 Technical Specifications 4 Troubleshooting 5 Version 10.02.2009 1.

More information

How-To Guide. SigPlus Demo LCD 4x3 Java. Copyright Topaz Systems Inc. All rights reserved.

How-To Guide. SigPlus Demo LCD 4x3 Java. Copyright Topaz Systems Inc. All rights reserved. How-To Guide SigPlus Demo LCD 4x3 Java Copyright Topaz Systems Inc. All rights reserved. For Topaz Systems, Inc. trademarks and patents, visit www.topazsystems.com/legal. Table of Contents Overview...

More information

12% of course grade. CSCI 201L Final - Written Fall /7

12% of course grade. CSCI 201L Final - Written Fall /7 12% of course grade 1. Interfaces and Inheritance Does the following code compile? If so, what is the output? If not, why not? Explain your answer. (1.5%) interface I2 { public void meth1(); interface

More information

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming

GUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming GUI Design Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu /~spring Overview of Part 1 of the Course Demystifying

More information

II 12, JFileChooser. , 2. SolidEllipse ( 2), PolyLine.java ( 3). Draw.java

II 12, JFileChooser. , 2. SolidEllipse ( 2), PolyLine.java ( 3). Draw.java II 12, 13 (ono@isnagoya-uacjp) 2007 1 15, 17 2 : 1 2, JFileChooser, 2,,, Draw 1, SolidEllipse ( 2), PolyLinejava ( 3) 1 Drawjava 2 import javaxswing*; 3 import javaawtevent*; import javautil*; 5 import

More information

Advanced Java Programming (17625) Event Handling. 20 Marks

Advanced Java Programming (17625) Event Handling. 20 Marks Advanced Java Programming (17625) Event Handling 20 Marks Specific Objectives To write event driven programs using the delegation event model. To write programs using adapter classes & the inner classes.

More information

Graphical User Interfaces in Java - SWING

Graphical User Interfaces in Java - SWING Graphical User Interfaces in Java - SWING Graphical User Interfaces (GUI) Each graphical component that the user can see on the screen corresponds to an object of a class Component: Window Button Menu...

More information

BEAWebLogic SIP Server. Technical Product Description

BEAWebLogic SIP Server. Technical Product Description BEAWebLogic SIP Server Technical Product Description Version 3.1 Revised: July 16, 2007 Copyright Copyright 1995-2007 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software

More information

Single user Installation. Revisión: 13/10/2014

Single user Installation. Revisión: 13/10/2014 Revisión: 13/10/2014 I Contenido Parte I Introduction 1 Parte II Create Repositorio 3 1 Create... 3 Parte III Installation & Configuration 1 Installation 5... 5 2 Configuration... 9 3 Config. Modo... 11

More information

Manual Instructions for SAP Note [MX] Digital Fiscal Document (CFDi) - Loader and Viewer Reports Version 1

Manual Instructions for SAP Note [MX] Digital Fiscal Document (CFDi) - Loader and Viewer Reports Version 1 Manual Instructions for SAP Note 1992133 [MX] Digital Fiscal Document (CFDi) - Loader and Viewer Reports Version 1 TABLE OF CONTENTS 1 CREATION OF DOMAINS... 3 2 CREATION OF DATA ELEMENT HRPAYMX_CFDI_STATUS...

More information

agentmom User's Manual

agentmom User's Manual July 2000 agentmom User's Manual Scott A. DeLoach GRADUATE SCHOOL OF ENGINEERING AND MANAGEMENT AIR FORCE INSTITUTE OF TECHNOLOGY WRIGHT-PATTERSON AIR FORCE BASE, OHIO Approved for public release; distribution

More information

import javax.swing.*; import java.awt.*; import java.awt.event.*;

import javax.swing.*; import java.awt.*; import java.awt.event.*; I need to be walked through with why the stocks are being recognized "half way." They will print out in the console but won't be recognized by certain code. Every line of code seems to look right and that's

More information

Java Finite State Machine Framework

Java Finite State Machine Framework 1. Requirements JDK 1.4.x (http://java.sun.com/j2se/1.4.2/download.html) 2. Overview Java Finite State Machine Framework contains classes that define FSM meta-model, allows to manipulate with model, compile

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, WINTER TERM, 2011 FINAL EXAMINATION 7pm to 10pm, 26 APRIL 2011, Ross Gym Instructor: Alan McLeod If the instructor

More information

Programming Language Concepts: Lecture 8

Programming Language Concepts: Lecture 8 Programming Language Concepts: Lecture 8 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 8, 11 February 2009 GUIs and event

More information

Vendor: Oracle. Exam Code: 1Z Exam Name: Java SE 8 Programmer. Version: Demo

Vendor: Oracle. Exam Code: 1Z Exam Name: Java SE 8 Programmer. Version: Demo Vendor: Oracle Exam Code: 1Z0-808 Exam Name: Java SE 8 Programmer Version: Demo DEMO QUESTION 1 Which of the following data types will allow the following code snippet to compile? A. long B. double C.

More information

AWT DIALOG CLASS. Dialog control represents a top-level window with a title and a border used to take some form of input from the user.

AWT DIALOG CLASS. Dialog control represents a top-level window with a title and a border used to take some form of input from the user. http://www.tutorialspoint.com/awt/awt_dialog.htm AWT DIALOG CLASS Copyright tutorialspoint.com Introduction Dialog control represents a top-level window with a title and a border used to take some form

More information

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks)

Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) M257 MTA Spring2010 Multiple Choice Questions: Identify the choice that best completes the statement or answers the question. (15 marks) 1. If we need various objects that are similar in structure, but

More information

CS193k, Stanford Handout #16

CS193k, Stanford Handout #16 CS193k, Stanford Handout #16 Spring, 99-00 Nick Parlante Practice Final Final Exam Info Our regular exam time is Sat June 3rd in Skilling Aud (our regular room) from 3:30-5:30. The alternate will be Fri

More information

Operating Instructions

Operating Instructions Operating Instructions For Digital Camera PC Connection QuickTime and the QuickTime logo are trademarks or registered trademarks of Apple Computer, Inc., used under license. PC Connection for Sharing and

More information

High-Speed INTERNET Modem Installation Instructions

High-Speed INTERNET Modem Installation Instructions High-Speed INTERNET Modem Installation Instructions Install Your Modem Connect to the Internet BendBroadband-provided modems are pre-activated for service and fully supported by BendBroadband Technical

More information

RAIK 183H Examination 2 Solution. November 10, 2014

RAIK 183H Examination 2 Solution. November 10, 2014 RAIK 183H Examination 2 Solution November 10, 2014 Name: NUID: This examination consists of 5 questions and you have 110 minutes to complete the test. Show all steps (including any computations/explanations)

More information