public class MxsObject
extends java.lang.Object
Object data can be accessed via streams or channels. Object metadata can be accessed via metadata views.
Modifier and Type | Method and Description |
---|---|
void |
delete()
Deletes this object from MatrixStore
|
void |
deleteForcefully()
Deletes this object from MatrixStore bypassing the trashcan
|
boolean |
exists()
Returns true if this object exists in MatrixStore server or it's only in memory
in the client.
|
ObjectTypedAttributeView |
getAttributeView()
Opens a typed view to this objects' metadata.
|
java.lang.String |
getId()
Returns this object id
|
MXFSFileAttributeView |
getMXFSFileAttributeView()
Opens a typed view to this objects' metadata.
|
Vault |
getVault()
Returns a reference to the vault this object belongs to.
|
boolean |
hasReplicaCopy()
Checks if the object has a copy on replica vault
|
boolean |
isIndexed()
Returns true if the object has been indexed.
|
boolean |
isOnline()
Returns true if the object is online.
|
void |
makeOffline(java.lang.String applicationId)
Makes an object offline.
|
MxsOutputStream |
makeOnline()
Makes an object online.
|
MxsInputStream |
newInputStream()
Creates an input stream from this object's data
|
MxsInputStream |
newInputStream(int readChunkSize)
Creates an input stream from this object's data, using the specified chunk size (in mb)
|
MxsByteChannel |
newObjectChannel(AccessOption option)
Creates a channel to this object's data
|
MxsByteChannel |
newObjectChannel(AccessOption option,
int readChunkSize)
Creates a channel to this object's data, with the given chunk size to read (in mb)
|
MxsOutputStream |
newOutputStream()
Creates an output stream to this object's data
|
SeekableByteChannel |
newSeekableObjectChannel(java.util.Set<AccessOption> options)
Creates a random access channel to this object's data
|
SeekableByteChannel |
newSeekableObjectChannel(java.util.Set<AccessOption> options,
int readChunkSize)
Creates a random access channel to this object's data
If only option READ is supplied, then stream with given chunk size is created
|
OperationInitResult |
submitMakeOnline()
Initiates asynchronous operation of restoring this object to online state.
|
public java.lang.String getId()
public Vault getVault()
public boolean exists() throws java.io.IOException
java.io.IOException
public void delete() throws java.io.IOException
java.io.IOException
public void deleteForcefully() throws java.io.IOException
java.io.IOException
public ObjectTypedAttributeView getAttributeView()
public MXFSFileAttributeView getMXFSFileAttributeView()
public MxsInputStream newInputStream() throws java.io.IOException
java.io.IOException
public MxsInputStream newInputStream(int readChunkSize) throws java.io.IOException
readChunkSize
- specifies the chunk in MB to readjava.io.IOException
public MxsOutputStream newOutputStream() throws java.io.IOException
java.io.IOException
public MxsByteChannel newObjectChannel(AccessOption option) throws java.io.IOException
option
- specifies the type of access to the data.java.io.IOException
public MxsByteChannel newObjectChannel(AccessOption option, int readChunkSize) throws java.io.IOException
option
- specifies the type of access to the data.readChunkSize
- specifies the chunk in MB to readjava.io.IOException
public SeekableByteChannel newSeekableObjectChannel(java.util.Set<AccessOption> options) throws java.io.IOException
options
- specifies the type of access to the datajava.io.IOException
public SeekableByteChannel newSeekableObjectChannel(java.util.Set<AccessOption> options, int readChunkSize) throws java.io.IOException
options
- specifies the type of access to the datareadChunkSize
- specifies the chunk in MB to readjava.io.IOException
public void makeOffline(java.lang.String applicationId) throws java.io.IOException
When an object is offline, the object is still searchable and its metadata is accessible but the data is cleared from the system. The data is not accessible until the application feeds it back to the object and marks it as online.
applicationId
- identifies which application is making the object offlinejava.io.IOException
public MxsOutputStream makeOnline() throws java.io.IOException
In order to make an object online, the application must provide the data again.
MxsOutputStream
stream to feed the data back to the objectjava.io.IOException
public OperationInitResult submitMakeOnline() throws java.io.IOException
java.io.IOException
- if there was a failure during initialisation of the operation. Error code is embedded in the cause exception of the thrown exception
Example error codes:
public boolean isOnline() throws java.io.IOException
java.io.IOException
public boolean isIndexed() throws java.io.IOException
java.io.IOException
public boolean hasReplicaCopy() throws java.io.IOException
java.io.IOException
- if operation cannot be completed due to system or network error.