private void persistServiceResource(Registry registry, Resource resource, String servicePath) throws RegistryException { registry.put(servicePath, resource); }
private void persistServiceResource(Registry registry, Resource resource, String servicePath) throws RegistryException { registry.put(servicePath, resource); }
/** * Method that gets called instructing a schema to be added the registry. * * @param context the request context for this request. * @param path the path to add the resource to. * @param url the path from which the resource was imported from. * @param resource the resource to be added. * @param registry the registry instance to use. * * @throws RegistryException if the operation failed. */ protected void addSchemaToRegistry(RequestContext context, String path, String url, Resource resource, Registry registry) throws RegistryException { registry.put(path, resource); }
/** * Method that gets called instructing a WSDL to be added the registry. * * @param context the request context for this request. * @param path the path to add the resource to. * @param url the path from which the resource was imported from. * @param resource the resource to be added. * @param registry the registry instance to use. * * @throws RegistryException if the operation failed. */ protected void addWSDLToRegistry(RequestContext context, String path, String url, Resource resource, Registry registry) throws RegistryException { registry.put(path, resource); }
/** * Method to make an aspect to default. * @param path path of the resource * @param aspect the aspect to be removed. * @param registry registry instance to be used */ public static void setDefaultLifeCycle(String path, String aspect, Registry registry) throws RegistryException { Resource resource = registry.get(path); if(resource != null) { resource.setProperty("registry.LC.name", aspect); registry.put(path, resource); } }
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 void init() { try { Registry registry = Utils.getRegistryService().getSystemRegistry(); if (!registry.resourceExists(shutterbugHome)) { Collection col = registry.newCollection(); registry.put(shutterbugHome, col); } } catch (Exception e) { log.error("An error occured while initializing the Shutterbug Collection Handler", e); } }
/** * Creates a collection in the given common location. * * @param commonLocation location to create the collection. * @throws RegistryException If fails to create a collection at given location. */ private void createCollection(String commonLocation) throws RegistryException { Registry systemRegistry = CommonUtil.getUnchrootedSystemRegistry(requestContext); //Creating a collection if not exists. if (!systemRegistry.resourceExists(commonLocation)) { systemRegistry.put(commonLocation, systemRegistry.newCollection()); } }
private void addLatestArchiveToRegistryCollection(BPELDeploymentContext bpelDeploymentContext) throws FileNotFoundException, RegistryException { Resource latestBPELArchive = configRegistry.newResource(); FileInputStream stream = new FileInputStream(bpelDeploymentContext.getBpelArchive()); latestBPELArchive.setContent(stream); configRegistry.put(BPELPackageRepositoryUtils. getBPELPackageArchiveResourcePath(bpelDeploymentContext.getBpelPackageName()), latestBPELArchive); }
/** * Remove a property from a GREG node */ public static void removeProperty(Registry repository,Resource resource, PropertyData<?> propertyData) throws RegistryException { String id = propertyData.getId(); if(resource.getPropertyValues(id) != null ){ //has property resource.removeProperty(id); repository.put(resource.getPath(), resource); } }
private void persistPolicy(AxisService service, OMElement policy, String policyID) throws RegistryException { //Registry registryToLoad = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(); Resource resource = registry.newResource(); resource.setContent(policy.toString()); String servicePath = getRegistryServicePath(service); String policyResourcePath = servicePath + RegistryResources.POLICIES + policyID; registry.put(policyResourcePath, resource); }
private void persistPolicy(AxisService service, OMElement policy, String policyID) throws RegistryException { //Registry registryToLoad = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(); Resource resource = registry.newResource(); resource.setContent(policy.toString()); String servicePath = getRegistryServicePath(service); String policyResourcePath = servicePath + RegistryResources.POLICIES + policyID; registry.put(policyResourcePath, resource); }
private void persistPolicy(AxisService service, OMElement policy, String policyID) throws RegistryException { //Registry registryToLoad = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(); Resource resource = registry.newResource(); resource.setContent(policy.toString()); String servicePath = getRegistryServicePath(service); String policyResourcePath = servicePath + RegistryResources.POLICIES + policyID; registry.put(policyResourcePath, resource); }
public void updateDataRetentionPeriod(TimeRange timeRange) throws BAMException { try { Collection configCollection; if (registry.resourceExists(BAMRegistryResources.GLOBAL_CONFIG_PATH)) { configCollection = (Collection)registry.get(BAMRegistryResources.GLOBAL_CONFIG_PATH); } else { configCollection = registry.newCollection(); } configCollection.setProperty(BAMRegistryResources.DATA_RETENTION_PROPERTY, timeRange.toString()); registry.put(BAMRegistryResources.GLOBAL_CONFIG_PATH, configCollection); } catch (RegistryException e) { String msg = "Could not save the data retention policy in registry"; log.error(msg); throw new BAMException(msg, e); } }
public static void createRegistryResource(String url, Object content) throws RegistryException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); Registry registry = ServiceHolder.getRegistryService().getConfigSystemRegistry(tenantId); Resource resource = registry.newResource(); resource.setContent(content); resource.setMediaType("application/json"); registry.put(url, resource); }
public RegistryFolder createFolder(RegistryFolder parentFolder, String name, Properties properties) { try { Collection node = repository.newCollection(); String destinationPath = CommonUtil.getTargetPathOfNode(parentFolder, name); repository.put(destinationPath, node); Resource resource = repository.get(destinationPath); // compile the properties RegistryFolder.setProperties(repository, resource, getTypeDefinition(), properties); return getGregNode(resource); } catch (RegistryException e) { log.debug(e.getMessage(), e); throw new CmisStorageException(e.getMessage(), e); } }
private static void saveEndpoint(RequestContext context, Registry registry, String url, String associatedPath, Map<String, String> properties, Registry systemRegistry, String environment) throws RegistryException { String pathExpression = getEndpointLocation(context, url, systemRegistry, environment); String urlToPath = deriveEndpointFromUrl(url); String endpointAbsoluteBasePath = RegistryUtils.getAbsolutePath(registry.getRegistryContext(), org.wso2.carbon.registry.core.RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + environment); if (!systemRegistry.resourceExists(endpointAbsoluteBasePath)) { systemRegistry.put(endpointAbsoluteBasePath, systemRegistry.newCollection()); } String relativePath = environment + urlToPath; String endpointAbsolutePath = pathExpression; saveEndpointValues(context, registry, url, associatedPath, properties, systemRegistry, relativePath, endpointAbsolutePath); }
public static boolean putRegistryResource(String path, Resource resource) throws MobileDeviceMgtPluginException { boolean status; try { MobileDeviceManagementUtil.getConfigurationRegistry().beginTransaction(); MobileDeviceManagementUtil.getConfigurationRegistry().put(path, resource); MobileDeviceManagementUtil.getConfigurationRegistry().commitTransaction(); status = true; } catch (RegistryException e) { throw new MobileDeviceMgtPluginException( "Error occurred while persisting registry resource : " + e.getMessage(), e); } return status; }
@Override public void createLink(RequestContext requestContext) throws RegistryException { String symlinkPath = requestContext.getResourcePath().getPath(); String targetResourcePath = requestContext.getTargetPath(); if (requestContext.getRegistry().resourceExists(targetResourcePath)) { Resource r = requestContext.getRegistry().get(targetResourcePath); r.addProperty("registry.resource.symlink.path", symlinkPath); requestContext.getRegistry().put(targetResourcePath, r); } }
public void saveMetadata () throws ReportingException { try { RegistryService registryService = ReportingTemplateComponent.getRegistryService(); Registry registry = registryService.getConfigSystemRegistry(); registry.beginTransaction(); Resource reportFilesResource = registry.newResource(); reportFilesResource.setContent(reportsElement.toString()); String location = ReportConstants.REPORT_META_DATA_PATH + ReportConstants.METADATA_FILE_NAME; registry.put(location, reportFilesResource); registry.commitTransaction(); } catch (RegistryException e) { throw new ReportingException("Exception occured in loading the meta-data of reports", e); } }