private bool ValidToSubmit()
        {
            StorageLinkAdapter adapter = (StorageLinkAdapter)StorageAdapterComboBox.SelectedItem;

            if (adapter == null)
            {
                return(false);
            }
            if (PortNumberTextBox.Text.Trim().Length == 0 && adapter.RequiresPort)
            {
                return(false);
            }
            if (StorageSystemAddress.Length == 0 && adapter.RequiresIPAddress)
            {
                return(false);
            }
            if (StorageSystemUsername.Length == 0 && adapter.RequiresUsername)
            {
                return(false);
            }
            if (StorageSystemPassword.Length == 0 && adapter.RequiresPassword)
            {
                return(false);
            }
            if (StorageSystemNamespace.Length == 0 && adapter.RequiresNamespace)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public StorageLinkJobInfo AddStorageSystem(StorageLinkAdapter adapter, int port, string address, string username, string password, string ns)
        {
            Util.ThrowIfParameterNull(adapter, "adapter");

            managementCredentials cred = new managementCredentials();

            cred.storageAdapterId = adapter.opaque_ref;
            cred.portNumber       = port;
            cred.ipAddress        = address;
            cred.username         = username;
            cred.password         = password;
            cred.ns = ns;

            managementCredentials credInfo = new managementCredentials();

            try
            {
                jobInfo jobInfo = _service.addStorageManagementCredentials(cred, (int)StorageLinkEnums.FlagsType.ASYNC, out credInfo);
                return(GetJobInfo(jobInfo.jobId));
            }
            catch (SoapException e)
            {
                throw ConvertSoapException(e);
            }
        }
        private void UpdateEnablement()
        {
            StorageLinkAdapter adapter = (StorageLinkAdapter)StorageAdapterComboBox.SelectedItem;

            PortNumberLabel.Enabled   = adapter.SupportsPort;
            PortNumberTextBox.Enabled = adapter.SupportsPort;
            IPAddressLabel.Enabled    = adapter.SupportsIPAddress;
            IPAddressTextBox.Enabled  = adapter.SupportsIPAddress;
            UsernameLabel.Enabled     = adapter.SupportsUsername;
            UsernameTextBox.Enabled   = adapter.SupportsUsername;

            PasswordLabel.Enabled    = adapter.SupportsPassword;
            PasswordTextBox.Enabled  = adapter.SupportsPassword;
            NamespaceLabel.Enabled   = adapter.SupportsNamespace;
            NamespaceTextBox.Enabled = adapter.SupportsNamespace;

            if (NamespaceTextBox.Enabled)
            {
                NamespaceTextBox.Text  = !string.IsNullOrEmpty(adapter.DefaultNamespace) ? adapter.DefaultNamespace : "interop";
                PortNumberTextBox.Text = adapter.DefaultPort == 0 ? string.Empty : adapter.DefaultPort.ToString();
                IPAddressLabel.Text    = Messages.ADD_STORAGE_LINK_SYSTEM_CIMOM_IP_ADDRESS_LABEL;
            }
            else
            {
                NamespaceTextBox.Text  = string.Empty;
                PortNumberTextBox.Text = string.Empty;
                IPAddressLabel.Text    = Messages.ADD_STORAGE_LINK_SYSTEM_IP_ADDRESS_LABEL;
            }
        }
        public StorageLinkJobInfo AddStorageSystem(StorageLinkAdapter adapter, int port, string address, string username, string password, string ns)
        {
            Util.ThrowIfParameterNull(adapter, "adapter");

            managementCredentials cred = new managementCredentials();
            cred.storageAdapterId = adapter.opaque_ref;
            cred.portNumber = port;
            cred.ipAddress = address;
            cred.username = username;
            cred.password = password;
            cred.ns = ns;

            managementCredentials credInfo = new managementCredentials();

            try
            {
                jobInfo jobInfo = _service.addStorageManagementCredentials(cred, (int)StorageLinkEnums.FlagsType.ASYNC, out credInfo);
                return GetJobInfo(jobInfo.jobId);
            }
            catch (SoapException e)
            {
                throw ConvertSoapException(e);
            }
        }