public boolean handleAddAssociation(RequestContext requestContext) throws RegistryException { Resource resource = requestContext.getRepository().get(requestContext.getSourcePath()); if (resource != null) { String mType = resource.getMediaType(); if (mType != null && (invert != mType.equals(CommonConstants.ENDPOINT_MEDIA_TYPE))) { return true; } } return false; }
public boolean handleRemoveAssociation(RequestContext requestContext) throws RegistryException { Resource resource = requestContext.getRepository().get(requestContext.getSourcePath()); if (resource != null) { String mType = resource.getMediaType(); if (mType != null && (invert != mType.equals(CommonConstants.ENDPOINT_MEDIA_TYPE))) { return true; } } return false; } }
public String move(RequestContext requestContext) throws RegistryException { Registry registry = requestContext.getRegistry(); String sourcePath = requestContext.getSourcePath(); checkEndpointDependency(registry, sourcePath); return requestContext.getTargetPath(); }
public String copy(RequestContext requestContext) throws RegistryException { validateUpdateInProgress(); String sourcePath = requestContext.getSourcePath(); String targetPath = requestContext.getTargetPath(); if (sourcePath.startsWith(mountPath) && targetPath.startsWith(mountPath)) { filesystemManager.copy(RegistryUtils.getRelativePathToOriginal(sourcePath, mountPath), RegistryUtils.getRelativePathToOriginal(targetPath, mountPath)); } else if (targetPath.startsWith(mountPath)) { preparePut(RegistryUtils.getRelativePathToOriginal(targetPath, mountPath), requestContext); } return null; }
public String move(RequestContext requestContext) throws RegistryException { checkDeleteLock(requestContext.getSourcePath(), requestContext); checkWriteLock(requestContext.getTargetPath(), requestContext); return requestContext.getTargetPath(); }
public String move(RequestContext requestContext) throws RegistryException { validateUpdateInProgress(); String sourcePath = requestContext.getSourcePath(); String targetPath = requestContext.getTargetPath(); if (sourcePath.startsWith(mountPath) && targetPath.startsWith(mountPath)) { String source = RegistryUtils.getRelativePathToOriginal(sourcePath, mountPath); filesystemManager.copy(source, RegistryUtils.getRelativePathToOriginal(targetPath, mountPath)); filesystemManager.delete(source); } else if (targetPath.startsWith(mountPath)) { preparePut(RegistryUtils.getRelativePathToOriginal(targetPath, mountPath), requestContext); } else if (sourcePath.startsWith(mountPath)) { filesystemManager.delete( RegistryUtils.getRelativePathToOriginal(sourcePath, mountPath)); } return null; }
public String rename(RequestContext requestContext) throws RegistryException { validateUpdateInProgress(); String sourcePath = requestContext.getSourcePath(); String targetPath = requestContext.getTargetPath(); String source = RegistryUtils.getRelativePathToOriginal(sourcePath, mountPath); filesystemManager.copy(source, RegistryUtils.getRelativePathToOriginal(targetPath, mountPath)); filesystemManager.delete(source); return null; }
String sourcePath = requestContext.getSourcePath();
String sourcePath = requestContext.getSourcePath();
@Override public final void addAssociation(RequestContext requestContext) throws RegistryException { super.addAssociation(requestContext); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); UserRegistry registry = GovernanceRegistryExtensionsDataHolder.getInstance().getRegistryService() .getGovernanceUserRegistry(tenantDomain); GenericArtifact source = (GenericArtifact) GovernanceUtils.retrieveGovernanceArtifactByPath(registry, getUserRegistryPath(requestContext.getSourcePath())); GenericArtifact target = (GenericArtifact) GovernanceUtils.retrieveGovernanceArtifactByPath(registry, getUserRegistryPath(requestContext.getTargetPath())); onAddAssociation(requestContext.getAssociationType(), source, target); }
@Override public final void removeAssociation(RequestContext requestContext) throws RegistryException { super.removeAssociation(requestContext); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); UserRegistry registry = GovernanceRegistryExtensionsDataHolder.getInstance().getRegistryService() .getGovernanceUserRegistry(tenantDomain); GenericArtifact source = (GenericArtifact) GovernanceUtils.retrieveGovernanceArtifactByPath(registry, getUserRegistryPath(requestContext.getSourcePath())); GenericArtifact target = (GenericArtifact) GovernanceUtils.retrieveGovernanceArtifactByPath(registry, getUserRegistryPath(requestContext.getTargetPath())); onRemoveAssociation(requestContext.getAssociationType(), source, target); }
public void removeAssociation(RequestContext requestContext) throws RegistryException { String path = getPathWithoutVersion(requestContext.getSourcePath()); String relativePath = RegistryUtils.getRelativePath(requestContext.getRegistryContext(), path); if (!sendNotifications(requestContext, relativePath)){
public void addAssociation(RequestContext requestContext) throws RegistryException { String path = getPathWithoutVersion(requestContext.getSourcePath()); String relativePath = RegistryUtils.getRelativePath(requestContext.getRegistryContext(), path); if (!sendNotifications(requestContext, relativePath)){
public String rename(RequestContext requestContext) throws RegistryException { String path = requestContext.getSourcePath(); String relativePath = RegistryUtils.getRelativePath(requestContext.getRegistryContext(), path); if (!sendNotifications(requestContext, relativePath)){
public String copy(RequestContext requestContext) throws RegistryException { String path = requestContext.getSourcePath(); String relativePath = RegistryUtils.getRelativePath(requestContext.getRegistryContext(), path); if (!sendNotifications(requestContext, relativePath)){
public String move(RequestContext requestContext) throws RegistryException { String path = requestContext.getSourcePath(); String relativePath = RegistryUtils.getRelativePath(requestContext.getRegistryContext(), path); if (!sendNotifications(requestContext, relativePath)){