def METHOD_NAME(self, target_instance, protocol):
    from terminal.utils import db_port_manager
    from assets.const import DatabaseTypes, Protocol
    if isinstance(target_instance, Asset) and \
            target_instance.is_type(DatabaseTypes.ORACLE) and \
            protocol == Protocol.oracle:
        port = db_port_manager.get_port_by_db(target_instance)
    else:
        if protocol == Protocol.sftp:
            protocol = Protocol.ssh
        port = getattr(self, f'{protocol}_port', 0)
    return port