Exception texts via NbBundle.getMessage

This commit is contained in:
Eugene Livis 2015-07-07 16:48:44 -04:00
parent c9f2863e27
commit b47a3a05ad
2 changed files with 5 additions and 4 deletions

View File

@ -20,3 +20,5 @@ ServicesMonitor.restoredService.notify.title=Collaboration Service Restored
ServicesMonitor.restoredDbService.notify.msg=Connection to remote database server restored ServicesMonitor.restoredDbService.notify.msg=Connection to remote database server restored
ServicesMonitor.restoredSolrService.notify.msg=Connection to remote keyword search server restored ServicesMonitor.restoredSolrService.notify.msg=Connection to remote keyword search server restored
ServicesMonitor.restoredMessageService.notify.msg=Connection to messaging server restored ServicesMonitor.restoredMessageService.notify.msg=Connection to messaging server restored
ServicesMonitor.nullServiceName.excepton.txt=Requested service name is null
ServicesMonitor.unknownServiceName.excepton.txt=Requested service name {0} is unknown

View File

@ -153,14 +153,13 @@ public class ServicesMonitor {
public String getServiceStatus(String service) throws UnknownServiceException { public String getServiceStatus(String service) throws UnknownServiceException {
if (service == null) { if (service == null) {
// TODO NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.existNotDir")); throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.nullServiceName.excepton.txt"));
throw new UnknownServiceException("Requested service name is null");
} }
String status = this.statusByService.get(service); String status = this.statusByService.get(service);
if (status == null) { if (status == null) {
// no such service // no such service
throw new UnknownServiceException("Requested service name " + service + " is unknown"); throw new UnknownServiceException(NbBundle.getMessage(ServicesMonitor.class, "ServicesMonitor.unknownServiceName.excepton.txt"));
} else if (status.equals(ServiceStatus.UNKNOWN.toString())) { } else if (status.equals(ServiceStatus.UNKNOWN.toString())) {
// status for the service is not known. This is likely because we haven't // status for the service is not known. This is likely because we haven't