use of org.motechproject.mds.dto.SchemaHolder in project motech by motech.
the class MdsDummyDataGeneratorImpl method generateDummyEntities.
@Override
public void generateDummyEntities(int numberOfEntities, int fieldsPerEntity, int lookupsPerEntity, boolean regenerateBundle) throws IOException {
for (int i = 0; i < numberOfEntities; i++) {
prepareDummyEntity(i, fieldsPerEntity, lookupsPerEntity);
}
if (regenerateBundle) {
SchemaHolder schemaHolder = entityService.getSchema();
jarGeneratorService.regenerateMdsDataBundle(schemaHolder);
}
}
use of org.motechproject.mds.dto.SchemaHolder in project motech by motech.
the class MdsBundleWatcher method handleBundleEvent.
private void handleBundleEvent(final Bundle bundle, final int eventType) {
if (eventType == BundleEvent.INSTALLED || eventType == BundleEvent.UPDATED) {
if (processingSuspended) {
awaitingBundles.add(new AwaitingBundle(bundle, eventType));
} else {
processSingleBundle(bundle);
}
} else if (eventType == BundleEvent.UNRESOLVED && !skipBundle(bundle)) {
LOGGER.info("Unregistering JDO classes for Bundle: {}", bundle.getSymbolicName());
MdsBundleHelper.unregisterBundleJDOClasses(bundle);
} else if (eventType == BundleEvent.UNINSTALLED && !skipBundle(bundle)) {
SchemaHolder schemaHolder = lockAndGetSchema();
refreshBundle(bundle, schemaHolder);
}
}
use of org.motechproject.mds.dto.SchemaHolder in project motech by motech.
the class MdsBundleRegenerationServiceImpl method regenerateMdsDataBundleAfterDdeEnhancement.
@Override
public void regenerateMdsDataBundleAfterDdeEnhancement(String... moduleNames) {
Map<String, Object> params = new HashMap<>();
params.put(MODULE_NAMES_EVENT_PARAM, moduleNames);
broadcast(REGENERATE_MDS_DATA_BUNDLE_AFTER_DDE_ENHANCEMENT, params);
SchemaHolder schemaHolder = entityService.getSchema();
jarGeneratorService.regenerateMdsDataBundleAfterDdeEnhancement(schemaHolder, moduleNames);
}
use of org.motechproject.mds.dto.SchemaHolder in project motech by motech.
the class MdsBundleRegenerationServiceImpl method handleMdsDataBundleRegenerationAfterDdeEnhancement.
private void handleMdsDataBundleRegenerationAfterDdeEnhancement(Event event) {
if (!isBroadcastFromThisInstance(event)) {
SchemaHolder schemaHolder = entityService.getSchema();
String[] moduleNames = (String[]) event.getProperty(MODULE_NAMES_EVENT_PARAM);
jarGeneratorService.regenerateMdsDataBundleAfterDdeEnhancement(schemaHolder, moduleNames);
}
}
Aggregations