[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
AW: [geclipse-dev] Get specific Services from info system
|
Hi Guys,
I have the feeling that we are currently discussing very specific use cases for a very general design pattern. I understand what Mateusz wants to have and I understand what Nick wants to provide. Nevertheless these are really special use cases. In my opinion we should not introduce one method for one use case but some very general new pattern. Therefore my suggestion would be something (but maybe not exactly since these are just the thoughts shooting to my brain):
class IGridInfoService {
[...]
public IGridResource[] query( final Query params );
[...]
}
class Query {
enum Field {
NAME,
HOST,
SCHEME,
[...]
};
private Class< T implements IGridResource > type;
private Hashtable< Field, String > conditions;
public Query( final Class< T implements IGridResource > type ) {
[...]
}
public void addCondition( final Field field, final String value ) {
this.conditions.put( field, value );
}
public boolean accept( final IGridResource resource ) {
// This method will test if the specified resource does meet all
// conditions and can therefore directly be used by the info
// service to filter all available resources
}
}
As I said this is just a quick shot. But
1) It is much more general than providing a single method for each usecase.
2) It is easily extensible for future requirements.
3) It can also be extended to allow more complex boolean conditions like or'ing and not'ing etc.
4) It catches one central point of a info service, namely to provide the user with specific information out of a pool of general resources.
5) At least a very first version is straightforward to implement.
Cheers, Mathias
-----Ursprüngliche Nachricht-----
Von: geclipse-dev-bounces@xxxxxxxxxxx [mailto:geclipse-dev-bounces@xxxxxxxxxxx] Im Auftrag von Mateusz Pabis'
Gesendet: Mittwoch, 6. Februar 2008 08:37
An: Developer mailing list
Betreff: Re: [geclipse-dev] Get specific Services from info system
Nick Tsioutsias pisze:
> Mateusz Pabis' wrote:
>> What I'm looking forward is to have an easy way to figure out what is
>> the endpoint for the SRM service on host abc.somwhere.com.
>
> I am thinking of adding the following method in the BDIIService class
> which is the info service for the projects with voms vo:
>
> public IGridService[] queryService( final String serviceType, // the
> type of the service for example SRM for srm 2.
> final String
> hostName) // the hostname.
>
>
> The above method will return all the services with the specific
> serviceType that belong to the specific hostName and are supported by
> the currentVO. If serviceType or hostName are null, they are not taken
> under account. For example by calling queryService(null,
> "plethon.grid.ucy.ac.cy") you will get all the two srm services of plethon.
>
> You can get the endpoint of it with the following code:
> IGridService[] resultArray;
> resultArray = this.queryService( null, "plethon.grid.ucy.ac.cy" );
> GridGlueService myService = (GridGlueService) resultArray[0];
> String myEndpoint = myService.getGlueService().endpoint;
>
> I don't think you will add any additional dependencies as
> GridGlueService is on eu.geclipse.info plugin and you should already a
> dependency to it. Is that satisfactory?
I need one more method, which is similar to this one, probably it looks
like:
public IGridStorage queryStorage( final String hostname )
I need it, because only from storage I can get home directory, which is
somehow essential to properly mount SRM service.
But this leads to the situation that I have to integrate these
information in EFS plugin, which is not a problem, but I think it should
be done somewhere between eu.geclipse.info and eu.geclipse.efs
--
Mateusz Pabis
_______________________________________________
geclipse-dev mailing list
geclipse-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/geclipse-dev