CopyTagQuery query)
{
String tag = query.getTag();
String sourceTag = query.getSourceTag();
RepositoryTagEntry entry = _repository.getTagMap().get(sourceTag);
if (entry == null) {
log.fine(this + " copyError dst='" + query.getTag() + "' src='" + query.getSourceTag() + "'");
getBroker().queryError(id, from, to, query,
new BamError(BamError.TYPE_CANCEL,
BamError.ITEM_NOT_FOUND,
"unknown tag"));
return;
}
log.fine(this + " copy dst='" + query.getTag() + "' src='" + query.getSourceTag() + "'");
String server = "default";
TreeMap<String,String> metaDataMap = new TreeMap<String,String>();
if (query.getAttributes() != null)
metaDataMap.putAll(query.getAttributes());
if (server != null)
metaDataMap.put("server", server);
boolean result = _repository.putTag(tag,
entry.getRoot(),
metaDataMap);
getBroker().queryResult(id, from, to, result);
}