Difference between revisions of "Advanced Topics"

From GCube System
Jump to: navigation, search
(ISClient interface)
(ISClient interface)
Line 57: Line 57:
 
The execute method takes as parameter:
 
The execute method takes as parameter:
 
*the ISQuery Object (with all parameters filled correctly otherwise the ISClient
 
*the ISQuery Object (with all parameters filled correctly otherwise the ISClient
throws an ISMalformedQueryException)
+
throws an ISMalformedQueryException);
*a GCUBEScope object that specifies the query scope
+
*a GCUBEScope object that specifies the query scope;
*The GCUBEContext of the caller ( in case of a gCube Service the caller Context is the Service Context itself)
+
*The GCUBEContext of the caller ( in case of a gCube Service the caller Context is the Service Context itself);
  
 
   
 
   

Revision as of 14:13, 31 March 2008

Interfacing the Information System

The gCore Frameork has been designed to work independently from a IS specific Implementation. In order to let the gCF unbound from a IS implementation both query & publishing interfaces have been designed. The gCF implements than a dynamic class loader that ( reading a implementation file that contains the mapping btw the IS interfaces and their implementations) can abstract over the IS technology.

ISQuery interface

The ISQuery interface designs the minimal query behavoiur accepted by the ISClient. The query contains the textual query expression and specify a time-to-live for their results (that can be exploited by future caching mechianism) The definition is parametric with respect the type of the exptected results. This is not required for the interface, though it may for its implementations; in addition , it allows full typing of the ISClients interface.

public interface ISQuery<RESULT> {
	   /**
	    * Returns the time-to-live of the results of the query.
	    * @return the time-to-live.
	    */
	   public long getTTL();

	   /**
	    * Sets the time-to-live of the results of the query.
	    * @param ttl the time-to-live.
	    */
	   public void setTTL(long ttl);

	   /**
	    * Returns the textual expression of the query.
	    * @return the expression.
	    */
	   public String getQueryExpression();

	   /**
	    * Sets the textual expression of the query.
	    * @param exp the expression.
	    */
	   public void setQueryExpression(String exp);
}

ISClient interface

The IS Client interface defines only two methods:

public <RESULT> List<RESULT> execute(ISQuery<RESULT> query, GCUBEScope scope,GCUBEContext ...context) throws 

ISMalformedQueryException,ISInvalidQueryException,ISException;	


The execute method takes as parameter:

  • the ISQuery Object (with all parameters filled correctly otherwise the ISClient

throws an ISMalformedQueryException);

  • a GCUBEScope object that specifies the query scope;
  • The GCUBEContext of the caller ( in case of a gCube Service the caller Context is the Service Context itself);


public <RESULT, QUERY extends ISQuery<RESULT>> QUERY getQuery(Class<QUERY> clazz) throws ISUnsupportedQueryException;

Sample usage

ISPublisher interface



Sample usage

Service security

Configuring gContainer with Security

Configuring gCube Service with Credentials

--Manuele.simi 20:11, 28 March 2008 (EET)