Class CommonUtil

java.lang.Object
org.wso2.carbon.registry.handler.util.CommonUtil

public class CommonUtil extends Object
  • 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

      public static SimulationResponse 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.RegistryException
      XMLStreamException
    • 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.RegistryException
      XMLStreamException
    • 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.RegistryException
      XMLStreamException
    • 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.RegistryException
      XMLStreamException
    • 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

      public static String getContextRoot()
    • setContextRoot

      public static void setContextRoot(String contextRoot)
    • 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.RegistryException
      XMLStreamException
    • 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.RegistryException
      XMLStreamException
    • isHandlerNameInUse

      public static boolean isHandlerNameInUse(String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException, XMLStreamException
      Throws:
      org.wso2.carbon.registry.core.exceptions.RegistryException
      XMLStreamException
    • 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.RegistryException
      FileNotFoundException
      XMLStreamException
    • 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)