Package org.openxri.xml

Examples of org.openxri.xml.Service


    log.debug("disassemble()");

    if (value == null) return(null);

    Service service = (Service) value;
    String serviceText;

    try {

      Document doc = this.builder.newDocument();
      Node element = service.toDOM(doc);
      doc.appendChild(element);
      serviceText = DOMUtils.toString((Element) element, true, true);
    } catch (Exception ex) {

      throw new HibernateException("Cannot disassemble service.", ex);
View Full Code Here


    log.debug("equals()");

    if (x == null || y == null) return(false);

    Service service1 = (Service) x;
    Service service2 = (Service) y;

    boolean result = (service1 == service2)// TODO change this to Service.equals()

    log.debug("Done: " + result);
    return(result)
View Full Code Here

    log.debug("hashCode()");

    if (x == null) return(0);

    Service service = (Service) x;

    return(service.hashCode());
  }
View Full Code Here

  public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
  throws HibernateException, SQLException {

    log.debug("nullSafeGet()");

    Service service;
    String str = rs.getString(names[0]);

    try {

      if (str != null) {

        Document document = this.builder.parse(new ByteArrayInputStream(str.getBytes()));
        Element element = document.getDocumentElement();

        try {

          service = new Service(element);
        } catch (Exception ex) {

          log.error(ex);
          throw(ex);
        }
View Full Code Here

  public void nullSafeSet(PreparedStatement st, Object value, int index)
  throws HibernateException, SQLException {

    log.debug("nullSafeSet()");

    Service service = (Service) value;

    try {

      if (service != null) {

        Document doc = this.builder.newDocument();
        Node element;

        try {

          element = service.toDOM(doc);
        } catch (Exception ex) {

          log.error(ex);
          throw(ex);
        }
View Full Code Here

    log.debug("replace()");

    if (original == null) return(null);

    Service service = (Service) original;

    try {

      return (service.clone());
    } catch (CloneNotSupportedException e) {

      throw new HibernateException("Cannot clone service.");
    }
  }
View Full Code Here

    * a generated authority id of "1234".
    */
    protected Service createAuthority(String sID)
        throws StoreException
    {
      Service oAuth = constructAuthority(sID);

        synchronized (this)
        {
            String sFile = getAuthorityDir(sID);
            File oFile = new File(sFile);
View Full Code Here

    public Service registerLocalAuthority(
        String sParentID, String sSubsegment, Service[] oServices,
        String[] oInternals, String[] oExternals)
        throws StoreException
    {
      Service oAuth = null;
        synchronized (this)
        {
            String sFile = getSubSegmentDir(sParentID, sSubsegment);
            File oNodeDir = new File(sFile);
            if (oNodeDir.exists())
            {
                throw new StoreException(
                    Util.KEY_DUPNAME, "Subsegment already exists");
            }
            else if (!oNodeDir.mkdir())
            {
                throw new StoreException(
                    Util.KEY_DBERR,
                    "Unable to create dir: " + oNodeDir.getPath());
            }

            oAuth = createAuthority();

            // write the local auth
            File oDataFile = new File(oNodeDir, ssLocalExt);
            String sContents = oAuth.getProviderID();
            writeFile(oDataFile, sContents);

            // write the date
            oDataFile = new File(oNodeDir, ssDateExt);
            sContents = getDate();
View Full Code Here

    * @return Authority bean
    */
    public static Service toAuthority(
        org.openxri.iiop.admin.Authority oIIOPAuth)
    {
      Service oAuth = new Service();
        oAuth.setProviderID(oIIOPAuth.id);
        oAuth.setType(oIIOPAuth.type);
        for (int i = 0; i < oIIOPAuth.urilist.length; i++)
        {
            oAuth.addURI(oIIOPAuth.urilist[i]);
        }

        return oAuth;

    } // toAuthority()
View Full Code Here

    * @return Service bean
    */
    public static Service toService(
        org.openxri.iiop.admin.Service oIIOPService)
    {
        Service oService = new Service();
        for (int i = 0; i < oIIOPService.urilist.length; i++)
        {
            oService.addURI(oIIOPService.urilist[i]);
        }

        String sCustomData = ""; // CSS TBD
        oService.setType(oIIOPService.type);
        oService.setMediaType(oIIOPService.mediatype);
        return oService;

    } // toService()
View Full Code Here

TOP

Related Classes of org.openxri.xml.Service

Copyright © 2018 www.massapicom. 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.