本文整理汇总了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);
}
示例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();
}
示例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();