📄 session.java
字号:
/* * Copyright (c) 2005, John Mettraux, OpenWFE.org * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * . Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * . Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * . Neither the name of the "OpenWFE" nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id: Session.java,v 1.23 2005/05/17 16:41:06 jmettraux Exp $ *///// Session.java//// jmettraux@openwfe.org//// generated with // jtmpl 1.1.00 16.08.2003 John Mettraux (jmettraux@openwfe.org)//package openwfe.org.xdbc;import openwfe.org.sql.ds.OwfeDataSource;import openwfe.org.query.item.QueryItem;import openwfe.org.xdbc.nquery.IdSet;//import openwfe.org.xdbc.nquery.XdbcQueryItem;/** * The xdbc methods. * * <p><font size=2>CVS Info : * <br>$Author: jmettraux $ * <br>$Id: Session.java,v 1.23 2005/05/17 16:41:06 jmettraux Exp $ </font> * * @author jmettraux@openwfe.org */public interface Session{ /** * Mainly sets the jdbc connection the session will use. * The idPrefix must be different for every service using Xdbc and * it must be comprised between 10 and 99 included. */ public void init (java.sql.Connection con, int idPrefix) throws XdbcException; /** * An alternative init : uses an XdbcDataSource. * The idPrefix must be different for every service using Xdbc and * it must be comprised between 10 and 99 included. */ public void init (OwfeDataSource ds, int idPrefix) throws XdbcException; /** * Closes the session * (perhaps removes or release the jdbc connection behind it) */ public void close () throws XdbcException; /** * Stores an xml document in the database. * The clientId is a unique id determined by the application client to * this Xdbc session. * * @return its unique id */ public long insert (String clientId, String xmlDocument) throws XdbcException; /** * Stores an xml document in the database. * The clientId is a unique id determined by the application client to * this Xdbc session. * * @return its unique id */ public long insert (String clientId, org.jdom.Document doc) throws XdbcException; /** * updates a doc * (in fact, removes it and readds it with the same docId) */ public void update (long documentId, String clientId, String xmlDocument) throws XdbcException; /** * updates a doc * (in fact, removes it and readds it with the same docId) */ public void update (long documentId, String clientId, org.jdom.Document doc) throws XdbcException; /** * removes a document given its id */ public void remove (long xmlDocumentId) throws XdbcException; /** * removes a document given its client id. * The clientId is a unique id determined by the application client to * this Xdbc session.<br> * Returns the xmlDocumentId this document was stored under.<br> * Returns -1 if the there was no document stored under that clientId. */ public long remove (String clientId) throws XdbcException; /** * retrieves a document from its id */ public org.jdom.Document find (long xmlDocumentId) throws XdbcException; /** * retrieves a document from its id and output it as a String * with the given encoding */ public String find (long xmlDocumentId, String encoding) throws XdbcException; /** * Retrieves a list of documents. If encoding is null, the documents * are returned as org.jdom.Document instances, else as encoded strings. */ public java.util.List find (java.util.List documentIds, String encoding) throws XdbcException; /** * retrieves a document from its client id. * The clientId is a unique id determined by the application client to * this Xdbc session. */ public org.jdom.Document find (String clientId) throws XdbcException; /** * retrieves a document from its client id and dumps it as a String. * The clientId is a unique id determined by the application client to * this Xdbc session. */ public String find (String clientId, String encoding) throws XdbcException; /** * queries the Xdbc system in order to find matching documents */ public IdSet query (QueryItem query) throws XdbcException; /** * queries the Xdbc system in order to find matching documents */ public IdSet query (String clientIdLike, QueryItem query) throws XdbcException; /** * Returns a list of documentIds based on the LIKE sql string * passed as a parameter * (Useful when you want to remove a bunch of documents). */ public java.util.List determineDocumentIds (String clientIdLike) throws XdbcException; /** * Returns a list of documentIds based on the LIKE sql strings * passed as a parameter. */ public java.util.List determineDocumentIds (String[] clientIdLikes) throws XdbcException; /** * This function is similar to determineDocumentIds() but only a count * of document matching the clientIdLike are returned. * This method is used in XdbcExpressionStore.getStatus() to announce * how many expressions and how many expressions of different workflow * instances are stored. */ public int count (String clientIdLike) throws XdbcException; /** * Returns a list of String : clientIds. * May be useful for stats on documents */ public java.util.List listClientIds (String clientIdLike) throws XdbcException; /** * Returns the document id, given the client id, returns -1 if no * document was stored under that clientId. */ public long determineDocumentId (String clientId) throws XdbcException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -