class ControllerExecutionBB extends AbstractControllerExecution<BuildingBlockExecution> {

    @Override
    protected String getControllerActor(BuildingBlockExecution execution, String controllerScope,
            String resourceCustomizationUuid, String controllerAction) {

        /**
         * Firstly, check the execution context for actor parameter.
         */
        String controllerActor = getParameterFromExecution(execution, CONTROLLER_ACTOR_PARAM);

        /**
         * If no meaningful controller actor value found in the execution context and the value is not SO-REF-DATA.
         */
        if (Strings.isNullOrEmpty(controllerActor) && !isSoRefControllerActor(controllerActor)) {

            /**
             * For BuildingBlockExecution, we should try to get the resource information from Cached metadata.
             *
             * As the current cached metadata doesn't support controller actor, we use the
             * {@link org.onap.so.db.catalog.client.CatalogDbClient} to fetch information. Once the change is done in
             * cached metadata, this part should be refactored as well.
             */
            if (isPnfResourceScope(controllerScope)) {
                PnfResourceCustomization pnfResourceCustomization =
                        catalogDbClient.getPnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
                controllerActor = pnfResourceCustomization.getControllerActor();
            } else if (isVnfResourceScope(controllerScope)) {
                VnfResourceCustomization vnfResourceCustomization =
                        catalogDbClient.getVnfResourceCustomizationByModelCustomizationUUID(resourceCustomizationUuid);
                controllerActor = vnfResourceCustomization.getControllerActor();
            } else {
                logger.warn("Unrecognized scope: {}", controllerScope);
            }
        }

        /**
         * Lastly, can NOT find the controller actor information from resource customization table or the return value
         * is SO-REF-DATA.
         */
        if (Strings.isNullOrEmpty(controllerActor) || isSoRefControllerActor(controllerActor)) {
            String resourceType = getParameterFromExecution(execution, RESOURCE_TYPE_PARAM);
            ControllerSelectionReference reference = catalogDbClient
                    .getControllerSelectionReferenceByVnfTypeAndActionCategory(resourceType, controllerAction);

            controllerActor = reference.getControllerName();
        }
        return controllerActor;
    }

}