Package org.exist.xquery.value

Examples of org.exist.xquery.value.IntegerValue


      throw( new XPathException(this, "Failed to open mail folder", me ) );
    }
   
    // save the folder and return the handle of the folder
     
    return( new IntegerValue( MailModule.storeFolder( context, folder ) ) );
  }
View Full Code Here


    } catch (IOException e) {
      throw new XPathException("Can't connect to memcahed server(s)");
    }
   
    // store the client and return the handle of the one.
    IntegerValue integerValue = new IntegerValue( MemcachedModule.storeClient(client));
    return integerValue;
  }
View Full Code Here

   
    Session session = Session.getInstance( props, null );
   
    // store the session and return the handle of the session
     
    IntegerValue integerValue = new IntegerValue( MailModule.storeSession( context, session ) );
    return integerValue;
  }
View Full Code Here

      throw( new XPathException( this, "Failed to open mail store", me ) );
    }
   
    // save the store and return the handle of the store
     
    return( new IntegerValue( MailModule.storeStore( context, store ) ) );
  }
View Full Code Here

     
      dirCtx = new InitialDirContext( env );

      // store the JNDI Directory Context and return the uid handle of the context
     
      return( new IntegerValue( JNDIModule.storeJNDIContext( context, dirCtx ) ) );
    }
    catch( NamingException ne ) {
      logger.error( "jndi:get-dir-context() Cannot get JNDI directory context: ", ne );
      throw( new XPathException( this, "jndi:get-dir-context() Cannot get JNDI directory context: " + ne ) );
    }
View Full Code Here

                if (counterName.contains(Counters.DELIMITER)) {
                    throw new EXistException("Invalid name for counter, character '"
                            + Counters.DELIMITER + "' is not allowed.");

                } else {
                    return new IntegerValue(counters.createCounter(counterName), Type.LONG);
                }

            } catch (EXistException e) {
                logger.error(e.getMessage());
                return Sequence.EMPTY_SEQUENCE;
            }

        } else if (getSignature().equals(createCounterAndInit)) {
            try {
                Long initValue = Long.parseLong(args[1].getStringValue());
                if (counterName.contains(Counters.DELIMITER)) {
                    throw new EXistException("Invalid name for counter, character '"
                            + Counters.DELIMITER + "' is not allowed.");
                   
                } else {
                    return new IntegerValue( counters.createCounter(counterName, initValue), Type.LONG);
                }

            } catch (EXistException e) {
                logger.error(e.getMessage());
                return Sequence.EMPTY_SEQUENCE;
            }

        } else {
            try {
                if (getSignature().equals(destroyCounter)) {
                    return new BooleanValue(counters.destroyCounter(counterName));

                } else if (getSignature().equals(nextValue)) {
                    return new IntegerValue(counters.nextValue(counterName), Type.LONG);

                } else {
                    return Sequence.EMPTY_SEQUENCE;
                }
               
View Full Code Here

            if(!FTPReply.isPositiveCompletion(reply)) {
                ftp.disconnect();
                log.warn("FTP server refused connection.");
            } else {
                // store the Connection and return the uid handle of the Connection
                result = new IntegerValue(FTPClientModule.storeConnection(context, ftp));
            }
        } catch(IOException se) {
            if(ftp.isConnected()) {
                try {
                    ftp.disconnect();
View Full Code Here

            compiled = xquery.compile(context, GET_CURRENT_REV_SOURCE);
        try {
            Sequence s = xquery.execute(compiled, Sequence.EMPTY_SEQUENCE);
            if (s.isEmpty())
                return 0;
            IntegerValue iv = (IntegerValue) s.itemAt(0);
            return iv.getLong();
        } finally {
            pool.returnCompiledXQuery(GET_CURRENT_REV_SOURCE, compiled);
        }
    }
View Full Code Here

            context = xquery.newContext(AccessContext.VALIDATION_INTERNAL);
        else
            context = compiled.getContext();
        context.declareVariable("collection", path.toString());
        context.declareVariable("document", docName);
        context.declareVariable("base", new IntegerValue(baseRev));
        context.declareVariable("key", key);
        if(compiled == null)
            compiled = xquery.compile(context, GET_CONFLICTING_REV_SOURCE);
        try {
            Sequence s = xquery.execute(compiled, Sequence.EMPTY_SEQUENCE);
View Full Code Here

            context = xquery.newContext(AccessContext.VALIDATION_INTERNAL);
        else
            context = compiled.getContext();
        context.declareVariable("collection", path.toString());
        context.declareVariable("document", docName);
        context.declareVariable("base", new IntegerValue(baseRev));
        context.declareVariable("key", sessionKey);

        if(compiled == null)
            compiled = xquery.compile(context, GET_BASE_REV_FOR_KEY_SOURCE);
        try {
            Sequence s = xquery.execute(compiled, Sequence.EMPTY_SEQUENCE);
            if (s.isEmpty())
                return 0;

            IntegerValue iv = (IntegerValue) s.itemAt(0);
            return iv.getLong();
        } finally {
            pool.returnCompiledXQuery(GET_BASE_REV_FOR_KEY_SOURCE, compiled);
        }
    }
View Full Code Here

TOP

Related Classes of org.exist.xquery.value.IntegerValue

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.