ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CAS_ProxiedService_Abstract Class Reference

This class implements common methods for ProxiedService implementations included with phpCAS. More...

+ Inheritance diagram for CAS_ProxiedService_Abstract:
+ Collaboration diagram for CAS_ProxiedService_Abstract:

Public Member Functions

 setProxyTicket ($proxyTicket)
 Register a proxy ticket with the Proxy that it can use when making requests. More...
 
 setCasClient (CAS_Client $casClient)
 Use a particular CAS_Client->initializeProxiedService() rather than the static phpCAS::initializeProxiedService(). More...
 
- Public Member Functions inherited from CAS_ProxiedService
 getServiceUrl ()
 Answer a service identifier (URL) for whom we should fetch a proxy ticket. More...
 
 setProxyTicket ($proxyTicket)
 Register a proxy ticket with the ProxiedService that it can use when making requests. More...
 

Protected Member Functions

 getProxyTicket ()
 Answer the proxy ticket to be used when making requests. More...
 
 initializeProxyTicket ()
 Fetch our proxy ticket. More...
 

Private Attributes

 $_proxyTicket
 The proxy ticket that can be used when making service requests. More...
 
 $_casClient
 

Detailed Description

This class implements common methods for ProxiedService implementations included with phpCAS.

Definition at line 41 of file Abstract.php.

Member Function Documentation

◆ getProxyTicket()

CAS_ProxiedService_Abstract::getProxyTicket ( )
protected

Answer the proxy ticket to be used when making requests.

Returns
string
Exceptions
CAS_OutOfSequenceExceptionIf called before a proxy ticket has already been initialized/set.

Definition at line 82 of file Abstract.php.

References $_proxyTicket.

Referenced by CAS_ProxiedService_Http_Abstract\send().

83  {
84  if (empty($this->_proxyTicket)) {
86  'No proxy ticket yet. Call $this->initializeProxyTicket() to aquire the proxy ticket.'
87  );
88  }
89 
90  return $this->_proxyTicket;
91  }
$_proxyTicket
The proxy ticket that can be used when making service requests.
Definition: Abstract.php:48
This class defines Exceptions that should be thrown when the sequence of operations is invalid...
+ Here is the caller graph for this function:

◆ initializeProxyTicket()

CAS_ProxiedService_Abstract::initializeProxyTicket ( )
protected

Fetch our proxy ticket.

Descendent classes should call this method once their service URL is available to initialize their proxy ticket.

Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after a proxy ticket has already been initialized.

Definition at line 132 of file Abstract.php.

References phpCAS\initializeProxiedService().

Referenced by CAS_ProxiedService_Imap\open(), and CAS_ProxiedService_Http_Abstract\send().

133  {
134  if (!empty($this->_proxyTicket)) {
135  throw new CAS_OutOfSequenceException(
136  'Already initialized, cannot initialize again.'
137  );
138  }
139  // Allow usage of a particular CAS_Client for unit testing.
140  if (empty($this->_casClient)) {
142  } else {
143  $this->_casClient->initializeProxiedService($this);
144  }
145  }
This class defines Exceptions that should be thrown when the sequence of operations is invalid...
static initializeProxiedService(CAS_ProxiedService $proxiedService)
Initialize a proxied-service handler with the proxy-ticket it should use.
Definition: CAS.php:915
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCasClient()

CAS_ProxiedService_Abstract::setCasClient ( CAS_Client  $casClient)

Use a particular CAS_Client->initializeProxiedService() rather than the static phpCAS::initializeProxiedService().

This method should not be called in standard operation, but is needed for unit testing.

Parameters
CAS_Client$casClientcas client
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after a proxy ticket has already been initialized/set.

Implements CAS_ProxiedService_Testable.

Definition at line 111 of file Abstract.php.

112  {
113  if (!empty($this->_proxyTicket)) {
114  throw new CAS_OutOfSequenceException(
115  'Already initialized, cannot change the CAS_Client.'
116  );
117  }
118 
119  $this->_casClient = $casClient;
120  }
This class defines Exceptions that should be thrown when the sequence of operations is invalid...

◆ setProxyTicket()

CAS_ProxiedService_Abstract::setProxyTicket (   $proxyTicket)

Register a proxy ticket with the Proxy that it can use when making requests.

Parameters
string$proxyTicketproxy ticket
Returns
void
Exceptions
InvalidArgumentExceptionIf the $proxyTicket is invalid.
CAS_OutOfSequenceExceptionIf called after a proxy ticket has already been initialized/set.

Definition at line 60 of file Abstract.php.

61  {
62  if (empty($proxyTicket)) {
64  'Trying to initialize with an empty proxy ticket.'
65  );
66  }
67  if (!empty($this->_proxyTicket)) {
69  'Already initialized, cannot change the proxy ticket.'
70  );
71  }
72  $this->_proxyTicket = $proxyTicket;
73  }
This class defines Exceptions that should be thrown when the sequence of operations is invalid...
Exception that denotes invalid arguments were passed.

Field Documentation

◆ $_casClient

CAS_Client CAS_ProxiedService_Abstract::$_casClient
private

Definition at line 96 of file Abstract.php.

◆ $_proxyTicket

string CAS_ProxiedService_Abstract::$_proxyTicket
private

The proxy ticket that can be used when making service requests.

Definition at line 48 of file Abstract.php.

Referenced by getProxyTicket().


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