|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.application.deployer.AppDeployerUtils
public final class AppDeployerUtils
| Method Summary | |
|---|---|
static boolean |
areAllFeaturesInstalled(List<Feature> features)
Checks whether the given list of features are already installed in the systme |
static void |
attachArtifactToOwnerApp(String fileName,
String artifactType,
String runtimeObjectName,
int tenantId)
Finds the owner application of the provided artifact file name and sets the runtime object name in the corresponding artifact. |
static Map<String,Boolean> |
buildAcceptanceList(Map<String,List<Feature>> features)
For each artifact type, there's a set of features which are needed to be installed in the system to properly deploy the artifacts. |
static String |
computeResourcePath(String basePath,
String resourceName)
|
static void |
copyFile(String fromPath,
String toPath)
Copy the artifact file at the fromPath to toPath |
static String |
createAppExtractionPath(String parentAppName)
|
static void |
createDir(String path)
|
static String |
extractAppArtifact(String artifactPath,
String parentPath)
Extract an individual cApp artifact at the provided path to the java temp dir. |
static String |
extractCarbonApp(String appCarPath)
Extract the Carbon application at the provided path to the java temp dir. |
static String |
formatPath(String path)
Format the string paths to match any platform.. |
static String |
getApplicationLocation()
Finds repo/carbonapps path |
static String |
getAppUnzipDir()
|
static String |
getArchivePathFromBundle(org.osgi.framework.Bundle b)
Computes the application artifact file path when the bundle is given |
static org.apache.axis2.deployment.Deployer |
getArtifactDeployer(org.apache.axis2.engine.AxisConfiguration axisConfig,
String directory,
String extension)
Finds the correct deployer for the given directory and extension |
static String |
getAxis2Repo()
Finds the carbon repository location |
static String |
getFileExtension(String fileName)
Finds teh extension of a given file |
static String |
getParentAppName(org.osgi.framework.Bundle bundle)
|
static String |
getProjectArtifactName(org.osgi.framework.Bundle bundle)
Check whether the given bundle is a project artifact. |
static int |
getTenantId()
|
static int |
getTenantId(org.apache.axis2.engine.AxisConfiguration axisConfig)
Deprecated. |
static String |
getTenantIdLogString(int tenantId)
|
static String |
getTenantIdString()
|
static String |
getTenantIdString(org.apache.axis2.engine.AxisConfiguration axisConfig)
Deprecated. |
static boolean |
hasLibs(List<Artifact.Dependency> deps)
Checks whether the given dependencies has library type artifacts |
static boolean |
isAppDeployer(org.osgi.framework.Bundle bundle)
Checking whether a bundle contains the WSO2-Application-Deployer header |
static Artifact |
populateArtifact(org.apache.axiom.om.OMElement artifactEle)
Builds the Artifact object when an artifact element is given |
static RegistryConfig |
populateRegistryConfig(org.apache.axiom.om.OMElement resourcesElement)
Builds a RegistryConfig instance using an OMElement which is built using the registry config file inside and cApp Registry/Resource artifact |
static String |
readAttribute(org.apache.axiom.om.OMElement element,
String attName)
Reads an attribute in the given element and returns the value of that attribute |
static String |
readChildText(org.apache.axiom.om.OMElement element,
String ln)
|
static String |
readChildText(org.apache.axiom.om.OMElement element,
String ln,
String ns)
Reads a text node which is in a child element of the given element and returns the text value. |
static String |
readMediaType(String artifactExtractedPath,
String fileName)
Read the mediaType from the meta file of a resource. |
static Map<String,List<Feature>> |
readRequiredFeaturs(org.apache.axiom.om.OMElement featureSets)
Reads the root element of the required-features.xml file and returns a list of required features for each and every artifact type. |
static String[] |
readServerRoles(CarbonAppPersistenceManager capm)
First checks for the "serverRoles" system property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getAppUnzipDir()
public static String getProjectArtifactName(org.osgi.framework.Bundle bundle)
bundle - - bundle to check
public static String getParentAppName(org.osgi.framework.Bundle bundle)
public static boolean isAppDeployer(org.osgi.framework.Bundle bundle)
bundle - - input bundle
public static String getAxis2Repo()
public static void copyFile(String fromPath,
String toPath)
throws org.apache.axis2.deployment.DeploymentException
fromPath - - path at which the read the file to copytoPath - - path to which the file should be copied
org.apache.axis2.deployment.DeploymentExceptionpublic static Artifact populateArtifact(org.apache.axiom.om.OMElement artifactEle)
artifactEle - - artifact OMElement
public static RegistryConfig populateRegistryConfig(org.apache.axiom.om.OMElement resourcesElement)
resourcesElement - - regConfig element
public static String readAttribute(org.apache.axiom.om.OMElement element,
String attName)
element - - Element to searchattName - - attribute name
public static String readChildText(org.apache.axiom.om.OMElement element,
String ln)
public static String readChildText(org.apache.axiom.om.OMElement element,
String ln,
String ns)
element - - Element to searchln - - Child element namens - - Child element namespace
public static String[] readServerRoles(CarbonAppPersistenceManager capm)
capm - - persistance manager
public static String getArchivePathFromBundle(org.osgi.framework.Bundle b)
b - - App artifact as an OSGi bundle
public static String getApplicationLocation()
public static String getFileExtension(String fileName)
fileName - - name of the file
public static String extractCarbonApp(String appCarPath)
throws org.wso2.carbon.CarbonException
appCarPath - - Absolute path of the Carbon application .car file
org.wso2.carbon.CarbonException - - error on extractionpublic static String createAppExtractionPath(String parentAppName)
public static String extractAppArtifact(String artifactPath,
String parentPath)
throws org.wso2.carbon.CarbonException
artifactPath - - Absolute path of the cApp artifact fileparentPath - - Parent's extracted path
org.wso2.carbon.CarbonException - - on error
public static void attachArtifactToOwnerApp(String fileName,
String artifactType,
String runtimeObjectName,
int tenantId)
fileName - - file name of the artifactartifactType - - this can be a module or a serviceruntimeObjectName - - name of the runtime object corresponding to this filetenantId - - id of the tenant in which the artifact is deployedpublic static String formatPath(String path)
path - - input file path
public static boolean hasLibs(List<Artifact.Dependency> deps)
deps - - list of dependencies
public static boolean areAllFeaturesInstalled(List<Feature> features)
features - - list of features
public static Map<String,Boolean> buildAcceptanceList(Map<String,List<Feature>> features)
features - - contains the list of features needed for each artifact type
public static Map<String,List<Feature>> readRequiredFeaturs(org.apache.axiom.om.OMElement featureSets)
featureSets - - root element of the required-features.xml
@Deprecated public static String getTenantIdString(org.apache.axis2.engine.AxisConfiguration axisConfig)
public static String getTenantIdString()
@Deprecated public static int getTenantId(org.apache.axis2.engine.AxisConfiguration axisConfig)
public static int getTenantId()
public static String getTenantIdLogString(int tenantId)
public static String computeResourcePath(String basePath,
String resourceName)
public static String readMediaType(String artifactExtractedPath,
String fileName)
artifactExtractedPath - - extracted path of the artifactfileName - - original resource file name. this is used to figure out meta file name
public static void createDir(String path)
public static org.apache.axis2.deployment.Deployer getArtifactDeployer(org.apache.axis2.engine.AxisConfiguration axisConfig,
String directory,
String extension)
axisConfig - - AxisConfiguration instancedirectory - - Directory to retrieve the deployerextension - - Extension of the deployable artifact
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||