otupy.core.actuator.Actuator

class Actuator(obj)

Bases: Choice

OpenC2 Actuator Specifier

The Actuator object carries a Specifier which identifies an implementation of the Profile to which the Command applies, according to the definition in Sec. 3.3.1.3 of the Language Specification. However, note that this Actuator definition is fully transparent to its concrete implementation for a specific security functions.

Methods

fromdict

Builds instance from dictionary

getClass

Get the class corresponding to the current choice

getName

Returns the name of the choice

getObj

Returns the objet instance embedded in the register.

todict

Converts to dictionary

Attributes

register

Registry of available Actuator

choice

Selected name for the Choice

obj

Class corresponding to the choice

__init__(obj)

Initialize the Choice object

Objects used as Choice must be registered in advance in the register dictionary.

Parameters:

obj – An object among those defined in the register.

choice: str

Selected name for the Choice

classmethod fromdict(dic, e)

Builds instance from dictionary

It is used during deserialization to create an otupy instance from the text message. It takes an Encoder instance that is used to recursively build instances of the inner objects (the Encoder provides standard methods to create instances of base objects like strings, integers, boolean).

Parameters:
  • dic – The intermediary dictionary representation from which the object is built.

  • e – The Encoder that is being used.

Returns:

An instance of this class initialized from the dictionary values.

classmethod getClass(choice)

Get the class corresponding to the current choice

It may be implemented by any derived class, if a different logic than the Register class is followed to store the name/class bindings.

Parameters:

choice – The name of the alternative that is being looked for.

Returns:

The class corresponding to the provided choice.

getName()

Returns the name of the choice

Returns the name of object, which is the selector carried by the Choice element. This does not include the object itself.

getObj()

Returns the objet instance embedded in the register.

obj

Class corresponding to the choice

register = {'slpf': <class 'otupy.profiles.slpf.actuator.Specifiers'>, 'x-ctxd': <class 'otupy.profiles.ctxd.actuator.Specifiers'>, 'x-dumb': <class 'otupy.profiles.dumb.actuator.dumb'>}

Registry of available Actuator

For internal use only. Do not change or alter.

todict(e)

Converts to dictionary

It is used to convert this object to an intermediary representation during serialization. It takes an Encoder argument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..

Parameters:

e – The Encoder that is being used.

Returns:

A dictionary compliants to the Language Specification’s serialization rules.