engine: Add SP for retrieving templates by vnic profile

The patch adds a stored-procedure for fetching all the
templates which are using a given vnic profile.

Change-Id: If143d7c23235c5aa56b1cb1f94f003eae7fe20a3
Signed-off-by: Moti Asayag <masayag@redhat.com>
core: Add parameter class for vnic profile commands

The class will be using for vnic profile actions, e.g.:
adding/updating/removing a vnic profile.

Change-Id: Ia98a96e4413f1b9cbc7012c2e2fc6da70a4027e4
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Introduce VnicProfileCommandBase class

The VnicProfileCommandBase class is the base class of the vnic profile
related commands in the system: add, update and remove.

Change-Id: I71debdb5fe5dc42b308ccd8bd3e177191f9d2a3a
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Add AddVnicProfileCommand

The patch adds command for creating a new vnic profile
entity in the system.

Change-Id: I27100ced5acfdf9cc1125f865937fd0d7e4ffd17
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Add update vnic profile command

The patch adds support to update an existing vnic profile
command. It will allow the user to modify the vnic profile
name, custom properties and set it as port-mirroring.

Change-Id: I1a666ccc4fc259c28e56e1c0c455fdd9b0ad14b7
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Add remove vnic profile command

The patch adds a new command for removing a vnic profile
which is no longer in use by vm or templates.

Change-Id: I53d8803f78838cea6c8423cb95b6d12ce6d3bea0
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Remove publicUse from AddNetwork command

Since there is no meaning for usage permissions on the
network entity (replaced by the vnic profile), the publicUse
option is removed from the command parameters and will also
be removed from the AddNetwork dialogue.

Change-Id: I3c95b56b22051da5fab5e4b5b34403fc4e2e8a03
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Remove vnic profiles for non-vm network

When a network is being changed from vm network to
non-vm network, all of its vnic-profiles whould be
removed, as no vms are allowed for that network.

The permissions of the vnic profiles will be deleted
as well.

Change-Id: Ife353a6824502c6aff47814368455aaddb0a2bac
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Extract removeVnicProfiles() to NetworkCommon

The patch moves removeVnicProfiles() into network actions
base class since it will will be used by other network
commands.

Change-Id: I28dc95fd1a20972c58b54f8ca5289e6a7138648f
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Delete vnic profiles when removing a network

The patch removes vnic profiles when the network is
being deleted from the system.

Change-Id: I6472fb81262d7eb2cf6886a42ba17a637c804b22
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: cleanup static access

The patch replaces a static access to the DbFacade.getInstance()
 with a class level method (CommandBase.getDbFacade()).

Change-Id: Ib22c075fe17d30da32ec28a5f24c9e196dd729a4
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Remove vnic profiles of a removed a data-center

The patch removes the vnic profiles associated to networks
which reside in a data-center which is being removed.

Change-Id: Ifb399dc916983780be9895278e9335e3631ad1cd
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Introduce VnicProfileValidator

The patch adds a validator class for constrains required by
the vnic profile command.

Change-Id: I6af74a398d1d7ffb97a1802305c56ad536acb346
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Prevent adding vnic profiles to non vm network

The patch prevent adding a vnic profiles to a non vm network
since the profiles are relevant only in the context of vms.

Change-Id: I9ca90d31a44038846b04bf23b3c9215d9560907d
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Prevent modifying port mirroring if used by vms

The patch prevents updating the port mirroring of a vnic
profile if it used by VMs, since there will be no idicator
what is the actual running configuration on the VMs.

Change-Id: Ibe7b2c4e4ab133f6d6928d1d18a458103e017baa
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Add rename logging capability to UpdateVnic

The patch adds the rename logging capability to the
UpdateVnicProfileCommand so each rename will be followed
with an event log specifying the old profile name to ease
entity tracking.

Change-Id: Idad93fb341151ab2b97532ec216e187d5049f415
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Modify custom properties type to map

The patch modifies the vnic profile custom properties
type to a map which is more usable and serves it purpose
better than a plan string.

Change-Id: I668a7d821e46e239325b8a021e04746041dbdad5
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Add audit log messages for vnic profile commands

The patch adds the audit log messages for the vnic profile
commands which will be created as an event log in case of
success or failure in action execution.

Change-Id: I3d41b5487faf7eafaeae0ed929fd53ad26e7416a
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Refactor VnicProfile row mapper

The VnicProfile row mapper is being refactored into a base
mapper which will serve both the VnicProfile and the
VnicProfileView entities mapping.

Change-Id: Iedf16874379c535471f0fb398da315f2eaa3c3a8
Signed-off-by: Moti Asayag <masayag@redhat.com>
engine: Introduce VnicProfileView and its DAO

The VnicProfileView is an extension of the VnicProfile
entity which contains further information required by
the UI.

Change-Id: Ib48832f29d0150d23d68c782be53d521628247e1
Signed-off-by: Moti Asayag <masayag@redhat.com>