public class CDRMetacard extends Object implements ddf.catalog.data.Metacard, Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
LINK_REL_PREVIEW |
static String |
METACARD_CONTENT_COLLECTION_ATTRIBUTE |
static String |
RESOURCE_MIME_TYPE |
static String |
RESOURCE_TITLE |
static String |
THUMBNAIL_LENGTH |
static String |
THUMBNAIL_LINK_TITLE |
static String |
THUMBNAIL_MIMETYPE |
static String |
WRAP_METADATA |
ANY_DATE, ANY_GEO, ANY_TEXT, CONTENT_TYPE, CONTENT_TYPE_VERSION, CREATED, EFFECTIVE, EXPIRATION, GEOGRAPHY, ID, METADATA, MODIFIED, RESOURCE_SIZE, RESOURCE_URI, SECURITY, SECURITY_MATCH_ALL, SECURITY_MATCH_ONE, SOURCE_ID, TARGET_NAMESPACE, THUMBNAIL, TITLE| Constructor and Description |
|---|
CDRMetacard()
Creates a
Metacard with a and empty Attributes. |
CDRMetacard(ddf.catalog.data.Metacard metacard)
Creates a
Metacard with the provided Metacard. |
CDRMetacard(ddf.catalog.data.MetacardType mt)
Creates a
Metacard with the provided MetacardType and empty Attribute s. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAtomId() |
ddf.catalog.data.Attribute |
getAttribute(String name) |
protected <T> T |
getAttributeValue(ddf.catalog.data.Attribute attribute,
Class<T> returnType) |
String |
getContentTypeName() |
URI |
getContentTypeNamespace() |
String |
getContentTypeVersion() |
Date |
getCreatedDate() |
Date |
getEffectiveDate() |
Date |
getExpirationDate() |
String |
getId() |
String |
getLocation() |
Map<String,ddf.catalog.data.Attribute> |
getMap() |
ddf.catalog.data.MetacardType |
getMetacardType() |
String |
getMetadata() |
URI |
getMetadataURL() |
Date |
getModifiedDate() |
String |
getResourceMIMETypeString() |
String |
getResourceSize() |
long |
getResourceSizeLong() |
URI |
getResourceURI() |
Map<String,List<String>> |
getSecurity()
Returns the security relevant markings on the
Metacard. |
String |
getSourceId() |
byte[] |
getThumbnail() |
long |
getThumbnailLength() |
String |
getThumbnailLinkTitle() |
MimeType |
getThumbnailMIMEType() |
URI |
getThumbnailURL() |
String |
getTitle() |
int |
hashCode() |
boolean |
hasLocation() |
boolean |
hasResource() |
boolean |
hasThumbnail() |
protected byte[] |
requestBytes(String key)
Get
byte[] data from the map or wrapped metacard. |
protected <T> T |
requestData(String attributeName,
Class<T> returnType)
The brains of the operation -- does the interaction with the map or the wrapped metacard.
|
protected Date |
requestDate(String key)
Get
Date data from the map or wrapped metacard. |
protected Double |
requestDouble(String key)
Get
Double data from the map or wrapped metacard. |
protected InputStream |
requestInputStream(String key)
Get
BinaryContent data from the map or wrapped metacard. |
protected Integer |
requestInteger(String key)
Get
Integer data from the map or wrapped metacard. |
protected Long |
requestLong(String key)
Get
Long data from the map or wrapped metacard. |
protected String |
requestString(String key)
Get
String data from the map or wrapped metacard. |
void |
setAttribute(ddf.catalog.data.Attribute attribute) |
void |
setAttribute(String name,
Serializable value)
Set an attribute via a name/value pair.
|
void |
setContentTypeName(String contentType)
Sets the name of the content type of the
Metacard. |
void |
setContentTypeVersion(String contentTypeVersion)
Sets the version of the content type of the
Metacard. |
void |
setCreatedDate(Date created)
Sets the date/time the
Metacard was created. |
void |
setEffectiveDate(Date effective)
Sets the date/time the
Metacard was last known to be valid. |
void |
setExpirationDate(Date expiration)
Sets the date/time this
Metacard is no longer valid and could be removed. |
void |
setId(String id)
Sets the ID of the
Metacard. |
void |
setLocation(String wkt)
Sets the WKT representation of the geometry.
|
void |
setMetadata(String metadata)
Sets the metadata associated with this
Metacard. |
void |
setMetadataLinkURI(URI uri) |
void |
setModifiedDate(Date modified)
Sets the date/time the
Metacard was last modifed. |
void |
setResourceSize(String dadSize)
Sets the size of the resource which may or may not contain a unit.
|
void |
setResourceURI(URI uri) |
void |
setSecurity(HashMap<String,List<String>> security)
Sets the security markings on this
Metacard. |
void |
setSourceId(String id) |
void |
setTargetNamespace(URI targetNamespace)
Some types of metadata use different content types.
|
void |
setThumbnail(byte[] bytes)
Sets the thumbnail associated with this
Metacard. |
void |
setThumbnailLinkURI(URI uri) |
void |
setTitle(String title)
Sets the title of this
Metacard. |
void |
setType(ddf.catalog.data.MetacardType mt)
Sets the
MetacardType of the Metacard. |
public static final String METACARD_CONTENT_COLLECTION_ATTRIBUTE
public static final String LINK_REL_PREVIEW
public static final String RESOURCE_MIME_TYPE
public static final String RESOURCE_TITLE
public static final String THUMBNAIL_LENGTH
public static final String THUMBNAIL_MIMETYPE
public static final String THUMBNAIL_LINK_TITLE
public static final String WRAP_METADATA
public CDRMetacard()
Metacard with a and empty Attributes.public CDRMetacard(ddf.catalog.data.MetacardType mt)
Metacard with the provided MetacardType and empty Attribute s.type - the MetacardTypepublic CDRMetacard(ddf.catalog.data.Metacard metacard)
Metacard with the provided Metacard.metacard - the Metacard to create this new Metacard frompublic boolean hasLocation()
public boolean hasResource()
public String getResourceMIMETypeString()
public long getResourceSizeLong()
public boolean hasThumbnail()
public long getThumbnailLength()
public String getAtomId()
public URI getMetadataURL()
public URI getThumbnailURL()
public MimeType getThumbnailMIMEType()
public String getThumbnailLinkTitle()
public String getMetadata()
getMetadata in interface ddf.catalog.data.Metacardpublic Date getModifiedDate()
getModifiedDate in interface ddf.catalog.data.Metacardpublic String getResourceSize()
getResourceSize in interface ddf.catalog.data.Metacardpublic byte[] getThumbnail()
getThumbnail in interface ddf.catalog.data.Metacardpublic String getTitle()
getTitle in interface ddf.catalog.data.Metacardpublic Date getCreatedDate()
getCreatedDate in interface ddf.catalog.data.Metacardpublic void setCreatedDate(Date created)
Metacard was created.
setAttribute(new AttributeImpl(Metacard.CREATED, created))
created - Date when this Metacard was created.Metacard.CREATEDpublic void setModifiedDate(Date modified)
Metacard was last modifed.
setAttribute(new AttributeImpl(Metacard.MODIFIED, modified))
modified - Date when this Metacard was last modified.Metacard.MODIFIEDpublic Date getExpirationDate()
getExpirationDate in interface ddf.catalog.data.Metacardpublic void setExpirationDate(Date expiration)
Metacard is no longer valid and could be removed.
setAttribute(new AttributeImpl(Metacard.EXPIRATION, expiration))
expiration - Date when the Metacard expires and should be removed from any stores.Metacard.EXPIRATIONpublic Date getEffectiveDate()
getEffectiveDate in interface ddf.catalog.data.Metacardpublic void setEffectiveDate(Date effective)
Metacard was last known to be valid.
setAttribute(new AttributeImpl(Metacard.EFFECTIVE, effective))
effective - Date when the information represented by the Metacard was last known to be valid.Metacard.EFFECTIVEpublic String getId()
getId in interface ddf.catalog.data.Metacardpublic void setId(String id)
Metacard.
setAttribute(new AttributeImpl(Metacard.ID, id))
id - unique identifier of the Metacard.Metacard.IDpublic String getLocation()
getLocation in interface ddf.catalog.data.Metacardpublic void setLocation(String wkt)
setAttribute(new AttributeImpl(Metacard.GEOGRAPHY, wkt))
wkt - WKT-defined geospatial String, returns null if not applicableMetacard.GEOGRAPHYpublic String getSourceId()
getSourceId in interface ddf.catalog.data.Metacardpublic void setSourceId(String id)
setSourceId in interface ddf.catalog.data.Metacardpublic void setThumbnail(byte[] bytes)
Metacard.
setAttribute(new AttributeImpl(Metacard.THUMBNAIL, bytes))
bytes - thumbnail for the Metacard.Metacard.THUMBNAILpublic void setTitle(String title)
Metacard.
setAttribute(new AttributeImpl(Metacard.TITLE, id))
title - Title of the MetacardMetacard.TITLEpublic void setMetadata(String metadata)
Metacard.
setAttribute(new AttributeImpl(Metacard.METADATA, metadata))
metadata - Associated metadata of the MetacardMetacard.METADATApublic ddf.catalog.data.MetacardType getMetacardType()
getMetacardType in interface ddf.catalog.data.Metacardpublic void setType(ddf.catalog.data.MetacardType mt)
MetacardType of the Metacard.type - MetacardType of the MetacardMetacardTypepublic URI getContentTypeNamespace()
getContentTypeNamespace in interface ddf.catalog.data.Metacardpublic void setTargetNamespace(URI targetNamespace)
URI of the content type.
setAttribute(new AttributeImpl(Metacard.TARGET_NAMESPACE, targetNamespace))
targetNamespace - URI of the sub-type, null if unusedMetacard.TARGET_NAMESPACEpublic String getContentTypeName()
getContentTypeName in interface ddf.catalog.data.Metacardpublic void setContentTypeName(String contentType)
Metacard.
setAttribute(new AttributeImpl(Metacard.CONTENT_TYPE, contentType))
contentType - name of content type of the MetacardMetacard.CONTENT_TYPEpublic String getContentTypeVersion()
getContentTypeVersion in interface ddf.catalog.data.Metacardpublic void setContentTypeVersion(String contentTypeVersion)
Metacard.
setAttribute(new AttributeImpl(Metacard.CONTENT_TYPE_VERSION, contentTypeVersion))
contentTypeVersion - version of content type of the MetacardMetacard.CONTENT_TYPE_VERSIONpublic URI getResourceURI()
getResourceURI in interface ddf.catalog.data.Metacardpublic void setResourceURI(URI uri)
Metacard.RESOURCE_URIpublic void setMetadataLinkURI(URI uri)
public void setThumbnailLinkURI(URI uri)
public void setResourceSize(String dadSize)
setAttribute(new AttributeImpl(Metacard.RESOURCE_SIZE, dadSize))
dadSize - String representation of the sizeMetacard.RESOURCE_SIZEpublic Map<String,List<String>> getSecurity()
Metacard.public void setSecurity(HashMap<String,List<String>> security)
Metacard.
setAttribute(new AttributeImpl(Metacard.SECURITY, security))
security - protected <T> T requestData(String attributeName, Class<T> returnType)
T - the type of the Attribute value expectedattributeName - the name of the Attribute to retrievereturnType - the class that the value of the AttributeType is expected to be bound toAttribute nameprotected <T> T getAttributeValue(ddf.catalog.data.Attribute attribute,
Class<T> returnType)
protected Date requestDate(String key)
Date data from the map or wrapped metacard.
requestData(key, Date.class))
key - the name of the Attribute to retrieveAttribute nameprotected Double requestDouble(String key)
Double data from the map or wrapped metacard.
requestData(key, Double.class))
key - the name of the Attribute to retrieveAttribute nameprotected InputStream requestInputStream(String key)
BinaryContent data from the map or wrapped metacard.
requestData(key, BinaryContent.class))
key - the name of the Attribute to retrieveAttribute nameprotected Integer requestInteger(String key)
Integer data from the map or wrapped metacard.
requestData(key, Integer.class))
key - the name of the Attribute to retrieveAttribute nameprotected Long requestLong(String key)
Long data from the map or wrapped metacard.
requestData(key, Long.class))
key - the name of the Attribute to retrieveAttribute nameprotected String requestString(String key)
String data from the map or wrapped metacard.
requestData(key, String.class))
key - the name of the Attribute to retrieveAttribute nameprotected byte[] requestBytes(String key)
byte[] data from the map or wrapped metacard.
requestData(key, byte[].class))
key - the name of the Attribute to retrieveAttribute namepublic ddf.catalog.data.Attribute getAttribute(String name)
getAttribute in interface ddf.catalog.data.Metacardpublic void setAttribute(String name, Serializable value)
name - the name of the Attributevalue - the value of the Attributepublic void setAttribute(ddf.catalog.data.Attribute attribute)
setAttribute in interface ddf.catalog.data.MetacardCopyright © 2014–2015 Cohesive Integrations, LLC. All rights reserved.