public class ServiceQuery<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ServiceQuery.Multiplicity
Define cases for multiplicity.
|
Modifier and Type | Field and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Boolean> |
DEFAULT_MATCHINGMODES
Default matching modes set the elements with OR semantics.
|
protected boolean |
eventmode
Flag if event mode is enabled on the query.
|
protected boolean |
excludeowner
Flag, if service by the query owner should be excluded, i.e.
|
protected java.lang.String |
id
The query id.
|
protected java.util.Map<java.lang.String,java.lang.Boolean> |
matchingmodes
The matching mode for multivalued terms.
|
protected ServiceQuery.Multiplicity |
multiplicity
The multiple flag.
|
protected java.lang.String[] |
networknames
The network names.
|
static java.lang.String[] |
NETWORKS_NOT_SET
Marker for networks not set.
|
protected IComponentIdentifier |
owner
The query owner.
|
protected IComponentIdentifier |
platform
The service platform.
|
static java.lang.String |
PROXYTYPE_DECOUPLED
The (default) decoupled proxy type (decouples from component thread to caller thread).
|
static java.lang.String |
PROXYTYPE_DIRECT
The direct proxy type (supports custom interceptors, but uses caller thread).
|
static java.lang.String |
PROXYTYPE_RAW
The raw proxy type (i.e.
|
protected java.lang.String |
requiredproxytype
Required service proxy type.
|
protected ServiceScope |
scope
The search scope.
|
protected IComponentIdentifier |
searchstart
Starting point for the search scoping.
|
protected IServiceIdentifier |
serviceidentifier
The service ID of the target service.
|
protected java.lang.String[] |
servicetags
Tags of the service.
|
protected ClassInfo |
servicetype
The service type.
|
protected java.lang.Boolean |
unrestricted
Should the service be unrestricted.
|
Modifier | Constructor and Description |
---|---|
protected |
ServiceQuery()
Create a new service query.
|
|
ServiceQuery(java.lang.Class<T> servicetype)
Create a new service query.
|
|
ServiceQuery(java.lang.Class<T> servicetype,
ServiceScope scope)
Create a new service query.
|
|
ServiceQuery(java.lang.Class<T> servicetype,
ServiceScope scope,
IComponentIdentifier owner)
Create a new service query.
|
|
ServiceQuery(ClassInfo servicetype)
Create a new service query.
|
|
ServiceQuery(ClassInfo servicetype,
ServiceScope scope,
IComponentIdentifier owner)
Create a new service query.
|
|
ServiceQuery(ServiceQuery<T> original)
Shallow copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Test if other object equals this one.
|
java.lang.String |
getId()
Get the id.
|
java.util.List<Tuple3<java.lang.String,java.lang.String[],java.lang.Boolean>> |
getIndexerSearchSpec()
Gets the specification for the indexer.
|
java.lang.Boolean |
getMatchingMode(java.lang.String key)
Get the matching mode for a key.
|
ServiceQuery.Multiplicity |
getMultiplicity()
Get the multiplicity.
|
java.lang.String[] |
getNetworkNames()
Get the networknames.
|
IComponentIdentifier |
getOwner()
Get the owner.
|
IComponentIdentifier |
getPlatform()
Get the platform.
|
java.lang.String |
getRequiredProxyType()
Returns the requested required service proxy type.
|
ServiceScope |
getScope()
Get the scope.
|
IComponentIdentifier |
getSearchStart()
Get the provider.
|
IServiceIdentifier |
getServiceIdentifier()
Gets the service identifier.
|
java.lang.String[] |
getServiceTags()
Gets the service tags.
|
ClassInfo |
getServiceType()
Get the service type.
|
IComponentIdentifier |
getTargetPlatform()
Get the target platform if specified (using platform and provider).
|
int |
hashCode()
Get the hashcode.
|
boolean |
isEventMode()
Checks if query is in event mode.
|
boolean |
isExcludeOwner()
Checks if service of the query owner should be excluded.
|
java.lang.Boolean |
isUnrestricted()
Get the unrestricted mode.
|
protected boolean |
matchesKeys(IServiceIdentifier service)
Tests if the query keys matches a service.
|
ServiceQuery<ServiceEvent<T>> |
setEventMode()
Changes the query to event mode.
|
void |
setEventMode(boolean eventmode)
Deprecated.
For bean purposes only, use setEventMode().
|
ServiceQuery<T> |
setExcludeOwner(boolean excludeowner)
Sets if service of the query owner should be excluded.
|
ServiceQuery<T> |
setId(java.lang.String id)
Set the id.
|
ServiceQuery<T> |
setMatchingMode(java.lang.String key,
java.lang.Boolean and)
Set a matching mode.
|
ServiceQuery<T> |
setMultiplicity(int multiplicity)
Set the multiplicity.
|
ServiceQuery<T> |
setMultiplicity(int multiplicitystart,
int multiplicityend)
Set the multiplicity.
|
ServiceQuery<T> |
setMultiplicity(ServiceQuery.Multiplicity multiplicity)
Set the multiplicity.
|
ServiceQuery<T> |
setNetworkNames(java.lang.String... networknames)
Set the networknames.
|
ServiceQuery<T> |
setOwner(IComponentIdentifier owner)
Set the owner.
|
ServiceQuery<T> |
setPlatform(IComponentIdentifier platform)
Set the platform.
|
ServiceQuery<T> |
setProvider(IComponentIdentifier provider)
Set the provider.
|
ServiceQuery<T> |
setRequiredProxyType(java.lang.String requiredproxytype)
Sets the requested required service proxy type.
|
ServiceQuery<T> |
setScope(ServiceScope scope)
Set the scope.
|
ServiceQuery<T> |
setSearchStart(IComponentIdentifier searchstart)
Set the provider.
|
ServiceQuery<T> |
setServiceIdentifier(IServiceIdentifier serviceidentifier)
Sets the service identifier.
|
ServiceQuery<T> |
setServiceTags(java.lang.String... servicetags)
Sets the service tags.
|
ServiceQuery<T> |
setServiceTags(java.lang.String[] servicetags,
IExternalAccess component)
Sets the service tags.
|
ServiceQuery<T> |
setServiceType(ClassInfo servicetype)
Set the service type.
|
ServiceQuery<T> |
setUnrestricted(java.lang.Boolean unrestricted)
Set the unrestricted mode.
|
java.lang.String |
toString()
Get the string representation.
|
public static final java.lang.String PROXYTYPE_RAW
public static final java.lang.String PROXYTYPE_DIRECT
public static final java.lang.String PROXYTYPE_DECOUPLED
public static final java.lang.String[] NETWORKS_NOT_SET
public static final java.util.Map<java.lang.String,java.lang.Boolean> DEFAULT_MATCHINGMODES
protected ClassInfo servicetype
protected java.lang.String[] servicetags
protected IComponentIdentifier searchstart
protected IComponentIdentifier platform
protected IServiceIdentifier serviceidentifier
protected java.lang.String[] networknames
protected java.lang.Boolean unrestricted
protected ServiceScope scope
protected IComponentIdentifier owner
protected boolean excludeowner
protected ServiceQuery.Multiplicity multiplicity
protected boolean eventmode
protected java.util.Map<java.lang.String,java.lang.Boolean> matchingmodes
protected java.lang.String requiredproxytype
protected java.lang.String id
protected ServiceQuery()
public ServiceQuery(java.lang.Class<T> servicetype)
public ServiceQuery(java.lang.Class<T> servicetype, ServiceScope scope)
public ServiceQuery(java.lang.Class<T> servicetype, ServiceScope scope, IComponentIdentifier owner)
public ServiceQuery(ClassInfo servicetype)
public ServiceQuery(ClassInfo servicetype, ServiceScope scope, IComponentIdentifier owner)
public ServiceQuery(ServiceQuery<T> original)
original
- Original query.public ClassInfo getServiceType()
public ServiceQuery<T> setServiceType(ClassInfo servicetype)
type
- The service type to set@Deprecated public void setEventMode(boolean eventmode)
eventmode
- the event mode state.public ServiceQuery<ServiceEvent<T>> setEventMode()
public boolean isEventMode()
public ServiceScope getScope()
public ServiceQuery<T> setScope(ServiceScope scope)
scope
- The scope to setpublic java.lang.String[] getServiceTags()
public ServiceQuery<T> setServiceTags(java.lang.String... servicetags)
servicetags
- The service tags.public ServiceQuery<T> setServiceTags(java.lang.String[] servicetags, IExternalAccess component)
servicetags
- The service tags.
todo: move or refactor to hide complexity!?public ServiceQuery<T> setProvider(IComponentIdentifier provider)
provider
- The provider to setpublic IComponentIdentifier getSearchStart()
public ServiceQuery<T> setSearchStart(IComponentIdentifier searchstart)
provider
- The provider to setpublic IComponentIdentifier getPlatform()
public ServiceQuery<T> setPlatform(IComponentIdentifier platform)
platform
- The platformpublic IServiceIdentifier getServiceIdentifier()
public ServiceQuery<T> setServiceIdentifier(IServiceIdentifier serviceidentifier)
serviceidentifier
- The service identifier.public IComponentIdentifier getOwner()
public ServiceQuery<T> setOwner(IComponentIdentifier owner)
owner
- The owner to setpublic boolean isExcludeOwner()
public ServiceQuery<T> setExcludeOwner(boolean excludeowner)
excludeowner
- True, if the services should be excluded.public java.lang.String getId()
public ServiceQuery<T> setId(java.lang.String id)
id
- The id to setpublic ServiceQuery.Multiplicity getMultiplicity()
public ServiceQuery<T> setMultiplicity(int multiplicity)
multiplicity
- The minimum multiplicity to setpublic ServiceQuery<T> setMultiplicity(int multiplicitystart, int multiplicityend)
multiplicitystart
- The minimum multiplicity to setmultiplicityend
- The max multiplicity to setpublic ServiceQuery<T> setMultiplicity(ServiceQuery.Multiplicity multiplicity)
multiplicity
- The multiplicity to setpublic java.util.List<Tuple3<java.lang.String,java.lang.String[],java.lang.Boolean>> getIndexerSearchSpec()
public java.lang.Boolean getMatchingMode(java.lang.String key)
key
- The key name.public ServiceQuery<T> setMatchingMode(java.lang.String key, java.lang.Boolean and)
key
- The key name.and
- True for and.public java.lang.Boolean isUnrestricted()
public ServiceQuery<T> setUnrestricted(java.lang.Boolean unrestricted)
unrestricted
- the unrestricted to setprotected boolean matchesKeys(IServiceIdentifier service)
service
- The service.public java.lang.String[] getNetworkNames()
public ServiceQuery<T> setNetworkNames(java.lang.String... networknames)
networknames
- The networknames to setpublic java.lang.String getRequiredProxyType()
public ServiceQuery<T> setRequiredProxyType(java.lang.String requiredproxytype)
requiredproxytype
- The requested required service proxy type.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public IComponentIdentifier getTargetPlatform()
public java.lang.String toString()
toString
in class java.lang.Object