Coverage Report - fr.paris.lutece.plugins.releaser.util.CommandResult
 
Classes in this File Line Coverage Branch Coverage Complexity
CommandResult
46 %
18/39
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2002-2013, Mairie de Paris
 3  
  * All rights reserved.
 4  
  *
 5  
  * Redistribution and use in source and binary forms, with or without
 6  
  * modification, are permitted provided that the following conditions
 7  
  * are met:
 8  
  *
 9  
  *  1. Redistributions of source code must retain the above copyright notice
 10  
  *     and the following disclaimer.
 11  
  *
 12  
  *  2. Redistributions in binary form must reproduce the above copyright notice
 13  
  *     and the following disclaimer in the documentation and/or other materials
 14  
  *     provided with the distribution.
 15  
  *
 16  
  *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
 17  
  *     contributors may be used to endorse or promote products derived from
 18  
  *     this software without specific prior written permission.
 19  
  *
 20  
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 21  
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 22  
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 23  
  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
 24  
  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 25  
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 26  
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 27  
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 28  
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 29  
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 30  
  * POSSIBILITY OF SUCH DAMAGE.
 31  
  *
 32  
  * License 1.0
 33  
  */
 34  
 package fr.paris.lutece.plugins.releaser.util;
 35  
 
 36  
 import java.io.Serializable;
 37  
 import java.util.Date;
 38  
 import java.util.HashMap;
 39  
 import java.util.Map;
 40  
 
 41  
 
 42  1
 public class CommandResult implements Cloneable, Serializable
 43  
 {
 44  
     /**
 45  
     *
 46  
     */
 47  
     private static final long serialVersionUID = 1L;
 48  
 
 49  1
     public static int STATUS_ERROR = 0;
 50  1
     public static int STATUS_OK= 1;
 51  1
     public static int ERROR_TYPE_INFO = 0;
 52  1
     public static int ERROR_TYPE_STOP = 1;
 53  
     
 54  
     
 55  
     private StringBuffer _strLog;
 56  
     private int _nStatus;
 57  
     private int _nErrorType;
 58  
     private boolean _bRunning;
 59  
     private Date _dBegin;
 60  
     private Date _dEnd;
 61  
     private int progressValue;
 62  
     
 63  
     private String _strError;
 64  
  
 65  1
     private Map<String,String> _mResultInformations=new HashMap<String, String>();
 66  
     
 67  
     /**
 68  
      * "Getter method" pour la variable {@link #_strLog}
 69  
      * @return La variable {@link #_strLog}
 70  
      */
 71  
     public StringBuffer getLog(  )
 72  
     {
 73  4
         return _strLog;
 74  
     }
 75  
 
 76  
     /**
 77  
      * "Setter method" pour la variable {@link #_strLog}
 78  
      * @param strLog La nouvelle valeur de la variable {@link #_strLog}
 79  
      */
 80  
     public void setLog( StringBuffer strLog )
 81  
     {
 82  1
         _strLog = strLog;
 83  1
     }
 84  
 
 85  
     /**
 86  
      * "Getter method" pour la variable {@link #_nStatus}
 87  
      * @return La variable {@link #_nStatus}
 88  
      */
 89  
     public int getStatus(  )
 90  
     {
 91  0
         return _nStatus;
 92  
     }
 93  
 
 94  
     /**
 95  
      * "Setter method" pour la variable {@link #_nStatus}
 96  
      * @param nStatus La nouvelle valeur de la variable {@link #_nStatus}
 97  
      */
 98  
     public void setStatus( int nStatus )
 99  
     {
 100  1
         _nStatus = nStatus;
 101  1
     }
 102  
 
 103  
     /**
 104  
      * "Getter method" pour la variable {@link #_bRunning}
 105  
      * @return La variable {@link #_bRunning}
 106  
      */
 107  
     public boolean isRunning(  )
 108  
     {
 109  0
         return _bRunning;
 110  
     }
 111  
 
 112  
     /**
 113  
      * "Setter method" pour la variable {@link #_bRunning}
 114  
      * @param bRunning La nouvelle valeur de la variable {@link #_bRunning}
 115  
      */
 116  
     public void setRunning( boolean bRunning )
 117  
     {
 118  1
         _bRunning = bRunning;
 119  1
     }
 120  
 
 121  
     /**
 122  
      *
 123  
      *{@inheritDoc}
 124  
      */
 125  
     @Override
 126  
     public Object clone(  ) throws CloneNotSupportedException
 127  
     {
 128  0
         CommandResult clone = (CommandResult) super.clone(  );
 129  0
         clone._bRunning = this._bRunning;
 130  0
         clone._nStatus = this._nStatus;
 131  0
         clone._strLog = this._strLog;
 132  0
         clone._strError = this._strError;
 133  
 
 134  0
         return clone;
 135  
     }
 136  
 
 137  
     /**
 138  
      * "Getter method" pour la variable {@link #_nIdError}
 139  
      * @return La variable {@link #_nIdError}
 140  
      */
 141  
     public String getError(  )
 142  
     {
 143  0
         return _strError;
 144  
     }
 145  
 
 146  
     /**
 147  
      * "Setter method" pour la variable {@link #_nIdError}
 148  
      * @param nIdError La nouvelle valeur de la variable {@link #_nIdError}
 149  
      */
 150  
     public void setError( String strIdError )
 151  
     {
 152  0
         _strError = strIdError;
 153  0
     }
 154  
 
 155  
         public Map<String,String> getResultInformations() {
 156  0
                 return _mResultInformations;
 157  
         }
 158  
 
 159  
         public void setResultInformations(Map<String,String> _mResultInformations) {
 160  0
                 this._mResultInformations = _mResultInformations;
 161  0
         }
 162  
 
 163  
         public int getErrorType() {
 164  0
                 return _nErrorType;
 165  
         }
 166  
 
 167  
         public void setErrorType(int _nErrorType) {
 168  0
                 this._nErrorType = _nErrorType;
 169  0
         }
 170  
         
 171  
          public Date getDateBegin( )
 172  
             {
 173  0
                 return _dBegin;
 174  
             }
 175  
 
 176  
             public void setDateBegin( Date _dBegin )
 177  
             {
 178  1
                 this._dBegin = _dBegin;
 179  1
             }
 180  
 
 181  
             public Date getDateEnd( )
 182  
             {
 183  0
                 return _dEnd;
 184  
             }
 185  
 
 186  
             public void setDateEnd( Date _dEnd )
 187  
             {
 188  0
                 this._dEnd = _dEnd;
 189  0
             }
 190  
 
 191  
         public int getProgressValue( )
 192  
         {
 193  2
             return progressValue;
 194  
         }
 195  
 
 196  
         public void setProgressValue( int progressValue )
 197  
         {
 198  3
             this.progressValue = progressValue;
 199  3
         }
 200  
 
 201  
         
 202  
 }