Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evasques
Copy link
Contributor

Method requestRestoreContentFromArchive needs to use injected ContentStore

* @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

Possible God Class (WMC=60, ATFD=15, TCC=17.544%)
*/
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

Logger should be defined private static final and have the correct class
* 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 method 'selectReadStore(String)' has a cyclomatic complexity of 14.
* 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

The method 'selectReadStore(String)' has an NPath complexity of 405, current threshold is 200
*/
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

Explicit type arguments can be replaced by a diamond: new Pair<>(instanceKey, contentUrl)
*
* @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

The method 'getWriter(ContentContext)' is missing an @Override annotation.
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

Explicit type arguments can be replaced by a diamond: new Pair<>(instanceKey, contentUrl)
Comment on lines +348 to +351
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

Avoid throwing null pointer exceptions.
}
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

Explicit type arguments can be replaced by a diamond: new Pair<>(...)
/**
* 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

The method 'delete(String)' is missing an @Override annotation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant