本文整理汇总了Java中org.alfresco.util.ParameterCheck.mandatoryCollection方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterCheck.mandatoryCollection方法的具体用法?Java ParameterCheck.mandatoryCollection怎么用?Java ParameterCheck.mandatoryCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.util.ParameterCheck
的用法示例。
在下文中一共展示了ParameterCheck.mandatoryCollection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matchesPassword
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Does the password match?
* @param rawPassword mandatory password
* @param encodedPassword mandatory hashed version
* @param salt optional salt
* @param encodingChain mandatory encoding chain
* @return true if they match
*/
public boolean matchesPassword(String rawPassword, String encodedPassword, Object salt, List<String> encodingChain)
{
ParameterCheck.mandatoryString("rawPassword", rawPassword);
ParameterCheck.mandatoryString("encodedPassword", encodedPassword);
ParameterCheck.mandatoryCollection("encodingChain", encodingChain);
if (encodingChain.size() > 1)
{
String lastEncoder = encodingChain.get(encodingChain.size() - 1);
String encoded = encodePassword(rawPassword,salt, encodingChain.subList(0,encodingChain.size()-1));
return matches(lastEncoder,encoded,encodedPassword,salt);
}
if (encodingChain.size() == 1)
{
return matches(encodingChain.get(0), rawPassword, encodedPassword, salt);
}
return false;
}
示例2: deletePropertyRoots
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void deletePropertyRoots(final List<Long> ids)
{
ParameterCheck.mandatoryCollection("ids", ids);
LOGGER.debug("Deleting {} alf_prop_root entries", ids.size());
LOGGER.trace("Deleting alf_prop_root entries for IDs {}", ids);
this.sqlSessionTemplate.delete(DELETE_UNUSED_PROPERTY_ROOTS, ids);
if (this.propertyRootCache != null)
{
for (final Long id : ids)
{
this.propertyRootCache.remove(id);
}
}
}
示例3: deletePropertyValues
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void deletePropertyValues(final List<Long> ids)
{
ParameterCheck.mandatoryCollection("ids", ids);
LOGGER.debug("Deleting {} alf_prop_value entries", ids.size());
LOGGER.trace("Deleting alf_prop_value entries: {}", ids);
this.sqlSessionTemplate.delete(DELETE_UNUSED_PROPERTY_VALUES, ids);
if (this.propertyRootCache != null)
{
for (final Long id : ids)
{
this.propertyValueCache.remove(id);
}
}
}
示例4: encodePassword
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Encode a password
* @param rawPassword mandatory password
* @param salt optional salt
* @param encodingChain mandatory encoding chain
* @return the encoded password
*/
public String encodePassword(String rawPassword, Object salt, List<String> encodingChain) {
ParameterCheck.mandatoryString("rawPassword", rawPassword);
ParameterCheck.mandatoryCollection("encodingChain", encodingChain);
String encoded = new String(rawPassword);
for (String encoderKey : encodingChain)
{
encoded = encode(encoderKey, encoded, salt);
}
if (encoded == rawPassword) throw new AlfrescoRuntimeException("No password encoding specified. "+encodingChain);
return encoded;
}
示例5: deletePropertyValueInstances
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void deletePropertyValueInstances(final PropertyValueTableType valueTableType, final List<Long> ids)
{
ParameterCheck.mandatory("valueTableType", valueTableType);
ParameterCheck.mandatoryCollection("ids", ids);
LOGGER.debug("Deleting {} alf_prop_*_value entries of type {}", ids.size(), valueTableType);
LOGGER.trace("Deleting alf_prop_*_value entries: {}", ids);
final String query;
final SimpleCache<Serializable, Object> cache;
switch (valueTableType)
{
case DOUBLE:
query = DELETE_UNUSED_PROPERTY_DOUBLE_VALUES;
cache = this.propertyDoubleCache;
break;
case SERIALIZABLE:
query = DELETE_UNUSED_PROPERTY_SERIALIZABLE_VALUES;
cache = this.propertySerializableCache;
break;
case STRING:
query = DELETE_UNUSED_PROPERTY_STRING_VALUES;
cache = this.propertyStringCache;
break;
default:
throw new IllegalArgumentException("Unsupported value table type: " + valueTableType);
}
this.sqlSessionTemplate.delete(query, ids);
if (cache != null)
{
for (final Long id : ids)
{
cache.remove(id);
}
}
}
示例6: createWorkflowPackage
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Creates and returns a workflow package. This package will contain the
* given {@link NodeRef} <code>items</code>. The item name is used to create
* a valid local name for the association between the package and the item.
* The workflow package will contain only the existing items.
*
* @param items
* @return {@link NodeRef} of the newly created workflow package
*/
private NodeRef createWorkflowPackage(final List<NodeRef> items) {
ParameterCheck.mandatoryCollection("items", items);
final NodeRef wfPackage = workflowService.createPackage(null);
for (final NodeRef item : items) {
if ((item != null) && nodeService.exists(item)) {
final String itemName = (String) nodeService.getProperty(item, ContentModel.PROP_NAME);
nodeService.addChild(wfPackage, item, WorkflowModel.ASSOC_PACKAGE_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, QName.createValidLocalName(itemName)));
}
}
return wfPackage;
}
示例7: validate
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
public void validate()
{
ParameterCheck.mandatoryCollection("toEmails", toEmails);
ParameterCheck.mandatoryString("sharedId", sharedId);
ParameterCheck.mandatoryString("sharedNodeName", sharedNodeName);
}
示例8: fromFacetIntervals
import org.alfresco.util.ParameterCheck; //导入方法依赖的package包/类
/**
* Sets the Interval Parameters object on search parameters
*
* It does some valiation then takes any "SETS" at the top level and sets them at every field level.
*
* @param sp SearchParameters
* @param facetIntervals IntervalParameters
*/
public void fromFacetIntervals(SearchParameters sp, IntervalParameters facetIntervals)
{
if (facetIntervals != null)
{
ParameterCheck.mandatory("facetIntervals intervals", facetIntervals.getIntervals());
Set<IntervalSet> globalSets = facetIntervals.getSets();
validateSets(globalSets, "facetIntervals");
if (facetIntervals.getIntervals() != null && !facetIntervals.getIntervals().isEmpty())
{
List<String> intervalLabels = new ArrayList<>(facetIntervals.getIntervals().size());
for (Interval interval:facetIntervals.getIntervals())
{
ParameterCheck.mandatory("facetIntervals intervals field", interval.getField());
validateSets(interval.getSets(), "facetIntervals intervals "+interval.getField());
if (interval.getSets() != null && globalSets != null)
{
interval.getSets().addAll(globalSets);
}
ParameterCheck.mandatoryCollection("facetIntervals intervals sets", interval.getSets());
List<Map.Entry<String, Long>> duplicateSetLabels =
interval.getSets().stream().collect(groupingBy(IntervalSet::getLabel, Collectors.counting()))
.entrySet().stream().filter(e -> e.getValue().intValue() > 1).collect(toList());
if (!duplicateSetLabels.isEmpty())
{
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": duplicate set interval label "+duplicateSetLabels.toString() });
}
if (interval.getLabel() != null) intervalLabels.add(interval.getLabel());
}
List<Map.Entry<String, Long>> duplicateIntervalLabels =
intervalLabels.stream().collect(groupingBy(Function.identity(), Collectors.counting()))
.entrySet().stream().filter(e -> e.getValue().intValue() > 1).collect(toList());
if (!duplicateIntervalLabels.isEmpty())
{
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": duplicate interval label "+duplicateIntervalLabels.toString() });
}
}
if (facetIntervals.getSets() != null)
{
facetIntervals.getSets().clear();
}
}
sp.setInterval(facetIntervals);
}