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


Java CustomModelsInfo类代码示例

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


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

示例1: collectData

import org.alfresco.repo.dictionary.CustomModelsInfo; //导入依赖的package包/类
@Override
public List<HBData> collectData()
{
    logger.debug("Preparing repository usage (model) data...");

    final CustomModelsInfo customModelsInfo = transactionService.getRetryingTransactionHelper().doInTransaction(
            () -> customModelService.getCustomModelsInfo(), true);

    Map<String, Object> modelUsageValues = new HashMap<>();
    modelUsageValues.put("numOfActiveModels", new Integer(customModelsInfo.getNumberOfActiveModels()));
    modelUsageValues.put("numOfActiveTypes", new Integer(customModelsInfo.getNumberOfActiveTypes()));
    modelUsageValues.put("numOfActiveAspects", new Integer(customModelsInfo.getNumberOfActiveAspects()));
    HBData modelUsageData = new HBData(
            this.currentRepoDescriptorDAO.getDescriptor().getId(),
            this.getCollectorId(),
            this.getCollectorVersion(),
            new Date(),
            modelUsageValues);

    return Arrays.asList(modelUsageData);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ModelUsageDataCollector.java

示例2: setUp

import org.alfresco.repo.dictionary.CustomModelsInfo; //导入依赖的package包/类
@Before
public void setUp()
{
    mockDescriptorDAO = mock(DescriptorDAO.class);
    mockCollectorService = mock(HBDataCollectorService.class);

    Descriptor mockDescriptor = mock(Descriptor.class);
    when(mockDescriptor.getId()).thenReturn("mock_id");
    when(mockDescriptorDAO.getDescriptor()).thenReturn(mockDescriptor);

    CustomModelsInfo mockCustomModelsInfo = mock(CustomModelsInfo.class);
    CustomModelService customModelService = mock(CustomModelService.class);
    when(customModelService.getCustomModelsInfo()).thenReturn(mockCustomModelsInfo);

    TransactionService mockTransactionService = mock(TransactionService.class);
    RetryingTransactionHelper mockRetryingTransactionHelper = mock(RetryingTransactionHelper.class);
    when(mockRetryingTransactionHelper.doInTransaction(any(RetryingTransactionHelper.RetryingTransactionCallback.class), anyBoolean())).thenReturn(mockCustomModelsInfo);
    when(mockTransactionService.getRetryingTransactionHelper()).thenReturn(mockRetryingTransactionHelper);

    usageModelCollector = new ModelUsageDataCollector("acs.repository.usage.model","1.0", "0 0 0 ? * *" );

    usageModelCollector.setHbDataCollectorService(mockCollectorService);
    usageModelCollector.setCurrentRepoDescriptorDAO(mockDescriptorDAO);
    usageModelCollector.setCustomModelService(customModelService);
    usageModelCollector.setTransactionService(mockTransactionService);

    collectedData = usageModelCollector.collectData();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:ModelUsageDataCollectorTest.java

示例3: getCustomModelsInfo

import org.alfresco.repo.dictionary.CustomModelsInfo; //导入依赖的package包/类
/**
 * Gets custom models' information.
 *
 * @return {@code CustomModelsInfo} containing:
 *         <li>number of active models</li>
 *         <li>number of active models' types</li>
 *         <li>number of active models' aspects</li>
 */
public CustomModelsInfo getCustomModelsInfo();
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:10,代码来源:CustomModelService.java


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