Source code: com/flexstor/common/data/ActionResult.java
1 /*
2 * ActionResult.java
3 *
4 * Copyright $Date: 2003/08/11 02:22:35 $ FLEXSTOR.net Inc.
5 *
6 * This work is licensed for use and distribution under license terms found at
7 * http://www.flexstor.org/license.html
8 *
9 */
10
11 package com.flexstor.common.data;
12
13 import java.util.Vector;
14
15 /**
16 * ActionResult returns the result from a service performed to an ActionData object.
17 * It returns the ActionData object with only those records that succeeded; those with
18 * failures are returned in a Vector.
19 * All services for FLEXSTORdb should return this object in the return value of the go method.
20 */
21 public class ActionResult
22 extends KeyedCollectionData
23 {
24 /**
25 * All Service results should include a boolean indicating good
26 * completion (true) or errors (false)
27 */
28 private boolean bSucess;
29
30 /**
31 * Transaction id of the service just performed
32 */
33 private int nTransId;
34
35 /**
36 * Stores the ActionData object used in the service
37 */
38 private ActionData data;
39
40 /**
41 * Store the AssetRecordData objects for records that failed to
42 * process
43 */
44 private Vector vBadRecords = null;
45
46 public ActionResult() {}
47 public ActionResult(boolean bSucess) { this.bSucess = bSucess; }
48
49 public boolean isSuccess() { return bSucess; }
50 public void setSuccess(boolean bSucess) { this.bSucess = bSucess; }
51
52 public void setId(int nTransId) { this.nTransId = nTransId; }
53 public int getId() { return nTransId; }
54
55 public void setData( ActionData data ) { this.data = data; }
56 public ActionData getData() { return data; }
57
58 public void setBadRecords( Vector vBadRecords ) { this.vBadRecords = vBadRecords; }
59 public Vector getBadRecords() { return vBadRecords; }
60
61 public Vector getGoodRecords() { return data != null ? data.getRecords() : null; }
62 }