org.gcube.informationsystem.collector.impl.resources
Class GCUBEXMLResource

java.lang.Object
  extended by org.gcube.informationsystem.collector.impl.resources.GCUBEXMLResource

public class GCUBEXMLResource
extends java.lang.Object

Author:
Manuele Simi (ISTI-CNR)

Nested Class Summary
static class GCUBEXMLResource.MalformedXMLResourceException
          Malformed XML resource exception
static class GCUBEXMLResource.RESOURCETYPE
          the resource type states if the resource contains a profile or generic WS-ResourceProperties
 
Constructor Summary
GCUBEXMLResource(DAIXResource resource)
           
 
Method Summary
 void deserializeFromIndexing(java.lang.String content, boolean... enveloped)
          Sets the content of the resource
 java.lang.String getCollectionName()
           
 org.w3c.dom.Document getContent()
          Gets the wrapped BaseDAIXResource's content
 java.lang.String getEntryKey()
          Accesses the source EntryKey
 java.lang.String getGroupKey()
          Accesses the source GroupKey
 java.util.Calendar getLastUpdateTime()
           
 long getLastUpdateTimeinMills()
           
 java.lang.String getNamespace()
          Gets the namespace
 java.lang.String getPublicationMode()
          The mode in which the resource was published
 java.lang.String getResourceName()
           
 java.lang.String getSource()
          Accesses the source address of the service that published the data
 java.lang.String getSourceKey()
          Gets the key of the WS-Resource that published the data
 java.lang.String getSourceRunningInstance()
           
 java.util.Calendar getTerminationTime()
           
 void setEntryKey(java.lang.String entryKey)
          Sets the source EntryKey
 void setGroupKey(java.lang.String groupKey)
          Sets the source GroupKey
 void setNamespace(java.lang.String namespace)
          Sets the namespace
 void setPublicationMode(java.lang.String publicationMode)
           
 void setSource(java.lang.String source)
          Sets the source address of the RI that publishes resource as reported in the servicegroup entry
 void setSourceKey(java.lang.String key)
          Sets the key of the WS-Resource that published the data
 void setTerminationTime(java.util.Calendar terminationTime)
           
 java.lang.String toString()
           
 java.lang.String toStringFromElement(org.w3c.dom.Document xml, java.lang.String elementName)
          Returns a sub-serialization of the given XML, starting from the element name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GCUBEXMLResource

public GCUBEXMLResource(DAIXResource resource)
                 throws GCUBEXMLResource.MalformedXMLResourceException
Throws:
GCUBEXMLResource.MalformedXMLResourceException
Method Detail

getCollectionName

public java.lang.String getCollectionName()
                                   throws GCUBEXMLResource.MalformedXMLResourceException
Returns:
the name of the collection including the resource
Throws:
DAIXResource.MalformedResourceException
GCUBEXMLResource.MalformedXMLResourceException

getResourceName

public java.lang.String getResourceName()
                                 throws GCUBEXMLResource.MalformedXMLResourceException
Returns:
the resource name
Throws:
DAIXResource.MalformedResourceException
GCUBEXMLResource.MalformedXMLResourceException

getTerminationTime

public java.util.Calendar getTerminationTime()
Returns:
the terminationTime of this resource

getLastUpdateTime

public java.util.Calendar getLastUpdateTime()
Returns:
the lastUpdateTime of this resource

setTerminationTime

public void setTerminationTime(java.util.Calendar terminationTime)
Parameters:
terminationTime - the terminationTime to set

getLastUpdateTimeinMills

public long getLastUpdateTimeinMills()
                              throws DAIXResource.MalformedResourceException
Returns:
the lastUpdateTime in milliseconds
Throws:
java.lang.Exception - if an error occurs when accessing the LastUpdateMs field
DAIXResource.MalformedResourceException

getGroupKey

public java.lang.String getGroupKey()
Accesses the source GroupKey

Returns:
the ID

setGroupKey

public void setGroupKey(java.lang.String groupKey)
Sets the source GroupKey

Parameters:
groupKey - the new group key

getEntryKey

public java.lang.String getEntryKey()
Accesses the source EntryKey

Returns:
the ID

setEntryKey

public void setEntryKey(java.lang.String entryKey)
Sets the source EntryKey

Parameters:
entryKey - the new entry key

setSource

public void setSource(java.lang.String source)
Sets the source address of the RI that publishes resource as reported in the servicegroup entry

Parameters:
source - the new source address

getSource

public java.lang.String getSource()
Accesses the source address of the service that published the data

Returns:
the source

getPublicationMode

public java.lang.String getPublicationMode()
The mode in which the resource was published

Returns:
the mode

setSourceKey

public void setSourceKey(java.lang.String key)
Sets the key of the WS-Resource that published the data

Parameters:
key - the new source key

getSourceKey

public java.lang.String getSourceKey()
Gets the key of the WS-Resource that published the data

Returns:
the key

setNamespace

public void setNamespace(java.lang.String namespace)
Sets the namespace

Parameters:
namamespace - the namespace

getNamespace

public java.lang.String getNamespace()
Gets the namespace

Returns:
the namespace

setPublicationMode

public void setPublicationMode(java.lang.String publicationMode)

deserializeFromIndexing

public void deserializeFromIndexing(java.lang.String content,
                                    boolean... enveloped)
Sets the content of the resource

Parameters:
content - the content
enveloped - true if the content is wrapped in the metadata envelop

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringFromElement

public java.lang.String toStringFromElement(org.w3c.dom.Document xml,
                                            java.lang.String elementName)
                                     throws GCUBEXMLResource.MalformedXMLResourceException
Returns a sub-serialization of the given XML, starting from the element name

Parameters:
xml - the source XML serialization
elementName - the name of the element
Returns:
the node content serialized as string
Throws:
java.lang.Exception - if the serialization fails
GCUBEXMLResource.MalformedXMLResourceException

getContent

public org.w3c.dom.Document getContent()
                                throws GCUBEXMLResource.MalformedXMLResourceException
Gets the wrapped BaseDAIXResource's content

Returns:
Throws:
GCUBEXMLResource.MalformedXMLResourceException

getSourceRunningInstance

public java.lang.String getSourceRunningInstance()
                                          throws java.lang.Exception
Throws:
java.lang.Exception