Difference between revisions of "Advanced Topics"

From GCube System
Jump to: navigation, search
(ISClient interface)
(ISPublisher interface)
Line 139: Line 139:
 
*Topics  
 
*Topics  
  
In particular GCUBEResources are modeled as  
+
In particular GCUBEResources profiles are modeled as java classes inside the framework:
 +
*GCUBEService
 +
*GCUBERunningInstance
 +
*GCUBEHostingNode
 +
*GCUBECS
 +
*GCUBECSInstance
 +
*GCUBECollection
 +
*GCUBEMCollection
 +
*GCUBEVRE
 +
*GCUBETransformationProgram
 +
*GCUBEExternalRunningInstance
 +
*GCUBEGenericRescource
 +
 
 +
gCUBE Client/Services can explout the IS-Publisher to store/upadte/remove GCUBEResource profiles from/to the IS:
 +
 
 +
<pre>
 +
public String  registerGCUBEResource(GCUBEResource resource,GCUBEScope scope, GCUBESecurityManager manager)throws ISPublisherException;
 +
 +
/**
 +
* Remove a GCUBEResource from the Information Service
 +
* @param ID the ID related to the Gcube Resource to remove
 +
* @param the GCUBEResource type to remove
 +
* @param scope the registration scope
 +
* @param manager a GCUBESecurityManager
 +
* @throws ISPublisherException Exception
 +
*/
 +
public  void removeGCUBEResource(String ID,String type,GCUBEScope scope,GCUBESecurityManager manager) throws ISPublisherException;
 +
 +
/**
 +
* Update a GCUBEResource in the Information Service
 +
* @param resource The new Gcube Resource to update
 +
* @param manager a GCUBESecurityManager
 +
* @throws ISPublisherException Exception
 +
*/
 +
public void updateGCUBEResource(GCUBEResource resource,GCUBEScope scope,GCUBESecurityManager manager) throws ISPublisherException;
 +
 
 +
</pre>
 +
 
 +
 
 +
GCUBEWSResource class then, define WS-Resource-Porperties to publish in the IS ( the publication mechanism is completely
 +
hidden by the gCF)
 +
 
 +
Topics publishers can use the IS-Publihser interface to
 +
 
  
  

Revision as of 15:25, 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);

The return type is a List object specified as Type parameter in the related ISquery object.

In order to get the implementation of the ISClient Interface, the GHNContext exposes the static method getImplementation:

ISClient client =  GHNContext.getImplementation(ISClient.class);

The IS Client Interface predefines a list of abstract queries that model the most common useful queries used by the gCF.

In particular we have general queries over GCUBEResources:

  • GCUBEResourceEntriesQuery
  • GCUBEResourceFromIDQuery
  • GCUBEResourceIDQuery
  • GCUBEResourceXPathQuery
  • GCUBERIsFromClassAndName
  • GCUBERIsOnGHNQuery
  • GCUBERISpecificData
  • GCUBEAllResourceIDQuery
  • GCUBEGHNIDFromHostNameQuery
  • GCUBEEntriesFromGHNIDQuery

Queries over GCUBECollection:

  • GCUBEAllInternalCollectionEntriesQuery:
  • GCUBEAllInternalCollectionIDsQuery
  • GCUBECollectionIDFromSchemaQuery

Queries over GCUBEMCollection:

  • GCUBEMCollectionFormatsRelatedToCollectionQuery
  • GCUBEMCollectionIDsFromMetaFormatLanguageQuery
  • GCUBEMCollectionIDsFromMetaFormatNameQuery
  • GCUBEMCollectionIDsFromNameQuery
  • GCUBEMCollectionIDsFromSchemaQuery
  • GCUBEMCollectionIDsRelatedToCollectionAndRoleQuery
  • GCUBEMCollectionIDsRelatedToCollectionQuery


Queries over GCUBEWSResources:

  • GCUBEWSResourceEPRFromRPNamesAndNamespaceQuery
  • GCUBEWSResourceEPRFromRPNamesQuery
  • GCUBEWSResourceEPRFromRPValuesAndNamespaceQuery
  • GCUBEWSResourceEPRFromRPValuesQuery
  • GCUBEWSResourceHeaderQuery
  • GCUBEWSResourceRPEntriesFromEPRQuery
  • GCUBEWSResourceRPValueFromEPRQuery
  • GCUBEWSResourceXPathQuery
  • GCUBEAllWSResourcesQuery

And a GenericQuery Object that can be used to query the IS without using predefined queries.

In order to get the implementation specific ISQuery Object, IS Client exposes the method getQuery, that dynamically loads the ISQuery implementation of the given ISQuery interface:

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

i.e.

GCUBERIsFromClassAndName queryRI = client.getQuery(GCUBERIsFromClassAndName.class);


Sample usage

--Andrea.manzi 17:09, 31 March 2008 (EEST)

ISPublisher interface

The ISPublisher interface defines methods to register/unregister/update these kind of objects on the IS:

  • GCUBEResources
  • GCUBEWSResources
  • Topics

In particular GCUBEResources profiles are modeled as java classes inside the framework:

  • GCUBEService
  • GCUBERunningInstance
  • GCUBEHostingNode
  • GCUBECS
  • GCUBECSInstance
  • GCUBECollection
  • GCUBEMCollection
  • GCUBEVRE
  • GCUBETransformationProgram
  • GCUBEExternalRunningInstance
  • GCUBEGenericRescource

gCUBE Client/Services can explout the IS-Publisher to store/upadte/remove GCUBEResource profiles from/to the IS:

public String  registerGCUBEResource(GCUBEResource resource,GCUBEScope scope, GCUBESecurityManager manager)throws ISPublisherException;
	
	/**
	 * Remove a GCUBEResource from the Information Service
	 * @param ID the ID related to the Gcube Resource to remove
	 * @param the GCUBEResource type to remove
	 * @param scope the registration scope
	 * @param manager a GCUBESecurityManager
	 * @throws ISPublisherException Exception
	 */
	public  void removeGCUBEResource(String ID,String type,GCUBEScope scope,GCUBESecurityManager manager) throws ISPublisherException;
	
	/**
	 * Update a GCUBEResource in the Information Service
	 * @param resource The new Gcube Resource to update 
	 * @param manager a GCUBESecurityManager
	 * @throws ISPublisherException Exception
	 */
	public void updateGCUBEResource(GCUBEResource resource,GCUBEScope scope,GCUBESecurityManager manager) throws ISPublisherException;


GCUBEWSResource class then, define WS-Resource-Porperties to publish in the IS ( the publication mechanism is completely hidden by the gCF)

Topics publishers can use the IS-Publihser interface to


Sample usage

Service security

Configuring gContainer with Security

Configuring gCube Service with Credentials

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