/** * Returns Product name of the underlying EIS instance connected through the * ManagedConnection. * * @return Product name of the EIS instance * @throws ResourceException Thrown if an error occurs */ @Override public String getEISProductName() throws ResourceException { return repository.getDescriptor(Repository.REP_NAME_DESC); }
public void printConfiguration(final PrintWriter pw) { // try to get repository final Repository repo = this.repository; writeHeader(pw, "Repository Properties"); final String[] keys = repo.getDescriptorKeys(); Arrays.sort(keys); for (final String key : keys) { final String val = repo.getDescriptor(key); writeEntry(pw, key, val); } }
/** * Returns Product version of the underlying EIS instance connected through * the ManagedConnection. * * @return Product version of the EIS instance * @throws ResourceException Thrown if an error occurs */ @Override public String getEISProductVersion() throws ResourceException { return repository.getDescriptor(Repository.REP_VERSION_DESC); }
/** * Forwards the method call to the underlying repository. */ public String getDescriptor(String key) { return repository.getDescriptor(key); }
static String getClusterNodeId(final Session session) { String clusterNodeId = session.getRepository().getDescriptor("jackrabbit.cluster.id"); if (clusterNodeId == null) { clusterNodeId = DEFAULT_CLUSTER_NODE_ID; } return clusterNodeId; }
@Override public String getDescriptor(String name) { Repository repo = getRepository(); if (repo != null) { return repo.getDescriptor(name); } logger.error("getDescriptor: Repository not available"); return null; }
/** * Returns <code>true</code> if the repository supports observation. * * @param s a session of the repository. * @return <code>true</code> if the repository supports observation. */ private static boolean isObservationSupported(Session s) { return "true".equalsIgnoreCase(s.getRepository().getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED)); }
protected void failOnRepositoryVersions(String... versions) throws RepositoryException { String repositoryVersion = repository.getDescriptor(Repository.REP_VERSION_DESC); for (String version : versions) { if (repositoryVersion.startsWith(version)) { throw new RepositoryException( "Unable to run " + getClass().getName() + " on repository version " + version); } } }
/** * Returns <code>true</code> if the repository supports observation. * * @param s a session of the repository. * @return <code>true</code> if the repository supports observation. */ private static boolean isObservationSupported(Session s) { return "true".equalsIgnoreCase(s.getRepository().getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED)); }
/** * Returns <code>true</code> if the repository supports observation. * * @param s a session of the repository. * @return <code>true</code> if the repository supports observation. */ private static boolean isObservationSupported(Session s) { return "true".equalsIgnoreCase(s.getRepository().getDescriptor(Repository.OPTION_OBSERVATION_SUPPORTED)); }
public static boolean supportsAccessControl(Session session) { String desc = session.getRepository().getDescriptor(Repository.OPTION_ACCESS_CONTROL_SUPPORTED); return Boolean.valueOf(desc); } }
/** * @param repoSession * @return true if the JCR repository supports versioning. */ private static boolean versioningSupported(Session repoSession) { String desc = repoSession.getRepository().getDescriptor(Repository.OPTION_VERSIONING_SUPPORTED); return Boolean.valueOf(desc); } }
public String getClusterNodeId() { String clusteNodeId = session.getRepository().getDescriptor("jackrabbit.cluster.id"); if (clusteNodeId == null) { clusteNodeId = "default"; } return clusteNodeId; }
private static String getClusterNodeId(Session session) { String clusteNodeId = session.getRepository().getDescriptor("jackrabbit.cluster.id"); if (clusteNodeId == null) { clusteNodeId = "default"; } return clusteNodeId; }
/** * Returns <code>true</code> if this repository support a certain optional * feature; otherwise <code>false</code> is returned. If there is no * such <code>descriptorKey</code> present in the repository, this method * also returns false. * * @param descriptorKey the descriptor key. * @return <code>true</code> if the option is supported. * @throws RepositoryException if an error occurs. */ protected boolean isSupported(String descriptorKey) throws RepositoryException { return "true".equals(getHelper().getRepository().getDescriptor(descriptorKey)); }
protected void setUp() throws Exception { super.setUp(); // check for lock support if (Boolean.FALSE.toString().equals(superuser.getRepository().getDescriptor(Repository.OPTION_LOCKING_SUPPORTED))) { throw new NotExecutableException(); } testNode = testRootNode.addNode(nodeName1, testNodeType); testRootNode.getSession().save(); testPath = testNode.getPath(); openScopedLockMultiple = Boolean.TRUE.toString() .equals(getProperty(RepositoryStub.PROP_OPEN_SCOPED_LOCK_MULTIPLE, Boolean.FALSE.toString())); lockMgr = getLockManager(superuser); }
@Test public void testRepository() throws RepositoryException { System.out.println(repository); System.out.println(repository.getDescriptor(Repository.REP_NAME_DESC)); }
public String getRepositoryVersion() { Repository repository = UserSession.get().getJcrSession().getRepository(); if (repository != null) { return repository.getDescriptor(Repository.REP_VERSION_DESC); } else { return "unknown"; } }
public String getRepositoryVendor() { Repository repository = UserSession.get().getJcrSession().getRepository(); if (repository != null) { return repository.getDescriptor(Repository.REP_VENDOR_DESC); } else { return "unknown"; } } }
private String getDescriptor(String key) throws ResourceException { try { return mcf.getRepository().getDescriptor(key); } catch (RepositoryException e) { log("Failed to access the repository", e); ResourceException exception = new ResourceException( "Failed to access the repository: " + e.getMessage()); exception.initCause(e); throw exception; } }