}
@Override
public void release(PlatformLayerKey owner, T item) throws OpsException {
for (int i = 0; i < 10; i++) {
ItemBase resource = platformLayer.getItem(resourceKey);
List<Assignment> assignments = findAssignments(resource);
String key = adapter.toKey(item);
Assignment assigned = Assignment.find(assignments, key, subkey);
if (assigned == null) {
throw new OpsException("Resource not assigned");
}
if (!assigned.item.equals(owner.getUrl())) {
throw new OpsException("Resource not held");
}
Tag assignmentTag = assigned.asTag();
TagChanges tagChanges = new TagChanges();
tagChanges.removeTags.add(assignmentTag);
if (null != platformLayer.changeTags(resourceKey, tagChanges, resource.getVersion())) {
return;
}
if (!TimeSpan.ONE_SECOND.doSafeSleep()) {
break;