Package storage

Class StorageObject

  • All Implemented Interfaces:
    StubItf
    Direct Known Subclasses:
    DataClayObject

    public abstract class StorageObject
    extends Object
    implements StubItf
    This class intends to offer a basic API for DCObject.
    • Constructor Detail

      • StorageObject

        public StorageObject()
      • StorageObject

        public StorageObject​(String alias)
    • Method Detail

      • getObjectID

        public ObjectID getObjectID()
        Returns:
        The ObjectID
      • getMetaClassID

        public MetaClassID getMetaClassID()
        Returns:
        Class ID
      • getID

        public String getID()
        Specified by:
        getID in interface StubItf
        Returns:
        ID of the persistent object in string format
      • makePersistent

        public void makePersistent​(BackendID optionalBackendID)
        Parameters:
        optionalBackendID - optional backend where the object must be stored
      • makePersistent

        public void makePersistent​(String alias)
        Specified by:
        makePersistent in interface StubItf
        Parameters:
        alias - the alias associated to this object
      • makePersistent

        public void makePersistent​(boolean recursive)
        Parameters:
        recursive - Indicates if all referenced objects from this objects that are not already persistent must also be stored. If true, all referenced objects are also stored. If the object is already persistent i.e. contains a DataClay objectID this function will fail.
      • makePersistent

        public void makePersistent​(boolean recursive,
                                   BackendID optionalBackendID)
        Parameters:
        recursive - Indicates if all referenced objects from this objects that are not already persistent must also be stored. If true, all referenced objects are also stored. If the object is already persistent i.e. contains a DataClay objectID this function will fail.
        optionalBackendID - ID of the backend in which the object should be stored. If null, any backend is accepted.
      • makePersistent

        public void makePersistent​(String alias,
                                   BackendID optionalBackendID)
        Parameters:
        alias - alias for the object
        optionalBackendID - ID of the backend in which the object should be stored. If null, any backend is accepted.
      • makePersistent

        public void makePersistent​(String alias,
                                   boolean recursive)
        Parameters:
        alias - alias for the object
        recursive - Indicates if all referenced objects from this objects that are not already persistent must also be stored. If true, all referenced objects are also stored. If the object is already persistent i.e. contains a DataClay objectID this function will fail.
      • makePersistent

        public void makePersistent​(String alias,
                                   BackendID optionalBackendID,
                                   boolean recursive)
        Parameters:
        alias - alias for the object
        optionalBackendID - ID of the backend in which the object should be stored. If null, any backend is accepted.
        recursive - Indicates if all referenced objects from this objects that are not already persistent must also be stored. If true, all referenced objects are also stored. If the object is already persistent i.e. contains a DataClay objectID this function will fail.
      • deletePersistent

        public void deletePersistent​(boolean recursive)
        Parameters:
        recursive - Indicates remove must be recursive or not
      • newReplica

        public BackendID newReplica()
        Parameters:
        recursive - Indicates if all sub-objects must be replicated as well.
        Returns:
        The ID of the backend in which the replica was created.
      • newReplica

        public BackendID newReplica​(boolean recursive)
        Parameters:
        recursive - Indicates if all sub-objects must be replicated as well.
        Returns:
        The ID of the backend in which the replica was created.
      • newReplica

        public BackendID newReplica​(BackendID optionalBackendID)
        Parameters:
        optionalBackendID - ID of the backend in which to create the replica. If null, any backend is accepted. If the object is not persistent i.e. does not contain a DataClay objectID this function will fail.
        Returns:
        The ID of the backend in which the replica was created.
      • newReplica

        public BackendID newReplica​(BackendID optionalBackendID,
                                    boolean recursive)
        Parameters:
        optionalBackendID - ID of the backend in which to create the replica. If null, any backend is accepted. If the object is not persistent i.e. does not contain a DataClay objectID this function will fail.
        recursive - Indicates if all sub-objects must be replicated as well.
        Returns:
        The ID of the backend in which the replica was created.
      • moveObject

        public void moveObject​(BackendID srcLocID,
                               BackendID destLocID)
        Parameters:
        srcLocID - of the source location in which the object is stored.
        destLocID - of the destination location in which the object should be moved.
      • moveObject

        public void moveObject​(BackendID srcLocID,
                               BackendID destLocID,
                               boolean recursive)
        Parameters:
        srcLocID - of the source location in which the object is stored.
        destLocID - of the destination location in which the object should be moved.
        recursive - Indicates if all sub-objects must be moved as well.
      • setObjectReadOnly

        public void setObjectReadOnly()
      • setObjectReadWrite

        public void setObjectReadWrite()
      • getLocation

        public BackendID getLocation()
        Returns:
        ID of the backend in which the object is stored. If the object is not persistent i.e. does not contain a DataClay objectID this function will fail.
      • getAllLocations

        public Set<BackendID> getAllLocations()
        Returns:
        A set of IDs of the backend in which this object or its replicas are stored. If the object is not persistent i.e. does not contain a DataClay objectID this function will fail.
      • executeRemoteImplementation

        public Object executeRemoteImplementation​(String methodSignature,
                                                  String implIDAsStr,
                                                  Object[] params)
        Parameters:
        methodSignature - Signature of the method
        implIDAsStr - ImplementationID as string
        params - Parameters to send
        Returns:
        Return value.