protected void unbindFromJndi() { if (jndiName != null && jndiName.trim().length() != 0) { try { InitialContext ic = new InitialContext(); ic.unbind(jndiName); } catch (NoInitialContextException e) { // No JNDI here ... logger.debug("No JNDI found, so not registering '{0}' repository", getName()); } catch (OperationNotSupportedException e) { warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } catch (Exception e) { logger.warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } } }
protected void unbindFromJndi() { if (jndiName != null && jndiName.trim().length() != 0) { try { InitialContext ic = new InitialContext(); ic.unbind(jndiName); } catch (NoInitialContextException e) { // No JNDI here ... logger.debug("No JNDI found, so not registering '{0}' repository", getName()); } catch (OperationNotSupportedException e) { warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } catch (Exception e) { logger.warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } } }
protected void bindIntoJndi() { if (jndiName != null && jndiName.trim().length() != 0) { try { InitialContext ic = new InitialContext(); ic.bind(jndiName, JcrRepository.this); } catch (NoInitialContextException e) { // No JNDI here ... logger.debug("No JNDI found, so not registering '{0}' repository", getName()); } catch (OperationNotSupportedException e) { warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } catch (NamingException e) { logger.error(e, JcrI18n.unableToBindToJndi, config.getName(), jndiName, e.getMessage()); } catch (Exception e) { logger.debug(e, "Error while registering the '{0}' repository from the '{1}' name in JNDI", config.getName(), jndiName); } } }
warn(JcrI18n.enablingDocumentOptimization, name()); threadPoolName = optConfig.getThreadPoolName(); long optInitialTimeInMillis = determineInitialDelay(optConfig.getInitialTimeExpression());
} catch (java.lang.SecurityException e) { if (MISSING_JAAS_POLICIES.add(policyName)) { warn(JcrI18n.loginConfigNotFound, policyName, RepositoryConfiguration.FieldName.SECURITY + "/" + RepositoryConfiguration.FieldName.JAAS_POLICY_NAME, repositoryName()); warn(JcrI18n.loginConfigNotFound, policyName, RepositoryConfiguration.FieldName.SECURITY + "/" + RepositoryConfiguration.FieldName.JAAS_POLICY_NAME, repositoryName());
} catch (java.lang.SecurityException e) { if (MISSING_JAAS_POLICIES.add(policyName)) { warn(JcrI18n.loginConfigNotFound, policyName, RepositoryConfiguration.FieldName.SECURITY + "/" + RepositoryConfiguration.FieldName.JAAS_POLICY_NAME, repositoryName()); warn(JcrI18n.loginConfigNotFound, policyName, RepositoryConfiguration.FieldName.SECURITY + "/" + RepositoryConfiguration.FieldName.JAAS_POLICY_NAME, repositoryName());
warn(JcrI18n.enablingDocumentOptimization, name()); threadPoolName = optConfig.getThreadPoolName(); long optInitialTimeInMillis = determineInitialDelay(optConfig.getInitialTimeExpression());
void execute( String cndFile ) { try { InputStream cndFileStream = getInputStreamForFile(cndFile); if (cndFileStream == null) { repository.warn(JcrI18n.cannotLoadCndFile, cndFile); return; } CndImporter cndImporter = new CndImporter(repository.context()); Problems importProblems = new SimpleProblems(); cndImporter.importFrom(cndFileStream, importProblems, cndFile); for (Problem problem : importProblems) { if (problem.getStatus() == Problem.Status.ERROR) { if (problem.getThrowable() != null) { repository.error(problem.getThrowable(), problem.getMessage(), problem.getParameters()); } else { repository.error(problem.getMessage(), problem.getParameters()); } } else if (problem.getStatus() == Problem.Status.WARNING) { repository.warn(problem.getMessage(), problem.getParameters()); } } if (importProblems.hasErrors()) { return; } this.nodeTypeDefinitions = cndImporter.getNodeTypeDefinitions(); this.namespaces = cndImporter.getNamespaces(); } catch (IOException e) { repository.error(e, JcrI18n.errorReadingCndFile, cndFile); } }
void execute( String cndFile ) { try { InputStream cndFileStream = getInputStreamForFile(cndFile); if (cndFileStream == null) { repository.warn(JcrI18n.cannotLoadCndFile, cndFile); return; } CndImporter cndImporter = new CndImporter(repository.context()); Problems importProblems = new SimpleProblems(); cndImporter.importFrom(cndFileStream, importProblems, cndFile); for (Problem problem : importProblems) { if (problem.getStatus() == Problem.Status.ERROR) { if (problem.getThrowable() != null) { repository.error(problem.getThrowable(), problem.getMessage(), problem.getParameters()); } else { repository.error(problem.getMessage(), problem.getParameters()); } } else if (problem.getStatus() == Problem.Status.WARNING) { repository.warn(problem.getMessage(), problem.getParameters()); } } if (importProblems.hasErrors()) { return; } this.nodeTypeDefinitions = cndImporter.getNodeTypeDefinitions(); this.namespaces = cndImporter.getNamespaces(); } catch (IOException e) { repository.error(e, JcrI18n.errorReadingCndFile, cndFile); } }
protected void bindIntoJndi() { if (jndiName != null && jndiName.trim().length() != 0) { try { InitialContext ic = new InitialContext(); ic.bind(jndiName, JcrRepository.this); } catch (NoInitialContextException e) { // No JNDI here ... logger.debug("No JNDI found, so not registering '{0}' repository", getName()); } catch (OperationNotSupportedException e) { warn(JcrI18n.jndiReadOnly, config.getName(), jndiName); } catch (NamingException e) { logger.error(e, JcrI18n.unableToBindToJndi, config.getName(), jndiName, e.getMessage()); } catch (Exception e) { logger.debug(e, "Error while registering the '{0}' repository from the '{1}' name in JNDI", config.getName(), jndiName); } } }
private boolean projectedPathExists( JcrSession session, RepositoryConfiguration.ProjectionConfiguration projectionCfg ) throws RepositoryException { try { session.getNode(projectionCfg.getProjectedPath()); repository.warn(JcrI18n.projectedPathPointsTowardsInternalNode, projectionCfg, projectionCfg.getSourceName(), projectionCfg.getProjectedPath()); return true; } catch (PathNotFoundException e) { return false; } }
private boolean projectedPathExists( JcrSession session, RepositoryConfiguration.ProjectionConfiguration projectionCfg ) throws RepositoryException { try { session.getNode(projectionCfg.getProjectedPath()); repository.warn(JcrI18n.projectedPathPointsTowardsInternalNode, projectionCfg, projectionCfg.getSourceName(), projectionCfg.getProjectedPath()); return true; } catch (PathNotFoundException e) { return false; } }
private InputStream getInitialContentFileStream( String workspaceName ) { String initialContentFileString = initialContentConfig.getInitialContentFile(workspaceName); InputStream stream = IoUtil.getResourceAsStream(initialContentFileString, repository.environment().getClassLoader(this), null); if (stream == null) { repository.warn(JcrI18n.cannotLoadInitialContentFile, initialContentFileString); } return stream; }
private InputStream getInitialContentFileStream( String workspaceName ) { String initialContentFileString = initialContentConfig.getInitialContentFile(workspaceName); InputStream stream = IoUtil.getResourceAsStream(initialContentFileString, repository.environment().getClassLoader(this), null); if (stream == null) { repository.warn(JcrI18n.cannotLoadInitialContentFile, initialContentFileString); } return stream; }