Package jadex.bridge.service
Class ServiceIdentifier
- java.lang.Object
 - 
- jadex.bridge.service.ServiceIdentifier
 
 
- 
- All Implemented Interfaces:
 IServiceIdentifier
public class ServiceIdentifier extends java.lang.Object implements IServiceIdentifier
Service identifier for uniquely identifying a service. Is composed of the container id and the service name. 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.String>networknamesThe network names (shared object with security service).protected IComponentIdentifierprovideridThe provider identifier.protected IResourceIdentifierridThe resource identifier.protected ServiceScopescopeThe scope.protected java.lang.StringservicenameThe service name.protected ClassInfo[]supertypesThe service super types.protected java.util.Set<java.lang.String>tagsThe tags.protected java.lang.StringtostringThe string representation (cached for reducing memory consumption).protected ClassInfotypeThe service type.protected booleanunrestrictedIs the service unrestricted. 
- 
Constructor Summary
Constructors Constructor Description ServiceIdentifier()Create a new service identifier.ServiceIdentifier(IComponentIdentifier providerid, ClassInfo type, ClassInfo[] supertypes, java.lang.String servicename, IResourceIdentifier rid, ServiceScope scope, java.util.Set<java.lang.String> networknames, boolean unrestricted)Create a new service identifier.ServiceIdentifier(IInternalAccess provider, java.lang.Class<?> type, java.lang.String servicename, IResourceIdentifier rid, ServiceScope scope)Create a new service identifier. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Test if an object is equal to this one.java.util.Set<java.lang.String>getNetworkNames()Get the network names.IComponentIdentifiergetProviderId()Get the service provider identifier.IResourceIdentifiergetResourceIdentifier()Get the resource identifier.static java.util.Set<java.lang.String>getRoles(Security sec, IInternalAccess provider)Get the roles from an annotation.ServiceScopegetScope()Get the scope.static SecuritygetSecurityLevel(java.lang.Class<?> ctype)Method to provide the security level.java.lang.StringgetServiceName()Get the service name.ClassInfo[]getServiceSuperTypes()Get the service super types.ClassInfogetServiceType()Get the service type.java.util.Set<java.lang.String>getTags()Get the service tags.inthashCode()Get the hashcode.static booleanisSystemService(java.lang.Class<?> iftype)Test if the service is a system service.booleanisUnrestricted()Check if the service has unrestricted access.static booleanisUnrestricted(IInternalAccess access, ClassInfo ctype)Is the service unrestricted.static booleanisUnrestricted(IInternalAccess access, java.lang.Class<?> ctype)Is the service unrestricted.voidsetNetworkNames(java.util.Set<java.lang.String> networknames)Set the network names.voidsetProviderId(IComponentIdentifier providerid)Set the providerid.voidsetResourceIdentifier(IResourceIdentifier rid)Set the resource identifier.voidsetScope(ServiceScope scope)Set the scope.voidsetServiceName(java.lang.String servicename)Set the servicename.voidsetServiceSuperTypes(ClassInfo[] supertypes)Set the service super types.voidsetServiceType(ClassInfo type)Set the service type.voidsetTags(java.util.Set<java.lang.String> tags)Set the tags.voidsetUnrestricted(boolean unrestricted)Set the unrestricted flag.java.lang.StringtoString()Get the string representation. 
 - 
 
- 
- 
Field Detail
- 
providerid
protected IComponentIdentifier providerid
The provider identifier. 
- 
servicename
protected java.lang.String servicename
The service name. 
- 
type
protected ClassInfo type
The service type. 
- 
supertypes
protected ClassInfo[] supertypes
The service super types. 
- 
rid
protected IResourceIdentifier rid
The resource identifier. 
- 
scope
protected ServiceScope scope
The scope. 
- 
networknames
protected java.util.Set<java.lang.String> networknames
The network names (shared object with security service). 
- 
unrestricted
protected boolean unrestricted
Is the service unrestricted. 
- 
tostring
protected java.lang.String tostring
The string representation (cached for reducing memory consumption). 
- 
tags
protected java.util.Set<java.lang.String> tags
The tags. 
 - 
 
- 
Constructor Detail
- 
ServiceIdentifier
public ServiceIdentifier()
Create a new service identifier. 
- 
ServiceIdentifier
public ServiceIdentifier(IInternalAccess provider, java.lang.Class<?> type, java.lang.String servicename, IResourceIdentifier rid, ServiceScope scope)
Create a new service identifier. 
- 
ServiceIdentifier
public ServiceIdentifier(IComponentIdentifier providerid, ClassInfo type, ClassInfo[] supertypes, java.lang.String servicename, IResourceIdentifier rid, ServiceScope scope, java.util.Set<java.lang.String> networknames, boolean unrestricted)
Create a new service identifier. 
 - 
 
- 
Method Detail
- 
getProviderId
public IComponentIdentifier getProviderId()
Get the service provider identifier.- Specified by:
 getProviderIdin interfaceIServiceIdentifier- Returns:
 - The provider id.
 
 
- 
setProviderId
public void setProviderId(IComponentIdentifier providerid)
Set the providerid.- Parameters:
 providerid- The providerid to set.
 
- 
getServiceType
public ClassInfo getServiceType()
Get the service type.- Specified by:
 getServiceTypein interfaceIServiceIdentifier- Returns:
 - The service type.
 
 
- 
setServiceType
public void setServiceType(ClassInfo type)
Set the service type.- Parameters:
 type- The service type.
 
- 
getServiceSuperTypes
public ClassInfo[] getServiceSuperTypes()
Get the service super types.- Specified by:
 getServiceSuperTypesin interfaceIServiceIdentifier- Returns:
 - The service super types.
 
 
- 
setServiceSuperTypes
public void setServiceSuperTypes(ClassInfo[] supertypes)
Set the service super types.- Parameters:
 type- The service super types.
 
- 
getServiceName
public java.lang.String getServiceName()
Get the service name.- Specified by:
 getServiceNamein interfaceIServiceIdentifier- Returns:
 - The service name.
 
 
- 
setServiceName
public void setServiceName(java.lang.String servicename)
Set the servicename.- Parameters:
 servicename- The servicename to set.
 
- 
getResourceIdentifier
public IResourceIdentifier getResourceIdentifier()
Get the resource identifier.- Specified by:
 getResourceIdentifierin interfaceIServiceIdentifier- Returns:
 - The resource identifier.
 
 
- 
setResourceIdentifier
public void setResourceIdentifier(IResourceIdentifier rid)
Set the resource identifier.- Parameters:
 rid- The resource identifier.
 
- 
getScope
public ServiceScope getScope()
Get the scope.- Specified by:
 getScopein interfaceIServiceIdentifier- Returns:
 - The scope.
 
 
- 
setScope
public void setScope(ServiceScope scope)
Set the scope.- Parameters:
 scope- The scope to set.
 
- 
getNetworkNames
public java.util.Set<java.lang.String> getNetworkNames()
Get the network names.- Specified by:
 getNetworkNamesin interfaceIServiceIdentifier- Returns:
 - the network names
 
 
- 
setNetworkNames
public void setNetworkNames(java.util.Set<java.lang.String> networknames)
Set the network names.- Parameters:
 networknames- The network names to set
 
- 
isUnrestricted
public boolean isUnrestricted()
Check if the service has unrestricted access.- Specified by:
 isUnrestrictedin interfaceIServiceIdentifier- Returns:
 - True, if it is unrestricted.
 
 
- 
setUnrestricted
public void setUnrestricted(boolean unrestricted)
Set the unrestricted flag.- Parameters:
 unrestricted- The unrestricted flag.
 
- 
getTags
public java.util.Set<java.lang.String> getTags()
Get the service tags.- Specified by:
 getTagsin interfaceIServiceIdentifier- Returns:
 - The tags.
 
 
- 
setTags
public void setTags(java.util.Set<java.lang.String> tags)
Set the tags.- Parameters:
 tags- the tags to set
 
- 
isSystemService
public static boolean isSystemService(java.lang.Class<?> iftype)
Test if the service is a system service. Checks wether the system property is set in properties annotation.- Parameters:
 iftype- The interface type.
 
- 
getSecurityLevel
public static Security getSecurityLevel(java.lang.Class<?> ctype)
Method to provide the security level. 
- 
isUnrestricted
public static boolean isUnrestricted(IInternalAccess access, ClassInfo ctype)
Is the service unrestricted.- Parameters:
 access- The access.ctype- The service interface.- Returns:
 - True, if is unrestricted.
 
 
- 
isUnrestricted
public static boolean isUnrestricted(IInternalAccess access, java.lang.Class<?> ctype)
Is the service unrestricted.- Parameters:
 access- The access.ctype- The service interface.- Returns:
 - True, if is unrestricted.
 
 
- 
getRoles
public static java.util.Set<java.lang.String> getRoles(Security sec, IInternalAccess provider)
Get the roles from an annotation.- Parameters:
 sec- The security annotation or null.provider- The component that owns the service.- Returns:
 - The roles, if any or null, if none given or sec==null.
 
 
- 
hashCode
public int hashCode()
Get the hashcode.- Overrides:
 hashCodein classjava.lang.Object- Returns:
 - The hashcode.
 
 
- 
equals
public boolean equals(java.lang.Object obj)
Test if an object is equal to this one.- Overrides:
 equalsin classjava.lang.Object- Parameters:
 obj- The object.- Returns:
 - True, if equal.
 
 
- 
toString
public java.lang.String toString()
Get the string representation.- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -