本文整理汇总了Java中org.wso2.carbon.registry.core.session.UserRegistry.newCollection方法的典型用法代码示例。如果您正苦于以下问题:Java UserRegistry.newCollection方法的具体用法?Java UserRegistry.newCollection怎么用?Java UserRegistry.newCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.carbon.registry.core.session.UserRegistry
的用法示例。
在下文中一共展示了UserRegistry.newCollection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRegistryResource
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
public static void createRegistryResource(int tenantId) throws RegistryException {
try {
UserRegistry registry;
if (tenantId != -1234){
registry = SecurityServiceHolder.getInstance().getRegistryService().getConfigSystemRegistry(tenantId);
} else {
registry = SecurityServiceHolder.getInstance().getRegistryService().getConfigSystemRegistry();
}
// creating vault-specific storage repository (this happens only if
// not resource not existing)
if (!registry.resourceExists(SecureVaultConstants.ENCRYPTED_PROPERTY_STORAGE_PATH)) {
Collection secureVaultCollection = registry.newCollection();
registry.put(SecureVaultConstants.ENCRYPTED_PROPERTY_STORAGE_PATH, secureVaultCollection);
}
} catch (RegistryException e) {
throw new RegistryException("Error while intializing the registry");
}
}
示例2: init
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
public void init(int tenantId) throws DeploymentSynchronizerException {
try {
UserRegistry configRegistry = getConfigurationRegistry(tenantId);
String tenantRegistryPath = getRegistryPath(tenantId);
this.registry = configRegistry;
this.registryPath = tenantRegistryPath;
this.basePath = RegistryConstants.CONFIG_REGISTRY_BASE_PATH;
if (!configRegistry.resourceExists(tenantRegistryPath)) {
Collection collection = configRegistry.newCollection();
configRegistry.put(tenantRegistryPath, collection);
collection.discard();
}
} catch (RegistryException e) {
throw new DeploymentSynchronizerException("Error while accessing registry for " +
"tenant: " + tenantId, e);
}
// try {
// if (!registry.resourceExists(registryPath)) {
// Collection collection = registry.newCollection();
// registry.put(registryPath, collection);
// collection.discard();
// }
// } catch (RegistryException e) {
// handleException("Error while creating the registry collection at: " + registryPath, e);
// }
}
示例3: createRegistryResource
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
private void createRegistryResource() throws RegistryException {
try {
UserRegistry registry = SecurityServiceHolder.getInstance().getRegistryService().getConfigSystemRegistry();
// creating vault-specific storage repository (this happens only if
// not resource not existing)
if (!registry.resourceExists(SecureVaultConstants.ENCRYPTED_PROPERTY_STORAGE_PATH)) {
org.wso2.carbon.registry.core.Collection secureVaultCollection = registry.newCollection();
registry.put(SecureVaultConstants.ENCRYPTED_PROPERTY_STORAGE_PATH, secureVaultCollection);
}
} catch (RegistryException e) {
throw new RegistryException("Error while intializing the registry");
}
}
示例4: createSystemConfigVersion
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
private static void createSystemConfigVersion(UserRegistry userReg,String workspaceRoot) throws RegistryException {
String confVerPath = workspaceRoot
+ JCR_SYSTEM_CONFIG
+ "/"
+ JCR_SYSTEM_CONFIG_VERSION;
if (!userReg.resourceExists(confVerPath)) {
Resource resource = (CollectionImpl)userReg.newCollection();
resource.setDescription("sys:config-jcr-storage");
resource.setProperty("sys:config","true");
userReg.put(confVerPath, resource);
}
}
示例5: createSystemConfigVersionLabelStore
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
private static void createSystemConfigVersionLabelStore(UserRegistry userReg,String workspaceRoot) throws RegistryException {
String confVerPath = workspaceRoot
+ JCR_SYSTEM_CONFIG
+ "/"
+ JCR_SYSTEM_VERSION_LABELS;
if (!userReg.resourceExists(confVerPath)) {
Resource resource = (CollectionImpl)userReg.newCollection();
resource.setDescription("sys:config-jcr-storage");
resource.setProperty("sys:config","true");
userReg.put(confVerPath, resource);
}
}
示例6: createSystemConfigNodeTypes
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
private static void createSystemConfigNodeTypes(UserRegistry userReg,String workspaceRoot) throws RegistryException {
String confVerPath = workspaceRoot
+ JCR_SYSTEM_CONFIG
+ "/"
+ JCR_SYSTEM_CONFIG_NODE_TYPES;
if (!userReg.resourceExists(confVerPath)) {
Resource resource = (CollectionImpl)userReg.newCollection();
resource.setDescription("sys:config-jcr-storage");
resource.setProperty("sys:config","true");
userReg.put(confVerPath, resource);
}
}
示例7: setCloudServiceActive
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
public static void setCloudServiceActive(boolean active,
String cloudServiceName,
int tenantId, CloudServiceConfig cloudServiceConfig)
throws Exception {
if (cloudServiceConfig.getLabel() == null) {
// for the non-labled services, we are not setting/unsetting the
// service active
return;
}
UserRegistry govRegistry =
CloudCommonServiceComponent.getGovernanceSystemRegistry(
MultitenantConstants.SUPER_TENANT_ID);
UserRegistry configRegistry = CloudCommonServiceComponent.getConfigSystemRegistry(tenantId);
String cloudServiceInfoPath = StratosConstants.CLOUD_SERVICE_INFO_STORE_PATH +
RegistryConstants.PATH_SEPARATOR + tenantId +
RegistryConstants.PATH_SEPARATOR + cloudServiceName;
Resource cloudServiceInfoResource;
if (govRegistry.resourceExists(cloudServiceInfoPath)) {
cloudServiceInfoResource = govRegistry.get(cloudServiceInfoPath);
} else {
cloudServiceInfoResource = govRegistry.newCollection();
}
cloudServiceInfoResource.setProperty(StratosConstants.CLOUD_SERVICE_IS_ACTIVE_PROP_KEY,
active ? "true" : "false");
govRegistry.put(cloudServiceInfoPath, cloudServiceInfoResource);
// then we will copy the permissions
List<PermissionConfig> permissionConfigs = cloudServiceConfig.getPermissionConfigs();
for (PermissionConfig permissionConfig : permissionConfigs) {
String path = permissionConfig.getPath();
String name = permissionConfig.getName();
if (active) {
if (!configRegistry.resourceExists(path)) {
Collection collection = configRegistry.newCollection();
collection.setProperty(StratosConstants.DISPLAY_NAME, name);
configRegistry.put(path, collection);
}
} else {
if (configRegistry.resourceExists(path)) {
configRegistry.delete(path);
}
}
}
}
示例8: setCloudServiceActive
import org.wso2.carbon.registry.core.session.UserRegistry; //导入方法依赖的package包/类
public static void setCloudServiceActive(boolean active,
String cloudServiceName,
int tenantId, CloudServiceConfig cloudServiceConfig)
throws Exception {
if (cloudServiceConfig.getLabel() == null) {
// for the non-labled services, we are not setting/unsetting the
// service active
return;
}
UserRegistry govRegistry =
ServiceReferenceHolder.getInstance().getRegistryService().getGovernanceSystemRegistry(
MultitenantConstants.SUPER_TENANT_ID);
UserRegistry configRegistry = ServiceReferenceHolder.getInstance().getRegistryService().getConfigSystemRegistry(tenantId);
String cloudServiceInfoPath = StratosConstants.CLOUD_SERVICE_INFO_STORE_PATH +
RegistryConstants.PATH_SEPARATOR + tenantId +
RegistryConstants.PATH_SEPARATOR + cloudServiceName;
Resource cloudServiceInfoResource;
if (govRegistry.resourceExists(cloudServiceInfoPath)) {
cloudServiceInfoResource = govRegistry.get(cloudServiceInfoPath);
} else {
cloudServiceInfoResource = govRegistry.newCollection();
}
cloudServiceInfoResource.setProperty(StratosConstants.CLOUD_SERVICE_IS_ACTIVE_PROP_KEY,
active ? "true" : "false");
govRegistry.put(cloudServiceInfoPath, cloudServiceInfoResource);
// then we will copy the permissions
List<PermissionConfig> permissionConfigs = cloudServiceConfig.getPermissionConfigs();
for (PermissionConfig permissionConfig : permissionConfigs) {
String path = permissionConfig.getPath();
String name = permissionConfig.getName();
if (active) {
if (!configRegistry.resourceExists(path)) {
Collection collection = configRegistry.newCollection();
collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
configRegistry.put(path, collection);
}
} else {
if (configRegistry.resourceExists(path)) {
configRegistry.delete(path);
}
}
}
}