~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cpp/demo/Glacier2/chat/Server.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
14
14
using namespace std;
15
15
using namespace Demo;
16
16
 
 
17
class DummyPermissionsVerifierI : public Glacier2::PermissionsVerifier
 
18
{
 
19
public:
 
20
 
 
21
    virtual bool
 
22
    checkPermissions(const string& userId, const string& password, string&, const Ice::Current&) const
 
23
    {
 
24
        cout << "verified user `" << userId << "' with password `" << password << "'" << endl;
 
25
        return true;
 
26
    }
 
27
};
 
28
 
17
29
class ChatSessionManagerI : public Glacier2::SessionManager
18
30
{
19
31
public:
40
52
 
41
53
        Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("ChatServer");
42
54
        
 
55
        Glacier2::PermissionsVerifierPtr dpv = new DummyPermissionsVerifierI;
 
56
        adapter->add(dpv, communicator()->stringToIdentity("ChatSessionVerifier"));
43
57
        Glacier2::SessionManagerPtr csm = new ChatSessionManagerI;
44
58
        adapter->add(csm, communicator()->stringToIdentity("ChatSessionManager"));
45
59
        adapter->activate();