org.wso2.carbon.rule.ws.admin
Class AbstractRuleServiceAdminHandler

java.lang.Object
  extended by org.wso2.carbon.rule.ws.admin.AbstractRuleServiceAdminHandler
All Implemented Interfaces:
RuleServiceAdminHandler
Direct Known Subclasses:
RuleServiceArchiveAdminHandler, RuleServiceFileAdminHandler

public abstract class AbstractRuleServiceAdminHandler
extends Object
implements RuleServiceAdminHandler

Base class for implementations of the RuleServiceAdminHandler. This contains a few common methods


Field Summary
protected  org.apache.commons.logging.Log log
           
protected static org.apache.axiom.om.OMNamespace NULL_NS
           
protected static org.apache.axiom.om.OMFactory OM_FACTORY
           
 
Constructor Summary
protected AbstractRuleServiceAdminHandler()
           
 
Method Summary
protected  void cleanUp(Paths paths)
          Clean up the temp resources
protected  String createServiceRepository(org.apache.axis2.engine.AxisConfiguration axisConfig)
          Creates the rule services repository if there is no repository
protected  org.apache.axiom.om.OMElement createXML(String serviceName, File ruleFile)
          Loads a file as an XML
protected  String getServicePath(org.apache.axis2.engine.AxisConfiguration axisConfig, String serviceName)
          Returns the path to the rule service with the given name
protected  String getTempDir()
          Returns the working directory for rule services
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wso2.carbon.rule.ws.admin.RuleServiceAdminHandler
deleteFactArchive, deleteRuleFile, deleteTempRuleServiceDirectory, getAllFacts, getFactArchiveList, getRuleFileList, getRuleService, saveRuleService, uploadFacts, uploadRuleFile
 

Field Detail

log

protected org.apache.commons.logging.Log log

OM_FACTORY

protected static final org.apache.axiom.om.OMFactory OM_FACTORY

NULL_NS

protected static final org.apache.axiom.om.OMNamespace NULL_NS
Constructor Detail

AbstractRuleServiceAdminHandler

protected AbstractRuleServiceAdminHandler()
Method Detail

getTempDir

protected String getTempDir()
Returns the working directory for rule services

Returns:
the working directory

createServiceRepository

protected String createServiceRepository(org.apache.axis2.engine.AxisConfiguration axisConfig)
                                  throws RuleServiceAdminException
Creates the rule services repository if there is no repository

Parameters:
axisConfig - Axis2 Environment configuration
Returns:
Path to the rule services repository
Throws:
RuleServiceAdminException

getServicePath

protected String getServicePath(org.apache.axis2.engine.AxisConfiguration axisConfig,
                                String serviceName)
                         throws RuleServiceAdminException
Returns the path to the rule service with the given name

Parameters:
axisConfig - Axis2 Environment configuration
serviceName - the name of the service
Returns:
Path to the rule service
Throws:
RuleServiceAdminException

createXML

protected org.apache.axiom.om.OMElement createXML(String serviceName,
                                                  File ruleFile)
                                           throws RuleServiceAdminException
Loads a file as an XML

Parameters:
serviceName - name of the service
ruleFile - file name
Returns:
An XML content of the file
Throws:
RuleServiceAdminException

cleanUp

protected void cleanUp(Paths paths)
Clean up the temp resources

Parameters:
paths - contains the service path and temp directory path for the service


Copyright © 2015 WSO2. All rights reserved.