This method is deprecated.  See {@link Facebook} and {@link Session} for more info.

@param appId the String representing the application ID
183488
@Deprecated
    public void setAppId(String appId) {
        checkUserSession("setAppId");
        synchronized (this.lock) {
            mAppId = appId;
            sessionInvalidated = true;
        }
    }
929198
private Session removeSession(String id) {
        try {
            Session session = sessionCache.delete(id);
            if (session != null) {
                session.beginInvalidate();
                for (int i = sessionListeners.size() - 1; i >= 0; i--) {
                    sessionListeners.get(i).sessionDestroyed(session);
                }
            }
            return session;
        } catch (Exception e) {
            log.warn("Failed to delete session", e);
            return null;
        }
    }
979943
public boolean restartApp(int appId) {
    if (appId == -1) {
      // TODO (nlu): implement restart all
      String message = "Restarting the whole topology is not supported yet. "
          + "Please kill and resubmit the topology.";
      LOG.log(Level.SEVERE, message);
      return false;
    }

    // Setup Connection
    String restartRequest = String.format("%s/v2/apps/%s/%d/restart",
        this.marathonURI, this.topologyName, appId);
    HttpURLConnection conn = NetworkUtils.getHttpConnection(restartRequest);

    if (this.marathonAuthToken != null) {
      conn.setRequestProperty("Authorization", String.format("token=%s", this.marathonAuthToken));
    }

    if (conn == null) {
      LOG.log(Level.SEVERE, "Failed to find marathon scheduler");
      return false;
    }

    try {
      // send post request to restart app
      byte[] empty = new byte[0];
      if (!NetworkUtils.sendHttpPostRequest(conn, NetworkUtils.JSON_TYPE, empty)) {
        LOG.log(Level.SEVERE, "Failed to send post request");
        return false;
      }

      // Check response
      boolean success = NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_OK);

      if (success) {
        LOG.log(Level.INFO, "Successfully restarted container {0}", appId);
        return true;
      } else if (NetworkUtils.checkHttpResponseCode(conn, HttpURLConnection.HTTP_UNAUTHORIZED)) {
        LOG.log(Level.SEVERE, "Marathon requires authentication");
        return false;
      } else {
        LOG.log(Level.SEVERE, "Failed to restart container {0}", appId);
        return false;
      }
    } finally {
      // Disconnect to release resources
      conn.disconnect();
    }
  }
572834
public ApplicationField getField(int appId, int fieldId) {
		return getResourceFactory().getApiResource(
				"/app/" + appId + "/field/" + fieldId).get(
				ApplicationField.class);
	}
811668
func (s *CreateBranchInput) SetAppId(v string) *CreateBranchInput {
	s.AppId = &v
	return s
}
550129
func (s *GetAppReplicationConfigurationInput) SetAppId(v string) *GetAppReplicationConfigurationInput {
	s.AppId = &v
	return s
}
753965
public static void destroyed(String appid){
		if(futureMap.containsKey(appid)){
			futureMap.get(appid).cancel(true);
			logger.info("destroyed appid:{}",appid);
		}
	}
1180270
public ApplicationState getApplication(final String applicationId) throws IOException {
    final String url = this.getApplicationURL(applicationId);
    final HttpGet get = prepareGet(url);
    try (final CloseableHttpResponse response = this.httpClient.execute(get, this.httpClientContext)) {
      final String message = IOUtils.toString(response.getEntity().getContent());
      final ApplicationResponse result = this.objectMapper.readValue(message, ApplicationResponse.class);
      return result.getApplicationState();
    }
  }
89466
func (s *GetDomainAssociationInput) SetAppId(v string) *GetDomainAssociationInput {
	s.AppId = &v
	return s
}
348948
void setId(String sessionAuthId) {
        synchronized (lock) {
            if (isCreatingSession.get()) {
                this.sessionAuthId = sessionAuthId;
            }
            lock.notifyAll();
        }
    }
749013
public void deleteById(String id) {
        final String sid = sessionPrefix + ":" + id;
        try {
            this.executor.execute(new RedisCallback<Void>() {
                public Void execute(Jedis jedis) {
                    jedis.del(sid);
                    return null;
                }
            });
        } catch (Exception e) {
            log.error("failed to delete session(key={}) in redis,cause:{}", sid, Throwables.getStackTraceAsString(e));
        }
    }
330989
func (s *DeleteBranchInput) SetAppId(v string) *DeleteBranchInput {
	s.AppId = &v
	return s
}
258617
protected void appendAppId(ApplicationId appId, Message m) {
    if (appId == null) {
      return;
    }

    // check if any application-id avp is already present.
    // we could use m.getApplicationIdAvps().size() > 0 but this should spare a few cpu cycles
    for (Avp avp : m.getAvps()) {
      int code = avp.getCode();
      if (code == Avp.ACCT_APPLICATION_ID || code == Avp.AUTH_APPLICATION_ID || code == Avp.VENDOR_SPECIFIC_APPLICATION_ID) {
        return;
      }
    }

    if (appId.getVendorId() == 0) {
      if (appId.getAcctAppId() != 0) {
        m.getAvps().addAvp(Avp.ACCT_APPLICATION_ID, appId.getAcctAppId(), true, false, true);
      }
      if (appId.getAuthAppId() != 0) {
        m.getAvps().addAvp(Avp.AUTH_APPLICATION_ID, appId.getAuthAppId(), true, false, true);
      }
    }
    else {
      AvpSet avp = m.getAvps().addGroupedAvp(Avp.VENDOR_SPECIFIC_APPLICATION_ID, true, false);
      avp.addAvp(Avp.VENDOR_ID, appId.getVendorId(), true, false, true);
      if (appId.getAuthAppId() != 0) {
        avp.addAvp(Avp.AUTH_APPLICATION_ID, appId.getAuthAppId(), true, false, true);
      }
      if (appId.getAcctAppId() != 0) {
        avp.addAvp(Avp.ACCT_APPLICATION_ID, appId.getAcctAppId(), true, false, true);
      }
    }
  }
164097
@Nonnull
  public PhotonGlobalState setDefaultApplicationID (@Nullable final String sDefaultApplicationID)
  {
    m_aRWLock.writeLocked ( () -> {
      if (!EqualsHelper.equals (m_sDefaultApplicationID, sDefaultApplicationID))
      {
        m_sDefaultApplicationID = sDefaultApplicationID;
        if (LOGGER.isInfoEnabled ())
          LOGGER.info ("Default application ID set to '" + sDefaultApplicationID + "'");
      }
    });
    return this;
  }
954317
func (s *GetBranchInput) SetAppId(v string) *GetBranchInput {
	s.AppId = &v
	return s
}
1301963
func (s *CreateDomainAssociationInput) SetAppId(v string) *CreateDomainAssociationInput {
	s.AppId = &v
	return s
}
872230
public static void deleteAllFromSharedTable(String appid) {
		if (StringUtils.isBlank(appid) || !isSharedAppid(appid)) {
			return;
		}
		Pager pager = new Pager(25);
		PageIterable<Item, QueryOutcome> pages;
		Map<String, AttributeValue> lastKey = null;
		do {
			// read all phase
			pages = queryGSI(appid, pager);
			if (pages == null) {
				break;
			}
			List<WriteRequest> deletePage = new LinkedList<>();
			for (Page<Item, QueryOutcome> page : pages) {
				for (Item item : page) {
					String key = item.getString(Config._KEY);
					// only delete rows which belong to the given appid
					if (StringUtils.startsWith(key, appid.trim())) {
						logger.debug("Preparing to delete '{}' from shared table, appid: '{}'.", key, appid);
						pager.setLastKey(item.getString(Config._ID));
						deletePage.add(new WriteRequest().withDeleteRequest(new DeleteRequest().
								withKey(Collections.singletonMap(Config._KEY, new AttributeValue(key)))));
					}
				}
				lastKey = page.getLowLevelResult().getQueryResult().getLastEvaluatedKey();
			}
			// delete all phase
			logger.info("Deleting {} items belonging to app '{}', from shared table...", deletePage.size(), appid);
			if (!deletePage.isEmpty()) {
				batchWrite(Collections.singletonMap(getTableNameForAppid(appid), deletePage), 1);
			}
		} while (lastKey != null && !lastKey.isEmpty());
	}