|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| package org.globus.cas.impl.bootstrap; |
|
12 |
| |
|
13 |
| import org.globus.cas.impl.CasConstants; |
|
14 |
| |
|
15 |
| import org.globus.cas.types.ServiceTypeData; |
|
16 |
| import org.globus.cas.types.NamespaceData; |
|
17 |
| |
|
18 |
| import org.globus.cas.impl.databaseAccess.NamespaceDataHandler; |
|
19 |
| import org.globus.cas.impl.databaseAccess.ServiceTypeDataHandler; |
|
20 |
| import org.globus.cas.impl.databaseAccess.ServiceTypeActionHandler; |
|
21 |
| |
|
22 |
| public class PopulateImplicitFTPData { |
|
23 |
| |
|
24 |
| |
|
25 |
| final public static String ftpServiceType = "file"; |
|
26 |
| |
|
27 |
| |
|
28 |
| final public static String readAction = "read"; |
|
29 |
| final public static String lookupAction = "lookup"; |
|
30 |
| final public static String writeAction = "write"; |
|
31 |
| final public static String createAction = "create"; |
|
32 |
| final public static String deleteAction = "delete"; |
|
33 |
| final public static String chdirAction = "chdir"; |
|
34 |
| |
|
35 |
| |
|
36 |
| final public static String ftpWildcardNS = "FTPDirectoryTree"; |
|
37 |
| final public static String ftpExactNS = "FTPExact"; |
|
38 |
| |
|
39 |
0
| public static void populateDb() throws Exception {
|
|
40 |
| |
|
41 |
| |
|
42 |
0
| NamespaceData nsData1 = new NamespaceData();
|
|
43 |
0
| nsData1.setNickname(ftpWildcardNS);
|
|
44 |
0
| nsData1.setBasename(".");
|
|
45 |
0
| nsData1.setComparisonAlg(CasConstants.WILD_ALG_CLASSNAME);
|
|
46 |
0
| NamespaceDataHandler.storeObject(nsData1);
|
|
47 |
| |
|
48 |
| |
|
49 |
0
| NamespaceData nsData2 = new NamespaceData();
|
|
50 |
0
| nsData2.setNickname(ftpExactNS);
|
|
51 |
0
| nsData2.setBasename(".");
|
|
52 |
0
| nsData2.setComparisonAlg(CasConstants.EXACT_ALG_CLASSNAME);
|
|
53 |
0
| NamespaceDataHandler.storeObject(nsData2);
|
|
54 |
| |
|
55 |
| |
|
56 |
0
| ServiceTypeData serviceType = new ServiceTypeData();
|
|
57 |
0
| serviceType.setName(ftpServiceType);
|
|
58 |
0
| ServiceTypeDataHandler.storeObject(serviceType);
|
|
59 |
| |
|
60 |
| |
|
61 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
62 |
| readAction); |
|
63 |
| |
|
64 |
| |
|
65 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
66 |
| lookupAction); |
|
67 |
| |
|
68 |
| |
|
69 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
70 |
| writeAction); |
|
71 |
| |
|
72 |
| |
|
73 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
74 |
| createAction); |
|
75 |
| |
|
76 |
| |
|
77 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
78 |
| deleteAction); |
|
79 |
| |
|
80 |
| |
|
81 |
0
| ServiceTypeActionHandler.addServiceActionMapping(ftpServiceType,
|
|
82 |
| chdirAction); |
|
83 |
| } |
|
84 |
| } |