FileDocCategorySizeDatePackage
MemorySubscription.javaAPI DocExample4421Thu Jul 08 09:28:10 BST 2004org.apache.struts.webapp.example.memory

MemorySubscription

public final class MemorySubscription extends Object implements org.apache.struts.webapp.example.Subscription

Concrete implementation of {@link Subscription} for an in-memory database backed by an XML data file.

version
$Revision: 1.4 $ $Date: 2004/03/14 06:23:50 $
since
Struts 1.1

Fields Summary
private String
host
The mail host for this subscription.
private MemoryUser
user
The {@link User} with which we are associated.
private boolean
autoConnect
Should we auto-connect at startup time?
private String
password
The password (in clear text) for this subscription.
private String
type
The subscription type ("imap" or "pop3").
private String
username
The username for this subscription.
Constructors Summary
public MemorySubscription(MemoryUser user, String host)

Construct a new Subscription associated with the specified {@link User}.

param
user The user with which we are associated
param
host The mail host for this subscription


        super();
        this.user = user;
        this.host = host;

    
Methods Summary
public booleangetAutoConnect()


       
        return (this.autoConnect);
    
public java.lang.StringgetHost()
The mail host for this subscription.

        return (this.host);
    
public java.lang.StringgetPassword()


       
        return (this.password);
    
public java.lang.StringgetType()


       
        return (this.type);
    
public org.apache.struts.webapp.example.UsergetUser()
The User owning this Subscription.

        return (this.user);
    
public java.lang.StringgetUsername()


       
        return (this.username);
    
public voidsetAutoConnect(boolean autoConnect)

        this.autoConnect = autoConnect;
    
public voidsetPassword(java.lang.String password)

        this.password = password;
    
public voidsetType(java.lang.String type)

        this.type = type;
    
public voidsetUsername(java.lang.String username)

        this.username = username;
    
public java.lang.StringtoString()
Return a String representation of this object.


        StringBuffer sb = new StringBuffer("<subscription host=\"");
        sb.append(host);
        sb.append("\" autoConnect=\"");
        sb.append(autoConnect);
        sb.append("\"");
        if (password != null) {
            sb.append(" password=\"");
            sb.append(password);
            sb.append("\"");
        }
        if (type != null) {
            sb.append(" type=\"");
            sb.append(type);
            sb.append("\"");
        }
        if (username != null) {
            sb.append(" username=\"");
            sb.append(username);
            sb.append("\"");
        }
        sb.append(">");
        return (sb.toString());