Package com.saperion.rmi.storage
Class Medium
- java.lang.Object
-
- com.saperion.rmi.storage.Medium
-
- All Implemented Interfaces:
java.io.Serializable
public class Medium extends java.lang.Object implements java.io.Serializable
Holds information about a medium.- Author:
- jschwarz
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, boolean isContainer, ContainerTrigger containerTrigger, java.util.List<java.lang.String> plugins)
Literal constructor.Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, ContainerTrigger containerTrigger, java.util.List<java.lang.String> plugins)
Literal constructor for container media.Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, java.util.List<java.lang.String> plugins)
Literal constructor for non-container media.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Medium
fromNative(com.saperion.jna.applsrv.m2j.natives.MediumInfoType mediumInfoType)
Constructs an instance ofMedium
from a given wrapper of the corresponding native type.MediumAccessData
getAccessData()
ContainerTrigger
getContainerTrigger()
MediumFillState
getFillState()
MediumId
getId()
MirrorType
getMirror()
java.lang.String
getName()
java.util.List<java.lang.String>
getPlugins()
MediumType
getType()
boolean
hashesContent()
Whether the medium is a "hashing" medium.boolean
isConflicted()
boolean
isContainer()
boolean
isMigrated()
boolean
isProtected()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Medium
public Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, ContainerTrigger containerTrigger, java.util.List<java.lang.String> plugins)
Literal constructor for container media.- Parameters:
id
-getId()
name
-getName()
type
-getType()
mirror
-getMirror()
fillState
-getFillState()
accessData
-getAccessData()
isProtected
-isProtected()
isMigrated
-isMigrated()
hashesContent
-hashesContent()
isConflicted
-isConflicted()
containerTrigger
-getContainerTrigger()
plugins
-getPlugins()
-
Medium
public Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, java.util.List<java.lang.String> plugins)
Literal constructor for non-container media.- Parameters:
id
-getId()
name
-getName()
type
-getType()
mirror
-getMirror()
fillState
-getFillState()
accessData
-getAccessData()
isProtected
-isProtected()
isMigrated
-isMigrated()
hashesContent
-hashesContent()
isConflicted
-isConflicted()
plugins
-getPlugins()
-
Medium
public Medium(MediumId id, java.lang.String name, MediumType type, MirrorType mirror, MediumFillState fillState, MediumAccessData accessData, boolean isProtected, boolean isMigrated, boolean hashesContent, boolean isConflicted, boolean isContainer, ContainerTrigger containerTrigger, java.util.List<java.lang.String> plugins)
Literal constructor. No Parameter is allowed to be null.- Parameters:
id
-getId()
name
-getName()
type
-getType()
mirror
-getMirror()
fillState
-getFillState()
accessData
-getAccessData()
isProtected
-isProtected()
isMigrated
-isMigrated()
hashesContent
-hashesContent()
isConflicted
-isConflicted()
isContainer
-isContainer()
containerTrigger
-getContainerTrigger()
plugins
-getPlugins()
-
-
Method Detail
-
fromNative
public static Medium fromNative(com.saperion.jna.applsrv.m2j.natives.MediumInfoType mediumInfoType)
Constructs an instance ofMedium
from a given wrapper of the corresponding native type.- Parameters:
mediumInfoType
- An instance of MediumInfoType corresponding to the same medium.- Returns:
- The instance of
Medium
corresponding to the same medium a the given MediumInfoType does.
-
getId
public MediumId getId()
- Returns:
- The id of the given medium that is unique in one saperion system.
-
getName
public java.lang.String getName()
- Returns:
- The name of the given medium.
-
getType
public MediumType getType()
- Returns:
- what type of medium this is.
-
getMirror
public MirrorType getMirror()
- Returns:
- The type of mirror medium this medium is (or none if it is not a mirror medium)
-
getFillState
public MediumFillState getFillState()
- Returns:
- Information about the size of the medium and how much space is already used.
-
getAccessData
public MediumAccessData getAccessData()
- Returns:
- Information about access times of the medium
-
isProtected
public boolean isProtected()
- Returns:
- whether the medium is write protected
-
isMigrated
public boolean isMigrated()
- Returns:
- whether this is a migration medium
-
hashesContent
public boolean hashesContent()
Whether the medium is a "hashing" medium. Such a medium computes and stores a cryptographic hash of binary content stored to it. Should content be requested to be stored on this medium that has the same hash as content already stored on the medium it will not written double.- Returns:
- whether this medium is a hashing medium
-
isConflicted
public boolean isConflicted()
- Returns:
- whether this medium is closed due to an error
-
isContainer
public boolean isContainer()
- Returns:
- whether this is a container medium
-
getContainerTrigger
public ContainerTrigger getContainerTrigger()
- Returns:
- If this is a container medium this holds information about when the generation of the next container item will be triggered.
-
getPlugins
public java.util.List<java.lang.String> getPlugins()
- Returns:
- The names of the plugins linked to this medium
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-