|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright 2010 SURFnet B.V. |
|
4
|
|
|
* |
|
5
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
6
|
|
|
* you may not use this file except in compliance with the License. |
|
7
|
|
|
* You may obtain a copy of the License at |
|
8
|
|
|
* |
|
9
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
10
|
|
|
* |
|
11
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
12
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
13
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14
|
|
|
* See the License for the specific language governing permissions and |
|
15
|
|
|
* limitations under the License. |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
namespace Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\State; |
|
19
|
|
|
|
|
20
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Exception\InvalidRemoteVettingStateException; |
|
21
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\Dto\AttributeListDto; |
|
22
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\Dto\RemoteVettingProcessDto; |
|
23
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\Dto\RemoteVettingTokenDto; |
|
24
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\RemoteVettingContext; |
|
25
|
|
|
use Surfnet\StepupSelfService\SelfServiceBundle\Service\RemoteVetting\Value\ProcessId; |
|
26
|
|
|
|
|
27
|
|
|
abstract class AbstractRemoteVettingState |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* Do not set state to be able to (de-)serialize state |
|
31
|
|
|
* The vetting state is only used to change behaviour and therefore state is not wanted. |
|
32
|
|
|
*/ |
|
33
|
|
|
public function __construct() |
|
34
|
|
|
{ |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function handleInitialise(RemoteVettingContext $context, $identityProviderName, RemoteVettingTokenDto $token) |
|
|
|
|
|
|
38
|
|
|
{ |
|
39
|
|
|
throw new InvalidRemoteVettingStateException('Unable to initialise the validation of a token'); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function handleValidating(RemoteVettingContext $context, RemoteVettingProcessDto $process, ProcessId $id) |
|
43
|
|
|
{ |
|
44
|
|
|
throw new InvalidRemoteVettingStateException('Unable to start the validation of a token'); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function handleValidated(RemoteVettingContext $context, RemoteVettingProcessDto $process, ProcessId $id, AttributeListDto $attributeLogDto) |
|
48
|
|
|
{ |
|
49
|
|
|
throw new InvalidRemoteVettingStateException('Unable to finish validation of a token'); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function handleDone(RemoteVettingContext $context, RemoteVettingProcessDto $process) |
|
53
|
|
|
{ |
|
54
|
|
|
throw new InvalidRemoteVettingStateException('Unable to end the validation of a token'); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getValidatedToken(RemoteVettingProcessDto $process) |
|
58
|
|
|
{ |
|
59
|
|
|
throw new InvalidRemoteVettingStateException('Unable to find a validated token'); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function getAttributes(RemoteVettingProcessDto $process) |
|
63
|
|
|
{ |
|
64
|
|
|
throw new InvalidRemoteVettingStateException('Unable to find attributes'); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.