jadex.standalone.service
Class DirectoryFacilitatorService

java.lang.Object
  extended by jadex.commons.service.BasicService
      extended by jadex.standalone.service.DirectoryFacilitatorService
All Implemented Interfaces:
IDF, IRemotable, IInternalService, IService

public class DirectoryFacilitatorService
extends BasicService
implements IDF

Directory facilitator implementation for standalone platform.


Field Summary
protected  IClockService clockservice
          The cached clock service.
protected  IComponentManagementService cms
          The cached component management service.
protected  IndexMap components
          The registered components.
protected  IServiceProvider provider
          The platform.
 
Fields inherited from class jadex.commons.service.BasicService
idcnt, properties, shutdowned, sid, started, startfutures
 
Fields inherited from interface jadex.commons.service.IService
EMPTY_SERVICES
 
Constructor Summary
DirectoryFacilitatorService(IServiceProvider provider)
          Create a standalone df.
DirectoryFacilitatorService(IServiceProvider provider, Map properties)
          Create a standalone df.
 
Method Summary
 IDFComponentDescription createDFComponentDescription(IComponentIdentifier component, IDFServiceDescription service)
          Create a df component description.
 IDFComponentDescription createDFComponentDescription(IComponentIdentifier component, IDFServiceDescription[] services, String[] languages, String[] ontologies, String[] protocols, Date leasetime)
          Create a new df component description.
 IDFServiceDescription createDFServiceDescription(String name, String type, String ownership)
          Create a df service description.
 IDFServiceDescription createDFServiceDescription(String name, String type, String ownership, String[] languages, String[] ontologies, String[] protocols, IProperty[] properties)
          Create a df service description.
 ISearchConstraints createSearchConstraints(int maxresults, int maxdepth)
          Create a search constraints object.
 IFuture deregister(IDFComponentDescription cdesc)
          Deregister a component description.
protected  boolean includes(Object[] a, Object[] b)
          Test if one array of objects is included in the other (without considering the order).
protected  boolean match(IDFComponentDescription desc, IDFComponentDescription template)
          Test if a component description matches a given template.
protected  boolean match(IDFServiceDescription desc, IDFServiceDescription template)
          Test if a service description matches a given template.
 IFuture modify(IDFComponentDescription cdesc)
          Modify a component description.
 IFuture register(IDFComponentDescription cdesc)
          Register a component description.
 IFuture search(IDFComponentDescription adesc, ISearchConstraints con)
          Search for components matching the given description.
 IFuture search(IDFComponentDescription adesc, ISearchConstraints con, boolean remote)
          Search for components matching the given description.
 IFuture startService()
          Start the service.
 
Methods inherited from class jadex.commons.service.BasicService
createServiceIdentifier, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap, shutdownService, signalStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jadex.commons.service.IService
getPropertyMap, getServiceIdentifier, signalStarted
 

Field Detail

provider

protected IServiceProvider provider
The platform.


cms

protected IComponentManagementService cms
The cached component management service.


clockservice

protected IClockService clockservice
The cached clock service.


components

protected IndexMap components
The registered components.

Constructor Detail

DirectoryFacilitatorService

public DirectoryFacilitatorService(IServiceProvider provider)
Create a standalone df.


DirectoryFacilitatorService

public DirectoryFacilitatorService(IServiceProvider provider,
                                   Map properties)
Create a standalone df.

Method Detail

register

public IFuture register(IDFComponentDescription cdesc)
Register a component description.

Specified by:
register in interface IDF
Throws:
RuntimeException - when the component description is already registered.

deregister

public IFuture deregister(IDFComponentDescription cdesc)
Deregister a component description.

Specified by:
deregister in interface IDF
Throws:
RuntimeException - when the component is not registered.

modify

public IFuture modify(IDFComponentDescription cdesc)
Modify a component description.

Specified by:
modify in interface IDF
Throws:
RuntimeException - when the component is not registered.

search

public IFuture search(IDFComponentDescription adesc,
                      ISearchConstraints con)
Search for components matching the given description.

Specified by:
search in interface IDF
Returns:
An array of matching component descriptions.

search

public IFuture search(IDFComponentDescription adesc,
                      ISearchConstraints con,
                      boolean remote)
Search for components matching the given description.

Specified by:
search in interface IDF
Returns:
An array of matching component descriptions.

createDFServiceDescription

public IDFServiceDescription createDFServiceDescription(String name,
                                                        String type,
                                                        String ownership)
Create a df service description.

Specified by:
createDFServiceDescription in interface IDF
Parameters:
name - The name.
type - The type.
ownership - The ownership.
Returns:
The service description.

createDFServiceDescription

public IDFServiceDescription createDFServiceDescription(String name,
                                                        String type,
                                                        String ownership,
                                                        String[] languages,
                                                        String[] ontologies,
                                                        String[] protocols,
                                                        IProperty[] properties)
Create a df service description.

Specified by:
createDFServiceDescription in interface IDF
Parameters:
name - The name.
type - The type.
ownership - The ownership.
languages - The languages.
ontologies - The ontologies.
protocols - The protocols.
properties - The properties.
Returns:
The service description.

createDFComponentDescription

public IDFComponentDescription createDFComponentDescription(IComponentIdentifier component,
                                                            IDFServiceDescription service)
Create a df component description.

Specified by:
createDFComponentDescription in interface IDF
Parameters:
component - The component.
service - The service.
Returns:
The df component description.

createDFComponentDescription

public IDFComponentDescription createDFComponentDescription(IComponentIdentifier component,
                                                            IDFServiceDescription[] services,
                                                            String[] languages,
                                                            String[] ontologies,
                                                            String[] protocols,
                                                            Date leasetime)
Create a new df component description.

Specified by:
createDFComponentDescription in interface IDF
Parameters:
component - The component id.
services - The services.
languages - The languages.
ontologies - The ontologies.
protocols - The protocols.
Returns:
The component description.

createSearchConstraints

public ISearchConstraints createSearchConstraints(int maxresults,
                                                  int maxdepth)
Create a search constraints object.

Specified by:
createSearchConstraints in interface IDF
Parameters:
maxresults - The maximum number of results.
maxdepth - The maximal search depth.
Returns:
The search constraints.

startService

public IFuture startService()
Start the service.

Specified by:
startService in interface IInternalService
Overrides:
startService in class BasicService

match

protected boolean match(IDFComponentDescription desc,
                        IDFComponentDescription template)
Test if a component description matches a given template.


match

protected boolean match(IDFServiceDescription desc,
                        IDFServiceDescription template)
Test if a service description matches a given template.


includes

protected boolean includes(Object[] a,
                           Object[] b)
Test if one array of objects is included in the other (without considering the order). Test is performed using equals().



Copyright © 2010. All Rights Reserved.