<p>
The key name associated with the instance.
</p>

@param resourceAwsEc2InstanceKeyName
The key name associated with the instance.
776261
public void setResourceAwsEc2InstanceKeyName(java.util.Collection<StringFilter> resourceAwsEc2InstanceKeyName) {
        if (resourceAwsEc2InstanceKeyName == null) {
            this.resourceAwsEc2InstanceKeyName = null;
            return;
        }

        this.resourceAwsEc2InstanceKeyName = new java.util.ArrayList<StringFilter>(resourceAwsEc2InstanceKeyName);
    }
949334
public void bindInstanceToSecurityGroup(String instanceId, String securityGroupId) {
        this.bindInstanceToSecurityGroup(new BindSecurityGroupRequest()
                .withInstanceId(instanceId).withSecurityGroupId(securityGroupId));
    }
747886
@Override
    protected void register(ServiceInstance instance) {
        // step 1 get domain from config
        // set service from config
        // check if service exists
        // register service if not
        // register instance to service

        Map<String, String> instanceAttributes = new HashMap<>();

        // you can't just put anything in there like a custom config. Only certain things are allowed or you get weird errors
        // see https://docs.aws.amazon.com/Route53/latest/APIReference/API_autonaming_RegisterInstance.html
        //if the service uses A records use these
        if (instance.getPort() > 0) {
            instanceAttributes.put("AWS_INSTANCE_PORT", Integer.toString(instance.getPort()));
        }
        if (amazonComputeInstanceMetadataResolver != null) {
            Optional<ComputeInstanceMetadata> instanceMetadata = amazonComputeInstanceMetadataResolver.resolve(environment);
            if (instanceMetadata.isPresent()) {
                ComputeInstanceMetadata computeInstanceMetadata = instanceMetadata.get();
                if (computeInstanceMetadata.getPublicIpV4() != null) {
                    instanceAttributes.put(AWS_INSTANCE_IPV4, computeInstanceMetadata.getPublicIpV4());
                } else {
                    if (computeInstanceMetadata.getPrivateIpV4() != null) {
                        instanceAttributes.put(AWS_INSTANCE_IPV4, computeInstanceMetadata.getPrivateIpV4());
                    }
                }

                if (!instanceAttributes.containsKey(AWS_INSTANCE_IPV4)) {
                    // try ip v6
                    if (computeInstanceMetadata.getPublicIpV4() != null) {
                        instanceAttributes.put(AWS_INSTANCE_IPV6, computeInstanceMetadata.getPublicIpV6());
                    } else {
                        if (computeInstanceMetadata.getPrivateIpV6() != null) {
                            instanceAttributes.put(AWS_INSTANCE_IPV6, computeInstanceMetadata.getPrivateIpV6());
                        }
                    }
                }
            }
        }


        ConvertibleValues<String> metadata = instance.getMetadata();

        String instanceId = null;
        if (instance.getInstanceId().isPresent()) {
            instanceId = instance.getInstanceId().get();
        } else {
            // try the metadata
            if (metadata.contains("instanceId")) {
                instanceId = metadata.asMap().get("instanceId");
            } else {
                if (LOG.isErrorEnabled()) {
                    LOG.error("Cannot determine the instance ID. Are you sure you are running on AWS EC2?");
                }
            }
        }
        RegisterInstanceRequest instanceRequest = new RegisterInstanceRequest().withServiceId(route53AutoRegistrationConfiguration.getAwsServiceId())
                .withInstanceId(instanceId).withCreatorRequestId(Long.toString(System.nanoTime())).withAttributes(instanceAttributes);

        Future<RegisterInstanceResult> instanceResult = getDiscoveryClient().registerInstanceAsync(instanceRequest);
        Flowable<RegisterInstanceResult> flowableResult = Flowable.fromFuture(instanceResult);


        //noinspection SubscriberImplementation
        flowableResult.subscribe(new Subscriber<RegisterInstanceResult>() {

            @Override
            public void onNext(RegisterInstanceResult registerInstanceResult) {
                if (LOG.isInfoEnabled()) {
                    LOG.info("Called AWS to register service [{}] with {}", instance.getId(), route53AutoRegistrationConfiguration.getAwsServiceId());
                }
                if (registerInstanceResult.getOperationId() != null) {
                    ServiceRegistrationStatusTask serviceRegistrationStatusTask = new ServiceRegistrationStatusTask(getDiscoveryClient(),
                            route53AutoRegistrationConfiguration,
                            instance,
                            registerInstanceResult.getOperationId());
                    executorService.execute(serviceRegistrationStatusTask);
                }

            }

            @Override
            public void onSubscribe(Subscription s) {
                s.request(1);
            }

            @Override
            public void onError(Throwable t) {
                if (LOG.isErrorEnabled()) {
                    LOG.error("Error registering instance with AWS:" + t.getMessage(), t);
                }
                if (route53AutoRegistrationConfiguration.isFailFast() && instance instanceof EmbeddedServerInstance) {
                    LOG.error("Error registering instance with AWS and Failfast is set: stopping instance");
                    ((EmbeddedServerInstance) instance).getEmbeddedServer().stop();
                }
            }

            @Override
            public void onComplete() {
                if (LOG.isInfoEnabled()) {
                    LOG.info("Success calling register service request [{}] with {} is complete.", instance.getId(),
                            route53AutoRegistrationConfiguration.getAwsServiceId());
                }
            }
        });

    }
1295580
@VisibleForTesting
	@Nullable
	public Instance getInstance(ResourceID resourceId) {
		for (Instance instance : allInstances) {
			if (Objects.equals(resourceId, instance.getTaskManagerID())) {
				return instance;
			}
		}
		return null;
	}
519506
public void setResourceAwsEc2InstanceIpV4Addresses(java.util.Collection<IpFilter> resourceAwsEc2InstanceIpV4Addresses) {
        if (resourceAwsEc2InstanceIpV4Addresses == null) {
            this.resourceAwsEc2InstanceIpV4Addresses = null;
            return;
        }

        this.resourceAwsEc2InstanceIpV4Addresses = new java.util.ArrayList<IpFilter>(resourceAwsEc2InstanceIpV4Addresses);
    }
857910
public void setInstancesList(java.util.Collection<String> instancesList) {
        if (instancesList == null) {
            this.instancesList = null;
            return;
        }

        this.instancesList = new com.amazonaws.internal.SdkInternalList<String>(instancesList);
    }
878816
public static ResourceKey key(Enum<?> value) {
        return new ResourceKey(value.getClass().getName(), value.name());
    }
912841
Set<String> searchInstancesContainingKey(String searchKey)
            throws KnowledgeSourceReadException {
        return getFromProtege(searchKey,
                new ProtegeCommand<Set<String>, String>(
                        "search instance in a given  slot") {
                    @Override
                    Set<String> get(String matchString) {
                        Set<String> searchResults = new HashSet<>();
                        try {
                            Collection<Frame> displayNameMatches = protegeKnowledgeBase
                                    .getMatchingFrames(protegeKnowledgeBase
                                            .getSlot("displayName"), null, false,
                                            "*" + matchString.trim() + "*", -1);
                            Collection<Frame> nameMatches = protegeKnowledgeBase
                                    .getMatchingFrames(protegeKnowledgeBase
                                            .getSlot(":NAME"), null, false, "*"
                                            + matchString.trim() + "*", -1);
                            Slot nameSlot = protegeKnowledgeBase.getSlot(":NAME");
                            Cls propositionCls = protegeKnowledgeBase.getCls("Proposition");
                            if (displayNameMatches != null) {
                                for (Frame match : displayNameMatches)
                                    if (match instanceof Instance) {
                                        Instance temp = (Instance) match;
                                        if (temp.hasType(propositionCls)) {
                                            searchResults.add((String) getOwnSlotValue(match, nameSlot));
                                        }
                                    }
                            }
                            if (nameMatches != null) {
                                for (Frame match : nameMatches) {
                                    if (match instanceof Instance) {
                                        Instance temp = (Instance) match;
                                        if (temp.hasType(propositionCls)) {
                                            String result = (String) getOwnSlotValue(match, nameSlot);
                                            if (!searchResults.contains(result))
                                                searchResults.add(result);
                                        }
                                    }
                                }
                            }
                        } catch (KnowledgeSourceReadException e) {
                            e.printStackTrace();
                        }
                        return searchResults;
                    }
                });
    }
89476
public void setWorkflowInstanceLinkLocalService(
		com.liferay.portal.kernel.service.WorkflowInstanceLinkLocalService workflowInstanceLinkLocalService) {
		this.workflowInstanceLinkLocalService = workflowInstanceLinkLocalService;
	}
408915
func (s *AwsSecurityFindingFilters) SetResourceAwsEc2InstanceType(v []*StringFilter) *AwsSecurityFindingFilters {
	s.ResourceAwsEc2InstanceType = v
	return s
}
865989
public void setResourceAwsIamAccessKeyStatus(java.util.Collection<StringFilter> resourceAwsIamAccessKeyStatus) {
        if (resourceAwsIamAccessKeyStatus == null) {
            this.resourceAwsIamAccessKeyStatus = null;
            return;
        }

        this.resourceAwsIamAccessKeyStatus = new java.util.ArrayList<StringFilter>(resourceAwsIamAccessKeyStatus);
    }
227084
public boolean containsKey(String key) {

        if (key == null) {
            throw new NullPointerException("Missing resource key.");
        }

        PropertyBundle p = this;

        do {
            String value = p.key2values.get(key);
            if (value != null) {
                return true;
            }
        } while ((p = p.parent) != null);

        return false;

    }
259885
private Object getJavaObjectInstance(Context c, Hashtable<?, ?> envmt, String className, String bindingName, ResourceInfo resourceRefInfo, IndirectReference ref) throws Exception {
        // Return null if we don't find a binding so that the caller can
        // use JNDI if enabled.
        Object resource = null;

        NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.match(bindingName);
        if (namespace != null) {
            ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
            if (cmd != null) {
                OSGiInjectionScopeData isd = injectionEngine.getInjectionScopeData(cmd, namespace);
                if (isd != null) {
                    String name = namespace.unprefix(bindingName);

                    InjectionBinding<?> binding = isd.getInjectionBinding(namespace, name);
                    if (binding == null && isd.processDeferredReferenceData()) {
                        // Try again after processing deferred reference data.
                        binding = isd.getInjectionBinding(namespace, name);
                    }

                    if (binding != null) {
                        resource = getBindingObjectInstance(c, envmt, className, resourceRefInfo, ref, binding);
                    }
                }
            }

            if (resource == null && namespace == NamingConstants.JavaColonNamespace.COMP) {
                resource = getDefaultJavaCompObjectInstance(namespace, bindingName, resourceRefInfo);
            }

            // If not found and the customer did not provide a binding, then try and
            // auto-link to a resource that matches on name in the service registry.
            if (resource == null && ref.defaultBinding && !ref.name.startsWith("java:")) {
                resource = createResource(ref.name, className, ref.name, resourceRefInfo);
            }
        }

        return resource;
    }
644363
private boolean doesSubjectContainUTOKEN(Subject subj) throws ResourceException {

        Set privateGenericCredentials = getPrivateGenericCredentials(subj);
        final Iterator iter = privateGenericCredentials.iterator();

        boolean subjectHasUtokenCred = false;
        GenericCredential credential = null;

        while (iter.hasNext()) {
            if (System.getSecurityManager() != null) {
                try {
                    credential = (GenericCredential) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                        @Override
                        public Object run() throws Exception {
                            return iter.next();
                        }
                    });
                } catch (java.security.PrivilegedActionException pae) {
                    FFDCFilter.processException(pae, "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection", "19", this);
                    Tr.error(tc, "FAILED_DOPRIVILEGED_J2CA0060", pae);
                    Exception e = pae.getException();
                    ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to access Subject's credentials");
                    re.initCause(e);
                    throw re;
                }

            } else {
                credential = (GenericCredential) iter.next();
            }

            if (credential.getMechType().equals("oid:1.3.18.0.2.30.1")) {
                subjectHasUtokenCred = true;
                break;
            }
        }
        return subjectHasUtokenCred;
    }
394670
def _iparam_instancename(instancename):
        

        if isinstance(instancename, CIMInstanceName):
            instancename = instancename.copy()
            instancename.host = None
            instancename.namespace = None
        elif instancename is None:
            pass
        else:
            raise TypeError(
                _format("The 'InstanceName' argument of the WBEMConnection "
                        "operation has invalid type {0} (must be None, a "
                        "string, or a CIMInstanceName)",
                        type(instancename)))
        return instancename
1271365
@Path("{id}")
    public InstanceResource getInstanceInfo(@PathParam("id") String id) {
        return new InstanceResource(this, id, serverConfig, registry);
    }
748038
public ResourceDescription getChildDescription(String resourceName, String instanceName) {
        if (hasChildren()) {
            List<Property> children = get("children").asPropertyList();
            for (Property child : children) {
                if (resourceName.equals(child.getName()) && child.getValue().hasDefined(MODEL_DESCRIPTION)) {
                    List<Property> modelDescriptions = child.getValue().get(MODEL_DESCRIPTION).asPropertyList();
                    for (Property modelDescription : modelDescriptions) {
                        if (instanceName.equals(modelDescription.getName())) {
                            return new ResourceDescription(modelDescription.getValue());
                        }
                    }
                }
            }
        }
        return EMPTY;
    }