private static void verifyRegisteredServiceProperties ( final RegisteredService registeredService , final Service service ) { if ( registeredService == null ) { val msg = String . format ( "Service [%s] is not found in service registry." , service . getId ( ) ) ; LOGGER . warn ( msg ) ; throw new UnauthorizedServiceException ( UnauthorizedServiceException . CODE_UNAUTHZ_SERVICE , msg ) ; } if ( ! registeredService . getAccessStrategy ( ) . isServiceAccessAllowed ( ) ) { val msg = String . format ( "ServiceManagement: Unauthorized Service Access. " + "Service [%s] is not enabled in service registry." , service . getId ( ) ) ; LOGGER . warn ( msg ) ; throw new UnauthorizedServiceException ( UnauthorizedServiceException . CODE_UNAUTHZ_SERVICE , msg ) ; } }
Ensure that the service is found and enabled in the service registry .