Changeset 3805


Ignore:
Timestamp:
Oct 4, 2007, 4:33:45 PM (16 years ago)
Author:
Martin Svensson
Message:

References #492 Added a basic support for includes in queries and added a refresh session service

Location:
branches/webservices
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/webservices/src/core/net/sf/basedb/core/Application.java

    r3695 r3805  
    617617 
    618618  /**
     619    Gets the maximum number of minutes before an active session
     620    is logged out.
     621      @return An integer with number of minutes
     622      @since 2.5
     623   */
     624  public static int sessionCacheTimeout()
     625  {
     626    return sessionCacheTimeout;
     627  }
     628 
     629  /**
    619630    Checks if the server has configured a secondary storage or not.
    620631   
  • branches/webservices/src/test/TestWebservices.java

    r3063 r3805  
    2727import net.sf.basedb.ws.client.SessionClient;
    2828import net.sf.basedb.ws.info.ItemInfo;
     29import net.sf.basedb.ws.info.QueryOptions;
    2930import net.sf.basedb.ws.info.RawBioAssayInfo;
    3031
     
    144145    {
    145146      ProjectClient projectClient = new ProjectClient(client);
    146       ItemInfo[] projects = projectClient.getProjects();
     147      QueryOptions qOp = new QueryOptions(); 
     148      ItemInfo[] projects = projectClient.getProjects(qOp);
    147149      if (projects != null)
    148150      {
  • branches/webservices/src/test/set_classpath.sh

    r3803 r3805  
    9999CP=$CP:$WS_LIB/activation-1.1.jar
    100100CP=$CP:$WS_LIB/backport-util-concurrent-2.2.jar
     101CP=$CP:$WS_LIB/annogen-0.1.0.jar
    101102
    102103# Affymetrix Fusion SDK
  • branches/webservices/src/webservices/client/java/net/sf/basedb/ws/client/ProjectClient.java

    r3039 r3805  
    2525
    2626import net.sf.basedb.ws.info.ItemInfo;
     27import net.sf.basedb.ws.info.QueryOptions;
    2728
    2829import org.apache.axis2.AxisFault;
     
    4748  }
    4849 
    49   public ItemInfo[] getProjects()
     50  public ItemInfo[] getProjects(QueryOptions qOptions)
    5051    throws AxisFault
    5152  {
    5253    RPCServiceClient service = getService();
    53     ItemInfo[] result = invokeBlocking("getProjects", ItemInfo[].class, session.getId());
     54    QueryOptions qOpt = new QueryOptions();
     55    ItemInfo[] result = invokeBlocking("getProjects", ItemInfo[].class, session.getId(), qOpt);
    5456    return result;
    55   }
    56  
     57  }
    5758}
  • branches/webservices/src/webservices/server/net/sf/basedb/ws/server/ProjectService.java

    r3135 r3805  
    2424package net.sf.basedb.ws.server;
    2525
     26import java.util.ArrayList;
    2627import java.util.LinkedList;
    2728import java.util.List;
     
    3334import net.sf.basedb.core.SessionControl;
    3435import net.sf.basedb.ws.info.ItemInfo;
     36import net.sf.basedb.ws.info.QueryOptions;
    3537
    3638public class ProjectService
     
    5961  }
    6062 
    61   public ItemInfo[] getProjects(String ID)
     63  public ItemInfo[] getProjects(String ID, QueryOptions qOpt)
    6264  {
    6365    SessionControl sc = getSessionControl(ID);
     
    6769    {
    6870      ItemQuery<Project> query = Project.getQuery();
    69       query.include(Include.MINE, Include.SHARED, Include.OTHERS);
     71      List<Include> includes = new ArrayList<Include>();
     72      if (qOpt.getIncludeMine()) includes.add(Include.MINE);
     73      if (qOpt.getIncludeShared()) includes.add(Include.SHARED);
     74      if (qOpt.getIncludeOthers()) includes.add(Include.OTHERS);
     75     
     76      Include incl[] = new Include[includes.size()];
     77      includes.toArray(incl);
     78      query.include(incl);
    7079      for (Project project : query.list(dc))
    7180      {
  • branches/webservices/src/webservices/server/net/sf/basedb/ws/server/SessionService.java

    r3006 r3805  
    5757  }
    5858 
     59  /**
     60    Gets the time in minutes when a session
     61    is automatically logged out.
     62      @return An integer with number of minutes
     63  */
     64  public int getSessionTimeOut()
     65  {
     66    return Application.sessionCacheTimeout();
     67  }
     68 
     69  /**
     70    Refresh a session so it wont be automatically logged out.
     71      @param ID The session id as a string
     72   */
     73  public void refreshSession(String ID)
     74  {
     75    SessionControl sc = getSessionControl(ID);
     76    sc.updateLastAccess();
     77  }
    5978}
  • branches/webservices/www/WEB-INF

    • Property svn:ignore
      •  

        old new  
        1 
        21classes
        32lib
        43web.xml
         4conf
         5services
Note: See TracChangeset for help on using the changeset viewer.