Skip to content

Commit

Permalink
ZCS-11432 Unsupported config exception method in ServiceException, se…
Browse files Browse the repository at this point in the history
…tStoreManager should be threadsafe
  • Loading branch information
Rakeshkumar More authored and silentsakky committed Aug 9, 2022
1 parent 888b2ae commit 5170f22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@ public static ServiceException UNSUPPORTED() {
return new ServiceException("unsupported", UNSUPPORTED, RECEIVERS_FAULT);
}

/**
* ServiceException in case wrong config provided by Sender
* @param msg
* @return
*/
public static ServiceException UNSUPPORTED_CONFIG(String msg) {
return new ServiceException("unsupported: " + msg, UNSUPPORTED, SENDERS_FAULT);
}

public static ServiceException FORBIDDEN(String str) {
return new ServiceException("forbidden: " + str, FORBIDDEN, SENDERS_FAULT);
}
Expand Down
9 changes: 6 additions & 3 deletions store/src/java/com/zimbra/cs/store/StoreManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static StoreManager getInstance(String className) {
if (sInstance != null) {
return sInstance;
}

try {
if (className != null && !className.equals("")) {
try {
Expand All @@ -69,12 +68,16 @@ public static StoreManager getInstance(String className) {
return sInstance;
}



/**
* Used for unit testing.
*/
public static void setInstance(StoreManager instance) {
ZimbraLog.store.info("Setting StoreManager to " + instance.getClass().getName());
sInstance = instance;
synchronized (StoreManager.class) {
ZimbraLog.store.info("Setting StoreManager to " + instance.getClass().getName());
sInstance = instance;
}
}

public static int getDiskStreamingThreshold() throws ServiceException {
Expand Down

0 comments on commit 5170f22

Please sign in to comment.