FileDocCategorySizeDatePackage
MailResource.javaAPI DocGlassfish v2 API10581Fri May 04 22:34:56 BST 2007com.sun.enterprise.tools.common.deploy

MailResource

public class MailResource extends Object implements Serializable

Fields Summary
private String
name
private String
Description
private String
JndiName
private String
StoreProtocol
private String
StoreProtocolClass
private String
TransportProtocol
private String
TransportProtocolClass
private String
Host
private String
Enabled
private NameValuePair[]
extParams
private String
User
private String
From
private String
Debug
protected transient PropertyChangeSupport
propertySupport
Constructors Summary
public MailResource(List resources)


       
        propertySupport = new PropertyChangeSupport ( this );
        JndiName = "mail/jndiname"; // NOI18N
        Description = ""; // NOI18N
        StoreProtocol = "imap";//NOI18N
        StoreProtocolClass = "com.sun.mail.imap.IMAPStore";//NOI18N
        TransportProtocol = "smtp";//NOI18N
        TransportProtocolClass = "com.sun.mail.smtp.SMTPTransport";//NOI18N
        Host = "Mail Host"; // NOI18N
 //       LogLevel = "ERROR";
        Enabled = "true"; // NOI18N
 //       extParams = new Vector();
        
        User = "User Name"; // NOI18N
        From = "User Email Address"; // NOI18N
        Debug = "false"; // NOI18N
        
        String resName = "MailResource"; // NOI18N
        String t_name = null;
        if(resources.size() != 0){
           int num = resources.size()+1; 
           t_name = resName + "_" + num;//NOI18N
           boolean resource_exists = FactoryName(t_name, resources);
           while(resource_exists){
             num++;
             t_name = resName + "_" + num;//NOI18N
             resource_exists = FactoryName(t_name, resources);
           }
        }else{
          t_name = resName + "_1";//NOI18N
        }
        name = t_name;
    
Methods Summary
public booleanFactoryName(java.lang.String value, java.util.List resources)

      boolean exists = false;  
      for(int i=0; i<resources.size(); i++){
        IMailResource instance = (IMailResource) resources.get(i);
        String inst = instance.getName();
        if(inst.equals(value))
           exists = true;
      }//for
      return exists;
    
public voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.addPropertyChangeListener (listener);
    
public java.lang.StringgetDebug()

        return Debug;
    
public java.lang.StringgetDescription()

        return Description;
    
public java.lang.StringgetEnabled()

        return Enabled;
    
public NameValuePair[]getExtParams()

        return extParams;
    
public java.lang.StringgetFrom()

        return From;
    
public java.lang.StringgetHost()

        return Host;
    
public java.lang.StringgetJndiName()

        return JndiName;
    
public java.lang.StringgetName()

        return name;
    
public java.lang.StringgetStoreProtocol()

        return StoreProtocol;
    
public java.lang.StringgetStoreProtocolClass()

        return StoreProtocolClass;
    
public java.lang.StringgetTransportProtocol()

        return TransportProtocol;
    
public java.lang.StringgetTransportProtocolClass()

        return TransportProtocolClass;
    
public java.lang.StringgetUser()

        return User;
    
private voidinitPropertyChangeSupport()

         if(propertySupport==null)
         propertySupport = new PropertyChangeSupport ( this );

    
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.removePropertyChangeListener (listener);
    
public voidsetDebug(java.lang.String value)

        String oldValue = Debug;
        this.Debug = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Debug", oldValue, Debug);//NOI18N
    
public voidsetDescription(java.lang.String value)

        String oldValue = Description;
        this.Description = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Description", oldValue, Description);//NOI18N
    
public voidsetEnabled(java.lang.String value)

        String oldValue = Enabled;
        this.Enabled = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Enabled", oldValue, Enabled);//NOI18N
    
public voidsetExtParams(java.lang.Object[] value)

        Reporter.info(new Integer(value.length)); //NOI18N
        NameValuePair[] pairs = new NameValuePair[value.length];
        for (int i = 0; i < value.length; i++) {
            NameValuePair val = (NameValuePair)value[i];
            NameValuePair pair = new NameValuePair();
            pair.setParamName(val.getParamName());
            pair.setParamValue(val.getParamValue());
            pair.setParamDescription(val.getParamDescription());
            Reporter.info(pair.getParamName() + "   " + pair.getParamValue()); //NOI18N
            pairs[i] = pair;
        }
        NameValuePair[] oldValue = extParams;
        this.extParams = pairs;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("extParams", oldValue, extParams);//NOI18N
    
public voidsetFrom(java.lang.String value)

        String oldValue = From;
        this.From = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("From", oldValue, From);//NOI18N
    
public voidsetHost(java.lang.String value)

        String oldValue = Host;
        this.Host = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Host", oldValue, Host);//NOI18N
    
public voidsetJndiName(java.lang.String value)

        String oldValue = JndiName;
        this.JndiName = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("JndiName", oldValue, JndiName);//NOI18N
        setName(JndiName);
    
public voidsetName(java.lang.String value)

        String oldValue = name;
        this.name = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("name", oldValue, name);//NOI18N
    
public voidsetStoreProtocol(java.lang.String value)

        String oldValue = StoreProtocol;
        this.StoreProtocol = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("StoreProtocol", oldValue, StoreProtocol);//NOI18N
    
public voidsetStoreProtocolClass(java.lang.String value)

        String oldValue = StoreProtocolClass;
        this.StoreProtocolClass = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("StoreProtocolClass", oldValue, StoreProtocolClass);//NOI18N
    
public voidsetTransportProtocol(java.lang.String value)

        String oldValue = TransportProtocol;
        this.TransportProtocol = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("TransportProtocol", oldValue, TransportProtocol);//NOI18N
    
public voidsetTransportProtocolClass(java.lang.String value)

        String oldValue = TransportProtocolClass;
        this.TransportProtocolClass = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("TransportProtocolClass", oldValue, TransportProtocolClass);//NOI18N
    
public voidsetUser(java.lang.String value)

        String oldValue = User;
        this.User = value;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("User", oldValue, User);//NOI18N
    
public voidsimpleSetJndiName(java.lang.String value)

        this.JndiName = value;
        setName(JndiName);
    
public java.lang.StringtoString()

        return "name: " + getName() + ", Description: " + getDescription() + ", JndiName: " + // NOI18N
          getJndiName()  + ", Store Protocol: " + getStoreProtocol() + // NOI18N
          ", Store Protocol Class: " + getStoreProtocolClass() + // NOI18N
          ", Transport Protocol: " + getTransportProtocol() + // NOI18N
          ", Transport Protocol Class: " + getTransportProtocolClass() + ", Host: " + // NOI18N
          getHost() + ", User: " + getUser() + ", From: " + getFrom() + // NOI18N
          ", Debug: " + getDebug() + ", Enabled: " + getEnabled(); // NOI18N