예제 #1
0
        new public void Init()
        {
            base.Init();

            FieldNotInitializedException.ThrowIfNull(this, ref _accountDao);
            FieldNotInitializedException.ThrowIfNull(this, ref _naasManager);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _adminUserName);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _runtimeUserName);
            FieldNotInitializedException.ThrowIfNull(this, ref _notificationManager);
            FieldNotInitializedException.ThrowIfNull(this, ref _transactionManager);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _securityFlowName);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _securityBulkAddUsersServiceName);

            _adminAccount = _accountDao.GetByName(_adminUserName);

            if (_adminAccount == null)
            {
                throw new ArgumentException(
                          "Admin account not set in the database or its name is not: " +
                          _adminUserName);
            }
            _runtimeAccount = _accountDao.GetByName(_runtimeUserName);

            if (_runtimeAccount == null)
            {
                throw new ArgumentException(
                          "Runtime account not set in the database or its name is not: " +
                          _runtimeUserName);
            }
        }
예제 #2
0
 public void Init()
 {
     if (string.IsNullOrEmpty(_tempFolderPath))
     {
         _tempFolderPath = Path.GetTempPath();
     }
     else
     {
         if (_tempFolderPath.StartsWith(".") || _tempFolderPath.StartsWith("\\") || _tempFolderPath.StartsWith("/"))
         {
             throw new ArgException(string.Format("The setting 'wnos.temp.dir.path' in Deployment.config cannot be a relative or network path: {0}", _tempFolderPath));
         }
     }
     if (!Directory.Exists(_tempFolderPath))
     {
         throw new DirectoryNotFoundException(string.Format("The node temporary folder does not exist: {0}",
                                                            _tempFolderPath));
     }
     if (!Directory.Exists(_logsFolderPath))
     {
         throw new DirectoryNotFoundException(string.Format("The node logs folder does not exist: {0}",
                                                            _logsFolderPath));
     }
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _nodeOrganizationName);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _nodeAdminEmail);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _nodeId);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _endpoint11Url);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _endpoint20Url);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _adminUrl);
     FieldNotInitializedException.ThrowIfNull(this, ref _nodeBoundingBox);
 }
예제 #3
0
        public void Init()
        {
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _repositoryDirectoryPath);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _documentExtension);

            if (!Directory.Exists(_repositoryDirectoryPath))
            {
                throw new DirectoryNotFoundException(string.Format("Repository directory does not exist: \"{0}\"",
                                                                   _repositoryDirectoryPath));
            }

            string testFilePath = Path.Combine(_repositoryDirectoryPath, Guid.NewGuid().ToString());

            try
            {
                LOG.Debug("Configuring DocumentContentManager with: " + _repositoryDirectoryPath);

                LOG.Debug("Writing test file to assure the provider has necessary rights: " + testFilePath);
                File.WriteAllText(testFilePath, DateTime.Now.ToString());

                LOG.Debug("Deleting test file to ensure the provider has necessary rights: " + testFilePath);
                File.Delete(testFilePath);

                LOG.Debug("OK");
            }
            catch (Exception ex)
            {
                FileUtils.SafeDeleteFile(testFilePath);
                throw new UnauthorizedAccessException(string.Format("Repository directory is not writable: \"{0}\"",
                                                                    _repositoryDirectoryPath), ex);
            }
        }
예제 #4
0
        new public void Init()
        {
            base.Init();

            FieldNotInitializedException.ThrowIfNull(this, ref _flowDao);
            FieldNotInitializedException.ThrowIfNull(this, ref _messageBodyFilePaths);
            FieldNotInitializedException.ThrowIfNull(this, ref _fromEmailAddress);
            FieldNotInitializedException.ThrowIfNull(this, ref _notificationDao);

            FieldNotInitializedException.ThrowIfEmptyString(this, ref _smtpHost);
            FieldNotInitializedException.ThrowIfZero(this, ref _smtpPort);
            FieldNotInitializedException.ThrowIfEmptyString(this, ref _adminInterfaceUrl);

            // Make sure all of the files are present
            foreach (KeyValuePair <string, string> pair in MessageBodyFilePaths)
            {
                FieldNotInitializedException.ThrowIfRelativeFileMissing(pair.Value);
            }
        }
예제 #5
0
 public void Init()
 {
     FieldNotInitializedException.ThrowIfNull(this, ref _configManager);
     FieldNotInitializedException.ThrowIfNull(this, ref _compressionHelper);
     FieldNotInitializedException.ThrowIfNull(this, ref _flowDao);
     // If set, use Dao, if not, don't:
     // FieldNotInitializedException.ThrowIfNull(this, ref _pluginDao);
     FieldNotInitializedException.ThrowIfNull(this, ref _compressionHelper);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _pluginConfigFilePath);
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _pluginFolderPath);
     _pluginConfigFilePath = Path.GetFullPath(_pluginConfigFilePath);
     if (!File.Exists(_pluginConfigFilePath))
     {
         throw new FileNotFoundException(string.Format("The plugin config file does not exist: \"{0}\"",
                                                       _pluginConfigFilePath), _pluginConfigFilePath);
     }
     _pluginFolderPath = Path.GetFullPath(_pluginFolderPath);
     if (!Directory.Exists(_pluginFolderPath))
     {
         throw new DirectoryNotFoundException(string.Format("The plugin folder does not exist: \"{0}\"",
                                                            _pluginFolderPath));
     }
 }
예제 #6
0
 public void Init()
 {
     FieldNotInitializedException.ThrowIfEmptyString(this, ref _nodeId);
     FieldNotInitializedException.ThrowIfNull(this, ref _usermgrClient);
 }