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


Java ParameterCheck.mandatory方法代码示例

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


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

示例1: updateNamespace

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public void updateNamespace(String oldNamespaceUri, String newNamespaceUri)
{
    ParameterCheck.mandatory("newNamespaceUri", newNamespaceUri);

    Pair<Long, String> oldEntityPair = getNamespace(oldNamespaceUri);   // incl. null check
    if (oldEntityPair == null)
    {
        throw new DataIntegrityViolationException(
                "Cannot update namespace as it doesn't exist: " + oldNamespaceUri);
    }
    // Find the value
    int updated = namespaceCache.updateValue(oldEntityPair.getFirst(), newNamespaceUri);
    if (updated != 1)
    {
        throw new ConcurrencyFailureException(
                "Incorrect update count: \n" +
                "   Namespace:    " + oldNamespaceUri + "\n" +
                "   Rows Updated: " + updated);
    }
    // All the QNames need to be dumped
    qnameCache.clear();
    // Done
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:AbstractQNameDAOImpl.java

示例2: resetDisabledPaths

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的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: postActivity

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public void postActivity(String activityType, String siteId, String appTool, NodeRef nodeRef, String name, QName typeQName, NodeRef parentNodeRef)
{
    // primarily for delete node activities - eg. delete document, delete folder
    
    ParameterCheck.mandatory("nodeRef", nodeRef);
    ParameterCheck.mandatory("typeQName", typeQName);
    ParameterCheck.mandatory("parentNodeRef", parentNodeRef);
    
    StringBuffer sb = new StringBuffer();
    sb.append("{").append("\""+PostLookup.JSON_NODEREF_LOOKUP+"\":\"").append(nodeRef.toString()).append("\"").append(",")
                  .append("\""+PostLookup.JSON_NAME+"\":\"").append(name).append("\"").append(",")
                  .append("\""+PostLookup.JSON_TYPEQNAME+"\":\"").append(typeQName.toPrefixString()).append("\"").append(",") // TODO toPrefixString does not return prefix ??!!
                  .append("\""+PostLookup.JSON_NODEREF_PARENT+"\":\"").append(parentNodeRef.toString()).append("\"")
                  .append("}");
    
    postActivity(activityType, siteId, appTool, sb.toString(), ActivityPostEntity.STATUS.PENDING, getCurrentUser(), null,null);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ActivityPostServiceImpl.java

示例4: bindPropertyBehaviour

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public BehaviourDefinition<ServiceBehaviourBinding> bindPropertyBehaviour(QName policy, Object service, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Service", service);
    ParameterCheck.mandatory("Behaviour", behaviour);
    
    // Create behaviour definition and bind to policy
    ServiceBehaviourBinding binding = new ServiceBehaviourBinding(service);
    BehaviourDefinition<ServiceBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Property, policy, binding, behaviour);
    getPropertyBehaviourIndex(policy).putServiceBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to property policy " + policy + " for service " + service);

    return definition;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:PolicyComponentImpl.java

示例5: updateAcl

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public void updateAcl(AclUpdateEntity entity)
{
    ParameterCheck.mandatory("entity", entity);
    ParameterCheck.mandatory("entity.id", entity.getId());
    ParameterCheck.mandatory("entity.aclVersion", entity.getAclVersion());
    ParameterCheck.mandatory("entity.version", entity.getVersion());
    
    int updated = aclEntityCache.updateValue(entity.getId(), entity);
    if (updated < 1)
    {
        aclEntityCache.removeByKey(entity.getId());
        throw new ConcurrencyFailureException("AclEntity with ID (" + entity.getId() + ") no longer exists or has been updated concurrently");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:AbstractAclCrudDAOImpl.java

示例6: getAuthorities

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public PagingResults<String> getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)
{
    ParameterCheck.mandatory("pagingRequest", pagingRequest);
    
    if ((type == null) && (zoneName == null))
    {
        throw new IllegalArgumentException("Type and/or zoneName required - both cannot be null");
    }
    if (type != null)
    {
        switch (type)
        {
        case USER:
        case GROUP:
        case ROLE:
            return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
        case ADMIN:
        case EVERYONE:
        case GUEST:
        case OWNER:
        default:
             // others
             return getOtherAuthorities(type); // either singletons or empty - hence ignore zone/filter/sort/paging
        }
    }
    
    // type is null
    return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:AuthorityServiceImpl.java

示例7: isEnabled

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
@Override
public boolean isEnabled(NodeRef nodeRef)
{
    ParameterCheck.mandatory("nodeRef",  nodeRef);
    
    // Check the class (includes global) and instance, first
    if (!isEnabled())
    {
        return false;
    }
    
    if (!TransactionalResourceHelper.isResourcePresent(KEY_INSTANCE_FILTERS))
    {
        // Nothing was disabled
        return true;
    }
    nodeRef = tenantService.getName(nodeRef);

    Map<NodeRef, MutableInt> instanceFilters = TransactionalResourceHelper.getMap(KEY_INSTANCE_FILTERS);
    MutableInt filter = instanceFilters.get(nodeRef);
    if (filter != null && filter.intValue() > 0)
    {
        // Instance was disabled
        return false;
    }
    return true;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:BehaviourFilterImpl.java

示例8: findNode

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
/**
 * Find a single Node by the Node reference
 * 
 * @param ref       The NodeRef of the Node to find
 * 
 * @return the Node if found or null if failed to find
 */
public ScriptNode findNode(NodeRef ref)
{
    ParameterCheck.mandatory("ref", ref);       
    if (this.services.getNodeService().exists(ref)
                && (this.services.getPermissionService().hasPermission(ref,
                            PermissionService.READ) == AccessStatus.ALLOWED))
    {
        return new ScriptNode(ref, this.services, getScope());
    }
    return null;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:Search.java

示例9: unsetFeedControl

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public void unsetFeedControl(FeedControl feedControl)
{
    ParameterCheck.mandatory("feedControl", feedControl);
    
    String userId = getCurrentUser();
    
    if (userId == null)
    {
        throw new AlfrescoRuntimeException("Current user " + userId + " is not permitted to unset feed control");
    }
    
    try
    {
        if (logger.isDebugEnabled())
        {
            logger.debug("Deleting feed control for siteId: " + feedControl.getSiteId() + ",\n appToolId : " + feedControl.getAppToolId() + ",\n for user : " + userId);
        }
        // MNT-9104 If username contains uppercase letters the action of joining a site will not be displayed in "My activities"
        if (!userNamesAreCaseSensitive)
        {
            userId = userId.toLowerCase();
        }

        feedControlDAO.deleteFeedControl(new FeedControlEntity(userId, feedControl));
    }
    catch (SQLException e) 
    {
        AlfrescoRuntimeException are = new AlfrescoRuntimeException("Failed to unset feed control: " + e, e);
        logger.error(are);
        throw are;
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:ActivityServiceImpl.java

示例10: Association

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public Association(ServiceRegistry services, AssociationRef assocRef, Scriptable scope)
{
	ParameterCheck.mandatory("Service registry", services);
	ParameterCheck.mandatory("Association reference", assocRef);		
	this.services = services;
	this.assocRef = assocRef;
	if (scope != null)
	{
		this.scope = scope;
	}
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:Association.java

示例11: SiteTitleDisplayHandler

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public SiteTitleDisplayHandler(Set<String> supportedFieldFacets, Map<String, String> nonSiteLocationsLabels)
{
    ParameterCheck.mandatory("supportedFieldFacets", supportedFieldFacets);

    this.supportedFieldFacets = Collections.unmodifiableSet(new HashSet<>(supportedFieldFacets));
    this.nonSiteLocationsLabels = nonSiteLocationsLabels == null ? Collections.<String, String> emptyMap() : nonSiteLocationsLabels;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:SiteTitleDisplayHandler.java

示例12: export

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
public RepositoryExportHandle[] export(NodeRef repositoryDestination, String packageName)
{
    ParameterCheck.mandatory("repositoryDestination", repositoryDestination);
    FileInfo destInfo = fileFolderService.getFileInfo(repositoryDestination);
    if (destInfo == null || !destInfo.isFolder())
    {
        throw new ExporterException("Repository destination " + repositoryDestination + " is not a folder.");
    }

    List<FileExportHandle> exportHandles = exportStores(exportStores, packageName, new TempFileExporter());
    Map<String, String> mimetypeExtensions = mimetypeService.getExtensionsByMimetype();
    List<RepositoryExportHandle> repoExportHandles = new ArrayList<RepositoryExportHandle>(exportHandles.size());
    for (FileExportHandle exportHandle : exportHandles)
    {
        String name = exportHandle.packageName + "." + mimetypeExtensions.get(exportHandle.mimeType);
        String title = exportHandle.packageName;
        String description;
        if (exportHandle.storeRef != null)
        {
            description = I18NUtil.getMessage("export.store.package.description", new Object[] { exportHandle.storeRef.toString() });
        }
        else
        {
            description = I18NUtil.getMessage("export.generic.package.description");
        }
        
        NodeRef repoExportFile = addExportFile(repositoryDestination, name, title, description, exportHandle.mimeType, exportHandle.exportFile);
        RepositoryExportHandle handle = new RepositoryExportHandle();
        handle.storeRef = exportHandle.storeRef;
        handle.packageName = exportHandle.packageName;
        handle.mimeType = exportHandle.mimeType;
        handle.exportFile = repoExportFile;
        repoExportHandles.add(handle);
        
        // delete temporary export file
        exportHandle.exportFile.delete();
    }
    
    return repoExportHandles.toArray(new RepositoryExportHandle[repoExportHandles.size()]);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:RepositoryExporterComponent.java

示例13: executeScript

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
/**
 * @see org.alfresco.service.cmr.repository.ScriptService#executeScript(java.lang.String, java.util.Map)
 */
public Object executeScript(String scriptClasspath, Map<String, Object> model)
    throws ScriptException
{
    ParameterCheck.mandatory("scriptClasspath", scriptClasspath);
    ScriptProcessor scriptProcessor = getScriptProcessor(scriptClasspath);
    return execute(scriptProcessor, scriptClasspath, model);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:ScriptServiceImpl.java

示例14: ChildAssociation

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param services ServiceRegistry
 * @param childAssocRef ChildAssociationRef
 * @param scope Scriptable
 */
public ChildAssociation(ServiceRegistry services, ChildAssociationRef childAssocRef, Scriptable scope)
{
	ParameterCheck.mandatory("Service registry", services);
	ParameterCheck.mandatory("Child association reference", childAssocRef);		
	this.services = services;
	this.childAssocRef = childAssocRef;
	if (scope != null)
	{
		this.scope = scope;
	}
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:ChildAssociation.java

示例15: URLExporter

import org.springframework.extensions.surf.util.ParameterCheck; //导入方法依赖的package包/类
/**
 * Construct
 * @param exporter  exporter to delegate to
 * @param streamHandler  the handler for transforming content streams to URLs
 */
public URLExporter(Exporter exporter, ExportPackageHandler streamHandler)
{
    ParameterCheck.mandatory("Exporter", exporter);
    ParameterCheck.mandatory("Stream Handler", streamHandler);
    
    this.exporter = exporter;
    this.streamHandler = streamHandler;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:URLExporter.java


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