}
public Object createObject(Attributes attributes) {
String host = attributes.getValue("host");
User user = (User) digester.peek();
Subscription subscription = user.createSubscription(host);
String autoConnect = attributes.getValue("autoConnect");
if (autoConnect == null) {
autoConnect = "false";
}
if ("true".equalsIgnoreCase(autoConnect) ||
"yes".equalsIgnoreCase(autoConnect)) {
subscription.setAutoConnect(true);
} else {
subscription.setAutoConnect(false);
}
subscription.setPassword(attributes.getValue("password"));
subscription.setType(attributes.getValue("type"));
subscription.setUsername(attributes.getValue("username"));
return (subscription);
}