diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainPortsDefPanel.java --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainPortsDefPanel.java Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainPortsDefPanel.java Wed Mar 19 12:49:04 2008 -0700 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -48,6 +48,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import org.netbeans.modules.j2ee.sun.ide.j2ee.PlatformValidator; import org.openide.WizardDescriptor; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; @@ -66,6 +67,8 @@ public class AddDomainPortsDefPanel impl */ private CreateServerVisualPanel component; private WizardDescriptor wiz; + private PlatformValidator pv; + private String serverVersion; // private TargetServerData targetData; /** Create the wizard panel descriptor. */ @@ -96,28 +99,36 @@ public class AddDomainPortsDefPanel impl Set portsUsed = new HashSet(7); portsUsed.add(component.getAdminPort()); - if (isPortReused(portsUsed, component.getAdminJmxPort(), "ERR_AdminJmxPort")) + if (isPortReused(portsUsed, component.getAdminJmxPort(), "ERR_AdminJmxPort")) // NOI18N return false; - if (isPortReused(portsUsed, component.getInstanceHttpPort(), "ERR_InstancePort")) + if (isPortReused(portsUsed, component.getInstanceHttpPort(), "ERR_InstancePort")) // NOI18N return false; - if (isPortReused(portsUsed, component.getJmsPort(), "ERR_JmsPort")) + if (isPortReused(portsUsed, component.getJmsPort(), "ERR_JmsPort")) // NOI18N return false; - if (isPortReused(portsUsed,component.getOrbPort(), "ERR_OrbListenerPort")) + if (isPortReused(portsUsed,component.getOrbPort(), "ERR_OrbListenerPort")) // NOI18N return false; - if (isPortReused(portsUsed,component.getHttpSslPort(), "ERR_HttpSslPort")) + if (isPortReused(portsUsed,component.getHttpSslPort(), "ERR_HttpSslPort")) // NOI18N return false; - if (isPortReused(portsUsed,component.getOrbSslPort(), "ERR_OrbSslPort")) + if (isPortReused(portsUsed,component.getOrbSslPort(), "ERR_OrbSslPort")) // NOI18N return false; - if (isPortReused(portsUsed,component.getOrbMutualAuthPort(), "ERR_OrbMutualAutPort")) + if (isPortReused(portsUsed,component.getOrbMutualAuthPort(), "ERR_OrbMutualAutPort")) // NOI18N return false; + if (PlatformValidator.SAILFIN_V1.equals(serverVersion)) { + if (isPortReused(portsUsed,component.getSipPort(), "ERR_SipPort")) // NOI18N + return false; + + if (isPortReused(portsUsed,component.getSipSslPort(), "ERR_SipSslPort")) // NOI18N + return false; + } + wiz.putProperty(AddDomainWizardIterator.ADMIN_JMX_PORT, component.getAdminJmxPort().toString()); wiz.putProperty(AddDomainWizardIterator.HTTP_SSL_PORT, @@ -135,11 +146,21 @@ public class AddDomainPortsDefPanel impl wiz.putProperty(AddDomainWizardIterator.PORT, component.getAdminPort().toString()); + // these values are ignored for non-sailfin platforms... + wiz.putProperty(AddDomainWizardIterator.SIP_PORT, + component.getSipPort().toString()); + wiz.putProperty(AddDomainWizardIterator.SIP_SSL_PORT, + component.getSipSslPort().toString()); + wiz.putProperty(AddDomainWizardIterator.PROP_ERROR_MESSAGE,null); wiz.putProperty(AddDomainWizardIterator.HOST,"localhost"); //NOI18N return true; } + void setPlatformValidator(PlatformValidator pv, String serverVersion) { + this.pv = pv; + this.serverVersion = serverVersion; + } private boolean isPortReused(Set portsUsed, Object newVal, String id) { if (portsUsed.contains(newVal)) { @@ -184,6 +205,9 @@ public class AddDomainPortsDefPanel impl // to store information entered by the user. public void readSettings(Object settings) { wiz = (WizardDescriptor) settings; + // todo : correct this after late change is approved... + //component.includeSip(PlatformValidator.SAILFIN_V1.equals(serverVersion)); + component.includeSip(false); } public void storeSettings(Object settings) { } diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainWizardIterator.java --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainWizardIterator.java Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/AddDomainWizardIterator.java Wed Mar 19 12:49:04 2008 -0700 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -105,6 +105,8 @@ public class AddDomainWizardIterator imp final static String HTTP_SSL_PORT = "http_ssl_port"; //NOI18N final static String ORB_MUTUAL_AUTH_PORT = "orb_mutual_auth_port"; //NOI18N final static String ADMIN_JMX_PORT = "admin_jmx_port"; //NOI18N + final static String SIP_PORT = "sip_port"; //NOI18N + final static String SIP_SSL_PORT = "sip_ssl_port"; //NOI18N final static String PROP_ERROR_MESSAGE = "WizardPanel_errorMessage"; // NOI18N final static String TYPE = "type"; //NOI18N final static String PROP_DISPLAY_NAME = "ServInstWizard_displayName"; // NOI18N @@ -145,6 +147,7 @@ public class AddDomainWizardIterator imp public AddDomainWizardIterator(PlatformValidator pv, String serverVersion) { platformPanel.setPlatformValidator(pv, serverVersion); + portsPanel.setPlatformValidator(pv,serverVersion); } /** @@ -423,6 +426,7 @@ public class AddDomainWizardIterator imp this.pword = pword; } + @Override public void run() { Process process = null; // attempt to do the domian/instance create HERE @@ -468,7 +472,11 @@ public class AddDomainWizardIterator imp ":orb.mutualauth.port="+ //NOI18N ((String)wizard.getProperty(ORB_MUTUAL_AUTH_PORT)).trim()+ ":domain.jmxPort="+ //NOI18N - ((String)wizard.getProperty(ADMIN_JMX_PORT)).trim(), + ((String)wizard.getProperty(ADMIN_JMX_PORT)).trim()+ + ":sip.port="+ //NOI18N + ((String)wizard.getProperty(SIP_PORT)).trim()+ + ":sip.ssl.port="+ //NOI18N + ((String)wizard.getProperty(SIP_SSL_PORT)).trim(), domain }; Integer detectedVersion = @@ -600,6 +608,7 @@ public class AddDomainWizardIterator imp passwordField.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AdminAuthenticator.class).getString("ACSD_PasswordField")); } + @Override public java.awt.Dimension getPreferredSize() { java.awt.Dimension sup = super.getPreferredSize(); return new java.awt.Dimension( Math.max(sup.width, DEFAULT_WIDTH), Math.max(sup.height, DEFAULT_HEIGHT )); diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle.properties --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle.properties Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/Bundle.properties Wed Mar 19 12:49:04 2008 -0700 @@ -194,6 +194,8 @@ ERR_HttpSslPort=HTTPS Port has duplicate ERR_HttpSslPort=HTTPS Port has duplicate value ERR_OrbSslPort=ORB SSL Port has duplicate value ERR_OrbMutualAutPort=ORB MutualAuth Port has duplicate value +ERR_SipPort=SIP Port has duplicate value +ERR_SipSslPort=SIP SSL Port has duplicate value MNEM_AdminJmxPort= LBL_AdminJmxPort_Mnemonic=A @@ -488,3 +490,5 @@ Msg_Utf8Required=Cannot create a domain Msg_Utf8Required=Cannot create a domain that includes multibyte characters in its name MSG_COULD_NOT_CREATE_INSTANCE=Could not create instance. +LBL_SipPort=SIP Po&rt: +LBL_SipSslPort=SIP SS&L Port: diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.form --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.form Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.form Wed Mar 19 12:49:04 2008 -0700 @@ -1,6 +1,6 @@ -
+ @@ -19,7 +19,10 @@ + + + @@ -222,7 +225,7 @@ - + @@ -422,7 +425,7 @@ - + @@ -482,6 +485,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.java --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.java Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/CreateServerVisualPanel.java Wed Mar 19 12:49:04 2008 -0700 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -78,6 +78,10 @@ public class CreateServerVisualPanel ext new javax.swing.SpinnerNumberModel(0,0,65535,1); private static javax.swing.SpinnerNumberModel orbMutualauthPortValue = new javax.swing.SpinnerNumberModel(0,0,65535,1); + private static javax.swing.SpinnerNumberModel sipPortValue = + new javax.swing.SpinnerNumberModel(0,0,65535,1); + private static javax.swing.SpinnerNumberModel sipSslPortValue = + new javax.swing.SpinnerNumberModel(0,0,65535,1); /** Create the wizard panel and set up some basic properties. */ public CreateServerVisualPanel() { @@ -90,6 +94,8 @@ public class CreateServerVisualPanel ext orbSslPortValue.addChangeListener(tmp); orbMutualauthPortValue.addChangeListener(tmp); adminPortValue.addChangeListener(tmp); + sipPortValue.addChangeListener(tmp); + sipSslPortValue.addChangeListener(tmp); initComponents(); // XXX picking defaults isn't safe... but it is the best we have for the moment. @@ -101,7 +107,9 @@ public class CreateServerVisualPanel ext orbPortValue.setValue(new Integer(3700+incr)); httpsPortValue.setValue(new Integer(8181+incr)); orbSslPortValue.setValue(new Integer(3820+incr)); - orbMutualauthPortValue.setValue(new Integer(3920+incr)); + orbMutualauthPortValue.setValue(new Integer(3920+incr)); + sipPortValue.setValue(new Integer(5060+incr)); + sipSslPortValue.setValue(new Integer(5061+incr)); // Provide a name in the title bar. setName(NbBundle.getMessage(CreateServerVisualPanel.class, "TITLE_ServerPortProperties")); @@ -140,6 +148,13 @@ public class CreateServerVisualPanel ext return httpsPortValue.getNumber(); } + Number getSipSslPort() { + return sipSslPortValue.getNumber(); + } + Number getSipPort() { + return sipPortValue.getNumber(); + } + // Event handling // private final Set/**/ listeners = new HashSet/**/(1); @@ -163,6 +178,13 @@ public class CreateServerVisualPanel ext ((ChangeListener)it.next()).stateChanged(ev); } } + + void includeSip(boolean b) { + sipPortLbl.setVisible(b); + sipPort.setVisible(b); + sipSslPortLbl.setVisible(b); + sipSslPort.setVisible(b); + } private class PortSetter implements javax.swing.event.ChangeListener { public void stateChanged(javax.swing.event.ChangeEvent ce) { @@ -175,7 +197,7 @@ public class CreateServerVisualPanel ext * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ - // //GEN-BEGIN:initComponents + // //GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; @@ -196,6 +218,10 @@ public class CreateServerVisualPanel ext orbMutualauthPort = new javax.swing.JSpinner(); adminPortLbl = new javax.swing.JLabel(); adminPort = new javax.swing.JSpinner(); + sipPortLbl = new javax.swing.JLabel(); + sipPort = new javax.swing.JSpinner(); + sipSslPortLbl = new javax.swing.JLabel(); + sipSslPort = new javax.swing.JSpinner(); spacingHack = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); @@ -292,7 +318,6 @@ public class CreateServerVisualPanel ext gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; - gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 3); @@ -393,7 +418,6 @@ public class CreateServerVisualPanel ext orbMutualauthPort.setPreferredSize(null); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; - gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0); @@ -427,6 +451,38 @@ public class CreateServerVisualPanel ext portConfPanel.add(adminPort, gridBagConstraints); adminPort.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CreateServerVisualPanel.class, "ACSN_adminPort")); // NOI18N adminPort.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CreateServerVisualPanel.class, "ACSD_AdminPort")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(sipPortLbl, org.openide.util.NbBundle.getMessage(CreateServerVisualPanel.class, "LBL_SipPort")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 8; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 3); + portConfPanel.add(sipPortLbl, gridBagConstraints); + + sipPort.setModel(sipPortValue); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 8; + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0); + portConfPanel.add(sipPort, gridBagConstraints); + + org.openide.awt.Mnemonics.setLocalizedText(sipSslPortLbl, org.openide.util.NbBundle.getMessage(CreateServerVisualPanel.class, "LBL_SipSslPort")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 3); + portConfPanel.add(sipSslPortLbl, gridBagConstraints); + + sipSslPort.setModel(sipSslPortValue); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0); + portConfPanel.add(sipSslPort, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -482,6 +538,10 @@ public class CreateServerVisualPanel ext private javax.swing.JSpinner orbSslPort; private javax.swing.JLabel orbSslPortLbl; private javax.swing.JPanel portConfPanel; + private javax.swing.JSpinner sipPort; + private javax.swing.JLabel sipPortLbl; + private javax.swing.JSpinner sipSslPort; + private javax.swing.JLabel sipSslPortLbl; private javax.swing.JLabel spacingHack; // End of variables declaration//GEN-END:variables diff -r 44c8fd88cd59 j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/DomainCreator.java --- a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/DomainCreator.java Tue Mar 18 16:56:20 2008 -0700 +++ b/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/ui/DomainCreator.java Wed Mar 19 12:49:04 2008 -0700 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -51,7 +51,6 @@ import org.netbeans.modules.j2ee.sun.ide import org.netbeans.modules.j2ee.sun.ide.dm.SunDeploymentManager; import org.netbeans.modules.j2ee.sun.ide.j2ee.PluginProperties; import org.netbeans.modules.j2ee.sun.ide.j2ee.Utils; -import org.netbeans.modules.j2ee.sun.ide.j2ee.ui.AddDomainWizardIterator; import org.openide.ErrorManager; import org.openide.WizardDescriptor; import org.openide.WizardDescriptor.Panel; @@ -83,6 +82,8 @@ public final class DomainCreator { private final static int DEFAULT_HTTPS_PORT = 8181; private final static int DEFAULT_ORB_SSL_PORT = 3820; private final static int DEFAULT_ORB_MUTUALAUTH_PORT = 3920; + private static int DEFAULT_SIP_PORT = 5060; + private static int DEFAULT_SIP_SSL_PORT = 5061; // properties @@ -100,9 +101,10 @@ public final class DomainCreator { private final static String PROP_HTTP_SSL_PORT = "http_ssl_port"; // NOI18N private final static String PROP_ORB_MUTUAL_AUTH_PORT = "orb_mutual_auth_port"; // NOI18N private final static String PROP_ADMIN_JMX_PORT = "admin_jmx_port"; // NOI18N + private final static String PROP_SIP_PORT = "sip_port"; // NOI18N + private final static String PROP_SIP_SSL_PORT = "sip_ssl_port"; // NOI18N private final static String PROP_TYPE = "type"; // NOI18N private final static String PROP_DISPLAY_NAME = "ServInstWizard_displayName"; // NOI18N - private WizardDescriptor wizardDescriptor; private AddDomainWizardIterator wizard; @@ -187,11 +189,14 @@ public final class DomainCreator { int orbSSLPort = DEFAULT_ORB_SSL_PORT + bucket; int orbMAPort = DEFAULT_ORB_MUTUALAUTH_PORT + bucket; int jmxPort = DEFAULT_JMX_PORT + bucket; + int sipPort = DEFAULT_SIP_PORT + bucket; + int sipSslPort = DEFAULT_SIP_SSL_PORT + bucket; - while (!isPortAvaibale(adminPort) || !isPortAvaibale(httpPort) - || !isPortAvaibale(jmsPort) || !isPortAvaibale(orbPort) - || !isPortAvaibale(httpsPort) || !isPortAvaibale(orbSSLPort) - || !isPortAvaibale(orbMAPort) || !isPortAvaibale(jmxPort)) { + while (!isPortAvailable(adminPort) || !isPortAvailable(httpPort) + || !isPortAvailable(jmsPort) || !isPortAvailable(orbPort) + || !isPortAvailable(httpsPort) || !isPortAvailable(orbSSLPort) + || !isPortAvailable(orbMAPort) || !isPortAvailable(jmxPort) + || !isPortAvailable(sipPort) || !isPortAvailable(sipSslPort)) { int incr = (new Random()).nextInt(100)+1; adminPort += incr; httpPort += incr; @@ -232,6 +237,8 @@ public final class DomainCreator { factory.setProperty(PROP_ORB_SSL_PORT, String.valueOf(orbSSLPort)); factory.setProperty(PROP_ORB_MUTUAL_AUTH_PORT, String.valueOf(orbMAPort)); factory.setProperty(PROP_ADMIN_JMX_PORT, String.valueOf(jmxPort)); + factory.setProperty(PROP_SIP_PORT, String.valueOf(sipPort)); + factory.setProperty(PROP_SIP_SSL_PORT, String.valueOf(sipSslPort)); factory.setProperty(PROP_TYPE, AddDomainWizardIterator.PERSONAL); if (jmxPort < 0xffff) { @@ -240,7 +247,7 @@ public final class DomainCreator { } } else { ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, - NbBundle.getMessage(DomainCreator.class, "MSG_DomainDirWriteProtect", + NbBundle.getMessage(DomainCreator.class, "MSG_DomainDirWriteProtect", // NOI18N domainRoot.getParentFile().getAbsolutePath())); } } @@ -271,7 +278,7 @@ public final class DomainCreator { * * @return true if the port is free or false when is being used */ - private static boolean isPortAvaibale(int port) { + private static boolean isPortAvailable(int port) { String host = DEFAULT_HOST; boolean retVal = true; Socket socket = null;