/*********************************************************************/ /* */ /* 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 System.Reflection; using AgentService.Agent; namespace AgentService.Platform.Modules { /// /// Interface IStorageModule. Defines the basic functionalities /// of the module that handles the assembly storage system. /// public interface IStorageModule : IPlatformModule { /// /// Clear all the content of the storage. /// Warning this operation is dangerous since is /// meant to delete all the assemblies that are /// contained in the storage system. /// /// true if the operation has been successfull, false otherwise bool ClearStorage(); /// /// Adds an assembly to the storage subsystem and /// associates it to a name. /// /// path to the file that locates the assembly. /// true if the assembly has been properly added to the storage, false if some error occurred. bool AddAssembly(string path, bool bReplaceIfExists); /// /// Removes an assembly from the storage. /// /// the name that identifies the assembly provided with the add method. /// true if the assembly ahs been properly removed from the storage. bool RemoveAssembly(string name); /// /// Executes a copy of an assembly mantained in the storage. /// /// assembly file name /// destination path /// true if the copy is successfull bool CopyAssembly(string name, string newPath); /// /// Retrieves the assembly name where the given AgentService type (AgentTemplate, /// Beaviour, Knowledge). /// /// reference to an AgentTemplate. /// the name of the assembly containig th agent definition. TypeDescriptor GetAssemblyFor(string template); /// /// Retrieves all the dependent assemblies of the given assembly. /// /// name of the assembly to look for. /// arry of AssemblyName that contains the names of the dependent assemblies. System.Reflection.AssemblyName[] GetDependentAssemblies(string assemblyName); /// /// Synchronizes the storage phisical content with repository of AgentTemplate types. /// Note: Call after AddAssembly, RemoveAssembly. /// /// true if the synchronization is successful bool Synchronize(); /// /// returns all the assemblies that the platform uses. /// System.Reflection.AssemblyName[] GetStoredAssemblies(); /// /// Gets all the templates stored in the assembly loaded into the platform. /// /// a descriptor of the type containing the full type name and /// the assembly information TypeDescriptor[] GetStoredAgentTemplates(); /// /// Gets all the Behaviour classes used by agents into the platform. /// /// a descriptor of the type containing the full type name and /// the assembly information TypeDescriptor[] GetStoredBehaviours(); /// /// Gets all the Knowledge classes used by agents into the platform. /// /// a descriptor of the type containing the full type name and /// the assembly information TypeDescriptor[] GetStoredKnowledges(); } }