blob: c7555c37014a81a2a5b3f7dc5d00da1ad3d4bd42 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "ihopdirective.h"
namespace mbus {
/**
* This class represents a policy directive within a {@link Hop}'s selector. This means to create the named protocol
* using the given parameter string, and the running that protocol within the context of this directive.
*
* @author Simon Thoresen Hult
* @version $Id$
*/
class PolicyDirective : public IHopDirective {
private:
string _name;
string _param;
public:
/**
* Constructs a new policy selector item.
*
* @param name The name of the policy to invoke.
* @param param The parameter to pass to the name constructor.
*/
PolicyDirective(vespalib::stringref name, vespalib::stringref param);
~PolicyDirective();
/**
* Returns the name of the policy that this item is to invoke.
*
* @return The name name.
*/
const string &getName() const { return _name; }
/**
* Returns the parameter string for this policy directive.
*
* @return The parameter.
*/
const string &getParam() const { return _param; }
Type getType() const override { return TYPE_POLICY; }
bool matches(const IHopDirective &) const override { return true; }
string toString() const override;
string toDebugString() const override;
};
} // mbus
|