Browseable/Cassandra.pm

filter: Statementstmt 75.0% 24 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 75.6% 31 / 41 CC 1 SCAR 1.2
CC
1
Cov
75%
populate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Browseable/Sybase.pm ↑ Summary Browseable.pm »
1 package Apache::Session::Browseable::Cassandra;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Apache::Session;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Apache::Session::Lock::Null;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Apache::Session::Browseable::Store::Cassandra;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Apache::Session::Generate::SHA256;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Apache::Session::Serialize::JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Apache::Session::Browseable::DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 our $VERSION = '1.3.13';
13 1 our @ISA = qw(Apache::Session::Browseable::DBI Apache::Session);
14  
15 0 ▶sub populate {
Subroutine populate: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $self = shift;
17  
18 $self->{object_store} =
19 0 new Apache::Session::Browseable::Store::Cassandra $self;
20 0 $self->{lock_manager} = new Apache::Session::Lock::Null $self;
21 0 $self->{generate} = \&Apache::Session::Generate::SHA256::generate;
22 0 $self->{validate} = \&Apache::Session::Generate::SHA256::validate;
23 0 $self->{serialize} = \&Apache::Session::Serialize::JSON::serialize;
24 0 $self->{unserialize} = \&Apache::Session::Serialize::JSON::unserialize;
25  
26 0 return $self;
27 }
28  
29 1 1;
30  
31 =pod
32  
33 =head1 NAME
34  
35 Apache::Session::Browseable::Cassandra - Apache::Session backend to store
36 sessions in a Cassadra database.
37  
38 =head1 SYNOPSIS
39  
40 use Apache::Session::Browseable::Cassandra;
41
42 my $args = {
43 DataSource => 'dbi:Cassandra:host=localhost;keyspace=llng',
44 UserName => $db_user,
45 Password => $db_pass,
46
47 # Choose your browseable fileds
48 Index => '_whatToTrace _session_kind _utime iAddr',
49 };
50
51 # Use it like Apache::Session
52 my %session;
53 tie %session, 'Apache::Session::Browseable::Cassandra', $id, $args;
54 $session{uid} = 'me';
55 $session{mail} = 'me@me.com';
56 $session{unindexedField} = 'zz';
57 untie %session;
58  
59 =head1 DESCRIPTION
60  
61 Apache::Session::Browseable::Cassandra is an implementation of Apache::Session
62 for Cassandra database.
63  
64 =head1 SCHEMA
65  
66 To use this module, you will need at least these columns in a table
67 called 'sessions':
68  
69 id text
70 a_session text
71  
72 To create this schema, you can execute this command using cqlsh:
73  
74 CREATE TABLE sessions (
75 id text PRIMARY KEY,
76 a_session text
77 );
78  
79 =head1 CONFIGURATION
80  
81 The module must know what datasource, username, and password to use when
82 connecting to the database. These values can be set using the options hash
83 (see Apache::Session documentation). The options are DataSource, UserName,
84 and Password.
85  
86 Example:
87  
88 tie %hash, 'Apache::Session::Cassandra', $id, {
89 DataSource => 'dbi:Cassandra:host=localhost;keyspace=llng',
90 UserName => 'database_user',
91 Password => 'K00l'
92 };
93  
94 Instead, you may pass in an already-opened DBI handle to your database.
95  
96 tie %hash, 'Apache::Session::Cassandra', $id, {
97 Handle => $dbh
98 };
99  
100 =head1 SEE ALSO
101  
102 L<Apache::Session>, L<Apache::Session::DBI>
103  
104 =head1 COPYRIGHT AND LICENSE
105  
106 =encoding utf8
107  
108 Copyright (C):
109  
110 =over
111  
112 =item 2009-2025 by Xavier Guimard
113  
114 =item 2013-2025 by Clément Oudot
115  
116 =item 2019-2025 by Maxime Besson
117  
118 =item 2013-2025 by Worteks
119  
120 =item 2023-2025 by Linagora
121  
122 =back
123  
124 This library is free software; you can redistribute it and/or modify
125 it under the same terms as Perl itself, either Perl version 5.10.1 or,
126 at your option, any later version of Perl 5 you may have available.
127  
128 =cut
« Browseable/Sybase.pm ↑ Summary Browseable.pm »