-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT-24753 Restore from Archive when we have multiple content stores #3066
base: master
Are you sure you want to change the base?
Conversation
* @since 2.1 | ||
* @author Derek Hulley | ||
*/ | ||
public abstract class AbstractRoutingContentStore implements ContentStore |
Check warning
Code scanning / PMD
Possible God Class (WMC=60, ATFD=15, TCC=17.544%) Warning
*/ | ||
public abstract class AbstractRoutingContentStore implements ContentStore | ||
{ | ||
private static Log logger = LogFactory.getLog(AbstractRoutingContentStore.class); |
Check warning
Code scanning / PMD
Logger should be defined private static final and have the correct class Warning
* the content URL to search for | ||
* @return Returns the store matching the content URL | ||
*/ | ||
private ContentStore selectReadStore(String contentUrl) |
Check warning
Code scanning / PMD
The method 'selectReadStore(String)' has a cyclomatic complexity of 14. Warning
* the content URL to search for | ||
* @return Returns the store matching the content URL | ||
*/ | ||
private ContentStore selectReadStore(String contentUrl) |
Check warning
Code scanning / PMD
The method 'selectReadStore(String)' has an NPath complexity of 405, current threshold is 200 Warning
*/ | ||
private ContentStore selectReadStore(String contentUrl) | ||
{ | ||
Pair<String, String> cacheKey = new Pair<String, String>(instanceKey, contentUrl); |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new Pair<>(...)` Warning
* | ||
* @see #selectWriteStore(ContentContext) | ||
*/ | ||
public ContentWriter getWriter(ContentContext context) throws ContentIOException |
Check warning
Code scanning / PMD
The method 'delete(String)' is missing an @Override annotation. Warning
public ContentWriter getWriter(ContentContext context) throws ContentIOException | ||
{ | ||
String contentUrl = context.getContentUrl(); | ||
Pair<String, String> cacheKey = new Pair<String, String>(instanceKey, contentUrl); |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new Pair<>(...)` Warning
throw new NullPointerException( | ||
"Unable to find a writer. 'selectWriteStore' may not return null: \n" + | ||
" Router: " + this + "\n" + | ||
" Chose: " + store); |
Check warning
Code scanning / PMD
Avoid throwing null pointer exceptions. Warning
} | ||
ContentWriter writer = store.getWriter(context); | ||
String newContentUrl = writer.getContentUrl(); | ||
Pair<String, String> newCacheKey = new Pair<String, String>(instanceKey, newContentUrl); |
Check warning
Code scanning / PMD
Explicit type arguments can be replaced by a diamond: `new Pair<>(...)` Warning
/** | ||
* This operation has to be performed on all the stores in order to maintain the {@link ContentStore#exists(String)} contract. | ||
*/ | ||
public boolean delete(String contentUrl) throws ContentIOException |
Check warning
Code scanning / PMD
The method 'delete(String)' is missing an @Override annotation. Warning
Method requestRestoreContentFromArchive needs to use injected ContentStore