Beispiel #1
0
  /**
   * This method tests whether this object of <code>InPort</code> has the required(mandatory) fields
   * set, before inserting values in the database.
   *
   * @exception FioranoException if the object is not valid
   * @since Tifosi2.0
   */
  public void validate() throws FioranoException {
    if (m_strPortName == null) {
      throw new FioranoException(DmiErrorCodes.ERR_INVALID_ARGUMENT_ERROR);
    }

    if (m_params != null) {
      Enumeration _enum = m_params.elements();

      while (_enum.hasMoreElements()) {
        Param param = (Param) _enum.nextElement();

        param.validate();
      }
    }
  }
Beispiel #2
0
  /**
   * Gets the extNamespaces attribute of the InPort object
   *
   * @return The extNamespaces value
   */
  public Enumeration getExtNamespaces() {
    Vector v = new Vector();
    int length = "External_".length();

    int size = m_params.size();

    for (int i = 0; i < size; i++) {
      Param param = (Param) m_params.get(i);

      if (param.getParamName().startsWith("External_")) {
        v.add(param.getParamName().substring(length));
      }
    }

    return v.elements();
  }
Beispiel #3
0
  /**
   * Retruns the xml string equivalent of this object
   *
   * @param document instance of Xml Document.
   * @return org.w3c.dom.Node
   * @exception FioranoException thrown in case of error.
   */
  protected Node toJXMLString(Document document) throws FioranoException {
    Node root0 = document.createElement("InPort");

    ((Element) root0).setAttribute("isSyncRequestType", "" + isSyncRequestType());

    Node child = null;

    child = XMLDmiUtil.getNodeObject("Name", m_strPortName, document);
    if (child != null) {
      root0.appendChild(child);
    }

    child = XMLDmiUtil.getNodeObject("Description", m_strDscription, document);
    if (child != null) {
      root0.appendChild(child);
    }

    if (m_strXSD != null) {
      Element elem = document.createElement("XSD");
      CDATASection cdata = document.createCDATASection(m_strXSD);

      elem.appendChild(cdata);
      root0.appendChild(elem);
    }

    child = XMLDmiUtil.getNodeObject("JavaClass", m_strJavaClass, document);
    if (child != null) {
      root0.appendChild(child);
    }

    if (m_params != null && m_params.size() > 0) {
      Enumeration _enum = m_params.elements();

      while (_enum.hasMoreElements()) {
        Param param = (Param) _enum.nextElement();
        if (!StringUtil.isEmpty(param.getParamName())
            && !StringUtil.isEmpty(param.getParamValue())) {
          Node paramNode = param.toJXMLString(document);

          root0.appendChild(paramNode);
        }
      }
    }

    return root0;
  }
Beispiel #4
0
 /**
  * This interface method is called to get enumeration of all the objects of <code>Param</code>,
  * for this object of <code>InPort</code>.
  *
  * @return Enumeration of all Param objects
  * @see #addParam(Param)
  * @see #removeParam(Param)
  * @see #clearParam()
  * @since Tifosi2.0
  */
 public Enumeration getParams() {
   if (m_params == null) {
     m_params = new Vector();
   }
   return m_params.elements();
 }