This method is called when a {@link ProtocolIdentifierReceivedEvent} is
received from the reader. Having received a correct protocol identifier
is the precondition for logging in.

@param identifier the protocol version used by the Asterisk server.
420873
private void setProtocolIdentifier(final String identifier)
    {
        logger.info("Connected via " + identifier);

        // NOTE: value is AMI_VERSION, defined in include/asterisk/manager.h

        if (
        // Asterisk 13
        !"Asterisk Call Manager/2.6.0".equals(identifier)

                // Asterisk 13.2
                && !"Asterisk Call Manager/2.7.0".equals(identifier)

                // Asterisk > 13.5
                && !"Asterisk Call Manager/2.8.0".equals(identifier)

                // Asterisk > 13.13
                && !"Asterisk Call Manager/2.9.0".equals(identifier)

                // Asterisk =14.3.0
                && !"Asterisk Call Manager/3.1.0".equals(identifier)

                // since Asterisk 14.4.0
                && !"Asterisk Call Manager/3.2.0".equals(identifier)

                // since Asterisk 15
                && !"Asterisk Call Manager/4.0.0".equals(identifier)

                // since Asterisk 15.1
                && !"Asterisk Call Manager/4.0.1".equals(identifier)

                // since Asterisk 15.2
                && !"Asterisk Call Manager/4.0.2".equals(identifier)

                // since Asterisk 15.3
                && !"Asterisk Call Manager/4.0.3".equals(identifier)

                // Asterisk 16
                && !"Asterisk Call Manager/5.0.0".equals(identifier)

                && !"OpenPBX Call Manager/1.0".equals(identifier) && !"CallWeaver Call Manager/1.0".equals(identifier)
                && !(identifier != null && identifier.startsWith("Asterisk Call Manager Proxy/")))
        {
            logger.warn("Unsupported protocol version '" + identifier + "'. Use at your own risk.");
        }

        protocolIdentifier.setValue(identifier);
        protocolIdentifier.countDown();

    }
1028589
public void setIdentifierResolver(final Object identifierResolver) {
        if (identifierResolver instanceof IdentifierResolver) {
            this.identifierResolver = (IdentifierResolver) identifierResolver;
        } else if (identifierResolver instanceof String) {
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    return (String) identifierResolver;
                }
            };
        } else if (identifierResolver instanceof Closure) {
            final ObjectGraphBuilder self = this;
            this.identifierResolver = new IdentifierResolver() {
                public String getIdentifierFor(String nodeName) {
                    Closure cls = (Closure) identifierResolver;
                    cls.setDelegate(self);
                    return (String) cls.call(new Object[]{nodeName});
                }
            };
        } else {
            this.identifierResolver = new DefaultIdentifierResolver();
        }
    }
627159
public SID setIdentifierAuthority(byte[] identifierAuthority) {
        if (identifierAuthority == null || identifierAuthority.length != 6) {
            throw new IllegalArgumentException("Invalid identifier authority");
        }

        this.identifierAuthority = Arrays.copyOf(identifierAuthority, identifierAuthority.length);
        return this;
    }
5173
public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
        Identifiers id = new Identifiers();

        Integer profileId = null;
        try {
            profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
        } catch (Exception e) {
            // this is OK for this since it isn't always needed
        }
        Integer pathId = convertPathIdentifier(pathIdentifier, profileId);

        id.setProfileId(profileId);
        id.setPathId(pathId);

        return id;
    }
954465
public void setIdentifierMetadata(IdentifierMetadata identifierMetadata) {
    if (this.identifierMetadata != null) {
      String format = "Class %s has at least two fields, %s and %s, marked with %s annotation. "
          + "Only one field can be marked as an identifier. ";
      String message = String.format(format, entityClass.getName(),
          this.identifierMetadata.getName(), identifierMetadata.getName(),
          Identifier.class.getName());
      throw new EntityManagerException(message);
    }
    this.identifierMetadata = identifierMetadata;
  }
237211
public static ValidationResult validateVariableName(String identifier)
   {
      if (Strings.isNullOrEmpty(identifier))
         return new ValidationResult(ERROR, Messages.notNullOrEmpty(VARIABLE_NAME));
      return validateIdentifier(identifier, IdentifierType.VARIABLE_NAME);
   }
874300
protected void remove(I identifier) {
        LatencyStats removed = latencyMetrics.remove(identifier);
        if (removed != null) {
            try {
                removed.stop();
            } catch (Exception ex) {
                LOGGER.warn("Caught exception while removing LatencyStats, moving on.", ex);
            }
        }
    }
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);
	}
652771
public boolean expireId(final String identifier, final long expirationTime) {

		if (identifier == null) {
			log.error("Unable to expire a null Identifier value.");
			return false;
		}

		if (this.originString == null) {
			log.error("Origin has not been set.  Cannot expire Ids without a valid origin.");
			return false;
		}
		ExpireIdentifierMessage message = new ExpireIdentifierMessage();
		message.setOrigin(this.originString);
		message.setId(identifier);
		message.setExpirationTime(expirationTime);

		this.session.write(message);
		log.debug("Sent {}", message);

		return true;
	}
626998
public void setParentIdentifier(String parentIdentifier) {

        // Translate root identifier back into null
        if (parentIdentifier != null
                && parentIdentifier.equals(RootConnectionGroup.IDENTIFIER))
            parentIdentifier = null;

        getModel().setParentIdentifier(parentIdentifier);

    }
955254
public void cache(String identifier, Object resource) {
		verifyState();

		if (!cacheLocked.get()) {
			resourceCache.get().put(identifier, resource);
		}
	}
91032
public final hqlParser.identifier_return identifier() throws RecognitionException {
		hqlParser.identifier_return retval = new hqlParser.identifier_return();
		retval.start = input.LT(1);

		CommonTree root_0 = null;

		Token IDENT305=null;

		CommonTree IDENT305_tree=null;

		try {
			// hql.g:720:2: ( IDENT )
			// hql.g:720:4: IDENT
			{
			root_0 = (CommonTree)adaptor.nil();


			IDENT305=(Token)match(input,IDENT,FOLLOW_IDENT_in_identifier3634);
			IDENT305_tree = (CommonTree)adaptor.create(IDENT305);
			adaptor.addChild(root_0, IDENT305_tree);

			}

			retval.stop = input.LT(-1);

			retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
			adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

		}
		catch (RecognitionException ex) {

					//retval.Tree = HandleIdentifierError(input.LT(1),ex);
			                retval.tree = HandleIdentifierError(input.LT(1),ex);

		}

		finally {
			// do for sure before leaving
		}
		return retval;
	}
428754
private void checkIdentity(SSLSession session, X509Certificate cert) throws CertificateException {
		if (session == null) {
			throw new CertificateException("No handshake session");
		}

		if (EndpointIdentificationAlgorithm.HTTPS == identityAlg) {
			String hostname = session.getPeerHost();
			APINameChecker.verifyAndThrow(hostname, cert);
		}
	}
924325
@Override
    public String getClassLoaderIdentifier(ClassLoader classloader) throws IllegalArgumentException {
        // Disable for bundles, because the bundle id can change across instances of the server,
        // meaning the identifier would not be reliable
        if (classloader instanceof ThreadContextClassLoader && !(classloader instanceof ThreadContextClassLoaderForBundles)) {
            return ((ThreadContextClassLoader) classloader).getKey();
        } else {
            return null;
        }
    }
687573
boolean scanSpecialIdentifier(String identifier) {

        int length = identifier.length();

        if (limit - currentPosition < length) {
            return false;
        }

        for (int i = 0; i < length; i++) {
            int character = identifier.charAt(i);

            if (character == sqlString.charAt(currentPosition + i)) {
                continue;
            }

            if (character
                    == Character.toUpperCase(sqlString.charAt(currentPosition
                        + i))) {
                continue;
            }

            return false;
        }

        currentPosition += length;

        return true;
    }
12332
@Deprecated
	@Override
	public void receive(UUID receiverID, Event event) {
		willReceive(receiverID, event);
	}
368725
public void detachIdentifier(String identifier) {
		if (!StringUtils.equals(identifier, getIdentifier())) {
			Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier);
			if (s != null && StringUtils.equals(getId(), s.getCreatorid())) {
				deleteIdentifier(identifier);
			}
		}
	}