1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.fatwire.gst.foundation.facade.cm;
18
19 import COM.FutureTense.Interfaces.ICS;
20
21 import com.fatwire.gst.foundation.facade.FTValListFacade;
22
23 public abstract class FTCmdTemplate extends FTValListFacade {
24
25 public static final String FTCMD = "ftcmd";
26
27 private final String ftcmd;
28
29 protected FTCmdTemplate(final String ftcmd, final String table) {
30 super();
31 list.setValString(FTCMD, ftcmd);
32 list.setValString("tablename", table);
33 this.ftcmd = ftcmd;
34 }
35
36
37
38
39
40
41
42 protected boolean preExcecuteAssert(final ICS ics) {
43 return true;
44 }
45
46 protected void postExcecuteCheck(final ICS ics) {
47
48 }
49
50 final public void execute(final ICS ics) {
51 if (this.preExcecuteAssert(ics)) {
52 ics.ClearErrno();
53 if (!ics.CatalogManager(list)) {
54 throw new RuntimeException("CatalogManager said no to " + ftcmd + "with errno: " + ics.GetErrno());
55 }
56 this.postExcecuteCheck(ics);
57 }
58 }
59
60 }