diff --git a/pom.xml b/pom.xml index 5fe0b2055..d2bae58dd 100644 --- a/pom.xml +++ b/pom.xml @@ -35,10 +35,6 @@ li.strolch li.strolch.model - - li.strolch - li.strolch.persistence.api - li.strolch li.strolch.runtime diff --git a/src/main/java/li/strolch/command/Command.java b/src/main/java/li/strolch/command/Command.java deleted file mode 100644 index e9edfcf41..000000000 --- a/src/main/java/li/strolch/command/Command.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package li.strolch.command; - -import li.strolch.persistence.api.StrolchTransaction; -import ch.eitchnet.privilege.model.Restrictable; - -/** - * @author Robert von Burg - * - */ -public abstract class Command implements Restrictable { - - private final StrolchTransaction tx; - - public Command(StrolchTransaction tx) { - this.tx = tx; - } - - /** - * Returns the {@link StrolchTransaction} bound to this {@link Command}'s runtime - * - * @return the {@link StrolchTransaction} bound to this {@link Command}'s runtime - */ - protected StrolchTransaction tx() { - return this.tx; - } - - /** - * @see ch.eitchnet.privilege.model.Restrictable#getPrivilegeName() - */ - @Override - public String getPrivilegeName() { - return Command.class.getName(); - } - - /** - * @see ch.eitchnet.privilege.model.Restrictable#getPrivilegeValue() - */ - @Override - public Object getPrivilegeValue() { - return this.getClass().getName(); - } - - public abstract void doCommand(); -} diff --git a/src/main/java/li/strolch/service/AbstractService.java b/src/main/java/li/strolch/service/AbstractService.java deleted file mode 100644 index 7fe175264..000000000 --- a/src/main/java/li/strolch/service/AbstractService.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import java.text.MessageFormat; - -import li.strolch.exception.StrolchException; -import li.strolch.runtime.agent.api.OrderMap; -import li.strolch.runtime.agent.api.ResourceMap; -import li.strolch.runtime.configuration.RuntimeConfiguration; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Robert von Burg - */ -public abstract class AbstractService implements Service { - - protected static final Logger logger = LoggerFactory.getLogger(AbstractService.class); - private static final long serialVersionUID = 1L; - - private DefaultServiceHandler serviceHandler; - - /** - * @param serviceHandler - * the serviceHandler to set - */ - public void setServiceHandler(DefaultServiceHandler serviceHandler) { - this.serviceHandler = serviceHandler; - } - - public V getComponent(Class clazz) { - return this.serviceHandler.getComponent(clazz); - } - - public RuntimeConfiguration getRuntimeConfiguration() { - return this.serviceHandler.getRuntimeConfiguration(); - } - - public ResourceMap getResourceMap(String realm) { - return this.serviceHandler.getResourceMap(realm); - } - - public OrderMap getOrderMap(String realm) { - return this.serviceHandler.getOrderMap(realm); - } - - @Override - public final U doService(T argument) { - - if (isArgumentRequired() && argument == null) { - - String msg = "Failed to perform service {0} because no argument was passed although it is required!"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, getClass()); - logger.error(msg); - - U result = getResultInstance(); - result.setState(ServiceResultState.FAILED); - result.setMessage(msg); - return result; - } - - try { - - U serviceResult = internalDoService(argument); - if (serviceResult == null) { - String msg = "Service {0} is not properly implemented as it returned a null result!"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, this.getClass().getName()); - throw new StrolchException(msg); - } - - return serviceResult; - - } catch (Exception e) { - - String msg = "Failed to perform service {0} due to {1}"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, getClass(), e.getMessage()); - logger.error(msg, e); - - U result = getResultInstance(); - result.setState(ServiceResultState.FAILED); - result.setMessage(msg); - result.setThrowable(e); - return result; - } - } - - /** - * @return if true, then an argument must be set to execute the service. If the argument is missing, then the - * service execution fails immediately - */ - protected boolean isArgumentRequired() { - return true; - } - - /** - * This method is called if the service execution fails and an instance of the expected {@link ServiceResult} is - * required to return to the caller - * - * @return - */ - protected abstract U getResultInstance(); - - /** - * Internal method to perform the {@link Service}. The implementor does not need to handle exceptions as this is - * done in the {@link #doService(ServiceArgument)} which calls this method - * - * @param arg - * @return - */ - protected abstract U internalDoService(T arg); - - /** - * @see ch.eitchnet.privilege.model.Restrictable#getPrivilegeName() - */ - @Override - public String getPrivilegeName() { - return Service.class.getName(); - } - - /** - * @see ch.eitchnet.privilege.model.Restrictable#getPrivilegeValue() - */ - @Override - public Object getPrivilegeValue() { - return this.getClass().getName(); - } -} diff --git a/src/main/java/li/strolch/service/model/AddOrderCollectionService.java b/src/main/java/li/strolch/service/AddOrderCollectionService.java similarity index 90% rename from src/main/java/li/strolch/service/model/AddOrderCollectionService.java rename to src/main/java/li/strolch/service/AddOrderCollectionService.java index 41144c01a..a2e41533e 100644 --- a/src/main/java/li/strolch/service/model/AddOrderCollectionService.java +++ b/src/main/java/li/strolch/service/AddOrderCollectionService.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package li.strolch.service.model; +package li.strolch.service; import java.util.List; import li.strolch.model.Order; import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.agent.api.OrderMap; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; /** * @author Robert von Burg diff --git a/src/main/java/li/strolch/service/model/AddOrderService.java b/src/main/java/li/strolch/service/AddOrderService.java similarity index 89% rename from src/main/java/li/strolch/service/model/AddOrderService.java rename to src/main/java/li/strolch/service/AddOrderService.java index af7869bf0..56d7335d4 100644 --- a/src/main/java/li/strolch/service/model/AddOrderService.java +++ b/src/main/java/li/strolch/service/AddOrderService.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package li.strolch.service.model; +package li.strolch.service; import li.strolch.model.Order; import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.agent.api.OrderMap; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; /** * @author Robert von Burg diff --git a/src/main/java/li/strolch/service/model/AddResourceCollectionService.java b/src/main/java/li/strolch/service/AddResourceCollectionService.java similarity index 90% rename from src/main/java/li/strolch/service/model/AddResourceCollectionService.java rename to src/main/java/li/strolch/service/AddResourceCollectionService.java index 377534fb9..e251d6620 100644 --- a/src/main/java/li/strolch/service/model/AddResourceCollectionService.java +++ b/src/main/java/li/strolch/service/AddResourceCollectionService.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package li.strolch.service.model; +package li.strolch.service; import java.util.List; import li.strolch.model.Resource; import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.agent.api.ResourceMap; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; /** * @author Robert von Burg diff --git a/src/main/java/li/strolch/service/model/AddResourceService.java b/src/main/java/li/strolch/service/AddResourceService.java similarity index 89% rename from src/main/java/li/strolch/service/model/AddResourceService.java rename to src/main/java/li/strolch/service/AddResourceService.java index 3dc33791a..1129c548c 100644 --- a/src/main/java/li/strolch/service/model/AddResourceService.java +++ b/src/main/java/li/strolch/service/AddResourceService.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package li.strolch.service.model; +package li.strolch.service; import li.strolch.model.Resource; import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.agent.api.ResourceMap; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; /** * @author Robert von Burg diff --git a/src/main/java/li/strolch/service/DefaultServiceHandler.java b/src/main/java/li/strolch/service/DefaultServiceHandler.java deleted file mode 100644 index 9e0963dc9..000000000 --- a/src/main/java/li/strolch/service/DefaultServiceHandler.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import java.text.MessageFormat; - -import li.strolch.exception.StrolchException; -import li.strolch.runtime.agent.api.OrderMap; -import li.strolch.runtime.agent.api.ResourceMap; -import li.strolch.runtime.agent.api.StrolchComponent; -import li.strolch.runtime.agent.impl.ComponentContainerImpl; -import li.strolch.runtime.configuration.ComponentConfiguration; -import li.strolch.runtime.configuration.RuntimeConfiguration; -import li.strolch.runtime.privilege.StrolchPrivilegeHandler; -import ch.eitchnet.privilege.model.Certificate; -import ch.eitchnet.privilege.model.PrivilegeContext; -import ch.eitchnet.utils.helper.StringHelper; - -/** - * @author Robert von Burg - */ -public class DefaultServiceHandler extends StrolchComponent implements ServiceHandler { - - private RuntimeConfiguration runtimeConfiguration; - private StrolchPrivilegeHandler privilegeHandler; - - /** - * @param container - * @param componentName - */ - public DefaultServiceHandler(ComponentContainerImpl container, String componentName) { - super(container, componentName); - } - - @Override - public void initialize(ComponentConfiguration configuration) { - if (getContainer().hasComponent(StrolchPrivilegeHandler.class)) - this.privilegeHandler = getContainer().getComponent(StrolchPrivilegeHandler.class); - this.runtimeConfiguration = configuration.getRuntimeConfiguration(); - super.initialize(configuration); - } - - public T getComponent(Class clazz) { - return getContainer().getComponent(clazz); - } - - public RuntimeConfiguration getRuntimeConfiguration() { - return this.runtimeConfiguration; - } - - public ResourceMap getResourceMap(String realm) { - return this.getContainer().getResourceMap(realm); - } - - public OrderMap getOrderMap(String realm) { - return this.getContainer().getOrderMap(realm); - } - - @Override - public U doService(Certificate certificate, Service service) { - return doService(certificate, service, null); - } - - @Override - public U doService(Certificate certificate, - Service service, T argument) { - - long start = System.nanoTime(); - - // first check that the caller may perform this service - if (this.privilegeHandler != null) { - // XXX Bad bad bad: remove the need for thread locals... - try { - PrivilegeContext privilegeContext = this.privilegeHandler.getPrivilegeContext(certificate); - PrivilegeContext.set(privilegeContext); - privilegeContext.validateAction(service); - } finally { - PrivilegeContext.set(null); - } - } - - try { - // then perform the service - if (service instanceof AbstractService) - ((AbstractService) service).setServiceHandler(this); - U serviceResult = service.doService(argument); - if (serviceResult == null) { - String msg = "Service {0} is not properly implemented as it returned a null result!"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, service); - throw new StrolchException(msg); - } - - // log the result - long end = System.nanoTime(); - String msg = "Service {0} took {1}"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, service, StringHelper.formatNanoDuration(end - start)); - if (serviceResult.getState() == ServiceResultState.SUCCESS) - logger.info(msg); - else if (serviceResult.getState() == ServiceResultState.WARNING) - logger.warn(msg); - else if (serviceResult.getState() == ServiceResultState.FAILED) - logger.error(msg); - - return serviceResult; - - } catch (Exception e) { - long end = System.nanoTime(); - String msg = "Failed to perform service {0} after {1} due to {2}"; //$NON-NLS-1$ - msg = MessageFormat.format(msg, service, StringHelper.formatNanoDuration(end - start), e.getMessage()); - logger.error(msg, e); - throw new StrolchException(msg, e); - } - } -} diff --git a/src/main/java/li/strolch/service/model/ImportModelFromXmlService.java b/src/main/java/li/strolch/service/ImportModelFromXmlService.java similarity index 94% rename from src/main/java/li/strolch/service/model/ImportModelFromXmlService.java rename to src/main/java/li/strolch/service/ImportModelFromXmlService.java index 9b4bf5837..bf78622e9 100644 --- a/src/main/java/li/strolch/service/model/ImportModelFromXmlService.java +++ b/src/main/java/li/strolch/service/ImportModelFromXmlService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package li.strolch.service.model; +package li.strolch.service; import java.io.File; import java.text.MessageFormat; @@ -25,9 +25,9 @@ import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.agent.api.OrderMap; import li.strolch.runtime.agent.api.ResourceMap; import li.strolch.runtime.agent.impl.InMemoryElementListener; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; import ch.eitchnet.utils.helper.StringHelper; /** diff --git a/src/main/java/li/strolch/service/Service.java b/src/main/java/li/strolch/service/Service.java deleted file mode 100644 index de558710b..000000000 --- a/src/main/java/li/strolch/service/Service.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import java.io.Serializable; - -import ch.eitchnet.privilege.model.Restrictable; - -/** - * @author Robert von Burg - */ -public interface Service extends Serializable, Restrictable { - - public U doService(T argument); -} diff --git a/src/main/java/li/strolch/service/ServiceArgument.java b/src/main/java/li/strolch/service/ServiceArgument.java deleted file mode 100644 index c81eb5622..000000000 --- a/src/main/java/li/strolch/service/ServiceArgument.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import java.io.Serializable; - -import li.strolch.runtime.StrolchConstants; - -/** - * Base argument to be used when performing {@link Service Services}. The realm parameter is set to - * {@link StrolchConstants#DEFAULT_REALM} and can be overridden when the caller of the service wants to perform the - * service in a different realm - * - * @author Robert von Burg - */ -public class ServiceArgument implements Serializable { - private static final long serialVersionUID = 1L; - - /** - *

- * Set this to the realm in which the service should operate - *

- * - *

- * realm = StrolchConstants.DEFAULT_REALM - *

- */ - public String realm = StrolchConstants.DEFAULT_REALM; -} diff --git a/src/main/java/li/strolch/service/ServiceHandler.java b/src/main/java/li/strolch/service/ServiceHandler.java deleted file mode 100644 index 32ca19a46..000000000 --- a/src/main/java/li/strolch/service/ServiceHandler.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import ch.eitchnet.privilege.model.Certificate; - -public interface ServiceHandler { - - public U doService(Certificate certificate, - Service service, T argument); - - public U doService(Certificate certificate, Service service); -} \ No newline at end of file diff --git a/src/main/java/li/strolch/service/ServiceResult.java b/src/main/java/li/strolch/service/ServiceResult.java deleted file mode 100644 index 5b846b200..000000000 --- a/src/main/java/li/strolch/service/ServiceResult.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -import java.io.Serializable; - -/** - * @author Robert von Burg - */ -public class ServiceResult implements Serializable { - private static final long serialVersionUID = 1L; - private ServiceResultState state; - private String message; - private Throwable throwable; - - public ServiceResult() { - // - } - - /** - * @param state - */ - public ServiceResult(ServiceResultState state) { - this.state = state; - } - - /** - * @param state - * @param message - * @param throwable - */ - public ServiceResult(ServiceResultState state, String message, Throwable throwable) { - this.state = state; - this.message = message; - this.throwable = throwable; - } - - /** - * @return true if the state is {@link ServiceResultState#SUCCESS} - */ - public boolean isOk() { - return this.state == ServiceResultState.SUCCESS; - } - - /** - * @return the state - */ - public ServiceResultState getState() { - return this.state; - } - - /** - * @param state - * the state to set - */ - public void setState(ServiceResultState state) { - this.state = state; - } - - /** - * @return the message - */ - public String getMessage() { - return this.message; - } - - /** - * @param message - * the message to set - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * @return the throwable - */ - public Throwable getThrowable() { - return this.throwable; - } - - /** - * @param throwable - * the throwable to set - */ - public void setThrowable(Throwable throwable) { - this.throwable = throwable; - } - - public static ServiceResult success() { - return new ServiceResult(ServiceResultState.SUCCESS, null, null); - } - - public static ServiceResult success(String msg) { - return new ServiceResult(ServiceResultState.SUCCESS, msg, null); - } - - public static ServiceResult warning(String warning) { - return new ServiceResult(ServiceResultState.WARNING, warning, null); - } - - public static ServiceResult warning(String warning, Throwable t) { - return new ServiceResult(ServiceResultState.WARNING, warning, t); - } - - public static ServiceResult failed(String error, Throwable t) { - return new ServiceResult(ServiceResultState.FAILED, error, t); - } -} diff --git a/src/main/java/li/strolch/service/ServiceResultState.java b/src/main/java/li/strolch/service/ServiceResultState.java deleted file mode 100644 index 9037211e9..000000000 --- a/src/main/java/li/strolch/service/ServiceResultState.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013 Robert von Burg - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package li.strolch.service; - -/** - * @author Robert von Burg - * - */ -public enum ServiceResultState { - - SUCCESS, WARNING, FAILED; -} diff --git a/src/test/java/li/strolch/service/test/AbstractServiceTest.java b/src/test/java/li/strolch/service/test/AbstractServiceTest.java index b8aa565fb..0dff3b8a1 100644 --- a/src/test/java/li/strolch/service/test/AbstractServiceTest.java +++ b/src/test/java/li/strolch/service/test/AbstractServiceTest.java @@ -17,7 +17,7 @@ package li.strolch.service.test; import java.io.File; -import li.strolch.service.ServiceHandler; +import li.strolch.service.api.ServiceHandler; import li.strolch.testbase.runtime.RuntimeMock; import org.junit.AfterClass; diff --git a/src/test/java/li/strolch/service/test/GreetingResult.java b/src/test/java/li/strolch/service/test/GreetingResult.java index 656dedc4e..6b37c252b 100644 --- a/src/test/java/li/strolch/service/test/GreetingResult.java +++ b/src/test/java/li/strolch/service/test/GreetingResult.java @@ -15,8 +15,8 @@ */ package li.strolch.service.test; -import li.strolch.service.ServiceResult; -import li.strolch.service.ServiceResultState; +import li.strolch.service.api.ServiceResult; +import li.strolch.service.api.ServiceResultState; public class GreetingResult extends ServiceResult { private static final long serialVersionUID = 1L; diff --git a/src/test/java/li/strolch/service/test/GreetingService.java b/src/test/java/li/strolch/service/test/GreetingService.java index b599034fd..da5a1af29 100644 --- a/src/test/java/li/strolch/service/test/GreetingService.java +++ b/src/test/java/li/strolch/service/test/GreetingService.java @@ -17,8 +17,8 @@ package li.strolch.service.test; import java.text.MessageFormat; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; import li.strolch.service.test.GreetingService.GreetingArgument; import ch.eitchnet.utils.helper.StringHelper; diff --git a/src/test/java/li/strolch/service/test/NoPrivilegeServiceTest.java b/src/test/java/li/strolch/service/test/NoPrivilegeServiceTest.java index 8f1fbd2a0..7acdea3a8 100644 --- a/src/test/java/li/strolch/service/test/NoPrivilegeServiceTest.java +++ b/src/test/java/li/strolch/service/test/NoPrivilegeServiceTest.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertThat; import java.io.File; -import li.strolch.service.ServiceHandler; +import li.strolch.service.api.ServiceHandler; import li.strolch.service.test.GreetingService.GreetingArgument; import li.strolch.testbase.runtime.RuntimeMock; diff --git a/src/test/java/li/strolch/service/test/ServiceTest.java b/src/test/java/li/strolch/service/test/ServiceTest.java index 37e1d91f3..616f8c041 100644 --- a/src/test/java/li/strolch/service/test/ServiceTest.java +++ b/src/test/java/li/strolch/service/test/ServiceTest.java @@ -60,7 +60,7 @@ public class ServiceTest extends AbstractServiceTest { @Test public void shouldFailWithNoAccess() { this.thrown.expect(AccessDeniedException.class); - this.thrown.expectMessage("User jill does not have Privilege li.strolch.service.Service"); //$NON-NLS-1$ + this.thrown.expectMessage("User jill does not have Privilege li.strolch.service.api.Service"); //$NON-NLS-1$ Certificate certificate = runtimeMock.getPrivilegeHandler().authenticate("jill", "jill".getBytes()); //$NON-NLS-1$//$NON-NLS-2$ try { diff --git a/src/test/java/li/strolch/service/test/TestService.java b/src/test/java/li/strolch/service/test/TestService.java index d53d59291..a3e2df4e8 100644 --- a/src/test/java/li/strolch/service/test/TestService.java +++ b/src/test/java/li/strolch/service/test/TestService.java @@ -15,9 +15,9 @@ */ package li.strolch.service.test; -import li.strolch.service.AbstractService; -import li.strolch.service.ServiceArgument; -import li.strolch.service.ServiceResult; +import li.strolch.service.api.AbstractService; +import li.strolch.service.api.ServiceArgument; +import li.strolch.service.api.ServiceResult; /** * @author Robert von Burg diff --git a/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml b/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml index 28c007077..848bbe71d 100644 --- a/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml +++ b/src/test/resources/withPrivilegeRuntime/config/PrivilegeModel.xml @@ -56,7 +56,7 @@ - + true @@ -65,7 +65,7 @@ - + li.strolch.service.test.GreetingService diff --git a/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml b/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml index fb9ed15a5..27d4a47bc 100644 --- a/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml +++ b/src/test/resources/withPrivilegeRuntime/config/StrolchConfiguration.xml @@ -9,8 +9,8 @@ ServiceHandler - li.strolch.service.ServiceHandler - li.strolch.service.DefaultServiceHandler + li.strolch.service.api.ServiceHandler + li.strolch.service.api.DefaultServiceHandler true diff --git a/src/test/resources/withoutPrivilegeRuntime/config/StrolchConfiguration.xml b/src/test/resources/withoutPrivilegeRuntime/config/StrolchConfiguration.xml index 76e96a2c8..c250eb161 100644 --- a/src/test/resources/withoutPrivilegeRuntime/config/StrolchConfiguration.xml +++ b/src/test/resources/withoutPrivilegeRuntime/config/StrolchConfiguration.xml @@ -9,8 +9,8 @@ ServiceHandler - li.strolch.service.ServiceHandler - li.strolch.service.DefaultServiceHandler + li.strolch.service.api.ServiceHandler + li.strolch.service.api.DefaultServiceHandler true