VirtualBox

Changeset 73571 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Aug 8, 2018 4:10:30 PM (7 years ago)
Author:
vboxsync
Message:

bugref:9152. Renamed ICloudUserProfiles to ICloudProvider, ICloudUserProfileManager to ICloudProviderManager. Commented out some code in the frontend. Sergey will rewrite it according to actual realization.

Location:
trunk/src/VBox/Main/src-server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/CloudUserProfileManagerImpl.cpp

    r73554 r73571  
    11/* $Id$ */
    22/** @file
    3  * ICloudUserProfileManager  COM class implementations.
     3 * ICloudProviderManager  COM class implementations.
    44 */
    55
     
    3636////////////////////////////////////////////////////////////////////////////////
    3737//
    38 // CloudUserProfileManager constructor / destructor
     38// CloudProviderManager constructor / destructor
    3939//
    4040// ////////////////////////////////////////////////////////////////////////////////
    41 CloudUserProfileManager::CloudUserProfileManager()
     41CloudProviderManager::CloudProviderManager()
    4242    : mParent(NULL)
    4343{
    4444}
    4545
    46 CloudUserProfileManager::~CloudUserProfileManager()
    47 {
    48 }
    49 
    50 
    51 HRESULT CloudUserProfileManager::FinalConstruct()
     46CloudProviderManager::~CloudProviderManager()
     47{
     48}
     49
     50
     51HRESULT CloudProviderManager::FinalConstruct()
    5252{
    5353    return BaseFinalConstruct();
    5454}
    5555
    56 void CloudUserProfileManager::FinalRelease()
     56void CloudProviderManager::FinalRelease()
    5757{
    5858    uninit();
     
    6161}
    6262
    63 HRESULT CloudUserProfileManager::init(VirtualBox *aParent)
     63HRESULT CloudProviderManager::init(VirtualBox *aParent)
    6464{
    6565    /* Enclose the state transition NotReady->InInit->Ready */
     
    7575    ExtPackManager *pExtPackMgr = aParent->i_getExtPackManager();
    7676    std::vector<ComPtr<IUnknown> > Objects;
    77     com::Guid idObj(COM_IIDOF(ICloudUserProfileManager));
     77    com::Guid idObj(COM_IIDOF(ICloudProviderManager));
    7878    pExtPackMgr->i_queryObjects(idObj.toString(), Objects);
    7979    for (unsigned i = 0; i < Objects.size(); i++)
    8080    {
    81         ComPtr<ICloudUserProfileManager> ptrTmp;
     81        ComPtr<ICloudProviderManager> ptrTmp;
    8282        HRESULT hrc = Objects[i].queryInterfaceTo(ptrTmp.asOutParam());
    8383        if (SUCCEEDED(hrc))
     
    8787
    8888    mSupportedProviders.clear();
    89     mSupportedProviders.push_back(CloudProviderId_OCI);
     89    mSupportedProviders.push_back("OCI");
     90
    9091#endif
    9192
     
    9495}
    9596
    96 void CloudUserProfileManager::uninit()
     97void CloudProviderManager::uninit()
    9798{
    9899    /* Enclose the state transition Ready->InUninit->NotReady */
     
    104105}
    105106
    106 HRESULT CloudUserProfileManager::getSupportedProviders(std::vector<CloudProviderId_T> &aSupportedProviders)
     107HRESULT CloudProviderManager::getSupportedProviders(std::vector<Utf8Str> &aSupportedProviders)
    107108{
    108109#ifdef VBOX_WITH_CLOUD_PROVIDERS_IN_EXTPACK
     
    113114    for (unsigned i = 0; i < mUserProfileManagers.size(); i++)
    114115    {
    115         SafeArray<CloudProviderId_T> FromCurrent;
     116        SafeArray<Utf8Str> FromCurrent;
    116117        HRESULT hrc2 = mUserProfileManagers[i]->COMGETTER(SupportedProviders)(ComSafeArrayAsOutParam(FromCurrent));
    117118        if (SUCCEEDED(hrc2))
     
    130131}
    131132
    132 HRESULT CloudUserProfileManager::getAllProfiles(std::vector<ComPtr<ICloudUserProfiles> > &aProfilesList)
     133HRESULT CloudProviderManager::getAllProfiles(std::vector<ComPtr<ICloudProvider> > &aProfilesList)
    133134{
    134135#ifdef VBOX_WITH_CLOUD_PROVIDERS_IN_EXTPACK
     
    139140    for (unsigned i = 0; i < mUserProfileManagers.size(); i++)
    140141    {
    141         SafeIfaceArray<ICloudUserProfiles> FromCurrent;
     142        SafeIfaceArray<ICloudProvider> FromCurrent;
    142143        HRESULT hrc2 = mUserProfileManagers[i]->GetAllProfiles(ComSafeArrayAsOutParam(FromCurrent));
    143144        if (SUCCEEDED(hrc2))
     
    153154#else
    154155    HRESULT hrc = S_OK;
    155     std::vector<ComPtr<ICloudUserProfiles> > lProfilesList;
     156    std::vector<ComPtr<ICloudProvider> > lProfilesList;
    156157    for (size_t i=0;i<mSupportedProviders.size();++i)
    157158    {
    158         ComPtr<ICloudUserProfiles> lProfiles;
     159        ComPtr<ICloudProvider> lProfiles;
    159160        hrc = getProfilesByProvider(mSupportedProviders.at(i), lProfiles);
    160161        if (FAILED(hrc))
     
    171172}
    172173
    173 HRESULT CloudUserProfileManager::getProfilesByProvider(CloudProviderId_T aProviderType,
    174                                                        ComPtr<ICloudUserProfiles> &aProfiles)
     174HRESULT CloudProviderManager::getProfilesByProvider(const com::Utf8Str &aProviderName,
     175                                                    ComPtr<ICloudProvider> &aProfiles)
    175176{
    176177#ifdef VBOX_WITH_CLOUD_PROVIDERS_IN_EXTPACK
     
    189190#else
    190191
    191     ComObjPtr<CloudUserProfiles> ptrCloudUserProfiles;
    192     HRESULT hrc = ptrCloudUserProfiles.createObject();
    193     switch(aProviderType)
    194     {
    195         case CloudProviderId_OCI:
    196         default:
    197             ComObjPtr<OCIUserProfiles> ptrOCIUserProfiles;
    198             hrc = ptrOCIUserProfiles.createObject();
     192    ComObjPtr<CloudProvider> ptrCloudProvider;
     193    HRESULT hrc = ptrCloudProvider.createObject();
     194    if (aProviderName.equals("OCI"))
     195    {
     196        ComObjPtr<OCIUserProfiles> ptrOCIUserProfiles;
     197        hrc = ptrOCIUserProfiles.createObject();
     198        if (SUCCEEDED(hrc))
     199        {
     200            AutoReadLock wlock(this COMMA_LOCKVAL_SRC_POS);
     201
     202            hrc = ptrOCIUserProfiles->init(mParent);
    199203            if (SUCCEEDED(hrc))
    200204            {
    201                 AutoReadLock wlock(this COMMA_LOCKVAL_SRC_POS);
    202 
    203                 hrc = ptrOCIUserProfiles->init(mParent);
    204                 if (SUCCEEDED(hrc))
     205                char szOciConfigPath[RTPATH_MAX];
     206                int vrc = RTPathUserHome(szOciConfigPath, sizeof(szOciConfigPath));
     207                if (RT_SUCCESS(vrc))
     208                    vrc = RTPathAppend(szOciConfigPath, sizeof(szOciConfigPath), ".oci" RTPATH_SLASH_STR "config");
     209                if (RT_SUCCESS(vrc))
    205210                {
    206                     char szOciConfigPath[RTPATH_MAX];
    207                     int vrc = RTPathUserHome(szOciConfigPath, sizeof(szOciConfigPath));
    208                     if (RT_SUCCESS(vrc))
    209                         vrc = RTPathAppend(szOciConfigPath, sizeof(szOciConfigPath), ".oci" RTPATH_SLASH_STR "config");
    210                     if (RT_SUCCESS(vrc))
     211                    LogRel(("config = %s\n", szOciConfigPath));
     212                    if (RTFileExists(szOciConfigPath))
    211213                    {
    212                         LogRel(("config = %s\n", szOciConfigPath));
    213                         if (RTFileExists(szOciConfigPath))
    214                         {
    215                             hrc = ptrOCIUserProfiles->readProfiles(szOciConfigPath);
    216                             if (SUCCEEDED(hrc))
    217                                 LogRel(("Reading profiles from %s has been done\n", szOciConfigPath));
    218                             else
    219                                 LogRel(("Reading profiles from %s hasn't been done\n", szOciConfigPath));
    220 
    221                             ptrCloudUserProfiles = ptrOCIUserProfiles;
    222                             hrc = ptrCloudUserProfiles.queryInterfaceTo(aProfiles.asOutParam());
    223                         }
     214                        hrc = ptrOCIUserProfiles->readProfiles(szOciConfigPath);
     215                        if (SUCCEEDED(hrc))
     216                            LogRel(("Reading profiles from %s has been done\n", szOciConfigPath));
    224217                        else
    225                             hrc = setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"),
    226                                                szOciConfigPath);
     218                            LogRel(("Reading profiles from %s hasn't been done\n", szOciConfigPath));
     219
     220                        ptrCloudProvider = ptrOCIUserProfiles;
     221                        hrc = ptrCloudProvider.queryInterfaceTo(aProfiles.asOutParam());
    227222                    }
    228223                    else
    229                         hrc = setErrorVrc(vrc);
     224                        hrc = setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"),
     225                                           szOciConfigPath);
    230226                }
     227                else
     228                    hrc = setErrorVrc(vrc);
    231229            }
    232             break;
    233     }
    234 
    235     return hrc;
    236 #endif
    237 }
    238 
     230        }
     231    }
     232
     233    return hrc;
     234#endif
     235}
     236
  • trunk/src/VBox/Main/src-server/CloudUserProfilesImpl.cpp

    r73337 r73571  
    11/* $Id$ */
    22/** @file
    3  * ICloudUserProfiles COM class implementations.
     3 * ICloudProvider COM class implementations.
    44 */
    55
     
    210210////////////////////////////////////////////////////////////////////////////////
    211211//
    212 // ICloudUserProfiles implementation
     212// ICloudProvider implementation
    213213//
    214214////////////////////////////////////////////////////////////////////////////////
    215 CloudUserProfiles::CloudUserProfiles()
     215CloudProvider::CloudProvider()
    216216    : mParent(NULL)
    217217{
    218218}
    219219
    220 CloudUserProfiles::~CloudUserProfiles()
    221 {
    222     LogRel(("CloudUserProfilesImpl::~CloudUserProfilesImpl()\n"));
     220CloudProvider::~CloudProvider()
     221{
     222    LogRel(("CloudProvider::~CloudProvider()\n"));
    223223    unconst(mParent) = NULL;
    224224}
    225225
    226 HRESULT CloudUserProfiles::FinalConstruct()
     226HRESULT CloudProvider::FinalConstruct()
    227227{
    228228    return BaseFinalConstruct();
    229229}
    230230
    231 void CloudUserProfiles::FinalRelease()
     231void CloudProvider::FinalRelease()
    232232{
    233233    uninit();
     
    236236}
    237237
    238 void CloudUserProfiles::uninit()
     238void CloudProvider::uninit()
    239239{
    240240    /* Enclose the state transition Ready->InUninit->NotReady */
     
    246246}
    247247
    248 HRESULT CloudUserProfiles::init(VirtualBox *aParent)
     248HRESULT CloudProvider::init(VirtualBox *aParent)
    249249{
    250250    /* Enclose the state transition NotReady->InInit->Ready */
     
    259259
    260260
    261 HRESULT CloudUserProfiles::getSupportedPropertiesNames(std::vector<com::Utf8Str> &aPropertiesNames)
    262 {
    263     LogRel(("CloudUserProfiles::getSupportedPropertiesNames:\n"));
     261HRESULT CloudProvider::getSupportedPropertiesNames(std::vector<com::Utf8Str> &aPropertiesNames)
     262{
     263    LogRel(("CloudProvider::getSupportedPropertiesNames:\n"));
    264264    aPropertiesNames.clear();
    265265    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    266266}
    267267
    268 HRESULT CloudUserProfiles::readProfiles(const Utf8Str &strConfigPath)
    269 {
    270     LogRel(("CloudUserProfiles::readProfiles: %s\n", strConfigPath.c_str()));
    271     return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    272 }
    273 
    274 HRESULT CloudUserProfiles::getProvider(CloudProviderId_T *aProvider)
     268HRESULT CloudProvider::readProfiles(const Utf8Str &strConfigPath)
     269{
     270    LogRel(("CloudProvider::readProfiles: %s\n", strConfigPath.c_str()));
     271    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
     272}
     273
     274HRESULT CloudProvider::getProvider(CloudProviderId_T *aProvider)
    275275{
    276276    *aProvider = CloudProviderId_Unknown;
    277     LogRel(("CloudUserProfiles::getProvider: %d\n", *aProvider));
    278     return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    279 }
    280 
    281 HRESULT CloudUserProfiles::createProfile(const com::Utf8Str &aProfileName,
     277    LogRel(("CloudProvider::getProvider: %d\n", *aProvider));
     278    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
     279}
     280
     281HRESULT CloudProvider::createProfile(const com::Utf8Str &aProfileName,
    282282                                            const std::vector<com::Utf8Str> &aNames,
    283283                                            const std::vector<com::Utf8Str> &aValues)
    284284{
    285     LogRel(("CloudUserProfiles::createProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size()));
    286     return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    287 }
    288 
    289 HRESULT CloudUserProfiles::updateProfile(const com::Utf8Str &aProfileName,
     285    LogRel(("CloudProvider::createProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size()));
     286    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
     287}
     288
     289HRESULT CloudProvider::updateProfile(const com::Utf8Str &aProfileName,
    290290                                            const std::vector<com::Utf8Str> &aNames,
    291291                                            const std::vector<com::Utf8Str> &aValues)
    292292{
    293     LogRel(("CloudUserProfiles::updateProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size()));
    294     return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    295 }
    296 
    297 HRESULT CloudUserProfiles::getStoredProfilesNames(std::vector<com::Utf8Str> &aProfilesNames)
    298 {
    299 
    300     LogRel(("CloudUserProfiles::getStoredProfilesNames:\n"));
     293    LogRel(("CloudProvider::updateProfile: %s, %d, %d\n", aProfileName.c_str(), aNames.size(), aValues.size()));
     294    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
     295}
     296
     297HRESULT CloudProvider::getStoredProfilesNames(std::vector<com::Utf8Str> &aProfilesNames)
     298{
     299
     300    LogRel(("CloudProvider::getStoredProfilesNames:\n"));
    301301    aProfilesNames.clear();
    302302    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    303303}
    304304
    305 HRESULT CloudUserProfiles::getProfileProperties(const com::Utf8Str &aProfileName,
     305HRESULT CloudProvider::getProfileProperties(const com::Utf8Str &aProfileName,
    306306                                              std::vector<com::Utf8Str> &aReturnNames,
    307307                                              std::vector<com::Utf8Str> &aReturnValues)
    308308{
    309     LogRel(("CloudUserProfiles::getProfileProperties: %s\n", aProfileName.c_str()));
     309    LogRel(("CloudProvider::getProfileProperties: %s\n", aProfileName.c_str()));
    310310    aReturnNames.clear();
    311311    aReturnValues.clear();
     
    313313}
    314314
    315 HRESULT CloudUserProfiles::getPropertyDescription(const com::Utf8Str &aName,
     315HRESULT CloudProvider::getPropertyDescription(const com::Utf8Str &aName,
    316316                                                     com::Utf8Str &aDescription)
    317317{
    318     LogRel(("CloudUserProfiles::getPropertyDescription: %s, %s\n", aName.c_str(), aDescription.c_str()));
    319     return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
    320 }
    321 
    322 HRESULT CloudUserProfiles::createCloudClient(const com::Utf8Str &aProfileName,
     318    LogRel(("CloudProvider::getPropertyDescription: %s, %s\n", aName.c_str(), aDescription.c_str()));
     319    return setErrorBoth(E_FAIL, VERR_NOT_IMPLEMENTED, tr("Not implemented"));
     320}
     321
     322HRESULT CloudProvider::createCloudClient(const com::Utf8Str &aProfileName,
    323323                                                ComPtr<ICloudClient> &aCloudClient)
    324324{
    325     LogRel(("CloudUserProfiles::createCloudClient: %s\n", aProfileName.c_str()));
     325    LogRel(("CloudProvider::createCloudClient: %s\n", aProfileName.c_str()));
    326326
    327327    if (aCloudClient.isNull())
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r73155 r73571  
    18201820}
    18211821
    1822 HRESULT VirtualBox::createCloudUserProfileManager(ComPtr<ICloudUserProfileManager> &aManager)
    1823 {
    1824     ComObjPtr<CloudUserProfileManager> ptrCloudUserProfileManager;
    1825     HRESULT hrc = ptrCloudUserProfileManager.createObject();
     1822HRESULT VirtualBox::createCloudProviderManager(ComPtr<ICloudProviderManager> &aManager)
     1823{
     1824    ComObjPtr<CloudProviderManager> ptrCloudProviderManager;
     1825    HRESULT hrc = ptrCloudProviderManager.createObject();
    18261826    if (SUCCEEDED(hrc))
    18271827    {
    18281828        AutoReadLock wlock(this COMMA_LOCKVAL_SRC_POS);
    1829         hrc = ptrCloudUserProfileManager->init(this);
     1829        hrc = ptrCloudProviderManager->init(this);
    18301830        if (SUCCEEDED(hrc))
    1831             hrc = ptrCloudUserProfileManager.queryInterfaceTo(aManager.asOutParam());
     1831            hrc = ptrCloudProviderManager.queryInterfaceTo(aManager.asOutParam());
    18321832    }
    18331833    return hrc;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette