Project

General

Profile

« Previous | Next » 

Revision 10361

Added by Jing Tao over 7 years ago

Add the code to read the MNPackage configuration.

View differences:

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

  
1143 1144
        boolean nodeSynchronize = false;
1144 1145
        boolean nodeReplicate = false;
......
1147 1148
        List<String> mnAuthorizationServiceAvailables = null;
1148 1149
        List<String> mnStorageServiceAvailables = null;
1149 1150
        List<String> mnReplicationServiceAvailables = null;
1151
        List<String> mnPackageServiceAvailables = null;
1150 1152

  
1151 1153
        try {
1152 1154
            // get the properties of the node based on configuration information
......
1269 1271
                }
1270 1272
            }
1271 1273
            
1274
            mnPackageServiceVersions = Settings.getConfiguration().getList("dataone.mnPackage.serviceVersion");
1275
            mnPackageServiceAvailables = Settings.getConfiguration().getList("dataone.mnPackage.serviceAvailable");
1276
            if(mnPackageServiceVersions != null && mnPackageServiceAvailables != null && mnPackageServiceVersions.size() == mnPackageServiceAvailables.size()) {
1277
                for (int i=0; i<mnPackageServiceVersions.size(); i++) {
1278
                    String version = mnPackageServiceVersions.get(i);
1279
                    boolean available = new Boolean(mnPackageServiceAvailables.get(i)).booleanValue();
1280
                    Service sMNPakcage = new Service();
1281
                    sMNPakcage.setName("MNPackage");
1282
                    sMNPakcage.setVersion(version);
1283
                    sMNPakcage.setAvailable(available);
1284
                    services.addService(sMNPakcage);
1285
                }
1286
            }
1287
            
1272 1288
            node.setServices(services);
1273 1289

  
1274 1290
            // Set the schedule for synchronization

Also available in: Unified diff