Interface IWebMemory

  • All Superinterfaces:
    RAAPI

    public interface IWebMemory
    extends RAAPI
    Provides access to web memory from the server-side Java code. IWebMemory is an extension of the universal model repository interface RAAPI (Repository Access API).
    See Also:
    RAAPI Docs, Notes on RAAPI
    • Method Detail

      • getUUID

        java.lang.String getUUID()
        Obtains a stringified reference (unique identifier, UUID) to the current web memory. The UUID can be used as an inter-process web memory reference (e.g., when connecting to web memory at the Java side from the native code via the native library webmem.dll/.so/.dylib).
        Returns:
        a string representing the current web memory
      • flush

        void flush()
        If this web memory has attached synchronizers, flushes them.
      • setContext

        void setContext​(org.webappos.webmem.WebMemoryContext ctx)
        Sets (temporarily) the context for this web memory. The context is used to provide more detail for further web call seeds originated from the current web call.
        Parameters:
        ctx - the context (~the last user used to invoke something on this web memory)
      • getContext

        org.webappos.webmem.WebMemoryContext getContext()
        Returns the current (temporal) context.
        Returns:
        the context last set (or null)
      • isSubmitter

        boolean isSubmitter​(long rObject)
        Checks whether the given object is a submitter.
        Parameters:
        rObject - the object to check
        Returns:
        the result of the check
      • isEvent

        boolean isEvent​(long rObject)
        Checks whether the given object is an event (e.g., web calls actions can be registered as listeners to this event).
        Parameters:
        rObject - the object to check
        Returns:
        the result of the check
      • isCommand

        boolean isCommand​(long rObject)
        Checks whether the given object is a command (e.g., a web call action with the same name exists and will be called when this object is linked to the submitter).
        Parameters:
        rObject - the object to check
        Returns:
        the result of the check
      • creatingSubmitLink

        default boolean creatingSubmitLink​(long rSourceObject,
                                           long rTargetObject,
                                           long rAssociationEnd)
        Checks whether the given link to be created is a submit link (i.e., the link used to invoke web calls).
        Parameters:
        rSourceObject - the source object reference
        rTargetObject - the target object reference
        rAssociationEnd - the target association end reference
        Returns:
        whether the operation succeeded
      • replicateObject

        default long replicateObject​(long rObject)
        Replicates the given object (copies attribute values and sets links to the same linked objects). Useful, when the object is about to be deleted, but we wish to keep it for us.
        Parameters:
        rObject - an object to replicate
        Returns:
        a reference to the new object
      • elevate

        default <T> T elevate​(java.lang.Class<T> javaObjectsFactoryClass,
                              boolean create)
        Elevates this web memory by initializing a factory of Java objects acting as wrappers for web memory objects.
        Type Parameters:
        T - is the factory class (generated by ecore2java or mmd2java)
        Parameters:
        javaObjectsFactoryClass - a factory class (usually, generated by ecore2java)
        create - create classes (and their attributes and associations) in web memory if they do not exist
        Returns:
        a new instance of the factory class, or null on error
      • elevate

        default <T> T elevate​(java.lang.Class<T> javaObjectsFactoryClass)
        Elevates this web memory by initializing a factory of Java objects acting as wrappers for web memory objects; creates the corresponding classes (with their attributes and associations) in web memory, if they do not exist.
        Type Parameters:
        T - is the factory class (generated by ecore2java or mmd2java)
        Parameters:
        javaObjectsFactoryClass - a factory class (usually, generated by ecore2java)
        Returns:
        a new instance of the factory class, or null on error