当前位置: 首页>>代码示例>>Java>>正文


Java MongoDbConf类代码示例

本文整理汇总了Java中org.entcore.common.mongodb.MongoDbConf的典型用法代码示例。如果您正苦于以下问题:Java MongoDbConf类的具体用法?Java MongoDbConf怎么用?Java MongoDbConf使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MongoDbConf类属于org.entcore.common.mongodb包,在下文中一共展示了MongoDbConf类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.entcore.common.mongodb.MongoDbConf; //导入依赖的package包/类
@Override
public void start() {
	super.start();

	MongoDbConf.getInstance().setCollection("communityPages");
	TimelineHelper timeline = new TimelineHelper(vertx, vertx.eventBus(), this.container);

	// Set RepositoryEvents implementation used to process events published for transition
	setRepositoryEvents(new CommunityRepositoryEvents(vertx.eventBus()));

	setDefaultResourceFilter(new ManagerFilter());
	CommunityController communityController = new CommunityController(timeline);
	communityController.setCommunityService(new DefaultCommunityService());
	addController(communityController);

	addController(new PagesController());
}
 
开发者ID:OPEN-ENT-NG,项目名称:community,代码行数:18,代码来源:Community.java

示例2: start

import org.entcore.common.mongodb.MongoDbConf; //导入依赖的package包/类
@Override
public void start() {
	super.start();
	MongoDbConf.getInstance().setCollection(SHARE_BIG_FILE_COLLECTION);

	if (config.getObject("swift") == null && config.getObject("file-system") == null) {
		log.fatal("[Share Big File] Error : Module property 'swift' or 'file-system' must be defined");
		vertx.stop();
	}

	final Long maxQuota = config.getLong("maxQuota", 1073741824L);
	final Long maxRepositoryQuota = config.getLong("maxRepositoryQuota", 1099511627776L);
	final JsonArray expirationDateList = config.getArray("expirationDateList",
			new JsonArray(new Integer[]{1, 5, 10, 30}));

	final CrudService shareBigFileCrudService = new MongoDbCrudService(SHARE_BIG_FILE_COLLECTION);
	final ShareBigFilesService shareBigFilesService = new ShareBigFilesServiceImpl(maxQuota);
	final Storage storage = new StorageFactory(vertx, container.config(), new ShareBigFileStorage()).getStorage();
	addController(new ShareBigFilesController(storage, shareBigFileCrudService, shareBigFilesService, log, maxQuota,
			maxRepositoryQuota, expirationDateList));

	setDefaultResourceFilter(new ShareAndOwner());
	// Subscribe to events published for searching
	if (config.getBoolean("searching-event", true)) {
		setSearchingEvents(new ShareBigFilesSearchingEvents(new MongoDbSearchService(SHARE_BIG_FILE_COLLECTION)));
	}

	final String purgeFilesCron = container.config().getString("purgeFilesCron", "0 0 23 * * ?");
	final TimelineHelper timelineHelper = new TimelineHelper(vertx, vertx.eventBus(), container);

	try {
		new CronTrigger(vertx, purgeFilesCron).schedule(
				new DeleteOldFile(timelineHelper, storage)
		);
	} catch (ParseException e) {
		log.fatal("[Share Big File] Invalid cron expression.", e);
		vertx.stop();
	}
}
 
开发者ID:OPEN-ENT-NG,项目名称:share-big-files,代码行数:40,代码来源:ShareBigFiles.java

示例3: start

import org.entcore.common.mongodb.MongoDbConf; //导入依赖的package包/类
/**
 * Entry point of the Vert.x module
 */
@Override
public void start() {
    super.start();

    MongoDbConf conf = MongoDbConf.getInstance();
    conf.setCollection(COLLABORATIVEEDITOR_COLLECTION);

    setDefaultResourceFilter(new ShareAndOwner());

    addController(new CollaborativeEditorController(vertx, COLLABORATIVEEDITOR_COLLECTION, container));
    // Subscribe to events published for searching
    final EPLiteClient epClient = new EPLiteClient(vertx, config.getString("etherpad-public-url",
            config.getString("etherpad-url", "")), config.getString("etherpad-api-key",""), config.getBoolean("trust-all-certificate", true));

    if (config.getBoolean("searching-event", true)) {
        setSearchingEvents(new CollaborativeEditorSearchingEvents(vertx,
                new MongoDbSearchService(COLLABORATIVEEDITOR_COLLECTION)));
    }

    final String unusedPadCron = container.config().getString("unusedPadCron", "0 0 23 * * ?");
    final TimelineHelper timelineHelper = new TimelineHelper(vertx, vertx.eventBus(), container);

    try {
        new CronTrigger(vertx, unusedPadCron).schedule(
                new NotUsingPAD(timelineHelper, epClient, container.config())
        );
    } catch (ParseException e) {
        log.fatal("[Collaborative Editor] Invalid cron expression.", e);
        vertx.stop();
    }
}
 
开发者ID:OPEN-ENT-NG,项目名称:collaborative-editor,代码行数:35,代码来源:CollaborativeEditor.java


注:本文中的org.entcore.common.mongodb.MongoDbConf类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。