/*********************************************************************/ /* */ /* AgentService Framework */ /* www.agentservice.it */ /* */ /* Copyright (C) 2007 l.i.d.o. - DIST, University of Genoa, Italy */ /* GNU Lesser General Public License */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License as published by the Free Software Foundation, */ /* version 2.1 of the License. */ /* */ /* This library is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /* */ /*********************************************************************/ using System; using AgentService.Agent; using AgentService.Platform.AMS; namespace AgentService.Platform.AMS { /// /// MoveRequest class. Intended for platform 's internal use. It Contains /// all the parameters needed to transfer an agent /// [Serializable()] public class MoveRequest { /// /// AID of the agent to move /// private AID aidOfAgentToMove; /// /// Get the AID of the agent to move /// public AID AidOfAgentToMove { get { return this.aidOfAgentToMove; } } /// /// Name of the target platform /// private string destinationPlatform; /// /// Get the name of the target platform /// public string DestinationPlatform { get { return this.destinationPlatform; } } /// /// Type of the behaviour that requested the transfer of the agent /// private Type behaviourType; /// /// Get and set the behaviour's type that requested the transfer /// of the agent /// public Type BehaviourType { get { return this.behaviourType; } set { this.behaviourType = value; } } /// /// Name of the behaviour that requested the transfer of the agent /// private string behaviourName; /// /// Get and set the name of the behaviour that requested the /// transfer of the agent /// public string BehaviourName { get { return this.behaviourName; } set { this.behaviourName = value; } } /// /// Flag that indicates if the request to move the agent was originated /// by the platform (i.e. load balancing motivation), or it was /// originated by the agent itself /// private bool bIsSystemRequest; /// /// Get the bIsSystemRequest flag. /// public bool IsSystemRequest { get { return this.bIsSystemRequest; } } /// /// Timeout value for the transfer process /// private TimeSpan timeout; /// /// Get the timeout for the transfer process /// public TimeSpan Timeout { get { return this.timeout; } } /// /// Default constructor. It's used by binary deserialization /// public MoveRequest() { this.aidOfAgentToMove = null; this.destinationPlatform = string.Empty; this.behaviourType = null; this.behaviourName = string.Empty; this.timeout = new TimeSpan(); } /// /// Constructor. /// /// AID of the agent to move /// Name od the target platform public MoveRequest(AID aidOfAgentToMove, string destinationPlatform, TimeSpan timeout, bool bIsSystemRequest) { this.aidOfAgentToMove = aidOfAgentToMove; this.destinationPlatform = destinationPlatform; this.behaviourType = null; this.behaviourName = string.Empty; this.bIsSystemRequest = bIsSystemRequest; this.timeout = timeout; } } }