use of eu.europa.ec.fisheries.uvms.exchange.service.exception.InputArgumentException in project UVMS-ExchangeModule-APP by UnionVMS.
the class PluginServiceBean method stop.
@Override
public boolean stop(String serviceClassName) throws ExchangeServiceException {
if (serviceClassName == null) {
throw new InputArgumentException("No service to stop");
}
try {
if (isServiceRegistered(serviceClassName)) {
String text = ExchangePluginRequestMapper.createStopRequest();
producer.sendEventBusMessage(text, serviceClassName);
return true;
} else {
throw new ExchangeServiceException("Service with service class name: " + serviceClassName + " does not exist");
}
} catch (ExchangeModelMarshallException e) {
throw new ExchangeServiceException("[ Couldn't map stop request for " + serviceClassName + " ]");
} catch (ExchangeMessageException e) {
throw new ExchangeServiceException("[ Couldn't send stop request for " + serviceClassName + " ]");
}
}
use of eu.europa.ec.fisheries.uvms.exchange.service.exception.InputArgumentException in project UVMS-ExchangeModule-APP by UnionVMS.
the class PluginServiceBean method start.
@Override
public boolean start(String serviceClassName) throws ExchangeServiceException {
if (serviceClassName == null) {
throw new InputArgumentException("No service to start");
}
try {
if (isServiceRegistered(serviceClassName)) {
String text = ExchangePluginRequestMapper.createStartRequest();
producer.sendEventBusMessage(text, serviceClassName);
return true;
} else {
throw new ExchangeServiceException("Service with service class name: " + serviceClassName + " does not exist");
}
} catch (ExchangeModelMarshallException e) {
throw new ExchangeServiceException("[ Couldn't map start request for " + serviceClassName + " ]");
} catch (ExchangeMessageException e) {
throw new ExchangeServiceException("[ Couldn't send start request for " + serviceClassName + " ]");
}
}
use of eu.europa.ec.fisheries.uvms.exchange.service.exception.InputArgumentException in project UVMS-ExchangeModule-APP by UnionVMS.
the class PluginServiceBean method ping.
@Override
public boolean ping(String serviceClassName) throws ExchangeServiceException {
if (serviceClassName == null) {
throw new InputArgumentException("No service to ping");
}
try {
String text = ExchangePluginRequestMapper.createPingRequest();
producer.sendEventBusMessage(text, serviceClassName);
return true;
} catch (ExchangeModelMarshallException e) {
throw new ExchangeServiceException("[ Couldn't map ping request for " + serviceClassName + " ]");
} catch (ExchangeMessageException e) {
throw new ExchangeServiceException("[ Couldn't send ping request for " + serviceClassName + " ]");
}
}
Aggregations