} else if (searchInShared) {
strategy = new SearchSharedShelvesStrategy();
} else if (searchInMy) {
strategy = new SearchMyShelvesStrategy();
} else {
throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
}
break;
}
case ALBUM: {
if (searchInShared && searchInMy) {
strategy = new SearchBothAlbumsStrategy();
} else if (searchInShared) {
strategy = new SearchSharedAlbumsStrategy();
} else if (searchInMy) {
strategy = new SearchMyAlbumsStrategy();
} else {
throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
}
break;
}
case IMAGE: {
if (searchInShared && searchInMy) {
strategy = new SearchBothImagesStrategy();
} else if (searchInShared) {
strategy = new SearchSharedImagesStrategy();
} else if (searchInMy) {
strategy = new SearchMyImagesStrategy();
} else {
throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
}
break;
}
case METATAG: {
strategy = new SearchMetatagsStrategy();
break;
}
default:
throw new PhotoAlbumException(Constants.WRONG_SEARCH_PARAMETERS_ERROR);
}
return strategy.getQuery(em, parameters, queryString);
}