The {@code appName} that will be used by this {@code EVCache}.

@param The
name of the EVCache App cluster.
@return this {@code Builder} object
420218
public Builder setAppName(String appName) {
            if (appName == null) throw new IllegalArgumentException("param appName cannot be null.");
            this._appName = appName.toUpperCase(Locale.US);
            if (!_appName.startsWith("EVCACHE")) logger.warn("Make sure the app you are connecting to is EVCache App");
            return this;
        }
685885
@Override
    public ServiceCache<T> build()
    {
        if (executorService != null)
        {
            return new ServiceCacheImplExt<>(discovery, name, executorService);
        }
        else
        {
            return new ServiceCacheImplExt<>(discovery, name, threadFactory);
        }
    }
999903
public final void setApplicationName(String... applicationNames) {
        synchronized (lock) {
            if (applicationNames == null) {
                serviceProperties.remove(APPLICATION_NAME);
            } else {
                serviceProperties.put(APPLICATION_NAME, applicationNames);
            }

            if (serviceRegistration != null) {
                serviceRegistration.setProperties(serviceProperties);
            }
        }
    }
727324
public static Builder newBuilder(BucketInfo bucketInfo, String name) {
    return newBuilder(bucketInfo.getName(), name);
  }
437674
public static AppVersion parseName(String amiName) {
        if (amiName == null) {
            return null;
        }
        Matcher matcher = APP_VERSION_PATTERN.matcher(amiName);
        if (!matcher.matches()) {
            return null;
        }
        AppVersion parsedName = new AppVersion();
        parsedName.packageName = matcher.group(1);
        parsedName.version = matcher.group(2);
        // Historically we put the change number first because with Perforce it was a number we could use to sort.
        // This broke when we started using git, since hashes have no order. For a while the stash builds ommited the
        // commit id, but eventually we began appending it after the build number.
        boolean buildFirst = matcher.group(3) != null && matcher.group(3).startsWith("h"); // 'h' is for Hudson
        String buildString = matcher.group(buildFirst ? 3 : 4);
        parsedName.buildNumber = buildString != null ? buildString.substring(1) : null;
        parsedName.commit = matcher.group(buildFirst ? 4 : 3);
        parsedName.buildJobName = matcher.group(5);
        return parsedName;
    }
44016
public VDirectory createApplication(String appName) {
        Tenant tenant = new Tenant(TenantService.instance().getDefaultTenantDef());
        return createApplication(tenant, appName);
	}
1151013
protected static ArrayCache getArrayCache() {
        ArrayCache cache = (ArrayCache) AppContext.getAppContext().get(ArrayCache.class);

        if (cache == null) {
            cache = new ArrayCache();
            AppContext.getAppContext().put(ArrayCache.class, cache);
        }

        return cache;
    }
330182
private Map<ServerGroup, EVCacheServerGroupConfig> bootstrapFromEureka(String appName) throws IOException {
        
        if(env == null || region == null) return Collections.<ServerGroup, EVCacheServerGroupConfig> emptyMap();
        
        final String url = "http://discoveryreadonly." + region + ".dyn" + env + ".netflix.net:7001/v2/apps/" + appName;
        final CloseableHttpClient httpclient = HttpClients.createDefault();
        final long start = System.currentTimeMillis();
        CloseableHttpResponse httpResponse = null;
        try {
            final RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout).build();
            HttpGet httpGet = new HttpGet(url);
            httpGet.addHeader("Accept", "application/json");
            httpGet.setConfig(requestConfig);
            httpResponse = httpclient.execute(httpGet);
            final int statusCode = httpResponse.getStatusLine().getStatusCode();
            if (!(statusCode >= 200 && statusCode < 300)) {
                log.error("Status Code : " + statusCode + " for url " + url);
                return Collections.<ServerGroup, EVCacheServerGroupConfig> emptyMap();
            }
            
            final InputStreamReader in = new InputStreamReader(httpResponse.getEntity().getContent(), Charset.defaultCharset());
            final JSONTokener js = new JSONTokener(in);
            final JSONObject jsonObj = new JSONObject(js);
            final JSONObject application = jsonObj.getJSONObject("application");
            final JSONArray instances = application.getJSONArray("instance");
            final Map<ServerGroup, EVCacheServerGroupConfig> serverGroupMap = new HashMap<ServerGroup, EVCacheServerGroupConfig>();
            final ChainedDynamicProperty.BooleanProperty useBatchPort = EVCacheConfig.getInstance().getChainedBooleanProperty(appName + ".use.batch.port", "evcache.use.batch.port", Boolean.FALSE, null);
            for(int i = 0; i < instances.length(); i++) {
                final JSONObject instanceObj = instances.getJSONObject(i);
                final JSONObject metadataObj = instanceObj.getJSONObject("dataCenterInfo").getJSONObject("metadata");

                final String asgName = instanceObj.getString("asgName");
                final DynamicBooleanProperty asgEnabled = EVCacheConfig.getInstance().getDynamicBooleanProperty(asgName + ".enabled", true);
                if (!asgEnabled.get()) {
                    if(log.isDebugEnabled()) log.debug("ASG " + asgName + " is disabled so ignoring it");
                    continue;
                }
                
                final String zone = metadataObj.getString("availability-zone");
                final ServerGroup rSet = new ServerGroup(zone, asgName);
                final String localIp = metadataObj.getString("local-ipv4");
                final JSONObject instanceMetadataObj = instanceObj.getJSONObject("metadata");
                final String evcachePortString = instanceMetadataObj.optString("evcache.port", "11211");
                final String rendPortString = instanceMetadataObj.optString("rend.port", "0");
                final String rendBatchPortString = instanceMetadataObj.optString("rend.batch.port", "0");
                final int rendPort = Integer.parseInt(rendPortString);
                final int rendBatchPort = Integer.parseInt(rendBatchPortString);
                final String rendMemcachedPortString = instanceMetadataObj.optString("rend.memcached.port", "0");
                final String rendMementoPortString = instanceMetadataObj.optString("rend.memento.port", "0");
                final int evcachePort = Integer.parseInt(evcachePortString);
                final int port = rendPort == 0 ? evcachePort : ((useBatchPort.get().booleanValue()) ? rendBatchPort : rendPort);

                EVCacheServerGroupConfig config = serverGroupMap.get(rSet);
                if(config == null) {
                    config = new EVCacheServerGroupConfig(rSet, new HashSet<InetSocketAddress>(), Integer.parseInt(rendPortString), 
                            Integer.parseInt(rendMemcachedPortString), Integer.parseInt(rendMementoPortString));
                    serverGroupMap.put(rSet, config);
//                    final ArrayList<Tag> tags = new ArrayList<Tag>(2);
//                    tags.add(new BasicTag(EVCacheMetricsFactory.CACHE, appName));
//                    tags.add(new BasicTag(EVCacheMetricsFactory.SERVERGROUP, rSet.getName()));
//                    EVCacheMetricsFactory.getInstance().getLongGauge(EVCacheMetricsFactory.CONFIG, tags).set(Long.valueOf(port));
                }

                final InetAddress add = InetAddresses.forString(localIp);
                final InetAddress inetAddress = InetAddress.getByAddress(localIp, add.getAddress());
                final InetSocketAddress address = new InetSocketAddress(inetAddress, port);
                config.getInetSocketAddress().add(address);
            }
            if (log.isDebugEnabled()) log.debug("Returning : " + serverGroupMap);
            return serverGroupMap;
        } catch (Exception e) {
            if (log.isDebugEnabled()) log.debug("URL : " + url + "; Timeout " + timeout, e);
        } finally {
            if (httpResponse != null) {
                try {
                    httpResponse.close();
                } catch (IOException e) {

                }
            }
            if (log.isDebugEnabled()) log.debug("Total Time to execute " + url + " " + (System.currentTimeMillis() - start) + " msec.");
        }
        return Collections.<ServerGroup, EVCacheServerGroupConfig> emptyMap();
    }
821022
public static Builder v2Builder(String name) {
        return new Builder(name, V2MarshallerSet.marshallers(), V2MarshallerSet.setMarshallers(),
                           StandardUnmarshallerSet.unmarshallers(),
                           StandardUnmarshallerSet.setUnmarshallers());
    }
695873
@Override
    @SuppressWarnings("unchecked")
    public <K extends Serializable, V> Map<K, V> getCache(String cacheName)
            throws IllegalArgumentException {
        return (Map<K, V>) this.mapCacheCreator.get(cacheName);
    }
1279076
public ISarlBehaviorUnitBuilder addSarlBehaviorUnit(String name) {
		ISarlBehaviorUnitBuilder builder = this.iSarlBehaviorUnitBuilderProvider.get();
		builder.eInit(getSarlBehavior(), name, getTypeResolutionContext());
		return builder;
	}
458701
public T providerOfType(final String providerName) throws ExecutionServiceException {
        if (null == providerName) {
            throw new NullPointerException("provider name was null for Service: " + getName());
        }
        if (isCacheInstances()) {
            if (null == instanceregistry.get(providerName)) {
                T instance = createProviderInstanceOfType(providerName);
                instanceregistry.put(providerName, instance);
                return instance;
            }
            return instanceregistry.get(providerName);
        } else {
            return createProviderInstanceOfType(providerName);
        }
    }
566470
public static String newAppId(String appName) {
    String appIdSuffix = String.format("%s_%d", appName, System.currentTimeMillis());
    return "app_" + appIdSuffix;
  }
170048
protected ApplicationInfoRequest buildApplicationRequest(String appName) {
        ApplicationInfoRequest applicationInfoRequest = new ApplicationInfoRequest();
        applicationInfoRequest.setAppName(appName);
        return applicationInfoRequest;
    }
863893
public AppIdentity getAppIdentity(final String applicationName) {
		if (isCached(applicationName)) {
			return applicationIdentityCache.get(applicationName).getAppIdentity();

		} else {
			// Update environment detail with new configured application name
			final EnvironmentDetail updatedEnvDetail =
				updateEnvironmentDetail(defaultApiConfig.getEnvDetail(), applicationName);

			// use existing apiConfig, with new application name
			final ApiConfiguration updatedApiConfig = defaultApiConfig.toBuilder()
				.application(applicationName)
				.envDetail(updatedEnvDetail)
				.build();

			return getAppIdentity(updatedApiConfig);
		}
	}
1306939
public PurgeJmsQueuesBuilder withApplicationContext(ApplicationContext applicationContext) {
        if (applicationContext.containsBean("connectionFactory")) {
            connectionFactory(applicationContext.getBean("connectionFactory", ConnectionFactory.class));
        }

        return this;
    }
171932
@NotNull
    @ObjectiveCName("build")
    public Configuration build() {
        if (endpoints.size() == 0) {
            throw new RuntimeException("Endpoints not set");
        }
        if (phoneBookProvider == null) {
            throw new RuntimeException("Phonebook Provider not set");
        }
        if (apiConfiguration == null) {
            throw new RuntimeException("Api Configuration not set");
        }
        if (deviceCategory == null) {
            throw new RuntimeException("Device Category not set");
        }
        if (platformType == null) {
            throw new RuntimeException("App Category not set");
        }
        if (trustedKeys.size() == 0) {
            Log.w("ConfigurationBuilder", "No Trusted keys set. Using anonymous server authentication.");
        }
        return new Configuration(endpoints.toArray(new ConnectionEndpoint[endpoints.size()]),
                phoneBookProvider, notificationProvider,
                apiConfiguration, enableContactsLogging, enableNetworkLogging,
                enableFilesLogging, deviceCategory, platformType,
                minDelay, maxDelay, maxFailureCount,
                timeZone, preferredLanguages.toArray(new String[preferredLanguages.size()]),
                customAppName,
                trustedKeys.toArray(new TrustedKey[trustedKeys.size()]),
                isPhoneBookImportEnabled,
                isOnClientPrivacyEnabled,
                callsProvider,
                rawUpdatesHandler,
                voiceCallsEnabled,
                videoCallsEnabled,
                isEnabledGroupedChatList,
                autoJoinGroups.toArray(new String[autoJoinGroups.size()]),
                autoJoinType);
    }