@Name("agent") @Required(false) String agent,
@Name("type") @Required(false) String type,
@Name("username") @Required(false) String username,
@Name("email") @Required(false) String email)
throws Exception {
ObjectDatastore datastore = new AnnotationObjectDatastore();
RootFindCommand<Registration> command = datastore.find()
.type(Registration.class)
.addFilter("directoryAgent", FilterOperator.EQUAL, getFirstUrl());
if (agent != null) {
command = command.addFilter("agent", FilterOperator.EQUAL, agent);
}