Commit aaf40ee58de5395f20508e86b99489ee748a0d97
1 parent
dec392b2
Exists in
master
and in
1 other branch
Melhora escrita em log
- Corrige locais que escreviam stacktrace no log. - Novas constantes criadas.
Showing
6 changed files
with
16 additions
and
13 deletions
Show diff stats
pom.xml
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <modelVersion>4.0.0</modelVersion> | 4 | <modelVersion>4.0.0</modelVersion> |
| 5 | <groupId>br.gov.ans</groupId> | 5 | <groupId>br.gov.ans</groupId> |
| 6 | <artifactId>sei-broker</artifactId> | 6 | <artifactId>sei-broker</artifactId> |
| 7 | - <version>2.6</version> | 7 | + <version>2.7</version> |
| 8 | <packaging>war</packaging> | 8 | <packaging>war</packaging> |
| 9 | <name>sei-broker</name> | 9 | <name>sei-broker</name> |
| 10 | <description>Camada de integração REST para comunicação com o SEI</description> | 10 | <description>Camada de integração REST para comunicação com o SEI</description> |
src/main/java/br/gov/ans/integracao/sei/rest/ContatoResource.java
| @@ -39,6 +39,7 @@ import br.gov.ans.integracao.sei.modelo.enums.Acao; | @@ -39,6 +39,7 @@ import br.gov.ans.integracao.sei.modelo.enums.Acao; | ||
| 39 | import br.gov.ans.integracao.sei.modelo.enums.TipoContato; | 39 | import br.gov.ans.integracao.sei.modelo.enums.TipoContato; |
| 40 | import br.gov.ans.integracao.sei.utils.Constantes; | 40 | import br.gov.ans.integracao.sei.utils.Constantes; |
| 41 | import br.gov.ans.integracao.sei.utils.ContatoHelper; | 41 | import br.gov.ans.integracao.sei.utils.ContatoHelper; |
| 42 | +import br.gov.ans.integracao.sei.utils.MessagesKeys; | ||
| 42 | import br.gov.ans.integracao.sei.utils.PessoaHelper; | 43 | import br.gov.ans.integracao.sei.utils.PessoaHelper; |
| 43 | import br.gov.ans.utils.MessageUtils; | 44 | import br.gov.ans.utils.MessageUtils; |
| 44 | 45 | ||
| @@ -288,7 +289,7 @@ public class ContatoResource { | @@ -288,7 +289,7 @@ public class ContatoResource { | ||
| 288 | null, null, sigla, null, null, null, null, null); | 289 | null, null, sigla, null, null, null, null, null); |
| 289 | 290 | ||
| 290 | if(ArrayUtils.isEmpty(contatos)){ | 291 | if(ArrayUtils.isEmpty(contatos)){ |
| 291 | - throw new ResourceNotFoundException(messages.getMessage("erro.contato.nao.encontrado",sigla)); | 292 | + throw new ResourceNotFoundException(messages.getMessage(MessagesKeys.ERRO_CONTATO_NAO_ENCONTRADO, sigla)); |
| 292 | } | 293 | } |
| 293 | 294 | ||
| 294 | return pessoaHelper.buildPessoa(contatos[0]); | 295 | return pessoaHelper.buildPessoa(contatos[0]); |
src/main/java/br/gov/ans/integracao/sei/rest/DocumentoResource.java
| @@ -62,6 +62,7 @@ import br.gov.ans.integracao.sei.modelo.ExclusaoDocumento; | @@ -62,6 +62,7 @@ import br.gov.ans.integracao.sei.modelo.ExclusaoDocumento; | ||
| 62 | import br.gov.ans.integracao.sei.modelo.InclusaoDocumento; | 62 | import br.gov.ans.integracao.sei.modelo.InclusaoDocumento; |
| 63 | import br.gov.ans.integracao.sei.modelo.Operacao; | 63 | import br.gov.ans.integracao.sei.modelo.Operacao; |
| 64 | import br.gov.ans.integracao.sei.utils.Constantes; | 64 | import br.gov.ans.integracao.sei.utils.Constantes; |
| 65 | +import br.gov.ans.integracao.sei.utils.MessagesKeys; | ||
| 65 | import br.gov.ans.utils.MessageUtils; | 66 | import br.gov.ans.utils.MessageUtils; |
| 66 | import br.gov.ans.utils.MustacheUtils; | 67 | import br.gov.ans.utils.MustacheUtils; |
| 67 | 68 | ||
| @@ -74,11 +75,9 @@ public class DocumentoResource { | @@ -74,11 +75,9 @@ public class DocumentoResource { | ||
| 74 | @Inject | 75 | @Inject |
| 75 | private UnidadeResource unidadeResource; | 76 | private UnidadeResource unidadeResource; |
| 76 | 77 | ||
| 77 | - @SuppressWarnings("cdi-ambiguous-dependency") | ||
| 78 | @Inject | 78 | @Inject |
| 79 | private DAO<InclusaoDocumento> daoInclusaoDocumento; | 79 | private DAO<InclusaoDocumento> daoInclusaoDocumento; |
| 80 | 80 | ||
| 81 | - @SuppressWarnings("cdi-ambiguous-dependency") | ||
| 82 | @Inject | 81 | @Inject |
| 83 | private DAO<ExclusaoDocumento> daoExclusaoDocumento; | 82 | private DAO<ExclusaoDocumento> daoExclusaoDocumento; |
| 84 | 83 | ||
| @@ -517,7 +516,7 @@ public class DocumentoResource { | @@ -517,7 +516,7 @@ public class DocumentoResource { | ||
| 517 | URL url = new URL(linkAcesso); | 516 | URL url = new URL(linkAcesso); |
| 518 | URLConnection con = url.openConnection(); | 517 | URLConnection con = url.openConnection(); |
| 519 | 518 | ||
| 520 | - String contentType = con.getHeaderField("Content-Type"); | 519 | + String contentType = con.getHeaderField(Constantes.CONTENT_TYPE_HEADER_KEY); |
| 521 | 520 | ||
| 522 | InputStream in = con.getInputStream(); | 521 | InputStream in = con.getInputStream(); |
| 523 | 522 | ||
| @@ -669,7 +668,8 @@ public class DocumentoResource { | @@ -669,7 +668,8 @@ public class DocumentoResource { | ||
| 669 | logger.debug(messages.getMessage("hash.em.geracao")); | 668 | logger.debug(messages.getMessage("hash.em.geracao")); |
| 670 | return HashUtils.toSHA256(input, null); | 669 | return HashUtils.toSHA256(input, null); |
| 671 | } catch (Exception ex) { | 670 | } catch (Exception ex) { |
| 672 | - logger.error(messages.getMessage("erro.calculo.hash"), ex); | 671 | + logger.error(messages.getMessage("erro.calculo.hash")); |
| 672 | + logger.debug(ex, ex); | ||
| 673 | return messages.getMessage("erro.calculo.hash"); | 673 | return messages.getMessage("erro.calculo.hash"); |
| 674 | }finally{ | 674 | }finally{ |
| 675 | logger.debug(messages.getMessage("hash.gerado")); | 675 | logger.debug(messages.getMessage("hash.gerado")); |
src/main/java/br/gov/ans/integracao/sei/rest/MessagesKeys.java
| @@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
| 1 | -package br.gov.ans.integracao.sei.rest; | ||
| 2 | - | ||
| 3 | -public class MessagesKeys { | ||
| 4 | - public static final String DEBUG_NOVO_DOCUMENTO_ENVIADO = "debug.novo.documento.enviado"; | ||
| 5 | - public static final String DEBUG_NOVO_DOCUMENTO_PROCESSADO = "debug.novo.documento.processado"; | ||
| 6 | -} |
src/main/java/br/gov/ans/integracao/sei/rest/ProcessoResource.java
| @@ -254,7 +254,8 @@ public class ProcessoResource { | @@ -254,7 +254,8 @@ public class ProcessoResource { | ||
| 254 | getSOuN(exibirInteressados), getSOuN(exibirObservacoes), getSOuN(exibirAndamento), getSOuN(exibirAndamentoConclusao), getSOuN(exibirUltimoAndamento), getSOuN(exibirUnidadesAberto), | 254 | getSOuN(exibirInteressados), getSOuN(exibirObservacoes), getSOuN(exibirAndamento), getSOuN(exibirAndamentoConclusao), getSOuN(exibirUltimoAndamento), getSOuN(exibirUnidadesAberto), |
| 255 | getSOuN(exibirProcessosRelacionados), getSOuN(exibirProcessosAnexados)); | 255 | getSOuN(exibirProcessosRelacionados), getSOuN(exibirProcessosAnexados)); |
| 256 | }catch(AxisFault ex){ | 256 | }catch(AxisFault ex){ |
| 257 | - logger.error(ex, ex); | 257 | + logger.error(ex); |
| 258 | + logger.debug(ex, ex); | ||
| 258 | return null; | 259 | return null; |
| 259 | } | 260 | } |
| 260 | } | 261 | } |
src/main/java/br/gov/ans/integracao/sei/utils/MessagesKeys.java
0 → 100644
| @@ -0,0 +1,7 @@ | @@ -0,0 +1,7 @@ | ||
| 1 | +package br.gov.ans.integracao.sei.utils; | ||
| 2 | + | ||
| 3 | +public class MessagesKeys { | ||
| 4 | + public static final String DEBUG_NOVO_DOCUMENTO_ENVIADO = "debug.novo.documento.enviado"; | ||
| 5 | + public static final String DEBUG_NOVO_DOCUMENTO_PROCESSADO = "debug.novo.documento.processado"; | ||
| 6 | + public static final String ERRO_CONTATO_NAO_ENCONTRADO = "erro.contato.nao.encontrado"; | ||
| 7 | +} |