NAME

IO::Iron::PolicyBase - Base package (inherited) for IO::Iron::IronMQ/Cache/Worker::Policy packages.

VERSION

version 0.13

SYNOPSIS

This class is for internal use only.

METHODS

IRON_CLIENT_DEFAULT_POLICIES

Default policies for all clients. These policies allow everything.

alternatives

Return all possible alternatives.

Parameters:

required_policy, name/key name

Return: List of possible alternatives if validation is successful. If the policy is not set, throws a NoIronPolicyException.

is_valid_policy

Is this policy valid?

Parameters:

policy, name/key name.
candidate, proposed string.

Return: Boolean.

validate_with_policy

Validate a candidate string. Same as method is_valid_policy() but this method throws an exception of type IronPolicyException if the validation fails.

Parameters:

policy, name/key name.
candidate, proposed string.

Return: Boolean True if validation is successful, otherwise throws an exception.

get_policies

Get the policies from file or use the defaults. This function is for internal use.

The configuration is constructed as follows:

1. The global defaults.
5. The policies file specified when instantiating the client library overwrites everything before it according to the file hierarchy.
6. Return only the policies connected to this client (specify in derived class with method _THIS_POLICY).

Return: ref to policies.

AUTHOR

Mikko Koivunalho <mikko.koivunalho@iki.fi>

BUGS

Please report any bugs or feature requests to bug-io-iron@rt.cpan.org or through the web interface at: http://rt.cpan.org/Public/Dist/Display.html?Name=IO-Iron

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Mikko Koivunalho.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

The full text of the license can be found in the LICENSE file included with this distribution.