Examples of StageException


Examples of org.openxri.exceptions.StageException

    this.attributeValues = attributeValues.toArray(new String[attributeValues.size()]);
  }

  public XRD execute(Store store, XRD xrd, XRISegment segment, Authority parentAuthority, String subSegmentName, Authority authority, boolean isCreate) throws StageException {

    if (! (store instanceof StoreAttributable)) throw new StageException("Cannot use this store implementation.");
    StoreAttributable storeAttributable = (StoreAttributable) store;

    Element xrdElement = xrd.getDOM();
    Document document = xrdElement.getOwnerDocument();

    // create new element

    Element element;

    if (this.elementNamespace != null) {

      element = document.createElementNS(this.elementNamespace, this.elementName);
    } else {

      element = document.createElement(this.elementName);
    }

    if (this.elementValue != null) {

      Text text = document.createTextNode(this.elementValue);
      element.appendChild(text);
    }

    for (int i=0; i<this.attributeNames.length; i++) {

      Attr attr = document.createAttribute(this.attributeNames[i]);
      attr.setNodeValue(this.attributeValues[i]);
      element.setAttributeNode(attr);
    }

    // insert element into XRD

    try {

      xrdElement.appendChild(element);
      xrd = new XRD(xrdElement, false);
    } catch (Exception ex) {

      throw new StageException("Unable to parse modified XRD.", ex);
    }

    // done

    return(xrd);
View Full Code Here

Examples of org.openxri.exceptions.StageException

  }

  public void init() throws Exception {

    this.uris = this.properties.getProperty(PROPERTIES_KEY_URIS, "").split(" +");
    if (this.uris.length < 1) throw new StageException("Required property " + PROPERTIES_KEY_URIS + " not found or empty.");

    this.types = this.properties.getProperty(PROPERTIES_KEY_TYPES, "").split(" +");
    this.paths = this.properties.getProperty(PROPERTIES_KEY_PATHS, "").split(" +");
    this.mediaTypes = this.properties.getProperty(PROPERTIES_KEY_MEDIATYPES, "").split(" +");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.