Turkey maintains close ties with both Israel and the Palestinians , and has frequently offered to mediate their long-standing conflict .