本文整理匯總了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();