'Retrieve an association. If no handle is specified, return
the association with the latest expiration.
(str, str or NoneType) -> Association or NoneType'

def getAssociation(self, server_url, handle=None):

    if (handle is None):
        handle = ''
    filename = self.getAssociationFilename(server_url, handle)
    if handle:
        return self._getAssociation(filename)
    else:
        association_files = os.listdir(self.association_dir)
        matching_files = []
        name = os.path.basename(filename)
        for association_file in association_files:
            if association_file.startswith(name):
                matching_files.append(association_file)
        matching_associations = []
        for name in matching_files:
            full_name = os.path.join(self.association_dir, name)
            association = self._getAssociation(full_name)
            if (association is not None):
                matching_associations.append((association.issued, association))
        matching_associations.sort()
        if matching_associations:
            (_, assoc) = matching_associations[(-1)]
            return assoc
        else:
            return None
