use of me.prettyprint.cassandra.model.CqlRows in project sling by apache.
the class AccessControlUtil method getACL.
private String[] getACL(String path) throws Exception {
if (getCassandraSystemNodeACL(path) != null) {
return getCassandraSystemNodeACL(path);
}
String rid = getrowID(path);
createColumnFamily(ACL_CF, provider.getKeyspace(), new StringSerializer());
String getAllACEs = "select * from " + ACL_CF + " where KEY = '" + rid + "'";
QueryResult<CqlRows<String, String, String>> results = CassandraResourceProviderUtil.executeQuery(getAllACEs, provider.getKeyspace(), new StringSerializer());
String policy = null;
for (Row<String, String, String> row : ((CqlRows<String, String, String>) results.get()).getList()) {
for (HColumn column : row.getColumnSlice().getColumns()) {
if ("policy".equalsIgnoreCase(column.getName().toString()) && column.getValue() != null) {
policy = column.getValue().toString();
}
}
}
return policy != null ? policy.split(";") : null;
}
use of me.prettyprint.cassandra.model.CqlRows in project sling by apache.
the class CassandraResourceProviderUtil method logResults.
public static void logResults(QueryResult<CqlRows<String, String, String>> result) {
LOGGER.info("############# RESULT ################");
for (Row<String, String, String> row : ((CqlRows<String, String, String>) result.get()).getList()) {
for (HColumn column : row.getColumnSlice().getColumns()) {
LOGGER.info(column.getValue().toString());
}
LOGGER.info("------------------------------------------------------------------------------------");
}
LOGGER.info("############# RESULT ################");
}
Aggregations