コード例 #1
0
 @Override
 public ApplicationPage doApiCall(Void... params)
     throws AcsApiException, NoInternetException, UnexpectedHttpResponseCodeException {
   ApplicationApiClient applicationApi =
       AcsApiClientFactory.createApplicationApiClient(settingsStore);
   CorrelationDefinitionApiClient correlationDefinitionApi =
       AcsApiClientFactory.createCorrelationDefinitionApiClient(settingsStore);
   ApplicationPage apps = applicationApi.getPage(1, 25);
   CorrelationDefinition corrDef = correlationDefinitionApi.get();
   assStore.update(corrDef);
   boolean modified = CorrelationDefinitionConsistency.cleanup(corrDef, appStore);
   if (modified) {
     corrDef = correlationDefinitionApi.update(corrDef);
     assStore.update(corrDef);
   }
   return apps;
 }
コード例 #2
0
    @Override
    public Boolean doApiCall(Application... params)
        throws AcsApiException, NoInternetException, UnexpectedHttpResponseCodeException {
      app = params[0];
      ApplicationApiClient applicationApi =
          AcsApiClientFactory.createApplicationApiClient(settingsStore);
      CorrelationDefinitionApiClient correlationDefinitionApi =
          AcsApiClientFactory.createCorrelationDefinitionApiClient(settingsStore);

      boolean deleted = applicationApi.delete(app.getId());
      if (deleted) {
        CorrelationDefinition corrDef = assStore.getCorrelationDefinition();
        corrDef.removeAssociationsByApplicationId(app.getId());
        corrDef = correlationDefinitionApi.update(corrDef);
        assStore.update(corrDef);
      }
      return deleted;
    }