Converts a {@link Participant} from {{@link #getParticipants()} to a
{@link ParticipantIdentity}.

@param participant {@link Participant} from {@link #getParticipants()}
@return {@link ParticipantIdentity} that corresponds to this {@link Participant}
540079
public ParticipantIdentity getParticipantIdentity(Participant participant) {
		if (participantIdentities != null) {
			for (ParticipantIdentity participantIdentity : participantIdentities) {
				if (participant.getParticipantId() == participantIdentity.getParticipantId()) {
					return participantIdentity;
				}
			}
		}
		
		return null;
	}
743114
def get_participant(participant_id):
    """"""
    try:
        ppt = models.Participant.query.filter_by(id=participant_id).one()
    except NoResultFound:
        return error_response(
            error_type="/participant GET: no participant found", status=403
        )

    # return the data
    return success_response(participant=ppt.__json__())
235720
def get(self, sid):
        
        return ParticipantContext(self._version, room_sid=self._solution['room_sid'], sid=sid, )
1033990
def participants(self):
        
        if self._participants is None:
            self._participants = ParticipantList(self._version, room_sid=self._solution['sid'], )
        return self._participants
928359
def get_participants(self, obj):
        
        # we set the many to many serialization to False, because we only want it with retrieve requests
        if self.callback is None:
            return [participant.id for participant in obj.participants.all()]
        else:
            # we do not want user information
            return self.callback(obj)
247387
@SuppressWarnings("unchecked")
  private CompletableFuture<Void> completeParticipant(
      ParticipantInfo participantInfo,
      Function<Transactional<?>, CompletableFuture<Void>> completionFunction) {
    // Look up the primitive type for the participant. If the primitive type is not found, return an exception.
    PrimitiveType primitiveType = managementService.getPrimitiveTypeRegistry().getPrimitiveType(participantInfo.type());
    if (primitiveType == null) {
      return Futures.exceptionalFuture(new TransactionException("Failed to locate primitive type " + participantInfo.type() + " for participant " + participantInfo.name()));
    }

    // Look up the protocol type for the participant.
    PrimitiveProtocol.Type protocolType = managementService.getProtocolTypeRegistry().getProtocolType(participantInfo.protocol());
    if (protocolType == null) {
      return Futures.exceptionalFuture(new TransactionException("Failed to locate protocol type for participant " + participantInfo.name()));
    }

    // Look up the partition group in which the primitive is stored.
    PartitionGroup partitionGroup;
    if (participantInfo.group() == null) {
      partitionGroup = managementService.getPartitionService().getPartitionGroup(protocolType);
    } else {
      partitionGroup = managementService.getPartitionService().getPartitionGroup(participantInfo.group());
    }

    // If the partition group is not found, return an exception.
    if (partitionGroup == null) {
      return Futures.exceptionalFuture(new TransactionException("Failed to locate partition group for participant " + participantInfo.name()));
    }

    PrimitiveBuilder builder = primitiveType.newBuilder(participantInfo.name(), primitiveType.newConfig(), managementService);
    ((ProxyCompatibleBuilder) builder).withProtocol(partitionGroup.newProtocol());
    DistributedPrimitive primitive = builder.build();
    return completionFunction.apply((Transactional<?>) primitive);
  }
1332191
public Url fromIdentifier(String identifier) {
        Matcher matcher = identifierPattern.matcher(identifier);
        if (!matcher.matches()) {
            throw new RuntimeException(String.format("Couldn't parse identifier %s", identifier));
        }

        String resourceType = matcher.group(1);
        if (resourceType != null) {
            resourceType(resourceType);
        }

        String type = matcher.group(2);
        if (type != null) {
            type(type);
        }

        String version = matcher.group(3);
        if (version != null) {
            version(version);
        }

        String publicId = matcher.group(4);
        if (publicId != null) {
            publicId(publicId);
        }

        String format = matcher.group(5);
        if (format != null) {
            format(format);
        }

        // Signature (group 6) is not used

        return this;
    }
1087894
private function assertParticipantHasRole(ActivityInterface $activity, ParticipantInterface $participant)
    {
        if (!$participant->hasRole($activity->getRole()->getId())) {
            throw new AccessDeniedException(sprintf('The participant "%s" does not have the role "%s" that is required to operate the activity "%s".', $participant->getId(), $activity->getRole()->getId(), $activity->getId()));
        }
    }
370786
protected final Object getIdentifier(Object value, SharedSessionContractImplementor session) throws HibernateException {
		if ( value == null ) {
			return null;
		}

		//isNotEmbedded copied from EntityType#isNotEmbedded
		boolean isNotEmbedded = isNotEmbedded( session );
		if ( isNotEmbedded ) {
			return value;
		}

		final String associatedEntityName = delegate.getAssociatedEntityName();
		final String uniqueKeyPropertyName = delegate.getRHSUniqueKeyPropertyName();

		if ( StringHelper.isEmpty( uniqueKeyPropertyName ) ) {
			return ForeignKeys.getEntityIdentifierIfNotUnsaved( associatedEntityName, value, session ); //tolerates nulls
		}
		else {
			final EntityPersister persister = session.getFactory().getMetamodel().entityPersister( delegate.getAssociatedEntityName() );

			Object propertyValue = persister.getPropertyValue( value, uniqueKeyPropertyName );
			// We now have the value of the property-ref we reference.  However,
			// we need to dig a little deeper, as that property might also be
			// an entity type, in which case we need to resolve its identifier
			Type type = persister.getPropertyType( uniqueKeyPropertyName );
			GridType gridType = typeTranslator.getType( type );
			if ( gridType.isEntityType() ) {
				propertyValue = ( (EntityType) gridType ).getIdentifier( propertyValue, session );
			}

			return propertyValue;
		}
	}
429125
public OvhConferenceParticipants billingAccount_conference_serviceName_participants_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
		String qPath = "/telephony/{billingAccount}/conference/{serviceName}/participants/{id}";
		StringBuilder sb = path(qPath, billingAccount, serviceName, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhConferenceParticipants.class);
	}
1326589
public function participant($participantId)
	{
		$participant = $this->info['participants'];
		if (isset($participant[$participantId]))
		{
			return $participant[$participantId];
		}

		return null;
	}
516092
@Override
    public String getProviderParticipantId(String domain, String interfaceName, int majorVersion, String defaultValue) {

        String token = ParticipantIdKeyUtil.getProviderParticipantIdKey(domain, interfaceName, majorVersion);

        String participantId;

        // first see if participantId exists in the persistence file
        if (persistedParticipantIds.containsKey(token.toLowerCase())) {
            participantId = persistedParticipantIds.getProperty(token.toLowerCase());
            // if not, use the default value that was passed in via properties
        } else if (defaultValue != null) {
            participantId = defaultValue;
            // if no default value, generate one and save it to the persistence file
        } else if (ProviderAnnotations.getInterfaceName(GlobalCapabilitiesDirectoryProvider.class)
                                      .equals(interfaceName)) {
            participantId = capabilitiesDirectoryEntry.getParticipantId();
        } else if (ProviderAnnotations.getInterfaceName(GlobalDomainAccessControllerProvider.class)
                                      .equals(interfaceName)) {
            participantId = domainAccessControllerEntry.getParticipantId();
        } else if (ProviderAnnotations.getInterfaceName(DiscoveryProvider.class).equals(interfaceName)) {
            participantId = discoveryProviderParticipantId;
        } else if (ProviderAnnotations.getInterfaceName(RoutingProvider.class).equals(interfaceName)) {
            participantId = routingProviderParticipantId;
        } else {

            participantId = createUuidString();
            persistedParticipantIds.put(token, participantId);
            FileOutputStream fileOutputStream = null;
            try {
                fileOutputStream = new FileOutputStream(persistenceFileName);
                persistedParticipantIds.store(fileOutputStream, null);
            } catch (IOException e1) {
                logger.error("Error saving properties file for channelId", e1);

            } finally {
                if (fileOutputStream != null) {
                    try {
                        fileOutputStream.close();
                    } catch (IOException e) {
                        logger.debug("error closing output stream", e);
                    }
                }
            }
        }
        return participantId;
    }
969421
def unregister_participant(name_or_participant)

      re = @context.plist.unregister(name_or_participant)

      raise(ArgumentError.new('participant not found')) unless re

      @context.storage.put_msg(
        'participant_unregistered',
        'regex' => re.to_s)
    end
578918
private static String resolveIdentity(ResourceAddress address, Subject subject) {
        IdentityResolver resolver = address.getOption(IDENTITY_RESOLVER);
        ResourceAddress transport = address.getTransport();
        if (resolver != null) {
            return resolver.resolve(subject);
        }
        if (transport != null) {
            return resolveIdentity(transport, subject);
        }
        return null;
    }
1200472
@Override
	public ORID getIdentity(final Object iPojo) {
		checkOpeness();
		final ODocument record = getRecordByUserObject(iPojo, false);
		if (record != null)
			return record.getIdentity();
		return OObjectSerializerHelper.getObjectID(this, iPojo);
	}
219377
def to_entry(name, participant, options, block)

      raise(
        ArgumentError.new(
          'can only accept strings (classnames) or classes as participant arg')
      ) unless [ String, Class, NilClass ].include?(participant.class)

      klass = (participant || Ruote::BlockParticipant).to_s

      options = options.remap { |(k, v), h|
        h[k.to_s] = case v
          when Symbol then v.to_s
          when Proc then v.to_raw_source
          else v
        end
      }

      extract_blocks(block).each do |meth, code|
        @context.treechecker.block_check(code)
        options[meth] = code
      end

      [
        (name.is_a?(Regexp) ? name : Regexp.new("^#{name}$")).source,
        [ klass, options ]
      ]
    end
624293
public SubscriberEndpoint getNewOrExistingSubscriber(String senderPublicId) {
		SubscriberEndpoint subscriberEndpoint = new SubscriberEndpoint(webParticipant, this, senderPublicId,
				this.getPipeline(), this.openviduConfig);

		SubscriberEndpoint existingSendingEndpoint = this.subscribers.putIfAbsent(senderPublicId, subscriberEndpoint);
		if (existingSendingEndpoint != null) {
			subscriberEndpoint = existingSendingEndpoint;
			log.trace("PARTICIPANT {}: Already exists a subscriber endpoint to user {}", this.getParticipantPublicId(),
					senderPublicId);
		} else {
			log.debug("PARTICIPANT {}: New subscriber endpoint to user {}", this.getParticipantPublicId(),
					senderPublicId);
		}

		return subscriberEndpoint;
	}