Class CarbonAppPersistenceManager
- java.lang.Object
-
- org.wso2.carbon.application.deployer.persistence.CarbonAppPersistenceManager
-
public class CarbonAppPersistenceManager extends Object
-
-
Constructor Summary
Constructors Constructor Description CarbonAppPersistenceManager(org.apache.axis2.engine.AxisConfiguration axisConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareRolesOverridden()Checks whether default server roles in carbon.xml are overridden through the UIvoidcreateResourcePathMappingFile(String appName)Create resource path mapping file in the registry.voiddeleteApplication(String appNameWithVersion)Delete the specified cApp from registry if already existsvoiddeleteResourcePathMappingFile(String appName)Delete resource path mapping file in the registry.StringgetHashValue(String appNameWithVersion)Reads the hash value property of the given cApp from registry..RegistryConfigloadRegistryConfig(String artifactPath)Loads the registry config stream for the given artifact path and builds a RegistryConfig instance.RegistryConfigloadRegistryConfig(String artifactPath, String appName)Loads the registry config stream for the given artifact path and builds a RegistryConfig instance.voidpersistRegConfig(String artifactPath, RegistryConfig regConfig)Persits the registry config file to registryList<String>readServerRoles(String roleType)Reads the server roles which are stored in registryvoidremoveArtifactResources(RegistryConfig registryConfig)Removes all registry collections, resources and associations introduced through this Capp artifact.voidwriteArtifactResources(RegistryConfig regConfig)Writes all registry contents (resources, collections and associations) of the given artifact to the registry.StringwriteFromFile(org.wso2.carbon.registry.core.Registry reg, File file, String registryPath, String mediaType)Write the file content as a registry resource to the given path
-
-
-
Method Detail
-
getHashValue
public String getHashValue(String appNameWithVersion) throws org.wso2.carbon.CarbonException
Reads the hash value property of the given cApp from registry..- Parameters:
appNameWithVersion- - cApp name with version- Returns:
- - hash value of the capp artifact
- Throws:
org.wso2.carbon.CarbonException- -
-
deleteApplication
public void deleteApplication(String appNameWithVersion) throws Exception
Delete the specified cApp from registry if already exists- Parameters:
appNameWithVersion- - application name with version- Throws:
Exception- - on registry transaction error
-
removeArtifactResources
public void removeArtifactResources(RegistryConfig registryConfig)
Removes all registry collections, resources and associations introduced through this Capp artifact.- Parameters:
registryConfig- - RegistryConfig instance
-
writeArtifactResources
public void writeArtifactResources(RegistryConfig regConfig) throws Exception
Writes all registry contents (resources, collections and associations) of the given artifact to the registry.- Parameters:
regConfig- - Artifact instance- Throws:
Exception- - on registry errors
-
writeFromFile
public String writeFromFile(org.wso2.carbon.registry.core.Registry reg, File file, String registryPath, String mediaType)
Write the file content as a registry resource to the given path- Parameters:
reg- - correct registry instancefile- - file to be writtenregistryPath- - path to write the resourcemediaType- - media type of the resource to be added- Returns:
- String resourcePath - actual resource path
-
createResourcePathMappingFile
public void createResourcePathMappingFile(String appName)
Create resource path mapping file in the registry. This is only used in GovernanceRegistry server role- Parameters:
appName- Governance Registry Application Name
-
deleteResourcePathMappingFile
public void deleteResourcePathMappingFile(String appName)
Delete resource path mapping file in the registry. This is only used in GovernanceRegistry server role- Parameters:
appName- Governance Registry Application Name
-
persistRegConfig
public void persistRegConfig(String artifactPath, RegistryConfig regConfig) throws Exception
Persits the registry config file to registry- Parameters:
artifactPath- - registry path of the "registry/resource" artifactregConfig- - RegistryConfig instance- Throws:
Exception- - on registry errors
-
loadRegistryConfig
public RegistryConfig loadRegistryConfig(String artifactPath) throws Exception
Loads the registry config stream for the given artifact path and builds a RegistryConfig instance.- Parameters:
artifactPath- - registry path of the "registry/resource" artifact- Returns:
- - RegistryConfig instance built
- Throws:
Exception- - on registry errors
-
loadRegistryConfig
public RegistryConfig loadRegistryConfig(String artifactPath, String appName) throws Exception
Loads the registry config stream for the given artifact path and builds a RegistryConfig instance.- Parameters:
artifactPath- - registry path of the "registry/resource" artifactappName- - carbon application name- Returns:
- - RegistryConfig instance built
- Throws:
Exception- - on registry errors
-
areRolesOverridden
public boolean areRolesOverridden()
Checks whether default server roles in carbon.xml are overridden through the UI- Returns:
- - true if modified, else false
-
-