use of org.platformlayer.keystone.cli.KeystoneCliContext in project platformlayer by platformlayer.
the class ProjectNameAutoCompleter method doComplete.
@Override
public List<String> doComplete(CliContext context, String prefix) throws Exception {
if (prefix.length() <= 2) {
// Let's avoid returning thousands of projects
return null;
}
KeystoneCliContext keystoneContext = (KeystoneCliContext) context;
UserDatabase userRepository = keystoneContext.getUserRepository();
List<String> userIds = userRepository.listAllProjectNames(prefix);
addSuffix(userIds, " ");
return userIds;
}
use of org.platformlayer.keystone.cli.KeystoneCliContext in project platformlayer by platformlayer.
the class UserNameAutoCompleter method doComplete.
@Override
public List<String> doComplete(CliContext context, String prefix) throws Exception {
if (prefix.length() < 3) {
// Let's avoid returning thousands of users
return null;
}
KeystoneCliContext keystoneContext = (KeystoneCliContext) context;
UserDatabase userRepository = keystoneContext.getUserRepository();
List<String> userIds = userRepository.listAllUserNames(prefix);
addSuffix(userIds, " ");
return userIds;
}
Aggregations