public void setResources(String type, String... id) {
   assert type != null;
   addHeader(RESOURCE_HEADER_ID_KEY, id);
   addHeader(RESOURCE_HEADER_TYPE_KEY, type);
 }
 public void setShard(ShardId shardId) {
   if (shardId != null) {
     setIndex(shardId.getIndex());
     addHeader(SHARD_HEADER_KEY, Integer.toString(shardId.id()));
   }
 }
 public void setShard(String index, int shardId) {
   setIndex(index);
   addHeader(SHARD_HEADER_KEY, Integer.toString(shardId));
 }
 public void setIndex(Index index) {
   if (index != null) {
     addHeader(INDEX_HEADER_KEY, index.getName());
     addHeader(INDEX_HEADER_KEY_UUID, index.getUUID());
   }
 }