use of tech.aroma.thrift.Application in project aroma-data-operations by RedRoma.
the class CassandraApplicationRepository method getRecentlyCreated.
@Override
public List<Application> getRecentlyCreated() throws TException {
List<Application> apps = Lists.create();
Statement query = createQueryForRecentlyCreatedApps();
ResultSet results = null;
try {
results = cassandra.execute(query);
} catch (Exception ex) {
LOG.error("Failed to query for recently created apps", ex);
throw new OperationFailedException("Could not get recently created apps: " + ex.getMessage());
}
for (Row row : results) {
Application app = createApplicationFromRow(row);
apps.add(app);
}
LOG.debug("Found {} recently created apps", apps.size());
return apps;
}
use of tech.aroma.thrift.Application in project aroma-data-operations by RedRoma.
the class CassandraApplicationRepository method getApplicationsOwnedBy.
@Override
public List<Application> getApplicationsOwnedBy(String userId) throws TException {
checkThat(userId).throwing(InvalidArgumentException.class).is(validUserId());
Statement query = createQueryForAppsOwnedBy(userId);
ResultSet results;
try {
results = cassandra.execute(query);
} catch (Exception ex) {
LOG.error("Failed to query for Apps owned by {}", userId, ex);
throw new OperationFailedException("Could not determine Apps owned by user: " + userId);
}
List<Application> apps = Lists.create();
for (Row row : results) {
if (row == null) {
continue;
}
Application app = createApplicationFromRow(row);
apps.add(app);
}
LOG.debug("Found {} apps owned by user {}", apps.size(), userId);
return apps;
}
Aggregations