本文整理汇总了Java中org.wso2.carbon.registry.core.utils.RegistryUtils.recordStatistics方法的典型用法代码示例。如果您正苦于以下问题:Java RegistryUtils.recordStatistics方法的具体用法?Java RegistryUtils.recordStatistics怎么用?Java RegistryUtils.recordStatistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.carbon.registry.core.utils.RegistryUtils
的用法示例。
在下文中一共展示了RegistryUtils.recordStatistics方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHandler
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public boolean createHandler(String payload) throws Exception {
RegistryUtils.recordStatistics(payload);
Registry configSystemRegistry = getConfigSystemRegistry();
String parsedPayload;
try {
parsedPayload = parseHandlerConfiguration(payload);
} catch (Exception e) {
log.error("Unable to parse the given handler configuration.", e);
throw new Exception("Unable to parse the given handler configuration. " +
e.getMessage());
}
if (parsedPayload == null) {
throw new Exception("The provided handler configuration is invalid.");
}
return !RegistryUtils.isRegistryReadOnly(configSystemRegistry.getRegistryContext()) &&
CommonUtil.addHandler(configSystemRegistry, parsedPayload);
}
示例2: updateHandler
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public boolean updateHandler(String oldName, String payload) throws Exception {
RegistryUtils.recordStatistics(oldName, payload);
Registry configSystemRegistry = getConfigSystemRegistry();
String parsedPayload;
try {
parsedPayload = parseHandlerConfiguration(payload);
} catch (Exception e) {
log.error("Unable to parse the given handler configuration.", e);
throw new Exception("Unable to parse the given handler configuration. " +
e.getMessage());
}
if (parsedPayload == null) {
throw new Exception("The provided handler configuration is invalid.");
}
return !RegistryUtils.isRegistryReadOnly(configSystemRegistry.getRegistryContext()) &&
CommonUtil.updateHandler(configSystemRegistry, oldName, parsedPayload);
}
示例3: subscribe
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public SubscriptionBean subscribe(String path, String endpoint, String eventName,
String sessionId) throws RegistryException {
String tempPath = path.substring(0, path.lastIndexOf("/"));
RegistryUtils.recordStatistics(tempPath, endpoint, eventName, sessionId);
UserRegistry registry = (UserRegistry) getRootRegistry();
if (RegistryUtils.isRegistryReadOnly(registry.getRegistryContext())) {
return null;
}
return SubscriptionBeanPopulator.subscribeAndPopulate(registry, path, endpoint, eventName);
}
示例4: subscribeREST
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public SubscriptionBean subscribeREST(String path, String endpoint, String eventName,
String sessionId) throws RegistryException {
RegistryUtils.recordStatistics(path, endpoint, eventName, sessionId);
UserRegistry registry = (UserRegistry) getRootRegistry();
if (RegistryUtils.isRegistryReadOnly(registry.getRegistryContext())) {
return null;
}
return SubscriptionBeanPopulator.subscribeAndPopulate(registry, path, endpoint,
eventName, true);
}
示例5: listpolicies
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public PolicyBean listpolicies()throws RegistryException{
RegistryUtils.recordStatistics();
UserRegistry registry = (UserRegistry)getGovernanceUserRegistry();
GovernanceArtifact[] artifacts = new GovernanceArtifact[0];
try {
artifacts = (new FilterPolicy(null, registry,null)).getArtifacts();
} catch (RegistryException e) {
log.error("An error occurred while obtaining the list of policies.", e);
}
return getPolicyBeanFromPaths(registry, artifacts);
}
示例6: listPoliciesByNames
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public PolicyBean listPoliciesByNames(String policyName) throws Exception {
RegistryUtils.recordStatistics();
UserRegistry registry = (UserRegistry)getGovernanceUserRegistry();
GovernanceArtifact[] artifacts = new GovernanceArtifact[0];
try {
artifacts = (new FilterPolicy(policyName, registry,null)).getArtifacts();
} catch (RegistryException e) {
log.error("An error occurred while obtaining the list of policies.", e);
}
return getPolicyBeanFromPaths(registry, artifacts);
}
示例7: listschema
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public SchemaBean listschema()throws RegistryException{
RegistryUtils.recordStatistics();
UserRegistry registry = (UserRegistry)getGovernanceUserRegistry();
GovernanceArtifact[] artifacts = new GovernanceArtifact[0];
try {
artifacts = (new FilterSchema(null, registry,null)).getArtifacts();
} catch (RegistryException e) {
log.error("An error occurred while obtaining the list of schemas.", e);
}
return getSchemaBeanFromPaths(registry, artifacts);
}
示例8: listSchemaByName
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public SchemaBean listSchemaByName(String schemaName)throws Exception{
RegistryUtils.recordStatistics();
UserRegistry registry = (UserRegistry)getGovernanceUserRegistry();
GovernanceArtifact[] artifacts = new GovernanceArtifact[0];
try {
artifacts = (new FilterSchema(schemaName, registry,null)).getArtifacts();
} catch (RegistryException e) {
log.error("An error occurred while obtaining the list of schemas.", e);
}
return getSchemaBeanFromPaths(registry, artifacts);
}
示例9: getSearchResults
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public SearchResultsBean getSearchResults(String searchType, String criteria) throws RegistryException {
RegistryUtils.recordStatistics(searchType, criteria);
UserRegistry registry = (UserRegistry) getRootRegistry();
return SearchResultsBeanPopulator.populate(registry, searchType, criteria);
}
示例10: getAdvancedSearchResults
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
/**
* Method to get Advance search result bean
*
* @param parameters CustomSearchParameterBean
* @return AdvancedSearchResultsBean
* @throws RegistryException
*/
public AdvancedSearchResultsBean getAdvancedSearchResults(CustomSearchParameterBean parameters)
throws RegistryException {
RegistryUtils.recordStatistics(parameters);
AdvancedSearchResultsBean advancedSearchResultsBean;
UserRegistry registry = (UserRegistry) getRootRegistry();
AttributeSearchService attributeSearchService = SearchDataHolder.getInstance().getAttributeIndexingService();
// Get advance search parameter values
String[][] searchParameterValues = parameters.getParameterValues();
ResourceData[] advanceSearchResourceData = new ResourceData[0];
// Map to store advance search attributes values
Map<String, String> advanceSearchAttributes;
// Validating the values sent
String validationErrorMessage = getValidationErrorMessage(searchParameterValues);
if (validationErrorMessage != null && StringUtils.isNotEmpty(validationErrorMessage)) {
return SearchUtils.getEmptyResultBeanWithErrorMsg(validationErrorMessage);
}
// No attribute has provide for search
if (allEmpty) {
return SearchUtils.getEmptyResultBeanWithErrorMsg(SEARCH_ATTRIBUTES_ALL_EMPTY_MESSAGE);
}
// Add search parameter values to advanceSearchAttributes Map
advanceSearchAttributes = getAdvanceSearchValueMap(searchParameterValues);
// Get Advance Search resource data
if (attributeSearchService != null && advanceSearchAttributes.size() > 0) {
if (!(advanceSearchAttributes.size() == 2 && advanceSearchAttributes.containsKey("leftOp")
&& advanceSearchAttributes.get("leftOp").equals("na") && advanceSearchAttributes
.containsKey("rightOp")
&& advanceSearchAttributes.get("rightOp").equals("na"))) {
advanceSearchAttributes.put(IndexingConstants.ADVANCE_SEARCH, "true");
advanceSearchResourceData = attributeSearchService.search(registry, advanceSearchAttributes);
}
}
advancedSearchResultsBean = new AdvancedSearchResultsBean();
if (advanceSearchResourceData != null && advanceSearchResourceData.length > 0) {
advanceSearchResourceData = getSortedSearchResults(advanceSearchResourceData);
advancedSearchResultsBean.setResourceDataList(advanceSearchResourceData);
if (!isEmptyResourceDataList(advancedSearchResultsBean)) {
return getPaginatedResult(advancedSearchResultsBean);
}
}
advancedSearchResultsBean.setResourceDataList(new ResourceData[0]);
return advancedSearchResultsBean;
}
示例11: deleteHandler
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public boolean deleteHandler(String name) throws Exception {
RegistryUtils.recordStatistics(name);
Registry configSystemRegistry = getConfigSystemRegistry();
return !RegistryUtils.isRegistryReadOnly(configSystemRegistry.getRegistryContext()) &&
CommonUtil.deleteHandler(configSystemRegistry, name);
}
示例12: unsubscribe
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public boolean unsubscribe(String path, String id, String sessionId) throws RegistryException {
RegistryUtils.recordStatistics(path, id, sessionId);
log.debug("Got unsubscribe request at path: " + path + " with id: " + id);
UserRegistry registry = (UserRegistry) getRootRegistry();
return InfoUtil.unsubscribe(registry, path, id, sessionId);
}
示例13: addAspect
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public void addAspect(String path, String aspect) throws Exception {
RegistryUtils.recordStatistics(path, aspect);
GovernanceUtils.associateAspect(path, aspect, getRootRegistry());
}
示例14: invokeAspect
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public void invokeAspect(String path, String aspect, String action, String[] items) throws Exception {
RegistryUtils.recordStatistics(path, aspect, action, items);
InvokeAspectUtil.invokeAspect(path, aspect, action, items, getRootRegistry(),
Collections.<String, String>emptyMap());
}
示例15: deleteLifecycle
import org.wso2.carbon.registry.core.utils.RegistryUtils; //导入方法依赖的package包/类
public boolean deleteLifecycle(String name) throws Exception {
RegistryUtils.recordStatistics(name);
return CommonUtil.deleteLifecycle(name, getConfigSystemRegistry(), getRootRegistry());
}