Class ServiceQuery<T>
java.lang.Object
jadex.providedservice.impl.search.ServiceQuery<T>
Service query definition. T is the return type for search methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Define cases for multiplicity. -
Field Summary
FieldsModifier and TypeFieldDescriptionDefault matching modes set the elements with OR semantics.protected boolean
Flag if event mode is enabled on the query.protected boolean
Flag, if service by the query owner should be excluded, i.e.protected String
The query id.The matching mode for multivalued terms.protected ServiceQuery.Multiplicity
The multiple flag.protected String[]
The network names.static final String[]
Marker for networks not set.protected jadex.core.ComponentIdentifier
The query owner.static final String
The (default) decoupled proxy type (decouples from component thread to caller thread).static final String
The direct proxy type (supports custom interceptors, but uses caller thread).static final String
The raw proxy type (i.e.protected String
Required service proxy type.protected ServiceScope
The search scope.protected IServiceIdentifier
The service ID of the target service.protected String[]
Tags of the service.protected jadex.common.ClassInfo
The service type.protected Boolean
Should the service be unrestricted. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Create a new service query.ServiceQuery
(jadex.common.ClassInfo servicetype) Create a new service query.ServiceQuery
(jadex.common.ClassInfo servicetype, ServiceScope scope, jadex.core.ComponentIdentifier owner) Create a new service query.ServiceQuery
(ServiceQuery<T> original) Shallow copy constructor.ServiceQuery
(Class<T> servicetype) Create a new service query.ServiceQuery
(Class<T> servicetype, ServiceScope scope) Create a new service query.ServiceQuery
(Class<T> servicetype, ServiceScope scope, jadex.core.ComponentIdentifier owner) Create a new service query. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if other object equals this one.getId()
Get the id.Gets the specification for the indexer.getMatchingMode
(String key) Get the matching mode for a key.Get the multiplicity.String[]
Get the networknames.jadex.core.ComponentIdentifier
getOwner()
Get the owner.Returns the requested required service proxy type.getScope()
Get the scope.Gets the service identifier.String[]
Gets the service tags.jadex.common.ClassInfo
Get the service type.int
hashCode()
Get the hashcode.boolean
Checks if query is in event mode.boolean
Checks if service of the query owner should be excluded.Get the unrestricted mode.protected boolean
matchesKeys
(IServiceIdentifier service) Tests if the query keys matches a service.Changes the query to event mode.void
setEventMode
(boolean eventmode) Deprecated.For bean purposes only, use setEventMode().setExcludeOwner
(boolean excludeowner) Sets if service of the query owner should be excluded.Set the id.setMatchingMode
(String key, Boolean and) Set a matching mode.setMultiplicity
(int multiplicity) Set the multiplicity.setMultiplicity
(int multiplicitystart, int multiplicityend) Set the multiplicity.setMultiplicity
(ServiceQuery.Multiplicity multiplicity) Set the multiplicity.setNetworkNames
(String... networknames) Set the networknames.setOwner
(jadex.core.ComponentIdentifier owner) Set the owner.setProvider
(jadex.core.ComponentIdentifier provider) Set the provider.setRequiredProxyType
(String requiredproxytype) Sets the requested required service proxy type.setScope
(ServiceScope scope) Set the scope.setServiceIdentifier
(IServiceIdentifier serviceidentifier) Sets the service identifier.setServiceTags
(String[] servicetags) Sets the service tags.setServiceType
(jadex.common.ClassInfo servicetype) Set the service type.setUnrestricted
(Boolean unrestricted) Set the unrestricted mode.toString()
Get the string representation.
-
Field Details
-
PROXYTYPE_RAW
The raw proxy type (i.e. no proxy).- See Also:
-
PROXYTYPE_DIRECT
The direct proxy type (supports custom interceptors, but uses caller thread).- See Also:
-
PROXYTYPE_DECOUPLED
The (default) decoupled proxy type (decouples from component thread to caller thread).- See Also:
-
NETWORKS_NOT_SET
Marker for networks not set. -
DEFAULT_MATCHINGMODES
Default matching modes set the elements with OR semantics. -
servicetype
protected jadex.common.ClassInfo servicetypeThe service type. -
servicetags
Tags of the service. -
serviceidentifier
The service ID of the target service. Fast lookup of a service by id. -
networknames
The network names. -
unrestricted
Should the service be unrestricted. -
scope
The search scope. -
owner
protected jadex.core.ComponentIdentifier ownerThe query owner. (rename queryowner?) -
excludeowner
protected boolean excludeownerFlag, if service by the query owner should be excluded, i.e. do not return my own service. -
multiplicity
The multiple flag. Search for multiple services -
eventmode
protected boolean eventmodeFlag if event mode is enabled on the query. -
matchingmodes
The matching mode for multivalued terms. True is and and false is or. -
requiredproxytype
Required service proxy type. -
id
The query id. Id is used for hashcode and equals and the same is used by servicequeryinfo class. Allows for hashing queryies and use a queryinfo object for lookup.
-
-
Constructor Details
-
ServiceQuery
protected ServiceQuery()Create a new service query. -
ServiceQuery
Create a new service query. -
ServiceQuery
Create a new service query. -
ServiceQuery
Create a new service query. -
ServiceQuery
public ServiceQuery(jadex.common.ClassInfo servicetype) Create a new service query. -
ServiceQuery
public ServiceQuery(jadex.common.ClassInfo servicetype, ServiceScope scope, jadex.core.ComponentIdentifier owner) Create a new service query. -
ServiceQuery
Shallow copy constructor.- Parameters:
original
- Original query.
-
-
Method Details
-
getServiceType
public jadex.common.ClassInfo getServiceType()Get the service type.- Returns:
- The service type
-
setServiceType
Set the service type.- Parameters:
type
- The service type to set
-
setEventMode
Deprecated.For bean purposes only, use setEventMode().Changes the query to event mode.- Parameters:
eventmode
- the event mode state.
-
setEventMode
Changes the query to event mode.- Returns:
- The new query.
-
isEventMode
public boolean isEventMode()Checks if query is in event mode.- Returns:
- True, if in event mode
-
getScope
Get the scope.- Returns:
- The scope
-
setScope
Set the scope.- Parameters:
scope
- The scope to set
-
getServiceTags
Gets the service tags.- Returns:
- The service tags.
-
setServiceTags
Sets the service tags.- Parameters:
servicetags
- The service tags. todo: move or refactor to hide complexity!?
-
setProvider
Set the provider.- Parameters:
provider
- The provider to set
-
getServiceIdentifier
Gets the service identifier.- Returns:
- The service identifier.
-
setServiceIdentifier
Sets the service identifier. Also sets the corresponding provider when sid!=null.- Parameters:
serviceidentifier
- The service identifier.
-
getOwner
public jadex.core.ComponentIdentifier getOwner()Get the owner.- Returns:
- The owner
-
setOwner
Set the owner.- Parameters:
owner
- The owner to set
-
isExcludeOwner
public boolean isExcludeOwner()Checks if service of the query owner should be excluded.- Returns:
- True, if the services should be excluded.
-
setExcludeOwner
Sets if service of the query owner should be excluded.- Parameters:
excludeowner
- True, if the services should be excluded.
-
getId
Get the id.- Returns:
- the id
-
setId
Set the id.- Parameters:
id
- The id to set
-
getMultiplicity
Get the multiplicity.- Returns:
- the multiplicity
-
setMultiplicity
Set the multiplicity.- Parameters:
multiplicity
- The minimum multiplicity to set
-
setMultiplicity
Set the multiplicity.- Parameters:
multiplicitystart
- The minimum multiplicity to setmultiplicityend
- The max multiplicity to set
-
setMultiplicity
Set the multiplicity.- Parameters:
multiplicity
- The multiplicity to set
-
getIndexerSearchSpec
Gets the specification for the indexer. Query needs to be enhanced before calling this method. See RequiredServiceFeature.enhanceQuery()- Returns:
- The specification for the indexer.
-
getMatchingMode
Get the matching mode for a key.- Parameters:
key
- The key name.- Returns:
- True for and, false for or.
-
setMatchingMode
Set a matching mode.- Parameters:
key
- The key name.and
- True for and.
-
isUnrestricted
Get the unrestricted mode.- Returns:
- The unrestricted mode.
-
setUnrestricted
Set the unrestricted mode.- Parameters:
unrestricted
- the unrestricted to set
-
matchesKeys
Tests if the query keys matches a service.- Parameters:
service
- The service.- Returns:
- True, if the service matches the keys.
-
getNetworkNames
Get the networknames.- Returns:
- the networknames
-
setNetworkNames
Set the networknames.- Parameters:
networknames
- The networknames to set
-
getRequiredProxyType
Returns the requested required service proxy type.- Returns:
- The requested required service proxy type.
-
setRequiredProxyType
Sets the requested required service proxy type.- Parameters:
requiredproxytype
- The requested required service proxy type.
-
hashCode
public int hashCode()Get the hashcode. -
equals
Test if other object equals this one. -
toString
Get the string representation.
-