Class CommonUtil
java.lang.Object
org.wso2.carbon.registry.handler.util.CommonUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddDefaultHandlersIfNotAvailable(org.wso2.carbon.registry.core.Registry configSystemRegistry) static booleanaddHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String payload) static booleandeleteHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) static HandlerConfigurationBeandeserializeHandlerConfiguration(org.apache.axiom.om.OMElement configurationElement) static booleangenerateHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String resourceFullPath) static Stringstatic StringgetHandlerConfiguration(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) static String[]getHandlerList(org.wso2.carbon.registry.core.Registry configSystemRegistry) static org.wso2.carbon.registry.core.service.RegistryServicestatic SimulationResponsestatic org.wso2.carbon.registry.core.service.SimulationServicestatic booleanhandlerExists(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) static booleanisHandlerNameInUse(String name) static booleanremoveHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String handlerName) static org.apache.axiom.om.OMElementstatic voidsetContextRoot(String contextRoot) static voidsetRegistryService(org.wso2.carbon.registry.core.service.RegistryService service) static voidsetSimulationService(org.wso2.carbon.registry.core.service.SimulationService simulationService) static voidsimulateRegistryOperation(org.wso2.carbon.registry.core.Registry rootRegistry, SimulationRequest simulationRequest) Simulates a configSystemRegistry operation.static booleanupdateHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String oldName, String payload)
-
Constructor Details
-
CommonUtil
public CommonUtil()
-
-
Method Details
-
setRegistryService
public static void setRegistryService(org.wso2.carbon.registry.core.service.RegistryService service) -
getRegistryService
public static org.wso2.carbon.registry.core.service.RegistryService getRegistryService() -
simulateRegistryOperation
public static void simulateRegistryOperation(org.wso2.carbon.registry.core.Registry rootRegistry, SimulationRequest simulationRequest) throws Exception Simulates a configSystemRegistry operation. Operation criteria: get - path put - path, resourcePath (existing resource), optional : mediaType resourceExists - path delete - path importResource - path, param1 (URL: source URL), optional : mediaType copy - path, param1 (target path) move - path, param1 (target path) rename - path, param1 (target path) removeLink - path createLink - path, param1 (target path), optional : param2 (target sub-path) invokeAspect - path, param1 (aspect name), param2 (action) addAssociation - path, param1 (target path), param2 (association type) removeAssociation - path, param1 (target path), param2 (association type) getAssociations - path, param1 (association type) getAllAssociations - path createVersion - path restoreVersion - path getVersions - path applyTag - path, param1 (tag) removeTag - path, param1 (tag) getTags - path getResourcePathsWithTag - param1 (tag) rateResource - path, param1 (Number: rating) getRating - path, param1 (username) getAverageRating - path addComment - path, param1 (comment) removeComment - path editComment - path, param1 (comment) getComments - path searchContent - param1 (keywords) executeQuery - param1 (Map: parameters, ex:- key1:val1,key2:val2,...), optional: path Operations not-supported dump restore- Parameters:
simulationRequest- the simulation request.- Throws:
Exception- if an exception occurs while executing any operation, or if an invalid parameter was entered.
-
getSimulationResponse
-
updateHandler
public static boolean updateHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String oldName, String payload) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
addHandler
public static boolean addHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String payload) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
handlerExists
public static boolean handlerExists(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
deleteHandler
public static boolean deleteHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
getHandlerConfiguration
public static String getHandlerConfiguration(org.wso2.carbon.registry.core.Registry configSystemRegistry, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
getHandlerList
public static String[] getHandlerList(org.wso2.carbon.registry.core.Registry configSystemRegistry) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getContextRoot
-
setContextRoot
-
generateHandler
public static boolean generateHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String resourceFullPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
removeHandler
public static boolean removeHandler(org.wso2.carbon.registry.core.Registry configSystemRegistry, String handlerName) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
isHandlerNameInUse
public static boolean isHandlerNameInUse(String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionXMLStreamException
-
addDefaultHandlersIfNotAvailable
public static boolean addDefaultHandlersIfNotAvailable(org.wso2.carbon.registry.core.Registry configSystemRegistry) throws org.wso2.carbon.registry.core.exceptions.RegistryException, FileNotFoundException, XMLStreamException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionFileNotFoundExceptionXMLStreamException
-
getSimulationService
public static org.wso2.carbon.registry.core.service.SimulationService getSimulationService() -
setSimulationService
public static void setSimulationService(org.wso2.carbon.registry.core.service.SimulationService simulationService) -
deserializeHandlerConfiguration
public static HandlerConfigurationBean deserializeHandlerConfiguration(org.apache.axiom.om.OMElement configurationElement) -
serializeHandlerConfiguration
public static org.apache.axiom.om.OMElement serializeHandlerConfiguration(HandlerConfigurationBean bean)
-