Get or create a new state for the provided app ID.

@param sAppID
The app ID to get the state for. May neither be <code>null</code>
nor empty.
@return Never <code>null</code>.
548148
@Nonnull
  public PhotonSessionStatePerApp state (@Nonnull @Nonempty final String sAppID)
  {
    ValueEnforcer.notEmpty (sAppID, "AppID");
    return m_aStateMap.computeIfAbsent (sAppID, k -> new PhotonSessionStatePerApp ());
  }
1160266
public Observable<InputStream> downloadQueryLogsAsync(UUID appId) {
        return downloadQueryLogsWithServiceResponseAsync(appId).map(new Func1<ServiceResponse<InputStream>, InputStream>() {
            @Override
            public InputStream call(ServiceResponse<InputStream> response) {
                return response.body();
            }
        });
    }
914021
public static DataSourceBackendId getInstance(String id) {
        DataSourceBackendId result = cache.get(id);
        if (result == null) {
            id = id.intern();
            result = new DataSourceBackendId(id);
            cache.put(id, result);
        }
        return result;
    }
473531
private AppIdentity getAppIdentity(ApiConfiguration apiConfig) {
		final String applicationName = apiConfig.getApplication();

		if (applicationName == null)
			return null;

		// If there's no record create it.
		if (!applicationIdentityCache.containsKey(applicationName)) {
			applicationIdentityCache.put(applicationName, new AppIdentityState());
		}

		final AppIdentityState state = applicationIdentityCache.get(applicationName);
		final long now = System.currentTimeMillis();

		if ((state.lastModified() + FIVE_MINUTES_MILLIS) < now) {
			state.touch();
			try {
				final AppIdentity identity = identifyApp(apiConfig);
				applicationIdentityCache.put(applicationName, state.updateAppIdentity(identity));

				LOGGER.debug("Application identity: {}", identity);

			} catch (Throwable t) {
				LOGGER.info("Unable to determine application identity", t);
			}
		}

		return applicationIdentityCache.get(apiConfig.getApplication()).getAppIdentity();
	}
18540
@SuppressWarnings("WeakerAccess")
  public String getInstanceId() {
    AppProfileName fullName =
        Verify.verifyNotNull(AppProfileName.parse(proto.getName()), "Name can never be null");

    //noinspection ConstantConditions
    return fullName.getInstance();
  }
460170
public <T> T getState(final Flow flow, final String stateId, final Class<T> clazz) {
        if (containsFlowState(flow, stateId)) {
            val state = flow.getState(stateId);
            return clazz.cast(state);
        }
        return null;
    }
367210
public Object newInstanceWithId(final Object id)
	{
		try
		{
			final Object o = clazz.newInstance();

			idProperty.set(o, id);

			return o;
		}
		catch (Throwable e)
		{
			throw new RuntimeException("Cannot create new instance of " +
			                           clazz +
			                           " with ID " +
			                           id +
			                           " (of type " +
			                           id.getClass() +
			                           ") populated!", e);
		}
	}
505519
public ISLhSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientSLhSession.class)) {
      ClientSLhSessionDataReplicatedImpl data = new ClientSLhSessionDataReplicatedImpl(sessionId, this.mobicentsCluster,
          this.replicatedSessionDataSource.getContainer());
      return data;
    } else if (clazz.equals(ServerSLhSession.class)) {
      ServerSLhSessionDataReplicatedImpl data = new ServerSLhSessionDataReplicatedImpl(sessionId, this.mobicentsCluster,
          this.replicatedSessionDataSource.getContainer());
      return data;
    }
    throw new IllegalArgumentException();
  }
1296699
public Optional<BrowserApplication> show(long applicationId)
    {
        QueryParameterList queryParams = new QueryParameterList();
        queryParams.add("filter[ids]", new Long(applicationId));
        return Optional.of(HTTP.GET("/v2/browser_applications.json", null, queryParams, BROWSER_APPLICATIONS).get().iterator().next());
    }
516293
def get_app_state(device_id, app_id):
    
    if not is_valid_app_id(app_id):
        abort(403)
    if not is_valid_device_id(device_id):
        abort(403)
    if device_id not in devices:
        abort(404)
    app_state = devices[device_id].app_state(app_id)
    return jsonify(state=app_state, status=app_state)
1002763
@Override
  public ICxDxSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientCxDxSession.class)) {
      ClientCxDxSessionDataReplicatedImpl data =
          new ClientCxDxSessionDataReplicatedImpl(sessionId, this.mobicentsCluster, this.replicatedSessionDataSource.getContainer());
      return data;
    }
    else if (clazz.equals(ServerCxDxSession.class)) {
      ServerCxDxSessionDataReplicatedImpl data =
          new ServerCxDxSessionDataReplicatedImpl(sessionId, this.mobicentsCluster, this.replicatedSessionDataSource.getContainer());
      return data;
    }
    throw new IllegalArgumentException();
  }
36956
public Optional<Application> show(long applicationId)
    {
        return HTTP.GET(String.format("/v2/applications/%d.json", applicationId), APPLICATION);
    }
707678
public SipApplicationSession getApplicationSession(boolean create) {
		if(logger.isDebugEnabled()) {
			logger.debug("getApplicationSession - create=" + create);
		}

		MobicentsSipApplicationSession sipApplicationSession = getSipApplicationSession(create);
		if(sipApplicationSession == null) {
			return null;
		} else {
			return sipApplicationSession.getFacade();
		}
	}
325164
public void setApplicationId(String applicationId) {
		// Set the application id as a GeoPackage
		int applicationIdInt = ByteBuffer.wrap(applicationId.getBytes())
				.asIntBuffer().get();
		execSQL(String.format("PRAGMA application_id = %d;", applicationIdInt));
	}
635940
public static MozuUrl getApplicationSummaryChildrenUrl(String appId)
	{
		UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/apps/{appId}/");
		formatter.formatUrl("appId", appId);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
946451
public Observable<ServiceResponse<PublishSettings>> getPublishSettingsWithServiceResponseAsync(UUID appId) {
        if (this.client.endpoint() == null) {
            throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
        }
        if (appId == null) {
            throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
        }
        String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
        return service.getPublishSettings(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<PublishSettings>>>() {
                @Override
                public Observable<ServiceResponse<PublishSettings>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PublishSettings> clientResponse = getPublishSettingsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
538796
public Integer getFirstStateId(){
		Set<Integer> ids = states.inverse().keySet();
		if (ids.size() < 1 ){
			throw new IllegalStateException("There is no state defined.");
		}
		Integer[] idsArray = new Integer[ids.size()];
		Arrays.sort(ids.toArray(idsArray));
		return idsArray[0];
	}