From d818f53ce4173f6bd49431ab5c2af4735fbd6f07 Mon Sep 17 00:00:00 2001 From: Christos KK Loverdos Date: Thu, 3 May 2012 17:39:23 +0300 Subject: [PATCH] Refactor actor messages --- .../scala/gr/grnet/aquarium/actor/ActorRole.scala | 16 +-- .../actor/message/GetUserBalanceRequest.scala | 46 +++++++++ .../actor/message/GetUserBalanceResponse.scala | 46 +++++++++ .../actor/message/GetUserStateRequest.scala | 46 +++++++++ .../actor/message/GetUserStateResponse.scala | 48 +++++++++ .../actor/message/RouterRequestMessage.scala | 45 +++++++++ .../actor/message/RouterResponseMessage.scala | 58 +++++++++++ .../actor/message/UserActorRequestMessage.scala | 44 ++++++++ .../actor/message/admin/PingAllRequest.scala | 46 +++++++++ .../actor/message/admin/PingAllResponse.scala | 46 +++++++++ .../actor/message/event/ProcessIMEvent.scala | 50 ++++++++++ .../actor/message/event/ProcessResourceEvent.scala | 51 ++++++++++ .../message/service/router/RouterMessage.scala | 105 -------------------- .../actor/service/pinger/PingerActor.scala | 6 +- .../aquarium/actor/service/rest/RESTActor.scala | 49 ++++----- .../actor/service/router/RouterActor.scala | 13 +-- .../aquarium/actor/service/user/UserActor.scala | 20 ++-- .../aquarium/service/IMEventProcessorService.scala | 3 +- .../service/ResourceEventProcessorService.scala | 2 +- 19 files changed, 578 insertions(+), 162 deletions(-) create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceRequest.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceResponse.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateRequest.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateResponse.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/RouterRequestMessage.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/RouterResponseMessage.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/UserActorRequestMessage.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllRequest.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllResponse.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessIMEvent.scala create mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessResourceEvent.scala delete mode 100644 src/main/scala/gr/grnet/aquarium/actor/message/service/router/RouterMessage.scala diff --git a/src/main/scala/gr/grnet/aquarium/actor/ActorRole.scala b/src/main/scala/gr/grnet/aquarium/actor/ActorRole.scala index 15cb372..0ddb187 100644 --- a/src/main/scala/gr/grnet/aquarium/actor/ActorRole.scala +++ b/src/main/scala/gr/grnet/aquarium/actor/ActorRole.scala @@ -34,13 +34,15 @@ */ package gr.grnet.aquarium.actor -import message.service.router._ import service.router.RouterActor import service.pinger.PingerActor import service.rest.RESTActor import service.user.{UserActor} import message.config.{AquariumPropertiesLoaded, ActorProviderConfigured, ActorConfigurationMessage} import cc.spray.can.{Timeout, RequestContext} +import gr.grnet.aquarium.actor.message.event.{ProcessIMEvent, ProcessResourceEvent} +import gr.grnet.aquarium.actor.message.admin.PingAllRequest +import gr.grnet.aquarium.actor.message.{GetUserStateRequest, GetUserBalanceRequest} /** * Each actor within Aquarium plays one role. @@ -87,7 +89,7 @@ case object PingerRole extends ActorRole("PingerRole", true, classOf[PingerActor], - Set(classOf[AdminRequestPingAll])) + Set(classOf[PingAllRequest])) /** * The generic router. @@ -96,11 +98,11 @@ case object RouterRole extends ActorRole("RouterRole", true, classOf[RouterActor], - Set(classOf[RequestUserBalance], - classOf[UserRequestGetState], + Set(classOf[GetUserBalanceRequest], + classOf[GetUserStateRequest], classOf[ProcessResourceEvent], classOf[ProcessIMEvent], - classOf[AdminRequestPingAll]), + classOf[PingAllRequest]), Set(classOf[ActorProviderConfigured], classOf[AquariumPropertiesLoaded])) @@ -123,7 +125,7 @@ case object UserActorRole classOf[UserActor], Set(classOf[ProcessResourceEvent], classOf[ProcessIMEvent], - classOf[RequestUserBalance], - classOf[UserRequestGetState]), + classOf[GetUserBalanceRequest], + classOf[GetUserStateRequest]), Set(classOf[ActorProviderConfigured], classOf[AquariumPropertiesLoaded])) diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceRequest.scala b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceRequest.scala new file mode 100644 index 0000000..ce7fe67 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceRequest.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +/** + * + * @author Christos KK Loverdos + */ + +case class GetUserBalanceRequest(userID: String, timestamp: Long) +extends ActorMessage + with RouterRequestMessage + with UserActorRequestMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceResponse.scala b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceResponse.scala new file mode 100644 index 0000000..790984e --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserBalanceResponse.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +/** + * + * @author Christos KK Loverdos + */ + +case class GetUserBalanceResponse( + userID: String, + balance: Either[String, Double]) +extends RouterResponseMessage(balance) diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateRequest.scala b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateRequest.scala new file mode 100644 index 0000000..80f9c11 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateRequest.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +/** + * + * @author Christos KK Loverdos + */ + +case class GetUserStateRequest(userID: String, timestamp: Long) +extends ActorMessage + with RouterRequestMessage + with UserActorRequestMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateResponse.scala b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateResponse.scala new file mode 100644 index 0000000..273b477 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/GetUserStateResponse.scala @@ -0,0 +1,48 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +import gr.grnet.aquarium.user.UserState + +/** + * + * @author Christos KK Loverdos + */ + +case class GetUserStateResponse( + userID: String, + state: Either[String, UserState]) +extends RouterResponseMessage(state) diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/RouterRequestMessage.scala b/src/main/scala/gr/grnet/aquarium/actor/message/RouterRequestMessage.scala new file mode 100644 index 0000000..d4a1607 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/RouterRequestMessage.scala @@ -0,0 +1,45 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +/** + * Request message sent to [[gr.grnet.aquarium.actor.service.router.RouterActor]]. + * + * @author Christos KK Loverdos + */ + + +trait RouterRequestMessage extends ActorMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/RouterResponseMessage.scala b/src/main/scala/gr/grnet/aquarium/actor/message/RouterResponseMessage.scala new file mode 100644 index 0000000..6fad97e --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/RouterResponseMessage.scala @@ -0,0 +1,58 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +import gr.grnet.aquarium.converter.{StdConverters, PrettyJsonTextFormat} + +/** + * Response message sent as a reply by [[gr.grnet.aquarium.actor.service.router.RouterActor]]. + * + * @author Christos KK Loverdos + */ + +abstract class RouterResponseMessage[T](val response: Either[String, T]) extends ActorMessage { + def isError = response.isRight + + def responseToJsonString: String = { + response match { + case Left(error) ⇒ + "{}" + + case Right(data) ⇒ + StdConverters.AllConverters.convertEx[PrettyJsonTextFormat](data).value + } + } +} diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/UserActorRequestMessage.scala b/src/main/scala/gr/grnet/aquarium/actor/message/UserActorRequestMessage.scala new file mode 100644 index 0000000..c5eb6fd --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/UserActorRequestMessage.scala @@ -0,0 +1,44 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message + +/** + * Mix this in to every message sent to [[gr.grnet.aquarium.actor.service.user.UserActor]]. + * + * @author Christos KK Loverdos + */ + +trait UserActorRequestMessage extends ActorMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllRequest.scala b/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllRequest.scala new file mode 100644 index 0000000..13d0ad9 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllRequest.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message.admin + +import gr.grnet.aquarium.actor.message.{RouterRequestMessage, ActorMessage} + + +/** + * + * @author Christos KK Loverdos + */ + +case class PingAllRequest() extends ActorMessage with RouterRequestMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllResponse.scala b/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllResponse.scala new file mode 100644 index 0000000..1f564a7 --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/admin/PingAllResponse.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message.admin + +import gr.grnet.aquarium.actor.message.{RouterResponseMessage, RouterRequestMessage, ActorMessage} + + +/** + * + * @author Christos KK Loverdos + */ + +case class PingAllResponse() extends RouterResponseMessage(Right("")) diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessIMEvent.scala b/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessIMEvent.scala new file mode 100644 index 0000000..4d7fabe --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessIMEvent.scala @@ -0,0 +1,50 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message.event + +import gr.grnet.aquarium.event.im.IMEventModel +import gr.grnet.aquarium.actor.message.{UserActorRequestMessage, ActorMessage} + +/** + * [[gr.grnet.aquarium.actor.service.router.RouterActor]] message + * that triggers the user event processing pipeline. + * + * Note that the prefix `Process` means that no reply is created or needed. + * + * @author Christos KK Loverdos + */ + +case class ProcessIMEvent(imEvent: IMEventModel) extends ActorMessage with UserActorRequestMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessResourceEvent.scala b/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessResourceEvent.scala new file mode 100644 index 0000000..f9ce93d --- /dev/null +++ b/src/main/scala/gr/grnet/aquarium/actor/message/event/ProcessResourceEvent.scala @@ -0,0 +1,51 @@ +/* + * Copyright 2011-2012 GRNET S.A. All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and + * documentation are those of the authors and should not be + * interpreted as representing official policies, either expressed + * or implied, of GRNET S.A. + */ + +package gr.grnet.aquarium.actor.message.event + +import gr.grnet.aquarium.event.resource.ResourceEventModel +import gr.grnet.aquarium.actor.message.{UserActorRequestMessage, ActorMessage} + +/** + * [[gr.grnet.aquarium.actor.service.router.RouterActor]] message + * that triggers the resource event processing pipeline. + * + * Note that the prefix `Process` means that no reply is created or needed. + * + * @author Christos KK Loverdos + */ +case class ProcessResourceEvent(rcEvent: ResourceEventModel) +extends ActorMessage + with UserActorRequestMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/message/service/router/RouterMessage.scala b/src/main/scala/gr/grnet/aquarium/actor/message/service/router/RouterMessage.scala deleted file mode 100644 index 9d3a403..0000000 --- a/src/main/scala/gr/grnet/aquarium/actor/message/service/router/RouterMessage.scala +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2011-2012 GRNET S.A. All rights reserved. - * - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and - * documentation are those of the authors and should not be - * interpreted as representing official policies, either expressed - * or implied, of GRNET S.A. - */ - -package gr.grnet.aquarium.actor.message -package service -package router - -import gr.grnet.aquarium.user.UserState -import gr.grnet.aquarium.util.json.JsonSupport -import gr.grnet.aquarium.event.im.IMEventModel -import gr.grnet.aquarium.converter.{PrettyJsonTextFormat, StdConverters} -import gr.grnet.aquarium.event.resource.ResourceEventModel - - -/** - * This is the base class of the messages the [[gr.grnet.aquarium.actor.service.router.RouterActor]] understands. - * - * FIXME: re-organize messages - * - * @author Christos KK Loverdos . - */ -sealed trait RouterMessage extends ActorMessage { - def isError: Boolean = false -} - -sealed trait RouterResponseMessage extends RouterMessage { - def error: Option[String] - - override def isError = error.isDefined - - def responseBody: Any - def responseBodyToJson: String = { - responseBody match { - case null ⇒ - throw new NullPointerException("Unexpected null response body in %s".format(this)) - case other ⇒ - StdConverters.AllConverters.convertEx[PrettyJsonTextFormat](other).value - } - } -} - -case class RequestUserBalance(userID: String, timestamp: Long) extends RouterMessage -case class BalanceValue(balance: Double) extends JsonSupport -case class ResponseUserBalance(userID: String, balance: Double, error: Option[String]) extends RouterResponseMessage { - def responseBody = BalanceValue(balance) -} - -case class UserResponseGetBalance(userId: String, balance: Double) extends RouterResponseMessage { - def responseBody = BalanceValue(balance) - def error = None -} - -case class UserRequestGetState(userID: String, timestamp: Long) extends RouterMessage -case class UserResponseGetState(userID: String, state: UserState) extends RouterResponseMessage { - def responseBody = state - val error = None -} - -/** - * Dispatcher message that triggers the resource event processing pipeline. - * - * Note that the prefix `Process` means that no reply is created or needed. - */ -case class ProcessResourceEvent(rcEvent: ResourceEventModel) extends RouterMessage - -/** - * Dispatcher message that triggers the user event processing pipeline. - * - * Note that the prefix `Process` means that no reply is created or needed. - */ -case class ProcessIMEvent(imEvent: IMEventModel) extends RouterMessage - -case class AdminRequestPingAll() extends RouterMessage diff --git a/src/main/scala/gr/grnet/aquarium/actor/service/pinger/PingerActor.scala b/src/main/scala/gr/grnet/aquarium/actor/service/pinger/PingerActor.scala index afed1dd..02d8351 100644 --- a/src/main/scala/gr/grnet/aquarium/actor/service/pinger/PingerActor.scala +++ b/src/main/scala/gr/grnet/aquarium/actor/service/pinger/PingerActor.scala @@ -38,8 +38,8 @@ package service package pinger -import gr.grnet.aquarium.actor.{ReflectiveActor, PingerRole} -import message.service.router.AdminRequestPingAll +import gr.grnet.aquarium.actor.{PingerRole} +import gr.grnet.aquarium.actor.message.admin.PingAllRequest /** @@ -51,7 +51,7 @@ import message.service.router.AdminRequestPingAll class PingerActor extends ReflectiveRoleableActor { def role = PingerRole - def onAdminRequestPingAll(msg: AdminRequestPingAll): Unit = { + def onPingAllRequest(msg: PingAllRequest): Unit = { logger.debug("Got {}", msg) } } diff --git a/src/main/scala/gr/grnet/aquarium/actor/service/rest/RESTActor.scala b/src/main/scala/gr/grnet/aquarium/actor/service/rest/RESTActor.scala index 2f1071c..5c2259d 100644 --- a/src/main/scala/gr/grnet/aquarium/actor/service/rest/RESTActor.scala +++ b/src/main/scala/gr/grnet/aquarium/actor/service/rest/RESTActor.scala @@ -40,16 +40,15 @@ package rest import cc.spray.can.HttpMethods.GET import cc.spray.can._ import gr.grnet.aquarium.util.Loggable -import net.liftweb.json.JsonAST.JValue -import net.liftweb.json.{JsonAST, Printer} import gr.grnet.aquarium.Configurator import akka.actor.Actor import gr.grnet.aquarium.actor.{RESTRole, RoleableActor, RouterRole} import RESTPaths.{UserBalancePath, UserStatePath, AdminPingAll} import com.ckkloverdos.maybe.{NoVal, Just} -import message.service.router._ import gr.grnet.aquarium.util.date.TimeHelpers import org.joda.time.format.ISODateTimeFormat +import gr.grnet.aquarium.actor.message.admin.PingAllRequest +import gr.grnet.aquarium.actor.message.{RouterResponseMessage, GetUserStateRequest, RouterRequestMessage, ActorMessage, GetUserBalanceRequest} /** * Spray-based REST service. This is the outer-world's interface to Aquarium functionality. @@ -61,11 +60,6 @@ class RESTActor private(_id: String) extends RoleableActor with Loggable { self.id = _id - private def jsonResponse200(body: JValue, pretty: Boolean = false): HttpResponse = { - val stringBody = Printer.pretty(JsonAST.render(body)) - stringResponse200(stringBody, "application/json") - } - private def stringResponse(status: Int, stringBody: String, contentType: String = "application/json"): HttpResponse = { HttpResponse( status, @@ -106,11 +100,11 @@ class RESTActor private(_id: String) extends RoleableActor with Loggable { //+ Main business logic REST URIs are matched here val millis = TimeHelpers.nowMillis() uri match { - case UserBalancePath(userId) ⇒ - callDispatcher(RequestUserBalance(userId, millis), responder) + case UserBalancePath(userID) ⇒ + callRouter(GetUserBalanceRequest(userID, millis), responder) case UserStatePath(userId) ⇒ - callDispatcher(UserRequestGetState(userId, millis), responder) + callRouter(GetUserStateRequest(userId, millis), responder) case AdminPingAll() ⇒ val mc = Configurator.MasterConfigurator @@ -118,7 +112,7 @@ class RESTActor private(_id: String) extends RoleableActor with Loggable { case Just(adminCookie) ⇒ headers.find(_.name.toLowerCase == Configurator.HTTP.RESTAdminHeaderNameLowerCase) match { case Some(cookieHeader) if(cookieHeader.value == adminCookie) ⇒ - callDispatcher(AdminRequestPingAll(), responder) + callRouter(PingAllRequest(), responder) case Some(cookieHeader) ⇒ logger.warn("Admin request with bad cookie '{}' from {}", cookieHeader.value, remoteAddress) @@ -148,7 +142,7 @@ class RESTActor private(_id: String) extends RoleableActor with Loggable { private[this] - def callDispatcher(message: RouterMessage, responder: RequestResponder): Unit = { + def callRouter(message: RouterRequestMessage, responder: RequestResponder): Unit = { val configurator = Configurator.MasterConfigurator val actorProvider = configurator.actorProvider val router = actorProvider.actorForRole(RouterRole) @@ -166,23 +160,22 @@ class RESTActor private(_id: String) extends RoleableActor with Loggable { case Some(Right(actualResponse)) ⇒ actualResponse match { - case dispatcherResponse: RouterResponseMessage if (!dispatcherResponse.isError) ⇒ - //logger.debug("Received response: %s".format(dispatcherResponse)) - //logger.debug("Received response (JSON): %s".format(dispatcherResponse.toJson)) - //logger.debug("Received response:body %s".format(dispatcherResponse.responseBody)) - //logger.debug("Received response:body (JSON): %s".format(dispatcherResponse.responseBodyToJson)) - responder.complete( - HttpResponse( - status = 200, - body = dispatcherResponse.responseBodyToJson.getBytes("UTF-8"), - headers = HttpHeader("Content-type", "application/json;charset=utf-8") :: Nil)) - - case dispatcherResponse: RouterResponseMessage ⇒ - logger.error("Error serving %s: Dispatcher response is: %s".format(message, actualResponse)) - responder.complete(stringResponse(500, "Internal Server Error", "text/plain")) + case routerResponse: RouterResponseMessage[_] ⇒ + routerResponse.response match { + case Left(error) ⇒ + logger.error("Error %s serving %s: Response is: %s".format(error, message, actualResponse)) + responder.complete(stringResponse(500, "Internal Server Error", "text/plain")) + + case Right(response) ⇒ + responder.complete( + HttpResponse( + status = 200, + body = routerResponse.responseToJsonString.getBytes("UTF-8"), + headers = HttpHeader("Content-type", "application/json;charset=utf-8") :: Nil)) + } case _ ⇒ - logger.error("Error serving %s: Dispatcher response is: %s".format(message, actualResponse)) + logger.error("Error serving %s: Response is: %s".format(message, actualResponse)) responder.complete(stringResponse(500, "Internal Server Error", "text/plain")) } } diff --git a/src/main/scala/gr/grnet/aquarium/actor/service/router/RouterActor.scala b/src/main/scala/gr/grnet/aquarium/actor/service/router/RouterActor.scala index 9fe11cf..c5178a2 100644 --- a/src/main/scala/gr/grnet/aquarium/actor/service/router/RouterActor.scala +++ b/src/main/scala/gr/grnet/aquarium/actor/service/router/RouterActor.scala @@ -39,10 +39,12 @@ package router import gr.grnet.aquarium.util.shortClassNameOf import gr.grnet.aquarium.service.RoleableActorProviderService -import message.service.router._ import akka.actor.ActorRef import user.{UserActorCache, UserActorSupervisor} import message.config.{AquariumPropertiesLoaded, ActorProviderConfigured} +import gr.grnet.aquarium.actor.message.event.{ProcessResourceEvent, ProcessIMEvent} +import gr.grnet.aquarium.actor.message.admin.PingAllRequest +import gr.grnet.aquarium.actor.message.{UserActorRequestMessage, GetUserStateRequest, GetUserBalanceRequest} /** * Business logic router. Incoming messages are routed to appropriate destinations. Replies are routed back @@ -73,7 +75,7 @@ class RouterActor extends ReflectiveRoleableActor { } } - private[this] def _forwardToUserActor(userID: String, m: RouterMessage): Unit = { + private[this] def _forwardToUserActor(userID: String, m: UserActorRequestMessage): Unit = { try { _findOrCreateUserActor(userID) forward m @@ -97,11 +99,11 @@ class RouterActor extends ReflectiveRoleableActor { _forwardToUserActor(m.imEvent.userID, m) } - def onRequestUserBalance(m: RequestUserBalance): Unit = { + def onGetUserBalanceRequest(m: GetUserBalanceRequest): Unit = { _forwardToUserActor(m.userID, m) } - def onUserRequestGetState(m: UserRequestGetState): Unit = { + def onGetUserStateRequest(m: GetUserStateRequest): Unit = { _forwardToUserActor(m.userID, m) } @@ -109,8 +111,7 @@ class RouterActor extends ReflectiveRoleableActor { _forwardToUserActor(m.rcEvent.userID, m) } - def onAdminRequestPingAll(m: AdminRequestPingAll): Unit = { - + def onPingAllRequest(m: PingAllRequest): Unit = { } override def postStop = { diff --git a/src/main/scala/gr/grnet/aquarium/actor/service/user/UserActor.scala b/src/main/scala/gr/grnet/aquarium/actor/service/user/UserActor.scala index 67c4abb..b5a22a0 100644 --- a/src/main/scala/gr/grnet/aquarium/actor/service/user/UserActor.scala +++ b/src/main/scala/gr/grnet/aquarium/actor/service/user/UserActor.scala @@ -41,13 +41,13 @@ import gr.grnet.aquarium.actor._ import gr.grnet.aquarium.user._ import gr.grnet.aquarium.util.shortClassNameOf -import gr.grnet.aquarium.actor.message.service.router._ import message.config.{ActorProviderConfigured, AquariumPropertiesLoaded} import gr.grnet.aquarium.event.im.IMEventModel import akka.config.Supervision.Temporary -import gr.grnet.aquarium.{AquariumInternalError, AquariumException, Configurator} -import gr.grnet.aquarium.util.date.{MutableDateCalc, TimeHelpers} - +import gr.grnet.aquarium.Configurator +import gr.grnet.aquarium.util.date.{TimeHelpers, MutableDateCalc} +import gr.grnet.aquarium.actor.message.event.{ProcessResourceEvent, ProcessIMEvent} +import gr.grnet.aquarium.actor.message.{GetUserStateResponse, GetUserBalanceResponse, GetUserStateRequest, GetUserBalanceRequest} /** * @@ -129,16 +129,16 @@ class UserActor extends ReflectiveRoleableActor { DEBUG("%s %s", if(isUpdate) "Update" else "Set", shortClassNameOf(this._imState)) } - def onRequestUserBalance(event: RequestUserBalance): Unit = { + def onGetUserBalanceRequest(event: GetUserBalanceRequest): Unit = { val userId = event.userID - // FIXME: Implement threshold - self reply UserResponseGetBalance(userId, _userState.creditsSnapshot.creditAmount) + // FIXME: Implement + self reply GetUserBalanceResponse(userId, Right(_userState.creditsSnapshot.creditAmount)) } - def onUserRequestGetState(event: UserRequestGetState): Unit = { + def onGetUserStateRequest(event: GetUserStateRequest): Unit = { val userId = event.userID - // FIXME: implement - self reply UserResponseGetState(userId, this._userState) + // FIXME: Implement + self reply GetUserStateResponse(userId, Right(this._userState)) } def onProcessResourceEvent(event: ProcessResourceEvent): Unit = { diff --git a/src/main/scala/gr/grnet/aquarium/service/IMEventProcessorService.scala b/src/main/scala/gr/grnet/aquarium/service/IMEventProcessorService.scala index d319fe2..a103d1d 100644 --- a/src/main/scala/gr/grnet/aquarium/service/IMEventProcessorService.scala +++ b/src/main/scala/gr/grnet/aquarium/service/IMEventProcessorService.scala @@ -39,12 +39,11 @@ package gr.grnet.aquarium.service import gr.grnet.aquarium.actor.RouterRole import gr.grnet.aquarium.Configurator.Keys import gr.grnet.aquarium.store.LocalFSEventStore -import gr.grnet.aquarium.actor.message.service.router.ProcessIMEvent import gr.grnet.aquarium.util.date.TimeHelpers import gr.grnet.aquarium.util.makeString import com.ckkloverdos.maybe._ -import gr.grnet.aquarium.store.memory.MemStore import gr.grnet.aquarium.event.im.{StdIMEvent, IMEventModel} +import gr.grnet.aquarium.actor.message.event.ProcessIMEvent /** * An event processor service for user events coming from the IM system diff --git a/src/main/scala/gr/grnet/aquarium/service/ResourceEventProcessorService.scala b/src/main/scala/gr/grnet/aquarium/service/ResourceEventProcessorService.scala index f61cb5b..89d597b 100644 --- a/src/main/scala/gr/grnet/aquarium/service/ResourceEventProcessorService.scala +++ b/src/main/scala/gr/grnet/aquarium/service/ResourceEventProcessorService.scala @@ -39,9 +39,9 @@ import gr.grnet.aquarium.actor.RouterRole import gr.grnet.aquarium.Configurator.Keys import gr.grnet.aquarium.store.LocalFSEventStore import com.ckkloverdos.maybe.Maybe -import gr.grnet.aquarium.actor.message.service.router.ProcessResourceEvent import gr.grnet.aquarium.util.date.TimeHelpers import gr.grnet.aquarium.event.resource.{StdResourceEvent, ResourceEventModel} +import gr.grnet.aquarium.actor.message.event.ProcessResourceEvent /** -- 1.7.10.4