Public Member Functions
Osp::Content::RemoteContentManager Class Reference
Inheritance diagram for Osp::Content::RemoteContentManager:
Osp::Base::Object

Deprecated:
This class is deprecated due to the operation policy of the bada Server. An alternate class will be introduced in the near future.
Since:
1.0
Precondition:
User should be authenticated.

For more information, see Sign-in AppControl (Osp::App::APPCONTROL_SIGNIN)

Precondition:
RemoteContent type setup, Component Setup should be done.

The RemoteContentManager class manages the server content. The contents information for the server content can be created, read, deleted, or updated through RemoteContentInfo.

The following example demonstrates how to use the RemoteContentManager class.

 // TestApp.h

 class UtsContentManagerListener : public IRemoteContentManagerListener
 {
  public:
        UtsContentManagerListener() {}
        ~UtsContentManagerListener() {}

        virtual void OnContentInfoReceivedN(RequestId reqId, RemoteContentInfo* pRemoteContentInfo, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage);
        virtual void OnContentCreated(RequestId reqId, const Osp::Base::String& contentId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage);
        virtual void OnContentDeleted(RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage);
        virtual void OnContentStatusReceived(RequestId reqId, RemoteContentStatus contentStatus, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage);
        virtual void OnContentUpdated(RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage);
 };


 // TestApp.cpp

 void 
 UtsContentManagerListener::OnContentInfoReceivedN(RequestId reqId, RemoteContentInfo* pRemoteContentInfo, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage)
 {
        // Do something
 }

 void 
 UtsContentManagerListener::OnContentCreated(RequestId reqId, const Osp::Base::String& contentId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage)
 {
        // Do something
 }

 void 
 UtsContentManagerListener::OnContentDeleted(RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage)
 {
        // Do something
 }

 void 
 UtsContentManagerListener::OnContentStatusReceived(RequestId reqId, RemoteContentStatus contentStatus, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage)
 {
        // Do something
 }

 void 
 UtsContentManagerListener::OnContentUpdated(RequestId reqId, result r, const Osp::Base::String& errorCode, const Osp::Base::String& errorMessage)
 {
        // Do something
 }

 result
 MyClass::TestRemoteContentManager()
 {
        RemoteContentManager remoteContentManager;
        RemoteContentInfo remoteContentInfo;
        UtsContentManagerListener managerListener;
        Osp::Base::String contentId;
        RequestId reqId;
        result r = E_SUCCESS;

        r = remoteContentManager.Construct(managerListener);
        TryReturn(!IsFailed(r), r, "Construct failed.");

        Osp::Base::Utility::Uri uri;
        uri.SetPath(L"Image.jpg");
        r = remoteContentInfo.Construct(L"Image", uri, 12345);
        TryReturn(!IsFailed(r), r, "Construct failed.");

        r = remoteContentInfo.SetContentName(L"UTcGetContentInfoP01");
        TryReturn(!IsFailed(r), r, "SetContentName failed.");
        r = remoteContentInfo.SetKeyword(L"lee, kyeong, woo");
        TryReturn(!IsFailed(r), r, "SetKeyword failed.");

        // Creates
        r = remoteContentManager.CreateContent(remoteContentInfo, reqId);
        TryReturn(!IsFailed(r), r, "CreateContent failed.");

        // The result will be returned to UtsContentManagerListener::OnContentCreated().
        // The result is the content ID.
    
        // Gets
        r = remoteContentManager.GetContentInfo(contentId, reqId);
        TryReturn(!IsFailed(r), r, "GetContentInfo failed.");

        // The result will be returned to UtsContentManagerListener::OnContentInfoReceivedN().
        // The result is an instance of RemoteContentInfo.

        // Updates
        r = remoteContentInfo.SetContentName(L"sample code");
        TryReturn(!IsFailed(r), r, "SetContentName failed.");
        r = remoteContentInfo.SetKeyword(L"lee, kyeong, woo, hi");
        TryReturn(!IsFailed(r), r, "SetKeyword failed.");
        r = remoteContentInfo.SetProvider(L"smybag");
        TryReturn(!IsFailed(r), r, "SetProvider failed.");
        r = remoteContentManager.UpdateContent(remoteContentInfo, reqId);
        TryReturn(!IsFailed(r), r, "UpdateContent failed.");

        // The result is returned to UtsContentManagerListener::OnContentUpdated().

        // Checks the contents status
        r = remoteContentManager.GetContentStatus(contentId, reqId);
        TryReturn(!IsFailed(r), r, "GetContentStatus failed.");

        // The result is returned to UtsContentManagerListener::OnContentStatusReceived().

        // Delete
        r = remoteContentManager.DeleteContent(contentId, reqId);
        TryReturn(!IsFailed(r), r, "DeleteContent failed.");

        // The result is returned to UtsContentManagerListener::OnContentDeleted().

        return r;
 }

List of all members.

Public Member Functions

result Construct (const IRemoteContentManagerListener &listener)
result CreateContent (const RemoteContentInfo &remoteContentInfo, RequestId &reqId)
result DeleteContent (const Osp::Base::String &serverContentId, RequestId &reqId)
result GetContentInfo (const Osp::Base::String &serverContentId, RequestId &reqId) const
result GetContentStatus (const Osp::Base::String &serverContentId, RequestId &reqId)
 RemoteContentManager (void)
result UpdateContent (const RemoteContentInfo &remoteContentInfo, RequestId &reqId)
virtual ~RemoteContentManager (void)

Constructor & Destructor Documentation

Osp::Content::RemoteContentManager::RemoteContentManager ( void  )

This is the default constructor for this class.

Since:
1.0
Remarks:
After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
virtual Osp::Content::RemoteContentManager::~RemoteContentManager ( void  ) [virtual]

This is the destructor for this class.

Since:
1.0

Member Function Documentation

result Osp::Content::RemoteContentManager::Construct ( const IRemoteContentManagerListener listener)

Initializes this instance of RemoteContentManager with the specified listener of type IRemoteContentManagerListener.

Since:
1.0
Returns:
An error code
Parameters:
[in]listenerA reference to IRemoteContentManagerListener
Exceptions:
E_SUCCESSThe method is successful.
E_OUT_OF_MEMORYThe memory is insufficient.
result Osp::Content::RemoteContentManager::CreateContent ( const RemoteContentInfo remoteContentInfo,
RequestId reqId 
)

Creates the content.

Since:
1.0
Privilege level:
SYSTEM
Privilege group:
REMOTE_CONTENT
Precondition:
User should be authenticated.
For more information, see the sign in Application control (Osp::App::APPCONTROL_SIGNIN).
Returns:
An error code
Parameters:
[in]remoteContentInfoA reference to the RemoteContentInfo instance
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
result Osp::Content::RemoteContentManager::DeleteContent ( const Osp::Base::String serverContentId,
RequestId reqId 
)

Deletes the contents.

Since:
1.0
Privilege level:
SYSTEM
Privilege group:
REMOTE_CONTENT
Precondition:
User should be authenticated.
For more information, see the sign in Application control (Osp::App::APPCONTROL_SIGNIN).
Returns:
An error code
Parameters:
[in]serverContentIdThe server content ID
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
result Osp::Content::RemoteContentManager::GetContentInfo ( const Osp::Base::String serverContentId,
RequestId reqId 
) const

Gets the information of the content.

Since:
1.0
Privilege level:
SYSTEM
Privilege group:
REMOTE_CONTENT
Precondition:
User should be authenticated.
For more information, see Sign-in AppControl (Osp::App::APPCONTROL_SIGNIN).
Returns:
An error code
Parameters:
[in]serverContentIdThe server content ID
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
result Osp::Content::RemoteContentManager::GetContentStatus ( const Osp::Base::String serverContentId,
RequestId reqId 
)

Gets the contents status.

Since:
1.0
Privilege level:
SYSTEM
Privilege group:
REMOTE_CONTENT
Precondition:
User should be authenticated.
For more information, see the sign in Application control (Osp::App::APPCONTROL_SIGNIN).
Returns:
An error code
Parameters:
[in]serverContentIdThe server contents ID
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.
result Osp::Content::RemoteContentManager::UpdateContent ( const RemoteContentInfo remoteContentInfo,
RequestId reqId 
)

Updates the content.

Since:
1.0
Privilege level:
SYSTEM
Privilege group:
REMOTE_CONTENT
Precondition:
User should be authenticated.
For more information, see the sign in Application control (Osp::App::APPCONTROL_SIGNIN).
Returns:
An error code
Parameters:
[in]remoteContentInfoA reference to the RemoteContentInfo instance
[out]reqIdThe request ID
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_STATEThis instance has not been constructed as yet.
E_INVALID_ARGA specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
E_PRIVILEGE_DENIEDThe application does not have the privilege to call this method.

The documentation for this class was generated from the following file:

Copyright © 2011 Samsung Electronics Co., Ltd. All rights reserved.