1 /* 2 * Copyright (c) 2002-2017, 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.deployment.business; 35 36 import java.io.Serializable; 37 import java.util.HashMap; 38 import java.util.Map; 39 40 public class CommandResult implements Cloneable, Serializable 41 { 42 /** 43 * 44 */ 45 private static final long serialVersionUID = 1L; 46 47 // synchro needed? 48 49 /** 50 * 51 */ 52 53 public static int STATUS_ERROR = 0; 54 public static int STATUS_OK = 1; 55 public static int ERROR_TYPE_INFO = 0; 56 public static int ERROR_TYPE_STOP = 1; 57 58 private StringBuffer _strLog; 59 private int _nStatus; 60 private int _nErrorType; 61 private boolean _bRunning; 62 private String _strError; 63 64 private Map<String, String> _mResultInformations = new HashMap<String, String>( ); 65 66 /** 67 * "Getter method" pour la variable {@link #_strLog} 68 * 69 * @return La variable {@link #_strLog} 70 */ 71 public StringBuffer getLog( ) 72 { 73 return _strLog; 74 } 75 76 /** 77 * "Setter method" pour la variable {@link #_strLog} 78 * 79 * @param strLog 80 * La nouvelle valeur de la variable {@link #_strLog} 81 */ 82 public void setLog( StringBuffer strLog ) 83 { 84 _strLog = strLog; 85 } 86 87 /** 88 * "Getter method" pour la variable {@link #_nStatus} 89 * 90 * @return La variable {@link #_nStatus} 91 */ 92 public int getStatus( ) 93 { 94 return _nStatus; 95 } 96 97 /** 98 * "Setter method" pour la variable {@link #_nStatus} 99 * 100 * @param nStatus 101 * La nouvelle valeur de la variable {@link #_nStatus} 102 */ 103 public void setStatus( int nStatus ) 104 { 105 _nStatus = nStatus; 106 } 107 108 /** 109 * "Getter method" pour la variable {@link #_bRunning} 110 * 111 * @return La variable {@link #_bRunning} 112 */ 113 public boolean isRunning( ) 114 { 115 return _bRunning; 116 } 117 118 /** 119 * "Setter method" pour la variable {@link #_bRunning} 120 * 121 * @param bRunning 122 * La nouvelle valeur de la variable {@link #_bRunning} 123 */ 124 public void setRunning( boolean bRunning ) 125 { 126 _bRunning = bRunning; 127 } 128 129 /** 130 * 131 * {@inheritDoc} 132 */ 133 @Override 134 public Object clone( ) throws CloneNotSupportedException 135 { 136 CommandResult clone = (CommandResult) super.clone( ); 137 clone._bRunning = this._bRunning; 138 clone._nStatus = this._nStatus; 139 clone._strLog = this._strLog; 140 clone._strError = this._strError; 141 142 return clone; 143 } 144 145 /** 146 * "Getter method" pour la variable {@link #_nIdError} 147 * 148 * @return La variable {@link #_nIdError} 149 */ 150 public String getError( ) 151 { 152 return _strError; 153 } 154 155 /** 156 * "Setter method" pour la variable {@link #_nIdError} 157 * 158 * @param nIdError 159 * La nouvelle valeur de la variable {@link #_nIdError} 160 */ 161 public void setError( String strIdError ) 162 { 163 _strError = strIdError; 164 } 165 166 public Map<String, String> getResultInformations( ) 167 { 168 return _mResultInformations; 169 } 170 171 public void setResultInformations( Map<String, String> _mResultInformations ) 172 { 173 this._mResultInformations = _mResultInformations; 174 } 175 176 public int getErrorType( ) 177 { 178 return _nErrorType; 179 } 180 181 public void setErrorType( int _nErrorType ) 182 { 183 this._nErrorType = _nErrorType; 184 } 185 186 }