From f3c4d206c784407cf2def348306840d0bb0fbb46 Mon Sep 17 00:00:00 2001 From: Falucho <german.faller@pcunix71.fing.edu.uy> Date: Fri, 21 Jun 2019 04:00:40 -0300 Subject: [PATCH] Se trabajo en errores --- backoffice/pom.xml | 10 +- .../java/uy/edu/fing/tse/jsf/RequestBean.java | 102 +----- .../java/uy/edu/fing/tse/jsf/SessionBean.java | 33 -- .../java/uy/edu/fing/tse/jsp/MyServlet.java | 77 ---- .../src/main/webapp/WEB-INF/faces-config.xml | 9 - backoffice/src/main/webapp/WEB-INF/web.xml | 18 +- .../src/main/webapp/jsp/getNoticias.jsp | 38 -- backoffice/src/main/webapp/jsp/index.html | 15 - .../webapp/jsp/verPublicacionesNoticia.jsp | 43 --- .../soapui/TSE-API-soapui-project.xml | 333 ------------------ .../edu/fing/tse/central/db/DataAccess.java | 6 + .../db/DataAccessBean.java | 17 +- .../db/DataAccessLocal.java | 2 +- .../fing/tse/central/db/DataAccessRemote.java | 6 + .../db/entity/Calificacion.java | 2 +- .../db/entity/Categoria.java | 2 +- .../db/entity/Estado.java | 2 +- .../db/entity/Hecho.java | 5 +- .../db/entity/Mecanismo.java | 2 +- .../db/entity/MecanismoInterno.java | 2 +- .../db/entity/Periferico.java | 2 +- .../{practico => central}/db/entity/Rol.java | 2 +- .../db/entity/TransicionEstado.java | 2 +- .../db/entity/Usuario.java | 2 +- .../db/entity/UsuarioBO.java | 2 +- .../db/entity/UsuarioFO.java | 2 +- .../db/entity/VerificacionChecker.java | 8 +- .../db/entity/VerificacionMecanismo.java | 8 +- .../db/mapper/MyMapper.java | 4 +- .../db/startup/Config.java | 6 +- .../edu/fing/tse/practico/db/DataAccess.java | 6 - .../tse/practico/db/DataAccessRemote.java | 8 - .../main/resources/META-INF/persistence.xml | 2 +- .../db/mapper/MyMapperTest.java | 2 +- .../{practico-ds.xml => central-ds.xml} | 4 +- .../META-INF/jboss-deployment-descriptor.xml | 10 +- .../business/Business.java | 2 +- .../business/BusinessBean.java | 12 +- .../business/BusinessLocal.java | 2 +- .../tse/central/business/BusinessRemote.java | 5 + .../business/common/Propiedades.java | 2 +- .../business/mq/MessageConsumer.java | 6 +- .../business/mq/MessageProducer.java | 2 +- .../business/mq/Queue.java | 2 +- .../business/mq/RabbitConfig.java | 4 +- .../tse/practico/business/BusinessRemote.java | 7 - pom.xml | 7 +- 47 files changed, 94 insertions(+), 751 deletions(-) delete mode 100644 backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java delete mode 100644 backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java delete mode 100644 backoffice/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 backoffice/src/main/webapp/jsp/getNoticias.jsp delete mode 100644 backoffice/src/main/webapp/jsp/index.html delete mode 100644 backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp delete mode 100644 backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml create mode 100644 central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/DataAccessBean.java (61%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/DataAccessLocal.java (70%) create mode 100644 central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Calificacion.java (93%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Categoria.java (95%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Estado.java (93%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Hecho.java (95%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Mecanismo.java (94%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/MecanismoInterno.java (68%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Periferico.java (96%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Rol.java (90%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/TransicionEstado.java (95%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/Usuario.java (92%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/UsuarioBO.java (94%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/UsuarioFO.java (66%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/VerificacionChecker.java (88%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/entity/VerificacionMecanismo.java (90%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/mapper/MyMapper.java (94%) rename central-db/src/main/java/uy/edu/fing/tse/{practico => central}/db/startup/Config.java (69%) delete mode 100644 central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java delete mode 100644 central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java rename central-db/src/test/java/uy/edu/fing/tse/{practico => central}/db/mapper/MyMapperTest.java (97%) rename central-ear/src/main/application/META-INF/{practico-ds.xml => central-ds.xml} (94%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/Business.java (83%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/BusinessBean.java (66%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/BusinessLocal.java (66%) create mode 100644 central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/common/Propiedades.java (97%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/mq/MessageConsumer.java (95%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/mq/MessageProducer.java (95%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/mq/Queue.java (89%) rename central-ejb/src/main/java/uy/edu/fing/tse/{practico => central}/business/mq/RabbitConfig.java (92%) delete mode 100644 central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java diff --git a/backoffice/pom.xml b/backoffice/pom.xml index a08d24c..f4bf4d2 100644 --- a/backoffice/pom.xml +++ b/backoffice/pom.xml @@ -42,7 +42,7 @@ <dependency> <groupId>org.jboss.spec.javax.faces</groupId> - <artifactId>jboss-jsf-api_2.2_spec</artifactId> + <artifactId>jboss-jsf-api_2.3_spec</artifactId> <scope>provided</scope> </dependency> @@ -88,14 +88,6 @@ <warName>backoffice</warName> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>5</source> - <target>5</target> - </configuration> - </plugin> </plugins> </build> diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java index b358919..172e08d 100644 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java +++ b/backoffice/src/main/java/uy/edu/fing/tse/jsf/RequestBean.java @@ -1,109 +1,21 @@ package uy.edu.fing.tse.jsf; -import uy.edu.fing.tse.dto.NoticiaDTO; -import uy.edu.fing.tse.dto.PublicacionDTO; -import uy.edu.fing.tse.practico.business.BusinessLocal; + +import uy.edu.fing.tse.central.business.BusinessLocal; import javax.ejb.EJB; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.RequestScoped; -import java.util.List; -import java.util.Optional; +import javax.enterprise.context.RequestScoped; +import javax.inject.Named; +import javax.jms.MessageProducer; +@Named @RequestScoped -@ManagedBean(name = "noticiaBean") public class RequestBean { @EJB private BusinessLocal negocio; @EJB - private uy.edu.fing.tse.practico.business.mq.JMSProducer jms; - - @ManagedProperty(value = "#{Session}") - private SessionBean session; - - - private Optional<String> tipo = Optional.empty(); - private Optional<String> url = Optional.empty(); - - private Optional<String> titulo = Optional.empty(); - private Optional<String> descripcion = Optional.empty(); - - public List<NoticiaDTO> getNoticias() { - return negocio.getNoticias(); - } - - public String getTipo() { - return tipo.orElse(""); - } - - public void setTipo(String tipo) { - this.tipo = Optional.ofNullable(tipo); - } - - public String getUrl() { - return url.orElse(""); - } - - public void setUrl(String url) { - this.url = Optional.ofNullable(url); - } - - public String getTitulo() { - return titulo.orElse(""); - } - - public void setTitulo(String titulo) { - this.titulo = Optional.ofNullable(titulo); - } - - public String getDescripcion() { - return descripcion.orElse(""); - } - - public void setDescripcion(String descripcion) { - this.descripcion = Optional.ofNullable(descripcion); - } - - public SessionBean getSession() { - return session; - } - - public void setSession(SessionBean session) { - this.session = session; - } - - public String add(long idN) { - final PublicacionDTO dtoP = new PublicacionDTO(null, tipo.get(), url.get()); - final NoticiaDTO noticiaDTO = negocio.addPublicacionANoticia(dtoP, idN); - session.setNoticia(noticiaDTO); - tipo = url = Optional.empty(); - return "noticia"; - } - - public String addNoticia() { - final int cant = negocio.getNoticias().size(); - jms.altaNoticia(new NoticiaDTO(null, titulo.get(), descripcion.get())); - - for (int i = 0; i < 50; i++) { - if (cant == negocio.getNoticias().size()) { - sleep(); - } else { - break; - } - } - - titulo = descripcion = Optional.empty(); - return "getNoticias"; - } + private MessageProducer mq; - private void sleep() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } } diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java deleted file mode 100644 index c780223..0000000 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/SessionBean.java +++ /dev/null @@ -1,33 +0,0 @@ -package uy.edu.fing.tse.jsf; - -import uy.edu.fing.tse.dto.NoticiaDTO; - -import javax.annotation.PostConstruct; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.SessionScoped; - -@SessionScoped -@ManagedBean(name = "Session") -public class SessionBean { - - private NoticiaDTO selected; - - @PostConstruct - public void init() { - - } - - public NoticiaDTO getNoticia() { - return selected; - } - - public void setNoticia(NoticiaDTO selected) { - this.selected = selected; - } - - public String seleccionar(NoticiaDTO n) { - selected = n; - return "noticia"; - } - -} diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java b/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java deleted file mode 100644 index b117d3b..0000000 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsp/MyServlet.java +++ /dev/null @@ -1,77 +0,0 @@ -package uy.edu.fing.tse.jsp; - -import uy.edu.fing.tse.dto.NoticiaDTO; -import uy.edu.fing.tse.dto.PublicacionDTO; -import uy.edu.fing.tse.practico.business.BusinessLocal; - -import javax.ejb.EJB; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -@WebServlet(name = "Controller", urlPatterns = "/jsp/controlador") -public class MyServlet extends HttpServlet { - private static final long serialVersionUID = -964003102417352102L; - - @EJB - private BusinessLocal negocio; - - @EJB - private uy.edu.fing.tse.practico.business.mq.JMSProducer jms; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - final String noticia = req.getParameter("noticia"); - if (noticia == null) { - req.setAttribute("noticias", negocio.getNoticias()); - req.getRequestDispatcher("getNoticias.jsp").forward(req, resp); - } else { - req.setAttribute("noticia", negocio.findNoticia(Long.parseLong(noticia))); - req.getRequestDispatcher("verPublicacionesNoticia.jsp").forward(req, resp); - } - } - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - final String idNoticia = req.getParameter("idNoticia"); - - if (idNoticia == null) { - - final int cant = negocio.getNoticias().size(); - final String descripcion = req.getParameter("descripcion"); - final String titulo = req.getParameter("titulo"); - - jms.altaNoticia(new NoticiaDTO(null, titulo, descripcion)); - - for (int i = 0; i < 10; i++) { - if (cant == negocio.getNoticias().size()) { - sleep(); - } else { - break; - } - } - - req.setAttribute("noticias", negocio.getNoticias()); - req.getRequestDispatcher("getNoticias.jsp").forward(req, resp); - } else { - final String tipo = req.getParameter("tipo"); - final String url = req.getParameter("url"); - final NoticiaDTO noticia = negocio.addPublicacionANoticia(new PublicacionDTO(null, tipo, url), Long.parseLong(idNoticia)); - - req.setAttribute("noticia", noticia); - req.getRequestDispatcher("verPublicacionesNoticia.jsp").forward(req, resp); - } - - } - - private void sleep() { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } -} diff --git a/backoffice/src/main/webapp/WEB-INF/faces-config.xml b/backoffice/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index ffc7e81..0000000 --- a/backoffice/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<!-- Marker file indicating JSF 2.2 should be enabled in the application --> -<faces-config version="2.2" - xmlns="http://xmlns.jcp.org/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://xmlns.jcp.org/xml/ns/javaee - http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> -</faces-config> diff --git a/backoffice/src/main/webapp/WEB-INF/web.xml b/backoffice/src/main/webapp/WEB-INF/web.xml index cb4b2e4..891e0f2 100644 --- a/backoffice/src/main/webapp/WEB-INF/web.xml +++ b/backoffice/src/main/webapp/WEB-INF/web.xml @@ -1,10 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns="http://java.sun.com/xml/ns/javaee" +<web-app version="4.0" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_3_0.xsd" - version="3.0"> + xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"> - <display-name>Practico TSE</display-name> + <display-name>Backoffice TSE</display-name> <!-- Change to "Production" when you are ready to deploy --> <context-param> @@ -53,13 +52,12 @@ <url-pattern>*.xhtml</url-pattern> </servlet-mapping> + <welcome-file-list> + <welcome-file>index.xhtml</welcome-file> + </welcome-file-list> + <session-config> <session-timeout>15</session-timeout> - <cookie-config> - <!-- Prevents session cookie from being read by clientside scripts --> - <!--<http-only>true</http-only>--> - <!--<secure>true</secure>--> - </cookie-config> - <tracking-mode>COOKIE</tracking-mode> + <tracking-mode>URL</tracking-mode> </session-config> </web-app> \ No newline at end of file diff --git a/backoffice/src/main/webapp/jsp/getNoticias.jsp b/backoffice/src/main/webapp/jsp/getNoticias.jsp deleted file mode 100644 index 974dc0a..0000000 --- a/backoffice/src/main/webapp/jsp/getNoticias.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%@ page import="uy.edu.fing.tse.dto.NoticiaDTO" %> -<%@ page import="java.util.List" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<html> -<head> - <title>TSE 2019 - Practico JSP</title> -</head> -<body> -<h1>TSE 2019 - Practico JSP</h1> -<br> - -<% - final List noticias = (List) request.getAttribute("noticias"); - - for (Object noticia : noticias) { - final NoticiaDTO noti = (NoticiaDTO) noticia; -%> -<h2><a href="controlador?noticia=<%= noti.getId()%>"><%= noti.getTitulo()%> -</a></h2> - -<%= noti.getDescripcion()%> -<br/> -<hr/> -<%}%> - -<hr/> - -<form action="controlador" method="post"> - <label for="titulo">Titulo:</label> - <input id="titulo" name="titulo"> - <br/> - <label for="descripcion">Descripcion:</label> - <textarea id="descripcion" name="descripcion"></textarea> - <br/> - <input value="Agregar" type="submit"> -</form> -</body> -</html> diff --git a/backoffice/src/main/webapp/jsp/index.html b/backoffice/src/main/webapp/jsp/index.html deleted file mode 100644 index dbfdd68..0000000 --- a/backoffice/src/main/webapp/jsp/index.html +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>TSE 2019 - Practico JSP</title> - <meta http-equiv="refresh" content="0; url=controlador"> -</head> -<body> - -<h1>TSE 2019 - Practico JSP</h1> -<br> -<meta> -<a href="controlador">getNoticias</a> -</body> -</html> \ No newline at end of file diff --git a/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp b/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp deleted file mode 100644 index 2ea3f72..0000000 --- a/backoffice/src/main/webapp/jsp/verPublicacionesNoticia.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@ page import="uy.edu.fing.tse.dto.NoticiaDTO" %> -<%@ page import="uy.edu.fing.tse.dto.PublicacionDTO" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<html> -<head> - <title>TSE 2019 - Practico JSP</title> -</head> -<body> -<h1>TSE 2019 - Practico JSP</h1> -<br> - -<% - final NoticiaDTO noticia = (NoticiaDTO) request.getAttribute("noticia"); -%> -<h2><%= noticia.getTitulo()%> -</h2> -<%= noticia.getDescripcion()%> -<br/> -<hr/> - -<% - for (Object pObject : noticia.getPublicaciones()) { - PublicacionDTO publicacion = (PublicacionDTO) pObject; -%> - -Id: <%=publicacion.getId()%> -<br/> -Tipo: <%=publicacion.getTipo()%> -<br/> -<a href="<%=publicacion.getUrl()%>">LINK</a> -<br/> -<%}%> - - -<form action="controlador" method="post"> - <input id="idNoticia" name="idNoticia" type="hidden" value="<%=noticia.getId()%>"> - Tipo: <input id="tipo" name="tipo" placeholder="Tweet"> - URL: <input id="url" name="url" placeholder="www.google.com"> - <input type="submit"> -</form> - -</body> -</html> diff --git a/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml b/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml deleted file mode 100644 index 2b4ced1..0000000 --- a/backoffice/src/main/webapp/resources/soapui/TSE-API-soapui-project.xml +++ /dev/null @@ -1,333 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<con:soapui-project id="36d9e2e5-cd71-41e6-a125-aec8926345a8" activeEnvironment="Default" name="TSE API" resourceRoot="" - soapui-version="5.5.0" xmlns:con="http://eviware.com/soapui/config"> - <con:settings/> - <con:interface xsi:type="con:RestService" id="9e519c47-0d19-4949-953a-114533b1ceb5" - wadlVersion="http://wadl.dev.java.net/2009/02" name="http://localhost:8080" type="rest" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <con:settings/> - <con:definitionCache/> - <con:endpoints> - <con:endpoint>http://localhost:8080</con:endpoint> - </con:endpoints> - <con:resource name="Publicacion" path="/practico-api/rest/noticia/{id}/publicacion" - id="8f67d9ef-e987-4e58-9f1f-32dd05a7f74a"> - <con:settings/> - <con:parameters> - <con:parameter> - <con:name>tipo</con:name> - <con:value>rest</con:value> - <con:style>QUERY</con:style> - <con:default>rest</con:default> - <con:path xsi:nil="true"/> - <con:description xsi:nil="true"/> - </con:parameter> - <con:parameter> - <con:name>url</con:name> - <con:value>www.sss.fb</con:value> - <con:style>QUERY</con:style> - <con:default>www.sss.fb</con:default> - <con:path xsi:nil="true"/> - <con:description xsi:nil="true"/> - </con:parameter> - <con:parameter> - <con:name>id</con:name> - <con:value/> - <con:style>TEMPLATE</con:style> - <con:default/> - <con:description xsi:nil="true"/> - </con:parameter> - </con:parameters> - <con:method name="Publicacion 1" id="9524c72a-cc60-48be-8834-a98887285109" method="POST"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element xmlns:pub="http://localhost/practico-api/rest/noticia/1/publicacion">pub:Response - </con:element> - </con:representation> - <con:representation type="REQUEST"> - <con:mediaType>application/json</con:mediaType> - <con:params/> - </con:representation> - <con:request name="Request 1" id="2c322e32-fb13-4f8d-9c99-06c71f6de9af" mediaType="application/json" - postQueryString="false"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticia/1/publicacion</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters> - <con:entry key="tipo" value="rest"/> - <con:entry key="id" value="1"/> - <con:entry key="url" value="www.sss.fb"/> - </con:parameters> - <con:parameterOrder> - <con:entry>tipo</con:entry> - <con:entry>url</con:entry> - <con:entry>id</con:entry> - </con:parameterOrder> - </con:request> - </con:method> - </con:resource> - <con:resource name="publicaciones" path="/practico-api/rest/noticia/{id}/publicaciones" - id="aaea0758-01a9-40be-9fa0-5ae0fea29651"> - <con:settings/> - <con:parameters> - <con:parameter> - <con:name>id</con:name> - <con:value/> - <con:style>TEMPLATE</con:style> - <con:default/> - <con:description xsi:nil="true"/> - </con:parameter> - </con:parameters> - <con:method name="Method 1" id="087fbea6-05a0-4d26-a699-8e716fc6bb06" method="GET"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element>Response</con:element> - </con:representation> - <con:request name="Request 1" id="46277185-9bfa-4836-b1b1-008b03bb23b2" mediaType="application/json"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticia/1/publicaciones</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters> - <entry key="id" value="1" xmlns="http://eviware.com/soapui/config"/> - </con:parameters> - <con:parameterOrder> - <con:entry>id</con:entry> - </con:parameterOrder> - </con:request> - </con:method> - </con:resource> - <con:resource name="noticias" path="/practico-api/rest/noticias" id="9bf57d07-edc8-4794-bed8-8e64e394bba6"> - <con:settings/> - <con:parameters/> - <con:method name="Method 1" id="07302d11-f397-4f3d-853e-c1f918be7c08" method="GET"> - <con:settings/> - <con:parameters/> - <con:representation type="RESPONSE"> - <con:mediaType>application/json</con:mediaType> - <con:status>200</con:status> - <con:params/> - <con:element>Response</con:element> - </con:representation> - <con:request name="Request 1" id="a527c0f7-4f39-49f5-9516-902a14056a2f" mediaType="application/json"> - <con:settings> - <con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/> - </con:setting> - </con:settings> - <con:endpoint>http://localhost:8080</con:endpoint> - <con:request/> - <con:originalUri>http://localhost/practico-api/rest/noticias</con:originalUri> - <con:credentials> - <con:authType>No Authorization</con:authType> - </con:credentials> - <con:jmsConfig JMSDeliveryMode="PERSISTENT"/> - <con:jmsPropertyConfig/> - <con:parameters/> - </con:request> - </con:method> - </con:resource> - </con:interface> - <con:interface xsi:type="con:WsdlInterface" id="06180e4e-0acf-4ad2-a9fc-80d0d8c8a033" wsaVersion="NONE" - name="SoapAPIServiceSoapBinding" type="wsdl" - bindingName="{http://soap.ws.tse.fing.edu.uy/}SoapAPIServiceSoapBinding" soapVersion="1_1" - anonymous="optional" definition="http://localhost:8080/practico-api/SoapAPI?wsdl" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <con:settings/> - <con:definitionCache type="TEXT" rootPart="http://localhost:8080/practico-api/SoapAPI?wsdl"> - <con:part> - <con:url>http://localhost:8080/practico-api/SoapAPI?wsdl</con:url> - <con:content><![CDATA[<wsdl:definitions name="SoapAPIService" targetNamespace="http://soap.ws.tse.fing.edu.uy/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soap.ws.tse.fing.edu.uy/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http"> - <wsdl:types> - <xs:schema targetNamespace="http://soap.ws.tse.fing.edu.uy/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="noticia" type="tns:noticiaDT"/> - <xs:element name="noticias" type="tns:noticiasDT"/> - <xs:element name="publicacion" type="tns:publicacionDT"/> - <xs:element name="publicaciones" type="tns:publicacionesDT"/> - <xs:complexType final="extension restriction" name="noticiasDT"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="noticia" type="tns:noticiaDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="noticiaDT"> - <xs:sequence> - <xs:element minOccurs="0" name="id" type="xs:long"/> - <xs:element minOccurs="0" name="titulo" type="xs:string"/> - <xs:element minOccurs="0" name="descripcion" type="xs:string"/> - <xs:element minOccurs="0" name="publicaciones" type="tns:publicacionesDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="publicacionesDT"> - <xs:sequence> - <xs:element maxOccurs="unbounded" minOccurs="0" name="publicacion" type="tns:publicacionDT"/> - </xs:sequence> - </xs:complexType> - <xs:complexType final="extension restriction" name="publicacionDT"> - <xs:sequence> - <xs:element minOccurs="0" name="id" type="xs:long"/> - <xs:element minOccurs="0" name="tipo" type="xs:string"/> - <xs:element minOccurs="0" name="url" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:schema> - </wsdl:types> - <wsdl:message name="getNoticiasResponse"> - <wsdl:part name="return" type="tns:noticiasDT"></wsdl:part> - </wsdl:message> - <wsdl:message name="getPublicaciones"> - <wsdl:part name="idNoticia" type="xsd:long"></wsdl:part> - </wsdl:message> - <wsdl:message name="getNoticias"></wsdl:message> - <wsdl:message name="getPublicacionesResponse"> - <wsdl:part name="return" type="tns:publicacionesDT"></wsdl:part> - </wsdl:message> - <wsdl:message name="addPublicacion"> - <wsdl:part name="tipo" type="xsd:string"></wsdl:part> - <wsdl:part name="url" type="xsd:string"></wsdl:part> - <wsdl:part name="idNoticia" type="xsd:long"></wsdl:part> - </wsdl:message> - <wsdl:portType name="API"> - <wsdl:operation name="getNoticias"> - <wsdl:input message="tns:getNoticias" name="getNoticias"></wsdl:input> - <wsdl:output message="tns:getNoticiasResponse" name="getNoticiasResponse"></wsdl:output> - </wsdl:operation> - <wsdl:operation name="getPublicaciones"> - <wsdl:input message="tns:getPublicaciones" name="getPublicaciones"></wsdl:input> - <wsdl:output message="tns:getPublicacionesResponse" name="getPublicacionesResponse"></wsdl:output> - </wsdl:operation> - <wsdl:operation name="addPublicacion"> - <wsdl:input message="tns:addPublicacion" name="addPublicacion"></wsdl:input> - </wsdl:operation> - </wsdl:portType> - <wsdl:binding name="SoapAPIServiceSoapBinding" type="tns:API"> - <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="getNoticias"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="getNoticias"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - <wsdl:output name="getNoticiasResponse"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:output> - </wsdl:operation> - <wsdl:operation name="getPublicaciones"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="getPublicaciones"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - <wsdl:output name="getPublicacionesResponse"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:output> - </wsdl:operation> - <wsdl:operation name="addPublicacion"> - <soap:operation soapAction="" style="rpc"/> - <wsdl:input name="addPublicacion"> - <soap:body namespace="http://soap.ws.tse.fing.edu.uy/" use="literal"/> - </wsdl:input> - </wsdl:operation> - </wsdl:binding> - <wsdl:service name="SoapAPIService"> - <wsdl:port binding="tns:SoapAPIServiceSoapBinding" name="APIPort"> - <soap:address location="http://localhost:8080/practico-api/SoapAPI"/> - </wsdl:port> - </wsdl:service> -</wsdl:definitions>]]></con:content> - <con:type>http://schemas.xmlsoap.org/wsdl/</con:type> - </con:part> - </con:definitionCache> - <con:endpoints> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - </con:endpoints> - <con:operation id="1f3552e6-5141-4cb5-872d-100142f636e6" isOneWay="false" action="" name="addPublicacion" - bindingOperationName="addPublicacion" type="One-Way" inputName="addPublicacion" - sendsAttachments="false" anonymous="optional"> - <con:settings/> - <con:call id="03c9de75-7570-4189-9db9-5bebdf72fef3" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:addPublicacion>\r - <tipo>?</tipo>\r - <url>?</url>\r - <idNoticia>?</idNoticia>\r - </soap:addPublicacion>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/addPublicacion"/> - </con:call> - </con:operation> - <con:operation id="16734cb9-e5ef-46df-bff1-938e09e09b1a" isOneWay="false" action="" name="getNoticias" - bindingOperationName="getNoticias" type="Request-Response" outputName="getNoticiasResponse" - inputName="getNoticias" receivesAttachments="false" sendsAttachments="false" - anonymous="optional"> - <con:settings/> - <con:call id="31718689-d64c-4c91-937d-5b8ddb75f8ae" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:getNoticias/>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/getNoticias"/> - </con:call> - </con:operation> - <con:operation id="569dba5f-41fc-4946-ab48-986e33d3c621" isOneWay="false" action="" name="getPublicaciones" - bindingOperationName="getPublicaciones" type="Request-Response" - outputName="getPublicacionesResponse" inputName="getPublicaciones" receivesAttachments="false" - sendsAttachments="false" anonymous="optional"> - <con:settings/> - <con:call id="b197d238-991b-462e-8c8c-4880bfad35d3" name="Request 1"> - <con:settings/> - <con:encoding>UTF-8</con:encoding> - <con:endpoint>http://localhost:8080/practico-api/SoapAPI</con:endpoint> - <con:request><![CDATA[<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://soap.ws.tse.fing.edu.uy/">\r - <soapenv:Header/>\r - <soapenv:Body>\r - <soap:getPublicaciones>\r - <idNoticia>?</idNoticia>\r - </soap:getPublicaciones>\r - </soapenv:Body>\r -</soapenv:Envelope>]]></con:request> - <con:wsaConfig mustUnderstand="NONE" version="200508" - action="http://soap.ws.tse.fing.edu.uy/API/getPublicaciones"/> - </con:call> - </con:operation> - </con:interface> - <con:properties/> - <con:wssContainer/> - <con:oAuth2ProfileContainer/> - <con:oAuth1ProfileContainer/> - <con:sensitiveInformation/> -</con:soapui-project> \ No newline at end of file diff --git a/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java new file mode 100644 index 0000000..2dd45d2 --- /dev/null +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccess.java @@ -0,0 +1,6 @@ +package uy.edu.fing.tse.central.db; + +public interface DataAccess { + + void metodo(); +} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java similarity index 61% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java index b03f08e..2b2dff6 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessBean.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessBean.java @@ -1,17 +1,11 @@ -package uy.edu.fing.tse.practico.db; +package uy.edu.fing.tse.central.db; import javax.annotation.PostConstruct; -import javax.ejb.Local; -import javax.ejb.LocalBean; -import javax.ejb.Remote; -import javax.ejb.Singleton; +import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; -@Singleton -@Local({DataAccessLocal.class}) -@Remote({DataAccessRemote.class}) -@LocalBean +@Stateless public class DataAccessBean implements DataAccessLocal, DataAccessRemote { @PersistenceContext(unitName = "central") @@ -22,4 +16,9 @@ public class DataAccessBean implements DataAccessLocal, DataAccessRemote { //Despues del constructor hace esto } + + @Override + public void metodo() { + System.out.println("asd"); + } } diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java similarity index 70% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java index 8af9685..2922392 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessLocal.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessLocal.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db; +package uy.edu.fing.tse.central.db; import javax.ejb.Local; diff --git a/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java new file mode 100644 index 0000000..0d7ca2b --- /dev/null +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/DataAccessRemote.java @@ -0,0 +1,6 @@ +package uy.edu.fing.tse.central.db; + +//@Remote +public interface DataAccessRemote extends DataAccess { + +} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java similarity index 93% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java index acdb4d0..7a91670 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Calificacion.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Calificacion.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java index 8c7099b..fee53dc 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Categoria.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Categoria.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java similarity index 93% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java index 5bbd796..efd22ce 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Estado.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Estado.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java index 3cfaa62..9f843f0 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Hecho.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Hecho.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.ArrayList; @@ -19,8 +19,7 @@ public final class Hecho { private String title; private String description; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Estado actualState; @ManyToOne diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java index 1729e03..0a53e02 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Mecanismo.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Mecanismo.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java similarity index 68% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java index 48adddc..b451ff7 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/MecanismoInterno.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/MecanismoInterno.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java similarity index 96% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java index e320c72..996cef3 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Periferico.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Periferico.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.ArrayList; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java similarity index 90% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java index 2f0ab9b..2eaa425 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Rol.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Rol.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java similarity index 95% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java index bb404bf..e5497fe 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/TransicionEstado.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/TransicionEstado.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.Date; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java similarity index 92% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java index c80987f..59f512c 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/Usuario.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/Usuario.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java index c1d5cfb..6d7cbb0 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioBO.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioBO.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java similarity index 66% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java index a99a7b4..a3918ee 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/UsuarioFO.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/UsuarioFO.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.Entity; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java similarity index 88% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java index acfb420..4439d23 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionChecker.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionChecker.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; @@ -9,12 +9,10 @@ public class VerificacionChecker { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private UsuarioBO checker; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Hecho fact; @Column(nullable = false) diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java similarity index 90% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java index d1c1e38..0ac4dfa 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/entity/VerificacionMecanismo.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/entity/VerificacionMecanismo.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.entity; +package uy.edu.fing.tse.central.db.entity; import javax.persistence.*; import java.util.Date; @@ -10,12 +10,10 @@ public class VerificacionMecanismo { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Periferico peripheral; - @ManyToOne - @Column(nullable = false) + @ManyToOne(optional = false) private Hecho fact; @Column(nullable = false) diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java similarity index 94% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java index 59e05fc..b164d08 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/mapper/MyMapper.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/mapper/MyMapper.java @@ -1,9 +1,9 @@ -package uy.edu.fing.tse.practico.db.mapper; +package uy.edu.fing.tse.central.db.mapper; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; +import uy.edu.fing.tse.central.db.entity.*; import uy.edu.fing.tse.dto.*; -import uy.edu.fing.tse.practico.db.entity.*; import java.util.List; diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java b/central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java similarity index 69% rename from central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java rename to central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java index c14edb1..4415d90 100644 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/startup/Config.java +++ b/central-db/src/main/java/uy/edu/fing/tse/central/db/startup/Config.java @@ -1,6 +1,6 @@ -package uy.edu.fing.tse.practico.db.startup; +package uy.edu.fing.tse.central.db.startup; -import uy.edu.fing.tse.practico.db.DataAccessBean; +import uy.edu.fing.tse.central.db.DataAccessLocal; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; @@ -13,7 +13,7 @@ import javax.ejb.Startup; public class Config { @EJB - private DataAccessBean dataAccess; + private DataAccessLocal dataAccess; @PostConstruct public void start() { diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java b/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java deleted file mode 100644 index b60074d..0000000 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccess.java +++ /dev/null @@ -1,6 +0,0 @@ -package uy.edu.fing.tse.practico.db; - -public interface DataAccess { - - -} diff --git a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java b/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java deleted file mode 100644 index ede5aaa..0000000 --- a/central-db/src/main/java/uy/edu/fing/tse/practico/db/DataAccessRemote.java +++ /dev/null @@ -1,8 +0,0 @@ -package uy.edu.fing.tse.practico.db; - -import javax.ejb.Remote; - -@Remote -public interface DataAccessRemote extends DataAccess { - -} diff --git a/central-db/src/main/resources/META-INF/persistence.xml b/central-db/src/main/resources/META-INF/persistence.xml index 002cb41..cf1d273 100644 --- a/central-db/src/main/resources/META-INF/persistence.xml +++ b/central-db/src/main/resources/META-INF/persistence.xml @@ -5,7 +5,7 @@ xsi:schemaLocation=" http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> - <persistence-unit name="practico"> + <persistence-unit name="central"> <!--OpenShift--> <jta-data-source>java:jboss/datasources/centralDS</jta-data-source> <!--Local--> diff --git a/central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java b/central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java similarity index 97% rename from central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java rename to central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java index 1f4e4ea..a38e2e0 100644 --- a/central-db/src/test/java/uy/edu/fing/tse/practico/db/mapper/MyMapperTest.java +++ b/central-db/src/test/java/uy/edu/fing/tse/central/db/mapper/MyMapperTest.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.db.mapper; +package uy.edu.fing.tse.central.db.mapper; import org.junit.Assert; import org.junit.Test; diff --git a/central-ear/src/main/application/META-INF/practico-ds.xml b/central-ear/src/main/application/META-INF/central-ds.xml similarity index 94% rename from central-ear/src/main/application/META-INF/practico-ds.xml rename to central-ear/src/main/application/META-INF/central-ds.xml index 9492e36..96a473f 100644 --- a/central-ear/src/main/application/META-INF/practico-ds.xml +++ b/central-ear/src/main/application/META-INF/central-ds.xml @@ -4,8 +4,7 @@ xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd"> <!-- The datasource is bound into JNDI at this location. We reference this in META-INF/persistence.xml --> - <datasource jndi-name="java:jboss/datasources/centralDS" pool-name="central" - enabled="true" use-java-context="true"> + <datasource jndi-name="java:jboss/datasources/centralDS" pool-name="central" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:file:./central</connection-url> <driver>h2</driver> <security> @@ -13,6 +12,7 @@ <password>sa</password> </security> </datasource> + <!--https://data.heroku.com/datastores/30b15fdc-4667-493f-b244-cdfea47f071f#administration--> <datasource jndi-name="java:jboss/datasources/herokuDS" pool-name="heroku" enabled="true" use-java-context="true"> <connection-url>jdbc:postgresql://ec2-23-23-92-204.compute-1.amazonaws.com:5432/dd1clqkconunk4</connection-url> diff --git a/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml b/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml index 5a0fce3..713e808 100644 --- a/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml +++ b/central-ear/src/main/application/META-INF/jboss-deployment-descriptor.xml @@ -1,11 +1,11 @@ <jboss> <enterprise-beans> <service> - <ejb-class>uy.edu.fing.tse.practico.business.BusinessBean</ejb-class> - <local>uy.edu.fing.tse.practico.business.BusinessLocal</local> - <remote>uy.edu.fing.tse.practico.business.BusinessRemote</remote> - <jndi-name>practico/remote</jndi-name> - <local-jndi-name>practico/local</local-jndi-name> + <ejb-class>uy.edu.fing.tse.central.business.BusinessBean</ejb-class> + <local>uy.edu.fing.tse.central.business.BusinessLocal</local> + <remote>uy.edu.fing.tse.central.business.BusinessRemote</remote> + <jndi-name>central-ear/remote</jndi-name> + <local-jndi-name>central-ear/local</local-jndi-name> </service> </enterprise-beans> </jboss> \ No newline at end of file diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java similarity index 83% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java index 3a650f5..97909c8 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/Business.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/Business.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; import uy.edu.fing.tse.dto.CheckMechanism; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java similarity index 66% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java index b3d2c3f..d150c47 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessBean.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessBean.java @@ -1,21 +1,19 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; +import uy.edu.fing.tse.central.db.DataAccessLocal; import uy.edu.fing.tse.dto.CheckMechanism; import uy.edu.fing.tse.dto.Peripherical; -import uy.edu.fing.tse.practico.db.DataAccessBean; import javax.annotation.PostConstruct; -import javax.ejb.*; +import javax.ejb.EJB; +import javax.ejb.Stateless; @Stateless -@Local({BusinessLocal.class}) -@Remote({BusinessRemote.class}) -@LocalBean public class BusinessBean implements BusinessLocal, BusinessRemote { @EJB - private DataAccessBean dataAccess; + private DataAccessLocal dataAccess; @PostConstruct void init() { diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java similarity index 66% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java index af4e403..20bac99 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessLocal.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessLocal.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business; +package uy.edu.fing.tse.central.business; import javax.ejb.Local; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java new file mode 100644 index 0000000..33b5bf8 --- /dev/null +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/BusinessRemote.java @@ -0,0 +1,5 @@ +package uy.edu.fing.tse.central.business; + +//@Remote +public interface BusinessRemote extends Business { +} diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java similarity index 97% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java index a0b19d5..8c87788 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/common/Propiedades.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/common/Propiedades.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.common; +package uy.edu.fing.tse.central.business.common; import java.io.File; import java.io.FileInputStream; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java similarity index 95% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java index fc6a8fe..f1fdd9a 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageConsumer.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageConsumer.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.AMQP; @@ -7,9 +7,9 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import uy.edu.fing.tse.central.business.BusinessLocal; import uy.edu.fing.tse.dto.CheckMechanism; import uy.edu.fing.tse.dto.Peripherical; -import uy.edu.fing.tse.practico.business.BusinessBean; import javax.annotation.PostConstruct; import javax.ejb.EJB; @@ -27,7 +27,7 @@ public class MessageConsumer { private Channel channel; @EJB - private BusinessBean negocio; + private BusinessLocal negocio; @PostConstruct public void init() { diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java similarity index 95% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java index cc264e1..db1b550 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/MessageProducer.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/MessageProducer.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.Channel; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java similarity index 89% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java index f5f1dae..db14dee 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/Queue.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/Queue.java @@ -1,4 +1,4 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; public enum Queue { REQUEST("request"), diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java similarity index 92% rename from central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java rename to central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java index f7bc956..222443f 100644 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/mq/RabbitConfig.java +++ b/central-ejb/src/main/java/uy/edu/fing/tse/central/business/mq/RabbitConfig.java @@ -1,9 +1,9 @@ -package uy.edu.fing.tse.practico.business.mq; +package uy.edu.fing.tse.central.business.mq; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; -import uy.edu.fing.tse.practico.business.common.Propiedades; +import uy.edu.fing.tse.central.business.common.Propiedades; import java.io.IOException; import java.util.concurrent.TimeoutException; diff --git a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java b/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java deleted file mode 100644 index 735cb9d..0000000 --- a/central-ejb/src/main/java/uy/edu/fing/tse/practico/business/BusinessRemote.java +++ /dev/null @@ -1,7 +0,0 @@ -package uy.edu.fing.tse.practico.business; - -import javax.ejb.Remote; - -@Remote -public interface BusinessRemote extends Business { -} diff --git a/pom.xml b/pom.xml index d907081..ab3e010 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ <module>central-db</module> <module>central-ejb</module> <module>central-ear</module> - <!-- <module>backoffice</module>--> + <module>backoffice</module> </modules> <properties> @@ -193,10 +193,11 @@ <dependency> <groupId>org.jboss.spec.javax.faces</groupId> - <artifactId>jboss-jsf-api_2.2_spec</artifactId> - <version>2.2.14</version> + <artifactId>jboss-jsf-api_2.3_spec</artifactId> + <version>2.3.9.SP02</version> </dependency> + <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> -- GitLab