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

DSFields

public class DSFields extends Object implements Serializable

Fields Summary
static final ResourceBundle
bundle
private static String
filename
private transient PropertyChangeSupport
propertySupport
private String
name
private String
JndiName
private String
PoolName
private String
Enabled
private String
Description
private NameValuePair[]
extParams
private String
RegPoolName
Constructors Summary
public DSFields(List ds)
Creates new ServerInstance

    
/*    private String JdbcFactoryClassName;
    private String DatabaseURL;
    private String UserName;
    private String Password;
    private String ResType;
    private ResPool resPoolProperties;
*/    
        
       
        propertySupport = new PropertyChangeSupport ( this );
        
//      JdbcFactoryClassName = "JdbcFactoryClassName";//NOI18N
        PoolName = bundle.getString("Unconfigured");  //NOI18N
        RegPoolName = PoolName;
//        SupportXA = "false";  //NOI18N
        Enabled = "true"; //NOI18N
        Description = "";   //NOI18N
        extParams = new NameValuePair[0];
/*       DatabaseURL = "DatabaseURL";//NOI18N
        UserName = "UserName";//NOI18N
        Password = "Password";//NOI18N
        ResType = "ResourceType";//NOI18N
        resPoolProperties = new ResPool();    
*/   
        //List ds = com.iplanet.ias.tools.forte.globalsettings.IasGlobalOptionsSettings.DEFAULT.getDataSources();
        String t_name = null;
        if(ds.size() != 0){
           int num = ds.size()+1; 
           t_name = "DataSource_" + num;//NOI18N
           boolean exists = DataSourceName(t_name,ds);
           while(exists){
             num++;
             t_name = "DataSource_" + num;//NOI18N
             exists = DataSourceName(t_name,ds);
           }
        }else{
          t_name = "DataSource_1";//NOI18N
        }
        name = t_name;
        JndiName = "jdbc/";//NOI18N
    
Methods Summary
private booleanDataSourceName(java.lang.String value, java.util.List pm1)

      boolean exists = false;  
      //IasGlobalOptionsSettings val1 = new IasGlobalOptionsSettings();
      //List pm1 = com.iplanet.ias.tools.forte.globalsettings.IasGlobalOptionsSettings.DEFAULT.getDataSources();
      //List pm1 = val1.getDataSources();
      for(int i=0; i<pm1.size(); i++){
        //IDSBean instance = val1.getDSInstance(i);
        //IDSBean instance = com.iplanet.ias.tools.forte.globalsettings.IasGlobalOptionsSettings.DEFAULT.getDSInstance(i);
          IDSBean instance = (IDSBean) pm1.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.StringgetDescription()

       return Description;
    
public java.lang.StringgetEnabled()

       return Enabled;
    
public NameValuePair[]getExtParams()

        return extParams;
    
public java.lang.StringgetJndiName()

      return JndiName;
    
public java.lang.StringgetName()

        return name;
    
public java.lang.StringgetPoolName()

        Reporter.info(PoolName + "  " + RegPoolName);  //NOI18N
       return PoolName;
    
public java.lang.StringgetRegPoolName()

        Reporter.info(PoolName + "  " + RegPoolName);  //NOI18N
       return RegPoolName;
    
private voidinitPropertyChangeSupport()

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

    
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)

        initPropertyChangeSupport();
        propertySupport.removePropertyChangeListener (listener);
    
public voidsetDescription(java.lang.String val)

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

        String prev = Enabled;
        this.Enabled = val;
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("Enabled", prev, 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 voidsetJndiName(java.lang.String jndiName)

       String prev = JndiName;
       this.JndiName = jndiName;
       initPropertyChangeSupport();
       propertySupport.firePropertyChange ("JndiName", prev, JndiName);//NOI18N
/*       
       if (JndiName.startsWith("jdbc")) // NOI18N
           setName(JndiName.substring(5));
       else 
 */
           setName(JndiName);
    
public voidsetName(java.lang.String value)

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

        String prev = PoolName;
        this.PoolName = val;
        setRegPoolName(PoolName);
        Reporter.info(PoolName + "  " + RegPoolName);  //NOI18N
        initPropertyChangeSupport();
        propertySupport.firePropertyChange ("PoolName", prev, PoolName);//NOI18N
    
public voidsetRegPoolName(java.lang.String val)

        String prev = RegPoolName;
        int offset = val.indexOf("(");   //NOI18N
        if (offset == -1)
            this.RegPoolName = val;
        else 
            this.RegPoolName = val.substring(0, offset);
        Reporter.info(PoolName + "  " + RegPoolName);  //NOI18N
    
public voidsimpleSetJndiName(java.lang.String value)

        this.JndiName = value;
        setName(JndiName);