public final class StreamDescriptor extends Object implements Comparable<StreamDescriptor>, Serializable
StreamDescriptor
describes the properties of a stream within
jadice server.Modifier and Type | Class and Description |
---|---|
static class |
StreamDescriptor.ContextMap |
static class |
StreamDescriptor.PropertyMap
Simple extension of
HashMap to accommodate for a more readable
toString() output. |
Modifier and Type | Field and Description |
---|---|
static String |
UNKNOWN_MIME_TYPE
Constant used to indicate unknown MIME types.
|
Constructor and Description |
---|
StreamDescriptor()
Default constructor leaving everything uninitialized.
|
StreamDescriptor(StreamDescriptor parent)
Create a new StreamDescriptor with the given parent.
|
StreamDescriptor(String mimeType) |
StreamDescriptor(String mimeType,
StreamDescriptor parent)
Create a new StreamDescriptor with the given MIME-type and parent.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(StreamDescriptor sdx) |
boolean |
equals(Object obj) |
String |
getBaseType()
Get the base MIME-type consisting of primary- and sub-type in the form "primary/sub".
|
Map<String,Serializable> |
getContext() |
String |
getDescription()
Get the user-friendly description of the stream.
|
String |
getFileName()
Get the original file name of the stream.
|
String |
getId()
Get the ID of the stream.
|
String |
getMimeType()
Get the Multipurpose Internet Mail Extension (MIME) type.
|
StreamDescriptor |
getParent() |
Map<String,Serializable> |
getProperties()
Get the
Stream 's extended properties. |
String |
getSemanticType() |
MimeType |
getType() |
String |
getUUID() |
int |
hashCode() |
String |
lookupFileName()
Recursively lookup the FileName for this StreamDescriptor.
|
String |
lookupFileName(int maxRecursion)
Recursively lookup the FileName for this StreamDescriptor.
|
void |
setDescription(String description)
Set the stream's (hopefully) user-friendly description.
|
void |
setFileName(String fileName)
Set the original file name of the stream.
|
void |
setId(String id)
Get the ID of the stream.
|
void |
setMimeType(String mimeType)
Set the Multipurpose Internet Mail Extension (MIME) type.
|
void |
setParent(StreamDescriptor parent) |
void |
setSemanticType(String semanticType)
Set the semantic type of the stream.
|
String |
toString() |
public static final String UNKNOWN_MIME_TYPE
public StreamDescriptor(String mimeType)
public StreamDescriptor()
public StreamDescriptor(StreamDescriptor parent)
parent
- public StreamDescriptor(String mimeType, StreamDescriptor parent)
mimeType
- parent
- public void setMimeType(String mimeType)
mimeType
- public String getMimeType()
getBaseType()
.String
public String getBaseType()
getType().getBaseType()
.public MimeType getType()
public int compareTo(StreamDescriptor sdx)
compareTo
in interface Comparable<StreamDescriptor>
public String getFileName()
null
if no file name was
provided.public String lookupFileName()
getFileName()
public String lookupFileName(int maxRecursion)
maxRecursion
- maximum level of recursion (i.e. number of ancestors). Value must be ≥ 0getFileName()
public void setFileName(String fileName)
fileName
- the file name to setpublic String getId()
public void setId(String id)
id
- a logical IDpublic Map<String,Serializable> getProperties()
Stream
's extended properties. The stream properties may be derived from
whatever meta-data is available about the stream. Most nodes will just shunt through this data.Stream
's propertiespublic StreamDescriptor getParent()
public void setParent(StreamDescriptor parent)
public String getUUID()
public String getDescription()
null
description was
set, this is what is returned from this call. Otherwise an attempt will be made to return a
reasonable description by using the fist non-null property from this list:
public void setDescription(String description)
description
- a user-friendly descriptionpublic String getSemanticType()
semantic type
of the stream.public void setSemanticType(String semanticType)
Examples:
semanticType
- the semantic type to setpublic Map<String,Serializable> getContext()
Copyright © 2017 levigo holding gmbh. All rights reserved.