private void validateUpdateInProgress() throws RegistryException { if (busy) { throw new RegistryException("An update is currently in progress. Please try again " + "later."); } }
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 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 boolean itemExists(String s) throws RepositoryException { boolean itemEx = true; try { itemEx = userRegistry.resourceExists(s); } catch (RegistryException e) { e.printStackTrace(); } return itemEx; }
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 copy(String source, String destination) throws RegistryException { File sourceFile = new File(baseDir, source); File destinationFile = new File(baseDir, destination); try { FileUtils.copyFile(sourceFile, destinationFile); } catch (IOException e) { throw new RegistryException("Unable to copy file at path: " + sourceFile.getAbsolutePath() + " to path: " + destinationFile.getAbsolutePath(),e); } }
public Object getContent() throws RegistryException { try { if (content == null) { // fetch data only if it hasn't been fetched previously content = filesystemManager.getFileContent(filePath); } return content; } catch (Exception e) { throw new RegistryException("Failed to get resource content", e); } } }
public void addAssociation(String resourcePath, String targetPath, String associationType) throws RegistryException { try { stub.addAssociation(resourcePath,targetPath,associationType); } catch (Exception e) { String msg = "Failed to perform addAssociation operation."; log.error(msg, e); throw new RegistryException(msg, e); } }
public void removeTag(String path,String tag) throws RegistryException { try { stub.removeTag(path,tag); } catch (Exception e) { String msg = "Failed to perform removeTag operation."; log.error(msg, e); throw new RegistryException(msg, e); } } public String addComment(String resourcePath, Comment comment) throws RegistryException {
public void createLink(String path, String target) throws RegistryException { try { stub.createLinkWithSubTarget(path, target, null); } catch (Exception e) { String msg = "Failed to perform createLink operation."; log.error(msg, e); throw new RegistryException(msg, e); } }
public void createLink(String path, String target, String subTargetPath) throws RegistryException { try { stub.createLinkWithSubTarget(path, target, subTargetPath); } catch (Exception e) { String msg = "Failed to perform createLink operation."; log.error(msg, e); throw new RegistryException(msg, e); } }
public void removeLink(String path) throws RegistryException { try { stub.removeLink(path); } catch (Exception e) { String msg = "Failed to perform removeLink operation."; log.error(msg, e); throw new RegistryException(msg, e); } } public String getEventingServiceURL(String path) throws RegistryException {
public void setEventingServiceURL(String path, String serviceURL) throws RegistryException { try { stub.setEventingServiceURL(path,serviceURL); } catch (Exception e) { String msg = "Failed to perform setEventingServiceURL operation."; log.error(msg, e); throw new RegistryException(msg, e); } }
public void removeComment(String comment) throws RegistryException { try { stub.removeComment(comment); } catch (Exception e) { String msg = "Failed to perform removeComment operation."; log.error(msg, e); throw new RegistryException(msg, e); } }
private static List<OMElement> getOmElements(OMElement serviceElement) throws RegistryException { List<OMElement> serviceEndpointEntryElements; try { serviceEndpointEntryElements = evaluateXPathToElements(SERVICE_ENDPOINT_ENTRY_EXPR, serviceElement); } catch (Exception e) { String msg = "Error in evaluating xpath expressions to extract endpoints"; log.error(msg, e); throw new RegistryException(msg, e); } return serviceEndpointEntryElements; }
public static void validateOMContent(OMElement element) throws RegistryException { if(!validateOMContent(element, getLifecycleSchemaValidator(getLifecycleSchemaLocation()))){ String message = "Unable to validate the lifecycle configuration"; log.error(message); throw new RegistryException(message); } }
private void checkWriteLock(String path, RequestContext requestContext) throws RegistryException { String owner; if ((owner = checkRetentionLock(requestContext.getRegistry(), path, CommonConstants.RETENTION_WRITE_LOCKED_PROP_NAME)) != null) { requestContext.setProcessingComplete(true); throw new RegistryException("Resource Retention does not allow this operation. " + "Resource at path " + path + " is write locked by " + owner); } }
private void checkDeleteLock(String path, RequestContext requestContext) throws RegistryException { String owner; if ((owner = checkRetentionLock(requestContext.getRegistry(), path, CommonConstants.RETENTION_DELETE_LOCKED_PROP_NAME)) != null) { requestContext.setProcessingComplete(true); throw new RegistryException("Resource Retention does not allow this operation. " + "Resource at path: " + path + " is delete locked by " + owner); } }
public static void updateMediaType(UserRegistry userRegistry, String path, String mediaType) throws RegistryException { try { Resource currentResource = userRegistry.get(path); currentResource.setMediaType(mediaType); userRegistry.put(path, currentResource); } catch (RegistryException e) { throw new RegistryException("Failed to update media type of the resource : "+path); } } }