Data Request Broker
2-3-release

fr.gael.drb.impl
Class URLNode

java.lang.Object
  extended by fr.gael.drb.DrbDefaultNodesChangeProducer
      extended by fr.gael.drb.DrbAbstractNode
          extended by fr.gael.drb.impl.DrbNodeImpl
              extended by fr.gael.drb.impl.URLNode
All Implemented Interfaces:
DrbMutableNode, DrbNode, DrbNodesChangeListener, DrbNodesChangeProducer, EventListener
Direct Known Subclasses:
FtpNode

public class URLNode
extends DrbNodeImpl

URL node implementation


Field Summary
protected  InputStream inputstream
          The inputStream used to read ftp node
protected  URL url
          The URL
 
Fields inherited from interface fr.gael.drb.DrbItem
ATTRIBUTE_ITEM, NODE_ITEM, UNDEFINED_ITEM, VALUE_ITEM
 
Constructor Summary
URLNode(URL url)
          Creates a URLNode with an url
 
Method Summary
 boolean allowsMultiOccurrence()
          Check if this node may have multiple occurrence
protected  URLNode createNode(URL url)
          This method create a url node with aa url
 boolean equals(Object obj)
          Indicates whether this node is "equal to" to another node.
 DrbNodeList getChildren()
          The list of child nodes.
 Object getImpl(Class api)
          Returns a specific implementation.
 String getName()
          This methods returns the name of the URL node
 DrbNode getNamedChild(String name, int occurence)
          Returns an occurence of the node matching the specified name.
 DrbNode getParent()
          This method returns the parent node
 String getPath()
          Returns the URL path
 boolean hasImpl(Class api)
          Tests if a specific interface can be provided.
 
Methods inherited from class fr.gael.drb.impl.DrbNodeImpl
close, createAttribute, createNode, flush, getProvider
 
Methods inherited from class fr.gael.drb.DrbAbstractNode
appendChild, appendReference, getAttribute, getAttributes, getChildAt, getChildrenCount, getContent, getFirstChild, getIndex, getItemType, getLastChild, getNamespaceBindings, getNamespaceURI, getNextSibling, getOccurrence, getPreviousSibling, getRoot, getValue, getValueType, getXPathName, getXPathName, hasChild, insertChild, removeChild, rename, replaceChild, setAttributes, setNamespaceBindings, setNamespaceURI, setValue, toString
 
Methods inherited from class fr.gael.drb.DrbDefaultNodesChangeProducer
addNodesChangeListener, getListenerList, nodesChanged, nodesInserted, nodesRemoved, removeNodesChangeListener, setListenerList, structureChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

url

protected URL url
The URL


inputstream

protected InputStream inputstream
The inputStream used to read ftp node

Constructor Detail

URLNode

public URLNode(URL url)
Creates a URLNode with an url

Parameters:
url - the url
Method Detail

allowsMultiOccurrence

public boolean allowsMultiOccurrence()
Check if this node may have multiple occurrence

Overrides:
allowsMultiOccurrence in class DrbAbstractNode
Returns:
true if the children may have a multiple occurrence and false otherwise.

equals

public boolean equals(Object obj)
Indicates whether this node is "equal to" to another node. See Object.equals() for the general contract of this method.

Overrides:
equals in class DrbAbstractNode
Parameters:
obj - another value.
Returns:
true if this object is the same as the obj argument

getName

public String getName()
This methods returns the name of the URL node

Overrides:
getName in class DrbAbstractNode
Returns:
String The name of the url

getChildren

public DrbNodeList getChildren()
The list of child nodes. This method is not implemented at this level.

Specified by:
getChildren in class DrbAbstractNode
Returns:
Always return null.

getParent

public DrbNode getParent()
This method returns the parent node

Specified by:
getParent in class DrbAbstractNode
Returns:
DrbNode the parent node

getPath

public String getPath()
Returns the URL path

Overrides:
getPath in class DrbAbstractNode
Returns:
URL path

getNamedChild

public DrbNode getNamedChild(String name,
                             int occurence)
Returns an occurence of the node matching the specified name.

Overrides:
getNamedChild in class DrbAbstractNode
Parameters:
name - the name of the name
occurence - the occurence number of the node
Returns:
the child node having the specified name or null.

createNode

protected URLNode createNode(URL url)
This method create a url node with aa url

Parameters:
url - the URL
Returns:
URLNode The new node created

hasImpl

public boolean hasImpl(Class api)
Tests if a specific interface can be provided. This operations tests with a minimum of time and memory consumption if the current implementation can provide a specific interface. It important to consider that hasImpl() provides information about the ability to provide such interface in general cases but not focused on the current instance. It may therefore be impossible to get a specific implementation from a node whereas hasImpl() operation returns true.

Overrides:
hasImpl in class DrbNodeImpl
Parameters:
api - The class type to test.
Returns:
true if an implementation of the interface can be provided and false otherwise.

getImpl

public Object getImpl(Class api)
Returns a specific implementation. This operation returns a reference to an object implementing a specific interface. This mean is useful to benefit by a specific and direct API instead of using the DrbNode interface. The provided object shall represent the current node such as it is possible after a call to this operation, to dismiss the reference to the node. For instance, a file is usually wrapped as a drb.imple.file.File class and thanks to this operation can be seen as a InputStream anabling direct access to the handled file.

Overrides:
getImpl in class DrbNodeImpl
Parameters:
api - The interface (or class) to be provided.
Returns:
A reference to the object implementing the interface or a null reference otherwise.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .