Package org.wso2.carbon.mediation.initializer.persistence

## Class SynapseRegistryStore

- java.lang.Object
- - org.wso2.carbon.mediation.initializer.persistence.AbstractStore<org.apache.synapse.registry.Registry>
  - - org.wso2.carbon.mediation.initializer.persistence.SynapseRegistryStore

-     public class SynapseRegistryStore
      extends AbstractStore<org.apache.synapse.registry.Registry>

- - ### Field Summary

    - ### Fields inherited from class org.wso2.carbon.mediation.initializer.persistence.AbstractStore

      `configPath, log, registryStore, serializer`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SynapseRegistryStore​(String configPath, org.wso2.carbon.registry.core.session.UserRegistry registry, String configName)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `deleteFile​(String fileName, org.apache.synapse.config.SynapseConfiguration synapseConfiguration)` | Delete the specified file from the persistence store.
    `protected String` | `getFileName​(org.apache.synapse.registry.Registry registry)` | Inspect the given object and find the file name to which it should be serialized to
    `protected org.apache.synapse.registry.Registry` | `getObjectToPersist​(String name, org.apache.synapse.config.SynapseConfiguration config)` | Find the specified object from the SynaspeConfiguration to be saved to the persistence store
    `void` | `save​(String name, org.apache.synapse.config.SynapseConfiguration config)` |
    `protected org.apache.axiom.om.OMElement` | `saveToFile​(org.apache.synapse.registry.Registry registry, org.apache.synapse.config.SynapseConfiguration synapseConfiguration)` | Serialize and save the given object to the local file system
    `protected void` | `saveToRegistry​(String name, org.apache.axiom.om.OMElement element, String fileName)` |
    `protected org.apache.axiom.om.OMElement` | `serialize​(org.apache.synapse.registry.Registry registry)` | Serialize the given object into XML

    - ### Methods inherited from class org.wso2.carbon.mediation.initializer.persistence.AbstractStore

      `delete, deleteFromRegistry, deleteItemFromRegistry, handleException, saveItemToRegistry`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SynapseRegistryStore

          public SynapseRegistryStore​(String configPath,
                                      org.wso2.carbon.registry.core.session.UserRegistry registry,
                                      String configName)

  - ### Method Detail

    - #### save

          public void save​(String name,
                           org.apache.synapse.config.SynapseConfiguration config)

      Overrides:
        `save` in class `AbstractStore<org.apache.synapse.registry.Registry>`

    - #### deleteFile

          protected void deleteFile​(String fileName,
                                    org.apache.synapse.config.SynapseConfiguration synapseConfiguration)

      Description copied from class: `AbstractStore`
      Delete the specified file from the persistence store. File name is provided as an argument and it is up to the implementation to the calculate the exact file path using the file name and other available data.
      Specified by:
        `deleteFile` in class `AbstractStore<org.apache.synapse.registry.Registry>`
      Parameters:
        `fileName` - Name of the file to be deleted
        `synapseConfiguration` - synapse configuration

    - #### getFileName

          protected String getFileName​(org.apache.synapse.registry.Registry registry)

      Description copied from class: `AbstractStore`
      Inspect the given object and find the file name to which it should be serialized to
      Specified by:
        `getFileName` in class `AbstractStore<org.apache.synapse.registry.Registry>`
      Parameters:
        `registry` - The object to be inspected
      Returns:
        A file name as a string or null if no file name is specified

    - #### getObjectToPersist

          protected org.apache.synapse.registry.Registry getObjectToPersist​(String name,
                                                                            org.apache.synapse.config.SynapseConfiguration config)

      Description copied from class: `AbstractStore`
      Find the specified object from the SynaspeConfiguration to be saved to the persistence store
      Specified by:
        `getObjectToPersist` in class `AbstractStore<org.apache.synapse.registry.Registry>`
      Parameters:
        `name` - Name or unique ID of the object
        `config` - Current SynapseConfiguration
      Returns:
        The named object or null if such an object doesn't exist

    - #### saveToFile

          protected org.apache.axiom.om.OMElement saveToFile​(org.apache.synapse.registry.Registry registry,
                                                             org.apache.synapse.config.SynapseConfiguration synapseConfiguration)

      Description copied from class: `AbstractStore`
      Serialize and save the given object to the local file system
      Specified by:
        `saveToFile` in class `AbstractStore<org.apache.synapse.registry.Registry>`
      Parameters:
        `registry` - Object to be saved
        `synapseConfiguration` - synapse configuration
      Returns:
        The OMElement generated as a result of the serialization or null

    - #### serialize

          protected org.apache.axiom.om.OMElement serialize​(org.apache.synapse.registry.Registry registry)

      Description copied from class: `AbstractStore`
      Serialize the given object into XML
      Specified by:
        `serialize` in class `AbstractStore<org.apache.synapse.registry.Registry>`
      Parameters:
        `registry` - The object to be serialized
      Returns:
        The resulting OMElement

    - #### saveToRegistry

          protected void saveToRegistry​(String name,
                                        org.apache.axiom.om.OMElement element,
                                        String fileName)

      Overrides:
        `saveToRegistry` in class `AbstractStore<org.apache.synapse.registry.Registry>`