Public Types | Protected Attributes | Private Attributes | Friends

wosh::Session Class Reference
[Core-Interfaces]

#include <H:/WOSH/win32_vc2010/src/core/Session.h>

List of all members.

Public Types

enum  SESSION_STATE { ,
  STATE_CREATED = 0x0001, STATE_LOGGING = 0x0002, STATE_LOGGED = 0x0010, STATE_OPENED = 0x0040,
  STATE_CLOSED = 0x0080, STATE_FAILURE = 0x0100
}
 

states of a session

More...
enum  SESSION_RESTRICTION {
  ALLOW_NOTHING = 0x00, ALLOW_ROOT = 0x01, ALLOW_SU = 0x02, ALLOW_SUDO = 0x04,
  ALLOW_CLOSE = 0x10, ALLOW_ALL = 0xFF
}

Public Member Functions

Message Events (incoming message)
virtual void busMessage (const Message &message, const Bus *source)
 Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Protected Attributes

LogContext Log
 my log
BusConnector BusCore
 connector to Core
int state
 session state
MutexRW stateLock
 mutex of state
int regState
 registration state (vs. SessionManager)
int64 regStateTs
 timestamp of registration state
std::string usernameLogged
 original logged user (never changes once set)
std::string usernameCurrent
 current user
long restrictions
 su/sudo restrictions
int maxLoginRetries
 max login retries
std::string welcomeMsg
 welcome message (after login)
bool welcomeShow
 skip welcome message
MutexRW securityLock
 mutex of { username, credentials, welcome* }
URI currentLocation
 target URI, it is like a system path (exec 'pwd' to prompt)
std::string currentBus
 target Bus, see Message::destinationBus, default should be wosh.Bus.Core
int64 lastInputTS
 timestamp of last user input
std::string prompt
 current prompt
MutexRW currentLock
 mutex of { prompt, currentLocation, currentBus, lastInputTS }

Private Attributes

long id
 session id (never changes once set)
URI creator
 uri of my creator (never changes once set)
int64 creation_ts
 timestamp of creation (never changes once set)

Friends

class wosh::SessionManager
class wosh::SessionManagerMonitor

Getters

long getID () const
long getCreationTS () const
const URIgetCreatorURI () const
int getState () const
bool isLogging () const
bool isOpened () const
bool isClosed () const
bool isFailed () const
bool isRegistered () const
const std::string & getUsernameLogged () const
const std::string & getUsernameCurrent () const
long getRestrictions () const
bool getRestriction (SESSION_RESTRICTION flag) const
int getMaxLoginRetries () const
std::string getWelcomeMessage () const
bool isWelcomePrompted () const
const URIgetCurrentLocation () const
const std::string & getCurrentBus () const
int64 getLastInputTS () const
const std::string & getPrompt () const
const StreamSource * getInputStream () const
StreamSource * getInputStream ()
const StreamSink * getOutputStream () const
StreamSink * getOutputStream ()
const SessionEncoder * getEncoder () const
SessionEncoder * getEncoder ()
const SessionInterpreter * getInterpreter () const
SessionInterpreter * getInterpreter ()
unsigned long getTimeout () const
bool isTimedOut () const
std::string getStateAsString () const
static struct
EnumerationDescription
< SESSION_STATE > * 
getStateEnum ()
static const char * getStateAsString (SESSION_STATE state)
static std::string getStateSetAsString (long state_mask)
static SESSION_STATE getStateFromString (const char *state)
static struct
EnumerationDescription
< SESSION_RESTRICTION > * 
getRestrictionEnum ()
static const char * getRestrictionAsString (SESSION_RESTRICTION state)
static std::string getRestrictionSetAsString (long state_mask)
static SESSION_RESTRICTION getRestrictionFromString (const char *state)

virtual void setCreatorURI (const URI &uri)

Detailed Description

Version:
Id:
Session.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo

Definition at line 68 of file Session.h.


Member Enumeration Documentation

Enumerator:
ALLOW_NOTHING 

reject all following

ALLOW_ROOT 

let user login as root

ALLOW_SU 

let user switch to root (once logged as user, if authorized)

ALLOW_SUDO 

let user execute commands as root (once logged as user, if authorized)

ALLOW_CLOSE 

let user close the session (i.e. command exit)

ALLOW_ALL 

allow all previous

Definition at line 88 of file Session.h.

states of a session

Enumerator:
STATE_CREATED 

"allocated"

STATE_LOGGING 

logging

STATE_LOGGED 

user is logged

STATE_OPENED 

session is active

STATE_CLOSED 

session is closed, may be deleted

STATE_FAILURE 

session is closed(failed), may be deleted

Definition at line 78 of file Session.h.


Member Function Documentation

void wosh::Session::busMessage ( const Message message,
const Bus source 
) [virtual]

Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Parameters:
[in]messagethe incoming message
[in]sourcethe source Bus of the incoming message
Warning:
The current thread is own and managed by the caller Bus. Heavy, dangerous or time expensive operations should be executed asynchronously and not inline!

Implements wosh::IBusListener.

Reimplemented in wosh::communication::SessionIM, and wosh::communication::SessionProxy.

Definition at line 367 of file Session.cpp.

References wosh::Message::getDestination(), and wosh::Message::isEmpty().

virtual void wosh::Session::setCreatorURI ( const URI uri ) [inline, virtual]

name Setters

Definition at line 176 of file Session.h.

References creator.

Referenced by wosh::bundles::JabberGlooxBundle::setupUserSession_().


Member Data Documentation

connector to Core

Definition at line 225 of file Session.h.

int64 wosh::Session::creation_ts [private]

timestamp of creation (never changes once set)

Definition at line 221 of file Session.h.

uri of my creator (never changes once set)

Definition at line 220 of file Session.h.

Referenced by setCreatorURI().

std::string wosh::Session::currentBus [mutable, protected]

target Bus, see Message::destinationBus, default should be wosh.Bus.Core

Definition at line 243 of file Session.h.

URI wosh::Session::currentLocation [mutable, protected]

target URI, it is like a system path (exec 'pwd' to prompt)

Definition at line 242 of file Session.h.

MutexRW wosh::Session::currentLock [mutable, protected]

mutex of { prompt, currentLocation, currentBus, lastInputTS }

Definition at line 246 of file Session.h.

long wosh::Session::id [private]

session id (never changes once set)

Definition at line 219 of file Session.h.

int64 wosh::Session::lastInputTS [mutable, protected]

timestamp of last user input

Definition at line 244 of file Session.h.

my log

Definition at line 224 of file Session.h.

max login retries

Definition at line 236 of file Session.h.

std::string wosh::Session::prompt [protected]

current prompt

Definition at line 245 of file Session.h.

int wosh::Session::regState [protected]

registration state (vs. SessionManager)

Definition at line 228 of file Session.h.

int64 wosh::Session::regStateTs [protected]

timestamp of registration state

Definition at line 229 of file Session.h.

long wosh::Session::restrictions [protected]

su/sudo restrictions

Definition at line 235 of file Session.h.

MutexRW wosh::Session::securityLock [mutable, protected]

mutex of { username, credentials, welcome* }

Definition at line 239 of file Session.h.

int wosh::Session::state [protected]

session state

Definition at line 226 of file Session.h.

mutex of state

Definition at line 227 of file Session.h.

std::string wosh::Session::usernameCurrent [protected]

current user

Definition at line 233 of file Session.h.

std::string wosh::Session::usernameLogged [protected]

original logged user (never changes once set)

Definition at line 232 of file Session.h.

std::string wosh::Session::welcomeMsg [protected]

welcome message (after login)

Definition at line 237 of file Session.h.

bool wosh::Session::welcomeShow [protected]

skip welcome message

Definition at line 238 of file Session.h.


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

Generated on Tue Feb 8 2011 09:33:32 for WOSH system 0.8.888 [wolf] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework