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


Java RepoUsageLevel类代码示例

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


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

示例1: onChangeRestriction

import org.alfresco.service.cmr.admin.RepoUsageStatus.RepoUsageLevel; //导入依赖的package包/类
/**
 * Checks the current status, logs messages and sets a read-write veto, if necessary
 */
@Override
public void onChangeRestriction(RepoUsage restrictions)
{
    RepoUsageStatus status = repoUsageComponent.getUsageStatus();
    if (logger.isDebugEnabled())
    {
        logger.debug("Current status is " + status);
    }
    
    status.logMessages(logger);
    
    if (status.getLevel() == RepoUsageLevel.LOCKED_DOWN)
    {
        transactionService.setAllowWrite(false, vetoName);
    }
    else
    {
        transactionService.setAllowWrite(true, vetoName);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:RepoUsageMonitor.java

示例2: putUsageInModel

import org.alfresco.service.cmr.admin.RepoUsageStatus.RepoUsageLevel; //导入依赖的package包/类
/**
 * Helper to assign JSON return variables based on the repository usage data.
 */
protected void putUsageInModel(
        Map<String, Object> model,
        RepoUsage repoUsage,
        boolean updated)
{
    model.put(JSON_KEY_LAST_UPDATE, repoUsage.getLastUpdate());
    model.put(JSON_KEY_USERS, repoUsage.getUsers());
    model.put(JSON_KEY_DOCUMENTS, repoUsage.getDocuments());
    model.put(JSON_KEY_LICENSE_MODE, repoUsage.getLicenseMode());
    model.put(JSON_KEY_READ_ONLY, repoUsage.isReadOnly());
    model.put(JSON_KEY_LICENSE_VALID_UNTIL, repoUsage.getLicenseExpiryDate());
    model.put(JSON_KEY_UPDATED, updated);

    // Add license holder
    LicenseDescriptor license = descriptorService.getLicenseDescriptor();
    if (license != null)
    {
        model.put(JSON_KEY_LICENSE_HOLDER, license.getHolderOrganisation());
    }

    model.put(JSON_KEY_LEVEL, RepoUsageLevel.OK.ordinal());
    model.put(JSON_KEY_WARNINGS, Collections.emptyList());
    model.put(JSON_KEY_ERRORS, Collections.emptyList());
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:28,代码来源:AbstractAdminWebScript.java


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