if (isNullOrEmpty(properties)) {
throw new IllegalArgumentException("Objects must be set!");
}
ObjectType objectType = null;
Map<String, SecondaryType> secondaryTypes = new HashMap<String, SecondaryType>();
// gather secondary types
if (addSecondaryTypeIds != null) {
for (String stid : addSecondaryTypeIds) {
ObjectType secondaryType = getTypeDefinition(stid);
if (!(secondaryType instanceof SecondaryType)) {
throw new IllegalArgumentException("Secondary types contains a type that is not a secondary type: "
+ secondaryType.getId());
}
secondaryTypes.put(secondaryType.getId(), (SecondaryType) secondaryType);
}
}
// gather ids and change tokens
List<BulkUpdateObjectIdAndChangeToken> objectIdsAndChangeTokens = new ArrayList<BulkUpdateObjectIdAndChangeToken>();
for (CmisObject object : objects) {
if (object == null) {
continue;
}
objectIdsAndChangeTokens.add(new BulkUpdateObjectIdAndChangeTokenImpl(object.getId(), object
.getChangeToken()));
if (objectType == null) {
objectType = object.getType();
}
if (object.getSecondaryTypes() != null) {
for (SecondaryType secondaryType : object.getSecondaryTypes()) {
secondaryTypes.put(secondaryType.getId(), secondaryType);
}
}
}
Set<Updatability> updatebility = EnumSet.noneOf(Updatability.class);