Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Public Attributes | Friends
IlsMvUser Class Reference

Repressents the user of a component connection. More...

#include <ilserver/mvuser.h>

Inheritance diagram for IlsMvUser:
IlsEntity

Public Member Functions

 IlsMvUser (const char *userName=0, int userId=0, const char *hostName=0, const char *inetId=0, int processId=0)
 Constructor. More...
 
virtual ~IlsMvUser ()
 Destructor. More...
 
const IlsMvValuegetUserInfo (int &userInfoCount) const
 Can be used to retrieve User Info that may have been assigned to the user object. More...
 
IlsBoolean isInteracting ()
 Returns IlsTrue if the user is associated with the interface of the component that issued the request currently handled by the server.
 
virtual void onBind (IlsMvComponentItf &compItf)
 alled by the server when the object is associated with the component interface compItf. More...
 
virtual void onUnbind (IlsMvComponentItf &compItf)
 Called by the server when the component identified by the interface compItf disconnects from the server. More...
 
virtual void setUserInfo (IlsMvValue *args, int argc)
 Called by Rogue Wave Server just after the IlsMvUser instance has been created if some user info has been sent by the component. More...
 
virtual void updateSendingQueueLength (IlsBoolean addMsg, unsigned int newLength)
 Called each time a message is added to, or removed from, the sending queue associated to the component, if applicable. More...
 
- Public Member Functions inherited from IlsEntity
 IlsEntity (IlsEntity &rhs)
 Copy constructor. The identifier is copied as well.
 
 IlsEntity (IlsIdentifier id, IlsActivity activity=IlsModel::GetDefaultActivity())
 
virtual ~IlsEntity ()
 Virtual destructor.
 
IlsActivity getActivity () const
 
virtual void cut (ILS_CUT_DIRECTIVE=ILS_ALL)
 
IlsIdentifier getIdentifier () const
 
virtual IlsString getKeyIdentifier () const
 
IlsEntitygetEntity ()
 
void rename (IlsIdentifier)
 
void setEntityContext (IlsEntityContext &)
 
void unsetEntityContext (IlsEntityContext &)
 
IlsBoolean isIdentifierModified ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
IlsIdentifier getOldIdentifier ()
 During a notification phase, this member function returns the old identifier of the entity. It returns a null smart pointer if the entity has not been modified since the last notification phase.
 
IlsBoolean remove ()
 
IlsBoolean areUsersModified ()
 During a notification phase, this function returns IlsTrue if a use relation has been added or removed since the last notification phase. More...
 
void onRmFromDictionary ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
void removeFromDictionaries ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
virtual IlsBoolean lock ()
 
virtual IlsBoolean unlock ()
 
virtual IlsBoolean trylock ()
 Tries to lock the entity. It returns IlsFalse if the operation fails.
 
virtual IlsBoolean isUpdateAllowed ()
 By default, this virtual member function returns IlsFalse when the entity is locked and IlsTrue if you have the right to modify the entity. It is called if the static member function IlsModel::SetUpdateChecked() returns IlsTrue.
 

Public Attributes

IlsEntryString hostName
 contains the name of the host running the application component associated with the user.
 
IlsEntryString inetId
 contains the internet identifier of the host running the application component associated with the user.
 
IlsEntryInt processId
 contains the process identifier of the application component associated with the user.
 
IlsEntryInt userId
 contains the user's identifier.
 
IlsEntryString userName
 contains the user's name.
 

Friends

class IlsMvComponentItf
 
class IlsMvUserFactory
 

Detailed Description

Repressents the user of a component connection.

Library: mvserver

Each time a new application component connects to the server, a component interface object is created on the server side (see the class IlsMvComponentItf for details). When the component interface object is created, it is associated with an IlsMvUser object. The class IlsMvUserFactory is used to get the relevant IlsMvUser object or to create such object if necessary. You can force Rogue Wave Server to handle instances of a subclass of IlsMvUser by declaring a factory of a class deriving from IlsMvUserFactory (see IlsMvUserFactory::setSingleton() for details).

This component interface object is used to identify the user of the application component. The class IlsMvUser is declared as a runtime type to the Server model interpreter. The runtime attribute user is automatically declared to the runtime type associated with IlsMvView. This attribute is associated with the accessor IlsMvView::getUser(). You can use it in a view specification. You can also define runtime accessible functions on your IlsMvUser class using the ILS_MEMBER_FUNCTION() macros.

The callback function IlsMvComponent::execUserCallback() implemented on the class enables you to request, starting from a component, the execution of one of these functions on the associated user object on the server side.

See also
ILS_MEMBER_FUNCTION(), IlsMvComponent, IlsMvComponentFactory, IlsMvComponentItf, IlsMvUserFactory, IlsMvView.

Constructor & Destructor Documentation

◆ IlsMvUser()

IlsMvUser::IlsMvUser ( const char *  userName = 0,
int  userId = 0,
const char *  hostName = 0,
const char *  inetId = 0,
int  processId = 0 
)

Constructor.

This constructor is called by the function IlsMvUserFactory::getUser(). The arguments are the following:

This default constructor is called by the server each time a new application component connects to the server.

Parameters
userNamename of the component process user (see IlsMvComponentFactory::getUserName())
userIdidentifier of the component process user (see IlsMvComponentFactory::getUserId())
hostNamename of the host running the component process (see IlsMvComponentFactory::getHostName())
inetIdthe internet identifier of the host running the component process (see IlsMvComponentFactory::getInetId())
processIdcomponent process identifier (see IlsMvComponentFactory::getProcessId())

◆ ~IlsMvUser()

virtual IlsMvUser::~IlsMvUser ( )
virtual

Destructor.

Since IlsMvUser derives from IlsEntity and, therefore, transitively from IlsRefCounted, its destructor must not be called explicitly.

Member Function Documentation

◆ getUserInfo()

const IlsMvValue* IlsMvUser::getUserInfo ( int &  userInfoCount) const

Can be used to retrieve User Info that may have been assigned to the user object.

It returns an array of IlsMvValue objects. The size of this array is assigned to the userInfoCount parameter. You must not delete the returned array.

Parameters
userInfoCountreceive the size of the returned array
Returns
Array of user info values. You must not delete it.

◆ onBind()

virtual void IlsMvUser::onBind ( IlsMvComponentItf compItf)
virtual

alled by the server when the object is associated with the component interface compItf.

It has no effect but can be overridden.

◆ onUnbind()

virtual void IlsMvUser::onUnbind ( IlsMvComponentItf compItf)
virtual

Called by the server when the component identified by the interface compItf disconnects from the server.

This function calls the member function IlsEntity::remove() on the user. It can be overriden.

◆ setUserInfo()

virtual void IlsMvUser::setUserInfo ( IlsMvValue args,
int  argc 
)
virtual

Called by Rogue Wave Server just after the IlsMvUser instance has been created if some user info has been sent by the component.

The IlsMvUser instance is filled with standard information sent by the component such as userId, processId, and so forth. User info are extra user-defined information that the component may send at connection time.

See also
IlsMvComponentFactory::getUserInfo().

◆ updateSendingQueueLength()

virtual void IlsMvUser::updateSendingQueueLength ( IlsBoolean  addMsg,
unsigned int  newLength 
)
virtual

Called each time a message is added to, or removed from, the sending queue associated to the component, if applicable.

The function is called by the main thread (if the addMsg parameter is set to IlsTrue) or by the sending thread (if the addMsg parameter is false) and only if the monitoring of the sending thread is enabled (see the function IlsMvComponentItf::monitorSendingQueue()). This function is useful to monitor the sending queue, which may grow when communication with the associated client is slow. If you want to disconnect the corresponding connection, you must do it from the main thread by calling the member function IlsMvComponent::disconnect() on the instance of IlsMvComponentItf that represents the connection.

Parameters
addMsgIlsTrue: called by the main thread. IlsFalse: called by the sending thread
newLengthnew queue length