InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IHTTPLinkResourceConnection Class Referenceabstract

#include <IHTTPLinkResourceConnection.h>

Inheritance diagram for IHTTPLinkResourceConnection:
IPMUnknownCPMUnknown< IHTTPLinkResourceConnection >CusHttpLnkLinkResourceConnection

Public Types

enum  { kDefaultIID = IID_IHTTPLINKRESOURCECONNECTION }
 
typedef PMString ConnectionId
 

Public Member Functions

virtual bool16 Shutdown ()=0
 
virtual bool16 IsConnected () const =0
 
virtual bool16 IsAuthorized () const =0
 
virtual bool16 Connect ()=0
 
virtual bool16 Reconnect ()=0
 
virtual bool16 Disconnect ()=0
 
virtual ConnectionId GetConnectionId ()=0
 
virtual bool16 GetLoginCredentials (std::stringstream &loginInformation) const =0
 
virtual bool16 SetLoginCredentials (const std::stringstream &loginInformation)=0
 
virtual void ReadWriteSnapshotForBackgroundThread (IPMStream *s)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IHTTPLinkResourceConnection deals with connection details of the server. It contains function related to connection with server. Use this interface to implement logic related to login details, passing session token etc. This interface is largely for client plugin usage to handle connection related operations.

To subclass create a boss based on kHTTPAssetLinkResourceHelperBoss with the implementation of this interface. And return this connection instance from the IHTTPLinkSubsystemObjectFactory. It is mandatory to implement this interface for creating new plugin to handle particular scheme.

Member Function Documentation

virtual bool16 IHTTPLinkResourceConnection::Connect ()
pure virtual

Creates/Logs-in the current connection

Returns
kTrue if connection is created/logged-in successfully else kFalse.

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::Disconnect ()
pure virtual

Disconnects the current connection

Returns
kTrue if the connection is disconnected else kFalse

Implemented in CusHttpLnkLinkResourceConnection.

virtual ConnectionId IHTTPLinkResourceConnection::GetConnectionId ()
pure virtual

Fetches the connection ID for the current connection

Returns
ConnectionId for the current connection

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::GetLoginCredentials (std::stringstream & loginInformation) const
pure virtual

Gets the login credentials for the given connection. Its intepretation depends on client. For example, they can combine their login data into stream, which can be interpreted in their API wrapper. Note - Type of parameter as stringstream still not final. Other options like IPMStream are still under evaluation.

Parameters
loginInformation[OUT] The login information that requires to be set for the given connection
Returns
kFalse if credentials could not be encoded, else kTrue

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::IsAuthorized () const
pure virtual

Checks if the current connection is authorized

Returns
kTrue if the Http Connection is authorized else kFalse.

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::IsConnected () const
pure virtual

Checks if the current connection is connected

Returns
kTrue if the Http Connection is connected else kFalse

Implemented in CusHttpLnkLinkResourceConnection.

virtual void IHTTPLinkResourceConnection::ReadWriteSnapshotForBackgroundThread (IPMStreams)
pure virtual

Used when snapshot is created for the object for running in background thread. Snapshots are used in some of the InDesign workflows like PDF export, to pass objects for processing in background thread. In this function, object should write relevant data into stream or read from it to create necessary data depending on type of stream.

Parameters
sstream for reading/writing object's data

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::Reconnect ()
pure virtual

Reconnects the current connection

Returns
kTrue if re-connection is successful else kFalse

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::SetLoginCredentials (const std::stringstream & loginInformation)
pure virtual

Sets the login credentials for the given connection. Client plugins before connecting can set their information using this stream. And within the implementation they can parse and store as per their needs. Note - Type of parameter as stringstream still not final. Other options like IPMStream are still under evaluation.

Parameters
loginInformation[IN] The login information that requires to be set for the given connection
Returns
kTrue if credentials are set

Implemented in CusHttpLnkLinkResourceConnection.

virtual bool16 IHTTPLinkResourceConnection::Shutdown ()
pure virtual

Shuts down the current connection

Returns
kTrue if the Http Connection is shutdown else kFalse

Implemented in CusHttpLnkLinkResourceConnection.