當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。