IlsMvUser
 
IlsMvUser
Category 
Dynamic view-related class (server side)
Inheritance Path 
IlsEntity
IlsMvUser
Description 
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 the member function 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.
Library 
<mvserver>
Header File 
#include <ilserver/mvuser.h>
Synopsis 
class IlsMvUser: public IlsEntity
{
public:
IlsMvUser(const char* userName=0,
int userId=0,
const char* hostName=0,
const char* inetId=0,
int processId=0);
protected:
virtual ~IlsMvUser();
public:
IlsEntry<IlsString> userName;
IlsEntry<int> userId;
IlsEntry<IlsString> hostName;
IlsEntry<IlsString> inetId;
IlsEntry<int> processId;
IlsBoolean isInteracting(IlsMvValue*, int);
virtual void updateSendingQueueLength(IlsBoolean addMsg,
unsigned int newLength);
virtual void setUserInfo(IlsMvValue* args, int argc);
const IlsMvValue* getUserInfo(int& userInfoCount) const;
int getUserInfoCount() const;
 
protected:
virtual void onBind(IlsMvComponentItf& itf);
virtual void onUnbind(IlsMvComponentItf& itf);
};
Constructor 
IlsMvUser(const char* userName=0,
int userId=0,
const char* hostName=0,
const char* inetId=0,
int processId=0);
This constructor is called by the function IlsMvUserFactory::getUser. The arguments are the following:
*userName: name of the component process user
(see IlsMvComponentFactory::getUserName);
*userId: identifier of the component process user
(see IlsMvComponentFactory::getUserId);
*hostName: name of the host running the component process
(see IlsMvComponentFactory::getHostName);
*inetId: the internet identifier of the host running the component process
(see IlsMvComponentFactory::getInetId);
*processId: component process identifier
(see IlsMvComponentFactory::getProcessId).
This default constructor is called by the server each time a new application component connects to the server.
Destructor 
virtual ~IlsMvUser();
Since IlsMvUser derives from IlsEntity and, therefore, transitively from IlsRefCounted, its destructor must not be called explicitly.
Data Members 
IlsEntry<IlsString> userName;
This entry data member contains the user’s name.
IlsEntry<int> userId;
This entry data member contains the user’s identifier.
IlsEntry<IlsString> hostName;
This entry data member contains the name of the host running the application component associated with the user.
IlsEntry<IlsString> inetId;
This entry data member contains the internet identifier of the host running the application component associated with the user.
IlsEntry<int> processId;
This entry data member contains the process identifier of the application component associated with the user.
Member Functions 
IlsBoolean isInteracting(IlsMvValue*, int);
This member function returns IlsTrue if the user is associated with the interface of the component that issued the request currently handled by the server.
[virtual] void updateSendingQueueLength(IlsBoolean addMsg,
unsigned int newLength);
This virtual member function is 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.
[virtual] void setUserInfo(IlsMvValue* args, int argc);
This virtual member function is called by Rogue Wave Server just after the IlsMvUser instance has been created if some user info has been sent by the component (see IlsMvComponentFactory::getUserInfo. 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.
const IlsMvValue* getUserInfo(int& userInfoCount) const;
This member function 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.
int getUserInfoCount() const;
This member function returns the number of User Info available for this user.
Protected Member Functions 
[virtual] void onBind(IlsMvComponentItf& itf);
This protected virtual member function is called by the server when the object is associated with the component interface itf. It has no effect but can be overridden.
[virtual] void onUnbind(IlsMvComponentItf& itf);
This protected virtual function is called by the server when the component identified by the interface itf disconnects from the server. This function calls the member function IlsEntity::remove on the user. It can be overriden.
See Also 
ILS_MEMBER_FUNCTION, IlsMvComponent, IlsMvComponentFactory, IlsMvComponentItf, IlsMvUserFactory, IlsMvView

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.