Gets the query logs of the past month for the application.

@param appId The application ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the InputStream object
551168
public Observable<ServiceResponse<InputStream>> downloadQueryLogsWithServiceResponseAsync(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.downloadQueryLogs(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<InputStream>>>() {
                @Override
                public Observable<ServiceResponse<InputStream>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<InputStream> clientResponse = downloadQueryLogsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
652325
@Override
  public AppSession getSession(String sessionId, Class<? extends AppSession> aClass) {
    if (sessionId == null) {
      throw new IllegalArgumentException("SessionId must not be null");
    }
    if (!this.iss.exists(sessionId)) {
      return null;
    }
    AppSession appSession = null;
    try {
      if (aClass == ServerRfSession.class) {
        IServerRfSessionData sessionData = (IServerRfSessionData) this.sessionDataFactory.getAppSessionData(ServerRfSession.class, sessionId);
        // FIXME: determine how to get boolean flag!
        ServerRfSessionImpl session = new ServerRfSessionImpl(sessionData, sessionFactory, getServerSessionListener(), getServerContextListener(),
            getStateListener(), messageTimeout, true);

        session.getSessions().get(0).setRequestListener(session);
        appSession = session;
      }
      else if (aClass == ClientRfSession.class) {
        IClientRfSessionData sessionData = (IClientRfSessionData) this.sessionDataFactory.getAppSessionData(ClientRfSession.class, sessionId);
        ClientRfSessionImpl session = new ClientRfSessionImpl(sessionData, sessionFactory, getClientSessionListener(), getClientContextListener(),
            getStateListener(), this.getApplicationId());

        session.getSessions().get(0).setRequestListener(session);
        appSession = session;
      }
      else {
        throw new IllegalArgumentException("Wrong session class: " + aClass + ". Supported[" + ClientRfSession.class + "," + ServerRfSession.class + "]");
      }
    }
    catch (Exception e) {
      logger.error("Failure to obtain new Rf Session.", e);
    }

    return appSession;
  }
914440
def get_app_data(app_id):
    
    try:
        conn = get_conn()
        c = conn.cursor()
        c.execute("SELECT id,name,app_data FROM app WHERE id='{0}' ".format(app_id))
        result = c.fetchone()
        conn.close()

        if result:
            appname = result[1]
            app_data = utils.str2dict( base64.b64decode(result[2]) )

            return (appname,app_data)
        else:
            return (None,None)

    except Exception,e:
        raise RuntimeError('get app data failed! %s' % e)
1019699
public Collection<ApplicationHost> list(long applicationId, List<String> queryParams)
    {
        return HTTP.GET(String.format("/v2/applications/%d/hosts.json", applicationId), null, queryParams, APPLICATION_HOSTS).get();
    }
1155753
public Observable<ServiceResponse<ApplicationInfoResponse>> getWithServiceResponseAsync(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.get(appId, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ApplicationInfoResponse>>>() {
                @Override
                public Observable<ServiceResponse<ApplicationInfoResponse>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<ApplicationInfoResponse> clientResponse = getDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
615898
public Observable<PolicyEventsQueryResultsInner> listQueryResultsForResourceAsync(String resourceId) {
        return listQueryResultsForResourceWithServiceResponseAsync(resourceId).map(new Func1<ServiceResponse<PolicyEventsQueryResultsInner>, PolicyEventsQueryResultsInner>() {
            @Override
            public PolicyEventsQueryResultsInner call(ServiceResponse<PolicyEventsQueryResultsInner> response) {
                return response.body();
            }
        });
    }
570023
private ApplicationDefinition getApplication(String uri, Tenant tenant) {
        if (uri.length() < 2 || uri.startsWith("/_")) {
            return null;    // Non-application request
        }
        String[] pathNodes = uri.substring(1).split("/");
        String appName = Utils.urlDecode(pathNodes[0]);
        ApplicationDefinition appDef = SchemaService.instance().getApplication(tenant, appName);
        if (appDef == null) {
            throw new NotFoundException("Unknown application: " + appName);
        }
        return appDef;
    }
316732
public Collection<ApplicationInstance> list(long applicationId, List<String> queryParams)
    {
        return HTTP.GET(String.format("/v2/applications/%d/instances.json", applicationId), null, queryParams, APPLICATION_INSTANCES).get();
    }
1040355
@Override
  public IRxSessionData getAppSessionData(Class<? extends AppSession> clazz, String sessionId) {
    if (clazz.equals(ClientRxSession.class)) {
      ClientRxSessionDataLocalImpl data = new ClientRxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    else if (clazz.equals(ServerRxSession.class)) {
      ServerRxSessionDataLocalImpl data = new ServerRxSessionDataLocalImpl();
      data.setSessionId(sessionId);
      return data;
    }
    throw new IllegalArgumentException(clazz.toString());
  }
1147136
public Observable<ApplicationSettings> getSettingsAsync(UUID appId) {
        return getSettingsWithServiceResponseAsync(appId).map(new Func1<ServiceResponse<ApplicationSettings>, ApplicationSettings>() {
            @Override
            public ApplicationSettings call(ServiceResponse<ApplicationSettings> response) {
                return response.body();
            }
        });
    }
910472
public Observable<ServiceResponse<Project>> getProjectWithServiceResponseAsync(UUID projectId) {
        if (projectId == null) {
            throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
        }
        if (this.client.apiKey() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
        }
        return service.getProject(projectId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Project>>>() {
                @Override
                public Observable<ServiceResponse<Project>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Project> clientResponse = getProjectDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
445697
Observable<ChatResult> getPreviousMessages(final String conversationId) {

        return persistenceController.getConversation(conversationId)
                .map(conversation -> conversation != null ? conversation.getFirstLocalEventId() : null)
                .flatMap(from -> {

                    final Long queryFrom;

                    if (from != null) {

                        if (from == 0) {
                            return Observable.fromCallable(() -> new ChatResult(true, null));
                        } else if (from > 0) {
                            queryFrom = from - 1;
                        } else {
                            queryFrom = null;
                        }
                    } else {
                        queryFrom = null;
                    }

                    return checkState().flatMap(client -> client.service().messaging().queryMessages(conversationId, queryFrom, messagesPerQuery))
                            .flatMap(result -> persistenceController.processMessageQueryResponse(conversationId, result))
                            .flatMap(result -> persistenceController.processOrphanedEvents(result, orphanedEventsToRemoveListener))
                            .flatMap((Func1<ComapiResult<MessagesQueryResponse>, Observable<ChatResult>>) result -> (result.isSuccessful() && result.getResult().getMessages().isEmpty() && result.getResult().getEarliestEventId() > 0) ?
                                    getPreviousMessages(conversationId) :
                                    Observable.fromCallable(() -> new ChatResult(result.isSuccessful(), result.isSuccessful() ? null : new ChatResult.Error(result))));
                });
    }
849027
@Export
	public Map getMap(String applicationId, String mapId) {
		HashMap<String, Map> application = maps.get(applicationId);
		if (null == application) {
			return null;
		}
		return application.get(mapId);
	}
899402
public Observable<SubscriptionInner> getAsync(String subscriptionId) {
        return getWithServiceResponseAsync(subscriptionId).map(new Func1<ServiceResponse<SubscriptionInner>, SubscriptionInner>() {
            @Override
            public SubscriptionInner call(ServiceResponse<SubscriptionInner> response) {
                return response.body();
            }
        });
    }
439706
public GetAppStreamResponse queryAppStream(GetAppStreamRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getApp(), "The parameter app should NOT be null or empty string.");
        checkStringNotEmpty(request.getStream(), "The parameter stream should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request, LIVE_APP,
                request.getApp(), LIVE_SESSION, request.getStream());
        return invokeHttpClient(internalRequest, GetAppStreamResponse.class);
    }
296705
public Optional<MetricData> metricData(long applicationId, List<String> queryParams)
    {
        return HTTP.GET(String.format("/v2/mobile_applications/%d/metrics/data.json", applicationId), null, queryParams, METRIC_DATA);
    }
740766
@Override
	public byte[] getAppIdCeil(String appId) {

		int appIdCode = codecer.findId(APP_ID, appId).intValue();
		ByteBuffer byteBuffer = ByteBuffer.allocate(12);
		putUnsignedShort(byteBuffer, appIdCode);
		putUnsignedShort(byteBuffer, Integer.MAX_VALUE);
		putUnsignedShort(byteBuffer, Integer.MAX_VALUE);
		putUnsignedShort(byteBuffer, Integer.MAX_VALUE);
		putUnsignedShort(byteBuffer, Integer.MAX_VALUE);
		putUnsignedShort(byteBuffer, Integer.MAX_VALUE);
		
		return byteBuffer.array();
	}