diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/new_RepositoryManager/new_RepositoryManager_Impl.h')
-rw-r--r-- | TAO/CIAO/DAnCE/new_RepositoryManager/new_RepositoryManager_Impl.h | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/TAO/CIAO/DAnCE/new_RepositoryManager/new_RepositoryManager_Impl.h b/TAO/CIAO/DAnCE/new_RepositoryManager/new_RepositoryManager_Impl.h new file mode 100644 index 00000000000..f544aa6e63d --- /dev/null +++ b/TAO/CIAO/DAnCE/new_RepositoryManager/new_RepositoryManager_Impl.h @@ -0,0 +1,207 @@ +// $Id$ + +///==================================================================== +//@filename: new_RepositoryManager_Impl.h +//@Author: Stoyan Paunov spaunov@isis.vanderbilt.edu +// +//@Purpose: This class is the implementation class for the new +// RepositoryManager + + + +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// .\be\be_codegen.cpp:873 + +#ifndef NEW_REPOSITORYMANAGERI_H_ +#define NEW_REPOSITORYMANAGERI_H_ + +#include "new_RepositoryManagerS.h" +#include "DeploymentS.h" //added for the deployment stuff + +#include "ace/Hash_Map_Manager.h" //for the ACE_Hash_Map_Manager +#include "ace/Null_Mutex.h" //for ACE_Null_Mutex +#include "ace/OS_NS_string.h" //for ACE_CString +#include "ace/SString.h" + + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +///DIRECTORY WHERE THE PACKAGES WILL BE STORED LOCALLY +const static char* RM_STORAGE_PATH = "./RepositoryDir"; + + +class CIAO_new_RepositoryManagerDaemon_i : public virtual POA_CIAO::new_RepositoryManagerDaemon, public virtual PortableServer::RefCountServantBase +{ +public: + + //Constructor + CIAO_new_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb); + + //Destructor + virtual ~CIAO_new_RepositoryManagerDaemon_i (void); + + virtual + void shutdown ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual + void installPackage ( + const char * installationName, + const ::Deployment::Package & the_package, + ::CORBA::Boolean replace + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NameExists, + ::Deployment::PackageError + )); + + virtual + ::Deployment::DeploymentPlan * retrievePlan ( + const char * packageName + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual + ::Deployment::Package * findPackageByName ( + const char * name + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NoSuchName + )); + + virtual + ::Deployment::Implementation * findImplementationByName ( + const char * implementation_name, + const char * package_name + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NoSuchName + )); + + virtual + ::Deployment::Package * findPackageByUUID ( + const char * UUID + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NoSuchName + )); + + virtual + ::Deployment::Implementation * findImplementationByUUID ( + const char * UUID + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NoSuchName + )); + + virtual + ::CORBA::StringSeq * getAllPackageNames ( + + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + + virtual + void deletePackage ( + const char * installationName + ) + ACE_THROW_SPEC (( + CORBA::SystemException, + ::Deployment::NoSuchName + )); + + + protected: + + ///function that writes out a file to a specified location on the hand disk + ///returns 1 on success + /// -1 on error + + int write_to_disk (const char* full_path, + const CORBA::Octet* buffer, + size_t length + ); + + + ///function that writes out a file to a specified location on the hand disk + ///returns 1 on success + /// 0 on already exists and replace == false + /// -1 on error + + int write_to_disk (const char* full_path, + ACE_Message_Block& mb, + bool replace = true + ); + + + ///function to read the contents of a file from disk into a CORBA::OctetSeq + ///returns a pointer to a CORBA::Octet buffer and updated the lenght on success + /// 0 on failure + + CORBA::Octet* read_from_disk (const char* full_path, size_t &lenght); + + private: + /// Cached information about the installed packages + /// and the Implementation Artifacts within them + /// Key: Package name of CString type or + /// Value: The location of the local copy of the package + + typedef ACE_Hash_Map_Manager_Ex<ACE_CString, + ACE_CString, + ACE_Hash<ACE_CString>, + ACE_Equal_To<ACE_CString>, + ACE_Null_Mutex> RepositoryDatabase; + + + typedef RepositoryDatabase::iterator RepositoryDatabase_Iterator; + + RepositoryDatabase packages_; + CORBA::ORB_var the_orb_; + +}; + + +#endif /* NEW_REPOSITORYMANAGERI_H_ */ + |