private void validateUpdateInProgress() throws RegistryException { if (busy) { throw new RegistryException("An update is currently in progress. Please try again " + "later."); } }
public static void process(String path, long snapshotId, UserRegistry registry) throws Exception { try { registry.removeVersionHistory(path, snapshotId); } catch (RegistryException e) { String msg = "Failed to delete the version of the " + snapshotId + " shapshot of " + path + ". " + ((e.getCause() instanceof SQLException) ? "" : e.getMessage()); log.error(msg, e); throw new RegistryException(msg, e); } } }
private void loadJCRSystemConfiguration(UserRegistry userReg,String workspaceRoot) throws RepositoryException{ try { RegistryJCRSpecificStandardLoderUtil.loadJCRSystemConfigs(userReg,workspaceRoot); } catch (RegistryException e) { e.printStackTrace(); // throw new RepositoryException("Registry Exception occurred while creating root node " + e.getMessage()); } }
public static String msgAddingDeploymentUnitToRegistryFailed(String name, RegistryException e) { return format("Adding deployment unit {0} to regstry failed;{1}", name, e.getMessage()); }
public MessageContext process(MessageContext requestMessageContext) throws AxisFault { try { GenericArtifactManager artifactManager = new GenericArtifactManager(governanceSystemRegistry, rxtKey); artifactIDs = artifactManager.getAllGenericArtifactIds(); } catch (RegistryException e) { String msg = e.getMessage(); log.error(msg); throw new AxisFault(msg, e); } return getAbstractResponseMessageContext(requestMessageContext); } }
public static UserRegistry getUserRegistry(HttpServletRequest request) throws RegistryException { UserRegistry userRegistry = (UserRegistry)request.getSession().getAttribute(RegistryConstants.REGISTRY_USER); if (userRegistry == null) { String msg = "User's Registry instance is not found. " + "Users have to login to retrieve a registry instance. "; log.error(msg); throw new RegistryException(msg); } return userRegistry; }
public RegistryManager() { try { if (!registry.resourceExists(CartridgeConstants.DomainMappingInfo.HOSTINFO)) { registry.put(CartridgeConstants.DomainMappingInfo.HOSTINFO, registry.newCollection()); } } catch (RegistryException e) { String msg = "Error while accessing registry or initializing domain mapping registry path\n"; log.error(msg + e.getMessage()); } }
public boolean itemExists(String s) throws RepositoryException { boolean itemEx = true; try { itemEx = userRegistry.resourceExists(s); } catch (RegistryException e) { e.printStackTrace(); } return itemEx; }
public static String computeSLAPathWithVersion(String path, String version) throws RegistryException { if (!version.matches(CommonConstants.SERVICE_VERSION_REGEX)) { String msg = "The specified sla version " + version + " is invalid. " + "The requested path to store the sla: " + path + "."; log.error(msg); throw new RegistryException(msg); } return path + RegistryConstants.PATH_SEPARATOR + version.replace(".", RegistryConstants.PATH_SEPARATOR) + RegistryConstants.PATH_SEPARATOR + "sla"; }
public ProfileManager() { RegistryService registryService = JmxTaskServiceComponent.getRegistryService(); TenantRegistryLoader tenantRegistryLoader = JmxTaskServiceComponent.getTenantRegistryLoader(); //get the tenant's registry int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { tenantRegistryLoader.loadTenantRegistry(tenantId); registry = registryService.getGovernanceSystemRegistry(tenantId); } catch (RegistryException e) { log.error("Error obtaining the registry " + e.getMessage(), e); } }
public static Resource getResourceById(Registry repository, String resourceId){ Resource resource = null; try { resource = repository.get(getPathById(resourceId)); } catch (RegistryException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } return resource; }
public static String computeProcessPathWithVersion(String path, String version) throws RegistryException { if (!version.matches(CommonConstants.SERVICE_VERSION_REGEX)) { String msg = "The specified process version " + version + " is invalid. " + "The requested path to store the process: " + path + "."; log.error(msg); throw new RegistryException(msg); } return path + RegistryConstants.PATH_SEPARATOR + version.replace(".", RegistryConstants.PATH_SEPARATOR) + RegistryConstants.PATH_SEPARATOR + "process"; }
public static SearchResultsBean populate(UserRegistry userRegistry, String searchType, String criteria) { SearchResultsBean searchResultsBean = new SearchResultsBean(); try { if (searchType.equalsIgnoreCase("Tag")) { searchResultsBean.setResourceDataList(searchByTags(criteria, userRegistry)); } else { searchResultsBean.setResourceDataList(searchByContent(criteria, userRegistry)); } } catch (RegistryException e) { String msg = "Failed to generate search results. " + e.getMessage(); searchResultsBean.setErrorMessage(msg); } return searchResultsBean; }
public void removeItem(String s) throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException { try { if (userRegistry.resourceExists(s)) { userRegistry.delete(s); } else { throw new PathNotFoundException("No such path exists" + s); } } catch (RegistryException e) { e.printStackTrace(); } }
public byte[] getFileContent(String path) throws RegistryException { File file = new File(baseDir, path); try { return FileUtils.readFileToByteArray(file); } catch (IOException e) { throw new RegistryException("Unable to read file at path: " + file.getAbsolutePath(), e); } }
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException { try { if (!(registrySession.getUserRegistry().resourceExists(nodePath))) { throw new InvalidItemStateException("Unable to save the node at" + nodePath); } } catch (RegistryException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } }
public void createDirectory(String path) throws RegistryException { File directory = new File(baseDir, path); if (directory.exists()) { return; } try { FileUtils.forceMkdir(directory); } catch (IOException e) { throw new RegistryException("Unable to create directory at path: " + directory.getAbsolutePath(), e); } }
public void initColl(String np) { try { resource = (CollectionImpl) registrySession.getUserRegistry().newCollection(); resource.setPath(np); } catch (RegistryException e) { e.printStackTrace(); } }
public static UserRegistry getUserRegistry( RegistryService registryService, HttpServletRequest request) throws RegistryException { UserRegistry registry = (UserRegistry) request.getSession().getAttribute(RegistryConstants.USER_REGISTRY); if (registry == null) { String msg = "User's Registry instance is not found. " + "Users have to login to retrieve a registry instance. "; log.error(msg); throw new RegistryException(msg); } return registry; }
private String getAbsoluteSchemaURL(String schemaLocation) throws RegistryException { if (schemaLocation != null && baseURI != null) { try { URI uri = new URI(baseURI); URI absoluteURI = uri.resolve(schemaLocation); return absoluteURI.toString(); } catch (URISyntaxException e) { throw new RegistryException(e.getMessage(), e); } } return schemaLocation; }