View Javadoc

1   /*
2    * Copyright 2008 fastConnect.
3    *    
4    * This file is part of Composite BulkDataPersister.  
5    *
6    * This is free software; you can redistribute it and/or modify it
7    * under the terms of the GNU Lesser General Public License as
8    * published by the Free Software Foundation; either version 3 of
9    * the License, or (at your option) any later version.
10   *
11   * This software 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 GNU
14   * Lesser General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this software. If not, see <http://www.gnu.org/licenses/>.
18   */
19  package fr.fastconnect.gigaspaces.datasource.strategy;
20  
21  import java.util.List;
22  
23  import com.gigaspaces.datasource.BulkItem;
24  import com.gigaspaces.datasource.DataSourceException;
25  
26  /**
27   * Encapsulates information from a failed execution of {@link com.gigaspaces.datasource.BulkDataPersister.BulkDataPersister#executeBulk(List)}.
28   * 
29   * @see fr.fastconnect.gigaspaces.datasource.ExecutionFailureStrategy.ExecutionFailureStrategy
30   */
31  public class SpaceStorageExecutionFailure {
32  	
33  	private Long timestamp;
34  	private String bulkDataPersisterClassName;
35  	private List<BulkItem> bulkItems;
36  	private DataSourceException exception;
37  	
38  	public SpaceStorageExecutionFailure() {
39  	}
40  	
41  	public SpaceStorageExecutionFailure(final String bulkDataPersisterClassName, final List<BulkItem> bulkItems, final DataSourceException e) {
42  		this.timestamp = System.currentTimeMillis();
43  		this.bulkDataPersisterClassName = bulkDataPersisterClassName;
44  		this.bulkItems = bulkItems;
45  		this.exception = e;
46  	}
47  	
48  	public Long getTimestamp() {
49  		return this.timestamp;
50  	}
51  	
52  	public void setTimestamp(final Long timestamp) {
53  		this.timestamp = timestamp;
54  	}
55  	
56  	public String getBulkDataPersisterClassName() {
57  		return this.bulkDataPersisterClassName;
58  	}
59  	
60  	public void setBulkDataPersisterClassName(final String bulkDataPersisterClassName) {
61  		this.bulkDataPersisterClassName = bulkDataPersisterClassName;
62  	}
63  	
64  	public List<BulkItem> getBulkItems() {
65  		return this.bulkItems;
66  	}
67  	
68  	public void setBulkItems(final List<BulkItem> bulkItems) {
69  		this.bulkItems = bulkItems;
70  	}
71  	
72  	public DataSourceException getDataSourceException() {
73  		return this.exception;
74  	}
75  	
76  	public void setDataSourceException(final DataSourceException exception) {
77  		this.exception = exception;
78  	}
79  	
80  }