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>
networknames
The network names (shared object with security service).protected IComponentIdentifier
providerid
The provider identifier.protected IResourceIdentifier
rid
The resource identifier.protected ServiceScope
scope
The scope.protected java.lang.String
servicename
The service name.protected ClassInfo[]
supertypes
The service super types.protected java.util.Set<java.lang.String>
tags
The tags.protected java.lang.String
tostring
The string representation (cached for reducing memory consumption).protected ClassInfo
type
The service type.protected boolean
unrestricted
Is 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 boolean
equals(java.lang.Object obj)
Test if an object is equal to this one.java.util.Set<java.lang.String>
getNetworkNames()
Get the network names.IComponentIdentifier
getProviderId()
Get the service provider identifier.IResourceIdentifier
getResourceIdentifier()
Get the resource identifier.static java.util.Set<java.lang.String>
getRoles(Security sec, IInternalAccess provider)
Get the roles from an annotation.ServiceScope
getScope()
Get the scope.static Security
getSecurityLevel(java.lang.Class<?> ctype)
Method to provide the security level.java.lang.String
getServiceName()
Get the service name.ClassInfo[]
getServiceSuperTypes()
Get the service super types.ClassInfo
getServiceType()
Get the service type.java.util.Set<java.lang.String>
getTags()
Get the service tags.int
hashCode()
Get the hashcode.static boolean
isSystemService(java.lang.Class<?> iftype)
Test if the service is a system service.boolean
isUnrestricted()
Check if the service has unrestricted access.static boolean
isUnrestricted(IInternalAccess access, ClassInfo ctype)
Is the service unrestricted.static boolean
isUnrestricted(IInternalAccess access, java.lang.Class<?> ctype)
Is the service unrestricted.void
setNetworkNames(java.util.Set<java.lang.String> networknames)
Set the network names.void
setProviderId(IComponentIdentifier providerid)
Set the providerid.void
setResourceIdentifier(IResourceIdentifier rid)
Set the resource identifier.void
setScope(ServiceScope scope)
Set the scope.void
setServiceName(java.lang.String servicename)
Set the servicename.void
setServiceSuperTypes(ClassInfo[] supertypes)
Set the service super types.void
setServiceType(ClassInfo type)
Set the service type.void
setTags(java.util.Set<java.lang.String> tags)
Set the tags.void
setUnrestricted(boolean unrestricted)
Set the unrestricted flag.java.lang.String
toString()
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:
getProviderId
in 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:
getServiceType
in 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:
getServiceSuperTypes
in 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:
getServiceName
in 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:
getResourceIdentifier
in 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:
getScope
in 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:
getNetworkNames
in 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:
isUnrestricted
in 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:
getTags
in 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:
hashCode
in classjava.lang.Object
- Returns:
- The hashcode.
-
equals
public boolean equals(java.lang.Object obj)
Test if an object is equal to this one.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object.- Returns:
- True, if equal.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Object
-
-