[otrs-cvs] otrs/Kernel/System/CustomerUser DB.pm, 1.60, 1.61 LDAP.pm, 1.37, 1.38

cvs-log at otrs.org cvs-log at otrs.org
Mon Mar 10 19:41:01 GMT 2008


Comments:
Update of /home/cvs/otrs/Kernel/System/CustomerUser
In directory lancelot:/tmp/cvs-serv30046/Kernel/System/CustomerUser

Modified Files:
	DB.pm LDAP.pm 
Log Message:
Improved cache backend with cache type option to separate different type of caches.

Author: martin

Index: DB.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/CustomerUser/DB.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** DB.pm	12 Feb 2008 21:58:53 -0000	1.60
--- DB.pm	10 Mar 2008 19:40:55 -0000	1.61
***************
*** 80,84 ****
          $Param{Count} = '';
      }
!     $Self->{CacheKey} = 'CustomerUser' . $Param{Count};
  
      # create new db connect if DSN is given
--- 80,84 ----
          $Param{Count} = '';
      }
!     $Self->{CacheType} = 'CustomerUser' . $Param{Count};
  
      # create new db connect if DSN is given
***************
*** 129,133 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Name = $Self->{CacheObject}->Get( Key => $Self->{CacheKey} . "::CustomerName::$SQL" );
          if ( defined($Name) ) {
              return $Name;
--- 129,136 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Name = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerName::$SQL",
!         );
          if ( defined($Name) ) {
              return $Name;
***************
*** 153,157 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerName::$SQL",
              Value => $Name,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 156,161 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerName::$SQL",
              Value => $Name,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 247,251 ****
      if ( $Self->{CacheObject} ) {
          my $Users = $Self->{CacheObject}->Get(
!             Key => $Self->{CacheKey} . "::CustomerSearch::$SQL",
          );
          if ($Users) {
--- 251,256 ----
      if ( $Self->{CacheObject} ) {
          my $Users = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerSearch::$SQL",
          );
          if ($Users) {
***************
*** 270,274 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerSearch::$SQL",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 275,280 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerSearch::$SQL",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 286,290 ****
      if ( $Self->{CacheObject} ) {
          my $Users = $Self->{CacheObject}->Get(
!             Key => $Self->{CacheKey} . "::CustomerUserList::$Valid",
          );
          if ($Users) {
--- 292,297 ----
      if ( $Self->{CacheObject} ) {
          my $Users = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerUserList::$Valid",
          );
          if ($Users) {
***************
*** 304,308 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerUserList::$Valid",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 311,316 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerUserList::$Valid",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 326,330 ****
      if ( $Self->{CacheObject} ) {
          my $CustomerIDs = $Self->{CacheObject}->Get(
!             Key => $Self->{CacheKey} . "::CustomerIDs::$Param{User}",
          );
          if ($CustomerIDs) {
--- 334,339 ----
      if ( $Self->{CacheObject} ) {
          my $CustomerIDs = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerIDs::$Param{User}",
          );
          if ($CustomerIDs) {
***************
*** 363,367 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerIDs::$Param{User}",
              Value => \@CustomerIDs,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 372,377 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerIDs::$Param{User}",
              Value => \@CustomerIDs,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 393,397 ****
          if ( $Self->{CacheObject} ) {
              my $Data = $Self->{CacheObject}->Get(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{User}",
              );
              if ($Data) {
--- 403,408 ----
          if ( $Self->{CacheObject} ) {
              my $Data = $Self->{CacheObject}->Get(
!                 Type => $Self->{CacheType},
!                 Key  => "CustomerUserDataGet::User::$Param{User}",
              );
              if ($Data) {
***************
*** 407,411 ****
          if ( $Self->{CacheObject} ) {
              my $Data = $Self->{CacheObject}->Get(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::CustomerID::$Param{CustomerID}",
              );
              if ($Data) {
--- 418,423 ----
          if ( $Self->{CacheObject} ) {
              my $Data = $Self->{CacheObject}->Get(
!                 Type => $Self->{CacheType},
!                 Key  => "CustomerUserDataGet::CustomerID::$Param{CustomerID}",
              );
              if ($Data) {
***************
*** 433,437 ****
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Set(
!                 Key   => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{User}",
                  Value => {},
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 445,450 ----
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Set(
!                 Type  => $Self->{CacheType},
!                 Key   => "CustomerUserDataGet::User::$Param{User}",
                  Value => {},
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 445,449 ****
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Set(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::CustomerID::$Param{CustomerID}",
                  Value => {},
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 458,463 ----
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Set(
!                 Type  => $Self->{CacheType},
!                 Key   => "CustomerUserDataGet::CustomerID::$Param{CustomerID}",
                  Value => {},
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 463,467 ****
          if ( $Param{User} ) {
              $Self->{CacheObject}->Set(
!                 Key   => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{User}",
                  Value => { %Data, %Preferences },
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 477,482 ----
          if ( $Param{User} ) {
              $Self->{CacheObject}->Set(
!                 Type  => $Self->{CacheType},
!                 Key   => "CustomerUserDataGet::User::$Param{User}",
                  Value => { %Data, %Preferences },
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 470,474 ****
          elsif ( $Param{CustomerID} ) {
              $Self->{CacheObject}->Set(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::CustomerID::$Param{CustomerID}",
                  Value => { %Data, %Preferences },
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 485,490 ----
          elsif ( $Param{CustomerID} ) {
              $Self->{CacheObject}->Set(
!                 Type  => $Self->{CacheType},
!                 Key   => "CustomerUserDataGet::CustomerID::$Param{CustomerID}",
                  Value => { %Data, %Preferences },
                  TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 600,604 ****
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Delete(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{UserLogin}", );
          }
          return $Param{UserLogin};
--- 616,621 ----
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Delete(
!                 Type => $Self->{CacheType},
!                 Key  => "CustomerUserDataGet::User::$Param{UserLogin}", );
          }
          return $Param{UserLogin};
***************
*** 692,696 ****
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Delete(
!                 Key => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{UserLogin}",
              );
          }
--- 709,714 ----
          if ( $Self->{CacheObject} ) {
              $Self->{CacheObject}->Delete(
!                 Type => $Self->{CacheType},
!                 Key  => "CustomerUserDataGet::User::$Param{UserLogin}",
              );
          }
***************
*** 799,803 ****
              if ( $Self->{CacheObject} ) {
                  $Self->{CacheObject}->Delete(
!                     Key => $Self->{CacheKey} . "::CustomerUserDataGet::User::$Param{UserLogin}",
                  );
              }
--- 817,822 ----
              if ( $Self->{CacheObject} ) {
                  $Self->{CacheObject}->Delete(
!                     Type => $Self->{CacheType},
!                     Key  => "CustomerUserDataGet::User::$Param{UserLogin}",
                  );
              }

Author: martin

Index: LDAP.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/CustomerUser/LDAP.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** LDAP.pm	9 Oct 2007 22:37:30 -0000	1.37
--- LDAP.pm	10 Mar 2008 19:40:55 -0000	1.38
***************
*** 1,6 ****
  # --
  # Kernel/System/CustomerUser/LDAP.pm - some customer user functions in LDAP
! # Copyright (C) 2002 Wiktor Wodecki <wiktor.wodecki at net-m.de>
! # Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
  # --
  # $Id$
--- 1,6 ----
  # --
  # Kernel/System/CustomerUser/LDAP.pm - some customer user functions in LDAP
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
! # Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
  # --
  # $Id$
***************
*** 8,12 ****
  # This software comes with ABSOLUTELY NO WARRANTY. For details, see
  # the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl.txt.
  # --
  
--- 8,12 ----
  # This software comes with ABSOLUTELY NO WARRANTY. For details, see
  # the enclosed file COPYING for license information (GPL). If you
! # did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
  # --
  
***************
*** 178,182 ****
          $Param{Count} = '';
      }
!     $Self->{CacheKey} = 'CustomerUser' . $Param{Count};
  
      # get valid filter if used
--- 178,182 ----
          $Param{Count} = '';
      }
!     $Self->{CacheType} = 'CustomerUser' . $Param{Count};
  
      # get valid filter if used
***************
*** 207,212 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Name
!             = $Self->{CacheObject}->Get( Key => $Self->{CacheKey} . "::CustomerName::$Filter" );
          if ( defined($Name) ) {
              return $Name;
--- 207,214 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Name = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerName::$Filter",
!         );
          if ( defined($Name) ) {
              return $Name;
***************
*** 244,248 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerName::$Filter",
              Value => $Name,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 246,251 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerName::$Filter",
              Value => $Name,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 313,318 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Users
!             = $Self->{CacheObject}->Get( Key => $Self->{CacheKey} . "::CustomerSearch::$Filter", );
          if ($Users) {
              return %{$Users};
--- 316,323 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Users = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerSearch::$Filter",
!         );
          if ($Users) {
              return %{$Users};
***************
*** 357,361 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerSearch::$Filter",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 362,367 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerSearch::$Filter",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 383,388 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Users = $Self->{CacheObject}
!             ->Get( Key => $Self->{CacheKey} . "::CustomerUserList::$Filter", );
          if ($Users) {
              return %{$Users};
--- 389,396 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Users = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerUserList::$Filter",
!         );
          if ($Users) {
              return %{$Users};
***************
*** 418,422 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerUserList::$Filter",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 426,431 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerUserList::$Filter",
              Value => \%Users,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 439,444 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $CustomerIDs = $Self->{CacheObject}
!             ->Get( Key => $Self->{CacheKey} . "::CustomerIDs::$Param{User}", );
          if ($CustomerIDs) {
              return @{$CustomerIDs};
--- 448,455 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $CustomerIDs = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerIDs::$Param{User}",
!         );
          if ($CustomerIDs) {
              return @{$CustomerIDs};
***************
*** 476,480 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerIDs::$Param{User}",
              Value => \@CustomerIDs,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 487,492 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerIDs::$Param{User}",
              Value => \@CustomerIDs,
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
***************
*** 516,521 ****
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Data = $Self->{CacheObject}
!             ->Get( Key => $Self->{CacheKey} . "::CustomerUserDataGet::$Filter", );
          if ($Data) {
              return %{$Data};
--- 528,535 ----
      # check cache
      if ( $Self->{CacheObject} ) {
!         my $Data = $Self->{CacheObject}->Get(
!             Type => $Self->{CacheType},
!             Key  => "CustomerUserDataGet::$Filter",
!         );
          if ($Data) {
              return %{$Data};
***************
*** 572,576 ****
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Key   => $Self->{CacheKey} . "::CustomerUserDataGet::$Filter",
              Value => { %Data, %Preferences },
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},
--- 586,591 ----
      if ( $Self->{CacheObject} ) {
          $Self->{CacheObject}->Set(
!             Type  => $Self->{CacheType},
!             Key   => "CustomerUserDataGet::$Filter",
              Value => { %Data, %Preferences },
              TTL   => $Self->{CustomerUserMap}->{'CacheTTL'},


More information about the cvs-log mailing list