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


Java AlfrescoTransactionSupport.checkTransactionReadState方法代码示例

本文整理汇总了Java中org.alfresco.repo.transaction.AlfrescoTransactionSupport.checkTransactionReadState方法的典型用法代码示例。如果您正苦于以下问题:Java AlfrescoTransactionSupport.checkTransactionReadState方法的具体用法?Java AlfrescoTransactionSupport.checkTransactionReadState怎么用?Java AlfrescoTransactionSupport.checkTransactionReadState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.repo.transaction.AlfrescoTransactionSupport的用法示例。


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

示例1: getApplicationId

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
private Long getApplicationId(String applicationName)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);

    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return null;
    }

    return application.getApplicationId();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:AuditComponentImpl.java

示例2: resetDisabledPaths

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * @since 3.2
 */
public void resetDisabledPaths(String applicationName)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return;
    }
    Long disabledPathsId = application.getDisabledPathsId();
    propertyValueDAO.updateProperty(disabledPathsId, (Serializable) Collections.emptySet());
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug("Removed all disabled paths for application " + applicationName);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:AuditComponentImpl.java

示例3: isAuditPathEnabled

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * @since 3.2
 */
public boolean isAuditPathEnabled(String applicationName, String path)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(false);
    
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return false;
    }
    // Ensure that the path gets a valid value
    if (path == null)
    {
        path = AuditApplication.AUDIT_PATH_SEPARATOR + application.getApplicationKey();
    }
    else
    {
        // Check the path against the application
        application.checkPath(path);
    }

    Set<String> disabledPaths = getDisabledPaths(application);
    
    // Check if there are any entries that match or supercede the given path
    String disablingPath = null;;
    for (String disabledPath : disabledPaths)
    {
        if (path.startsWith(disabledPath))
        {
            disablingPath = disabledPath;
            break;
        }
    }
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug(
                "Audit path enabled check: \n" +
                "   Application:    " + applicationName + "\n" +
                "   Path:           " + path + "\n" +
                "   Disabling Path: " + disablingPath);
    }
    return disablingPath == null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:53,代码来源:AuditComponentImpl.java

示例4: enableAudit

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * @since 3.2
 */
public void enableAudit(String applicationName, String path)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return;
    }
    // Ensure that the path gets a valid value
    if (path == null)
    {
        path = AuditApplication.AUDIT_PATH_SEPARATOR + application.getApplicationKey();
    }
    else
    {
        // Check the path against the application
        application.checkPath(path);
    }

    Long disabledPathsId = application.getDisabledPathsId();
    Set<String> disabledPaths = getDisabledPaths(application);
    
    // Remove any paths that start with the given path
    boolean changed = false;
    Iterator<String> iterateDisabledPaths = disabledPaths.iterator();
    while (iterateDisabledPaths.hasNext())
    {
        String disabledPath = iterateDisabledPaths.next();
        if (disabledPath.startsWith(path))
        {
            iterateDisabledPaths.remove();
            changed = true;
        }
    }
    // Persist, if necessary
    if (changed)
    {
        propertyValueDAO.updateProperty(disabledPathsId, (Serializable) disabledPaths);
        if (logger.isDebugEnabled())
        {
            logger.debug(
                    "Audit disabled paths updated: \n" +
                    "   Application: " + applicationName + "\n" +
                    "   Disabled:    " + disabledPaths);
        }
    }
    // Done
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:59,代码来源:AuditComponentImpl.java

示例5: disableAudit

import org.alfresco.repo.transaction.AlfrescoTransactionSupport; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * @since 3.2
 */
public void disableAudit(String applicationName, String path)
{
    ParameterCheck.mandatory("applicationName", applicationName);
    AlfrescoTransactionSupport.checkTransactionReadState(true);
    
    AuditApplication application = auditModelRegistry.getAuditApplicationByName(applicationName);
    if (application == null)
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("No audit application named '" + applicationName + "' has been registered.");
        }
        return;
    }
    // Ensure that the path gets a valid value
    if (path == null)
    {
        path = AuditApplication.AUDIT_PATH_SEPARATOR + application.getApplicationKey();
    }
    else
    {
        // Check the path against the application
        application.checkPath(path);
    }
    
    Long disabledPathsId = application.getDisabledPathsId();
    Set<String> disabledPaths = getDisabledPaths(application);
    
    // Shortcut if the disabled paths contain the exact path
    if (disabledPaths.contains(path))
    {
        if (logger.isDebugEnabled())
        {
            logger.debug(
                    "Audit disable path already present: \n" +
                    "   Path:       " + path);
        }
        return;
    }
    
    // Bring the set up to date by stripping out unwanted paths
    Iterator<String> iterateDisabledPaths = disabledPaths.iterator();
    while (iterateDisabledPaths.hasNext())
    {
        String disabledPath = iterateDisabledPaths.next();
        if (disabledPath.startsWith(path))
        {
            // We will be superceding this
            iterateDisabledPaths.remove();
        }
        else if (path.startsWith(disabledPath))
        {
            // There is already a superceding path
            if (logger.isDebugEnabled())
            {
                logger.debug(
                        "Audit disable path superceded: \n" +
                        "   Path:          " + path + "\n" +
                        "   Superceded by: " + disabledPath);
            }
            return;
        }
    }
    // Add our path in
    disabledPaths.add(path);
    // Upload the new set
    propertyValueDAO.updateProperty(disabledPathsId, (Serializable) disabledPaths);
    // Done
    if (logger.isDebugEnabled())
    {
        logger.debug(
                "Audit disabled paths updated: \n" +
                "   Application: " + applicationName + "\n" +
                "   Disabled:    " + disabledPaths);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:81,代码来源:AuditComponentImpl.java


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