com.cysols.iodef.rid.element
Class RIDElementCreator

java.lang.Object
  extended by com.cysols.iodef.ElementCreator
      extended by com.cysols.iodef.rid.element.RIDElementCreator
All Implemented Interfaces:
RIDElementConstants

public class RIDElementCreator
extends ElementCreator
implements RIDElementConstants

Create the element class indicated RID xml element, this class handle name spece.

RIDElementCreator. For example:

     RIDElementCreator ridcreator = new RIDElementCreator();
     ridcreator.setIODEFNamespace("iodef", "draft-ietf-inch-iodef-043.xsd"); 
     ridcreator.setRIDNamespace("iodef-rid", "draft-ietf-inch-iodef-rid-05.xsd"); 
     // Sets the namespace for IODEF nodes and RID nodes, the default value is used if not specify.
 
     ridcreator.setSchemaLocation("RIDSchema.xsd"); //Sets the schema location for validation

     NSIODEFElementCreator iodefcreator = new NSIODEFElementCreator("iodef", "draft-ietf-inch-iodef-043.xsd"); 
     // To create Iodef nodes with namespace
 
     RID rid_element = ridcreator.createRID();
     IPPacket packet_element = ridcreator.createIPPacket();
     ..... // Sets some values
     rid_element.setIPPacket(packet_element);

     NPPath path_element = ridcreator.createNPPath();
     .....
     Node node_element = iodefcreator.createNode();
     .....
     Address address_element = iodefcreator.createAddress();
     .....
     node_element.addAddress(address_element);
     path_element.setNode(node_element);
     rid_element.addNPPath(path_element);

     RIDPolicy policy_element = ridcreator.createRIDPolicy();
     .....
     rid_element.setRIDPolicy(policy_element);

     org.w3c.dom.Document doc = rid_element.createDomDocument();
 
 

Author:
cysol

Field Summary
 
Fields inherited from interface com.cysols.iodef.rid.element.RIDElementConstants
AUTHORIZATIONSTATUS_ELE, HEXPACKET_ELE, INCIDENTSOURCE_ELE, IPPACKET_ELE, IPVERSION_ELE, MEANING_ATT, MSGDESTINATION_ELE, MSGTYPE_ELE, NPPATH_ELE, POLICYREGION_ELE, RESTRICTION_ATT, RID_ELE, RIDPOLICY_ELE, SOURCEFOUND_ELE, TRACESTATUS_ELE, TRAFFICTYPE_ELE
 
Constructor Summary
RIDElementCreator()
           
 
Method Summary
protected  IElement create(String name)
          Creates an element of the type specified.
protected  IAttribute createAttribute(String name)
          Creates an attribute of the type specified.
protected  Attr createDomAttr(Document doc, IAttribute ia)
           
 IncidentSource createIncidentSource()
          Creates a new instance which represents IncidentSource node.
 IPPacket createIPPacket()
          Creates a new instance which represents IPPacket node.
 NPPath createNPPath()
          Creates a new instance which represents NPPath node.
 RID createRID()
          Creates a new instance which represents RID node.
 RIDPolicy createRIDPolicy()
          Creates a new instance which represents RIDPolicy node.
 TraceStatus createTraceStatus()
          Creates a new instance which represents TraceStatus node.
protected  Element getDomElement(Document doc, IElement ie)
           
 void setIODEFNamespace(String prefix, String namespace)
          Sets the namespace and prefix.
 void setRIDNamespace(String prefix, String namespace)
          Sets the namespace and prefix.
 
Methods inherited from class com.cysols.iodef.ElementCreator
createDomElement, replace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RIDElementCreator

public RIDElementCreator()
Method Detail

setRIDNamespace

public void setRIDNamespace(String prefix,
                            String namespace)
Sets the namespace and prefix.

Parameters:
prefix - The namespace prefix using RID node
namespace - The namespace uri using RID node

setIODEFNamespace

public void setIODEFNamespace(String prefix,
                              String namespace)
Sets the namespace and prefix.

Parameters:
prefix - The namespace prefix using IODEF node
namespace - The namespace uri using IODEF node

create

protected IElement create(String name)
Creates an element of the type specified. Note that the instance returned extends the IElement class,

Overrides:
create in class ElementCreator
Parameters:
name - The name of the element type to instantiate.
Returns:
The element class indicated by specified name.

getDomElement

protected Element getDomElement(Document doc,
                                IElement ie)
Overrides:
getDomElement in class ElementCreator

createAttribute

protected IAttribute createAttribute(String name)
Description copied from class: ElementCreator
Creates an attribute of the type specified.

Overrides:
createAttribute in class ElementCreator
Parameters:
name - The name of the attribute type to instantiate.
Returns:
The attribute class indicated by specified name.

createDomAttr

protected Attr createDomAttr(Document doc,
                             IAttribute ia)
Overrides:
createDomAttr in class ElementCreator

createRID

public RID createRID()
Creates a new instance which represents RID node.

Returns:
a new instance which represents RID node.

createIncidentSource

public IncidentSource createIncidentSource()
Creates a new instance which represents IncidentSource node.

Returns:
a new instance which represents IncidentSource node.

createIPPacket

public IPPacket createIPPacket()
Creates a new instance which represents IPPacket node.

Returns:
a new instance which represents IPPacket node.

createNPPath

public NPPath createNPPath()
Creates a new instance which represents NPPath node.

Returns:
a new instance which represents NPPath node.

createRIDPolicy

public RIDPolicy createRIDPolicy()
Creates a new instance which represents RIDPolicy node.

Returns:
a new instance which represents RIDPolicy node.

createTraceStatus

public TraceStatus createTraceStatus()
Creates a new instance which represents TraceStatus node.

Returns:
a new instance which represents TraceStatus node.