gets a specific affiliation

@param registrar The identity of the registrar
@return Returns response
@throws AffiliationException if getting an affiliation fails.
@throws InvalidArgumentException
324062
public int read(User registrar) throws AffiliationException, InvalidArgumentException {
        if (registrar == null) {
            throw new InvalidArgumentException("Registrar should be a valid member");
        }

        String readAffURL = "";
        try {
            readAffURL = HFCA_AFFILIATION + "/" + name;
            logger.debug(format("affiliation  url: %s, registrar: %s", readAffURL, registrar.getName()));

            JsonObject result = client.httpGet(readAffURL, registrar);

            logger.debug(format("affiliation  url: %s, registrar: %s done.", readAffURL, registrar));
            HFCAAffiliationResp resp = getResponse(result);
            this.childHFCAAffiliations = resp.getChildren();

            this.identities = resp.getIdentities();
            this.deleted = false;
            return resp.statusCode;
        } catch (HTTPException e) {
            String msg = format("[Code: %d] - Error while getting affiliation '%s' from url '%s': %s", e.getStatusCode(), this.name, readAffURL, e.getMessage());
            AffiliationException affiliationException = new AffiliationException(msg, e);
            logger.error(msg);
            throw affiliationException;
        } catch (Exception e) {
            String msg = format("Error while getting affiliation %s url: %s  %s ", this.name, readAffURL, e.getMessage());
            AffiliationException affiliationException = new AffiliationException(msg, e);
            logger.error(msg);
            throw affiliationException;
        }
    }
668915
public void registerAuthenticationProvider(Class<? extends AuthenticationProvider> providerClass) {
    AuthenticationProvider provider = instantiateProvider(providerClass);
    authenticationProviders.put(provider.getName(), providerClass);  
    credentialAuths.put(provider.getName(), provider.requiresCredentials());
  }
772144
public static function getFromIdentityProvider(Provider $identityProvider)
    {
        // Have the identity provider authenticate the current identity.
        $identityProvider->authenticate();
        // The identity is valid according to the provider, so authentication is
        // passed.
        $userId = $identityProvider->getUserId();
        // Check for authorisation.
        try {
            Logger::get()->debug(sprintf(
                'Checking OpenID user %s...',
                $userId
            ));
            $user = Users::getInstance()->findEntity($userId);
            // The user is valid according to our records. Keep it in the session.
            $user->authenticate($identityProvider);
        } catch (NotFoundException $exception) {
            Logger::get()->warning(sprintf(
                'OpenID user %s is not known.',
                $userId
            ));
            throw new NotAuthorisedException(
                'OpenID user is not authorised.'
            );
        }

        return $user;
    }
690984
def get(self, identifier):
        """"""
        for provider in self._providers:
            if provider.identifier == identifier:
                return provider
        return None
1140598
public Map<String, String> getAssociationResponse(final HttpServletRequest request) {
        val parameters = new ParameterList(request.getParameterMap());

        val mode = parameters.hasParameter(OpenIdProtocolConstants.OPENID_MODE)
            ? parameters.getParameterValue(OpenIdProtocolConstants.OPENID_MODE)
            : null;

        val response = FunctionUtils.doIf(StringUtils.equals(mode, OpenIdProtocolConstants.ASSOCIATE),
            () -> this.serverManager.associationResponse(parameters),
            () -> null)
            .get();

        val responseParams = new HashMap<String, String>();
        if (response != null) {
            responseParams.putAll(response.getParameterMap());
        }
        return responseParams;
    }
148002
def image_id_from_registry(image_name):
    """"""
    registry, repository, tag = parse(image_name)
    try:
        token = auth_token(registry, repository).get("token")
        # dockerhub is crazy
        if registry == "index.docker.io":
            registry = "registry-1.docker.io"
        res = requests.head("https://{}/v2/{}/manifests/{}".format(registry, repository, tag), headers={
            "Authorization": "Bearer {}".format(token),
            "Accept": "application/vnd.docker.distribution.manifest.v2+json"
        }, timeout=5)
        res.raise_for_status()
    except requests.RequestException:
        log.error("Received {} when attempting to get digest for {}".format(
            res, image_name))
        return None
    return "@".join([registry+"/"+repository, res.headers["Docker-Content-Digest"]])
1088286
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        PubSub reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS), null);
        AffiliationsExtension listElem = reply.getExtension(PubSubElementType.AFFILIATIONS);
        return listElem.getAffiliations();
    }
1093033
public ResourceIterator<Relationship> findAssociation(GraphDatabaseService executionEngine, Object[] columnValues, String role, AssociationKeyMetadata associationKeyMetadata) {
		String query = getFindAssociationQuery( role, associationKeyMetadata );
		Map<String, Object> params = params( columnValues );
		executionEngine.execute( query, params );
		return executionEngine.execute( query, params( columnValues ) ).columnAs( "r" );
	}
723737
public Member registerAndEnroll(RegistrationRequest registrationRequest) throws RegistrationException, EnrollmentException {
        Member member = getMember(registrationRequest.getEnrollmentID());
        member.registerAndEnroll(registrationRequest);
        return member;
    }
1112038
public function findModuleByIdentity($identity)
    {
        $field = $this->getModularIdentifier();

        if (null == $field) {
            throw new \InvalidArgumentException('The module manager is missing a modular identifier.');
        }

        return $this->repository->findOneBy([$field => $identity]);
    }
1159966
public function getAssociationPersister()
    {
        if (!isset($this->associationPersister)) {
            $this->associationPersister = new Persister\AssociationPersister(
                $this->dm,
                $this
            );
        }

        return $this->associationPersister;
    }
1319408
@Override
    public IAuthorizationPrincipal getCurrentPrincipal(final ExternalContext externalContext) {
        final IPerson person = getCurrentPerson(externalContext);
        final EntityIdentifier ei = person.getEntityIdentifier();
        return AuthorizationServiceFacade.instance().newPrincipal(ei.getKey(), ei.getType());
    }
1337396
def get_id2gos(self, **kws):
        """"""
        return self._get_id2gos(self.associations, **kws) if kws else self.id2gos
174570
public Signature getRelatedSignature() throws HelloSignException {
        String id = getRelatedSignatureId();
        if (id == null) {
            return null;
        }
        for (Signature sig : ((SignatureRequest) resource).getSignatures()) {
            if (id.equals(sig.getId())) {
                return sig;
            }
        }
        return null;
    }
1133373
public final String getChainIdentity(String separator) throws KSIException {
        StringBuilder identity = new StringBuilder();

        for (int i = chain.size()-1; i >=0 ; i--) {
            AggregationChainLink aggregationChainLink = chain.get(i);
            Identity linkIdentity = aggregationChainLink.getLinkIdentity();
            String id = linkIdentity == null ? "" : linkIdentity.getDecodedClientId();
            if (identity.length() > 0 && id.length() > 0) {
                identity.append(separator);
            }
            identity.append(id);
        }
        return identity.toString();
    }
243700
public java.util.List<String> getAssociationIds() {
        if (associationIds == null) {
            associationIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return associationIds;
    }
254672
public static vpnglobal_domain_binding[] get(nitro_service service) throws Exception{
		vpnglobal_domain_binding obj = new vpnglobal_domain_binding();
		vpnglobal_domain_binding response[] = (vpnglobal_domain_binding[]) obj.get_resources(service);
		return response;
	}