OperazioniFormBean.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.web.ctrlstat.servlet.operazioni;

  21. import java.util.List;
  22. import java.util.ArrayList;

  23. import org.openspcoop2.web.lib.queue.costanti.OperationStatus;
  24. import org.openspcoop2.web.lib.users.dao.User;

  25. /**
  26.  * OperazioniFormBean
  27.  *
  28.  * @author Pintori Giuliano (pintori@link.it)
  29.  * @author $Author$
  30.  * @version $Rev$, $Date$
  31.  */
  32. public class OperazioniFormBean {


  33.     private String utente;

  34.     private String tipo;

  35.     private String method;

  36.     private String idOperazione;

  37.     private String dataInizio;
  38.     private String dataFine;
  39.     private String hostname;
  40.     private String pezzoAny;
  41.     private List<String> listaUtenti;  
  42.     private List<User> listaUser;

  43.     public String getDataInizio() {
  44.         return this.dataInizio;
  45.     }

  46.     public void setDataInizio(String dataInizio) {
  47.         this.dataInizio = dataInizio;
  48.     }

  49.     public String getDataFine() {
  50.         return this.dataFine;
  51.     }

  52.     public void setDataFine(String dataFine) {
  53.         this.dataFine = dataFine;
  54.     }

  55.     public String getHostname() {
  56.         return this.hostname;
  57.     }

  58.     public void setHostname(String hostname) {
  59.         this.hostname = hostname;
  60.     }

  61.     public String getPezzoAny() {
  62.         return this.pezzoAny;
  63.     }

  64.     public void setPezzoAny(String pezzoAny) {
  65.         this.pezzoAny = pezzoAny;
  66.     }

  67.     public List<String> getListaUtenti() {
  68.         return this.listaUtenti;
  69.     }

  70.     public List<String> getUtenti(){
  71.         List<String> values = new ArrayList<>();
  72.         if(this.listaUser != null){
  73.             for (User user : this.listaUser) {
  74.                 values.add(user.getLogin());
  75.             }
  76.         }

  77.         return values;
  78.     }

  79.     public void setListaUtenti(List<String> listaUtenti) {
  80.         this.listaUtenti = listaUtenti;
  81.     }

  82.     public String getIdOperazione() {
  83.         return this.idOperazione;
  84.     }

  85.     public void setIdOperazione(String idOperazione) {
  86.         this.idOperazione = idOperazione;
  87.     }

  88.     public String getUtente() {
  89.         return this.utente;
  90.     }

  91.     public void setUtente(String utente) {
  92.         this.utente = utente;
  93.     }

  94.     public String getTipo() {
  95.         return this.tipo;
  96.     }

  97.     public OperationStatus getTipoOperationStatus(){
  98.         if(this.tipo != null){
  99.             if(this.tipo.equals(OperazioniCostanti.PARAMETRO_OPERAZIONI_OPERAZIONE_IN_CODA))
  100.                 return OperationStatus.NOT_SET;
  101.             else if(this.tipo.equals(OperazioniCostanti.PARAMETRO_OPERAZIONI_OPERAZIONE_ESEGUITE))
  102.                 return OperationStatus.SUCCESS;
  103.             else if(this.tipo.equals(OperazioniCostanti.PARAMETRO_OPERAZIONI_OPERAZIONE_ATTESA))
  104.                 return OperationStatus.WAIT;            
  105.             else if(this.tipo.equals(OperazioniCostanti.PARAMETRO_OPERAZIONI_OPERAZIONE_FALLITE))
  106.                 return OperationStatus.ERROR;  
  107.             else if(this.tipo.equals(OperazioniCostanti.PARAMETRO_OPERAZIONI_OPERAZIONE_INVALIDE))
  108.                 return OperationStatus.INVALID;        
  109.         }

  110.         return null;
  111.     }

  112.     public void setTipo(String tipo) {
  113.         this.tipo = tipo;
  114.     }

  115.     public String getMethod() {
  116.         return this.method;
  117.     }

  118.     public void setMethod(String method) {
  119.         this.method = method;
  120.     }

  121.     public List<User> getListaUser() {
  122.         return this.listaUser;
  123.     }

  124.     public void setListaUser(List<User> listaUser) {
  125.         this.listaUser = listaUser;
  126.     }

  127.    

  128.      

  129. }