Project

General

Profile

« Previous | Next » 

Revision 10362

Added by Jing Tao over 7 years ago

Add the code to handle query and view service.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
1140 1140
        List<String> mnStorageServiceVersions = null;
1141 1141
        List<String> mnReplicationServiceVersions = null;
1142 1142
        List<String> mnPackageServiceVersions = null;
1143
        List<String> mnQueryServiceVersions = null;
1144
        List<String> mnViewServiceVersions = null;
1143 1145

  
1144 1146
        boolean nodeSynchronize = false;
1145 1147
        boolean nodeReplicate = false;
......
1149 1151
        List<String> mnStorageServiceAvailables = null;
1150 1152
        List<String> mnReplicationServiceAvailables = null;
1151 1153
        List<String> mnPackageServiceAvailables = null;
1154
        List<String> mnQueryServiceAvailables = null;
1155
        List<String> mnViewServiceAvailables = null;
1152 1156

  
1153 1157
        try {
1154 1158
            // get the properties of the node based on configuration information
......
1285 1289
                }
1286 1290
            }
1287 1291
            
1292
            mnQueryServiceVersions = Settings.getConfiguration().getList("dataone.mnQuery.serviceVersion");
1293
            mnQueryServiceAvailables = Settings.getConfiguration().getList("dataone.mnQuery.serviceAvailable");
1294
            if(mnQueryServiceVersions != null && mnQueryServiceAvailables != null && mnQueryServiceVersions.size() == mnQueryServiceAvailables.size()) {
1295
                for (int i=0; i<mnQueryServiceVersions.size(); i++) {
1296
                    String version = mnQueryServiceVersions.get(i);
1297
                    boolean available = new Boolean(mnQueryServiceAvailables.get(i)).booleanValue();
1298
                    Service sMNQuery = new Service();
1299
                    sMNQuery.setName("MNQuery");
1300
                    sMNQuery.setVersion(version);
1301
                    sMNQuery.setAvailable(available);
1302
                    services.addService(sMNQuery);
1303
                }
1304
            }
1305
            
1306
            mnViewServiceVersions = Settings.getConfiguration().getList("dataone.mnView.serviceVersion");
1307
            mnViewServiceAvailables = Settings.getConfiguration().getList("dataone.mnView.serviceAvailable");
1308
            if(mnViewServiceVersions != null && mnViewServiceAvailables != null && mnViewServiceVersions.size() == mnViewServiceAvailables.size()) {
1309
                for (int i=0; i<mnViewServiceVersions.size(); i++) {
1310
                    String version = mnViewServiceVersions.get(i);
1311
                    boolean available = new Boolean(mnViewServiceAvailables.get(i)).booleanValue();
1312
                    Service sMNView = new Service();
1313
                    sMNView.setName("MNView");
1314
                    sMNView.setVersion(version);
1315
                    sMNView.setAvailable(available);
1316
                    services.addService(sMNView);
1317
                }
1318
            }
1319
            
1288 1320
            node.setServices(services);
1289 1321

  
1290 1322
            // Set the schedule for synchronization

Also available in: Unified diff