本文整理了Java中org.wso2.carbon.registry.core.Registry.put
方法的一些代码示例,展示了Registry.put
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.put
方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Registry
类名称:Registry
方法名:put
暂无
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
private void persistServiceResource(Registry registry, Resource resource,
String servicePath) throws RegistryException {
registry.put(servicePath, resource);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
private void persistServiceResource(Registry registry, Resource resource,
String servicePath) throws RegistryException {
registry.put(servicePath, resource);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
/**
* 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);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
/**
* 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);
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.api
/**
* 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);
}
}
代码示例来源:origin: org.apache.stratos/org.apache.stratos.adc.mgt
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());
}
}
代码示例来源:origin: org.wso2.greg/org.wso2.carbon.governance.samples.shutterbug
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);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
/**
* 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());
}
}
代码示例来源:origin: org.wso2.carbon.business-process/org.wso2.carbon.bpel
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);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis
/**
* 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);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt
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);
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt
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);
}
代码示例来源:origin: wso2/carbon-identity-framework
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);
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bam.core
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);
}
}
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.analytics.dashboard
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);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis
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);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
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);
}
代码示例来源:origin: org.wso2.carbon.devicemgt-plugins/org.wso2.carbon.device.mgt.mobile.impl
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;
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
@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);
}
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.reporting.template.core
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);
}
}
内容来源于网络,如有侵权,请联系作者删除!