Class ServiceIdentifier

java.lang.Object
jadex.providedservice.impl.service.ServiceIdentifier
All Implemented Interfaces:
IServiceIdentifier

public class ServiceIdentifier extends Object implements IServiceIdentifier
Service identifier for uniquely identifying a service. Is composed of the container id and the service name.
  • Field Details

    • providerid

      protected jadex.core.ComponentIdentifier providerid
      The provider identifier.
    • servicename

      protected String servicename
      The service name.
    • type

      protected jadex.common.ClassInfo type
      The service type.
    • supertypes

      protected jadex.common.ClassInfo[] supertypes
      The service super types.
    • scope

      protected ServiceScope scope
      The scope.
    • networknames

      protected Set<String> networknames
      The network names (shared object with security service).
    • unrestricted

      protected boolean unrestricted
      Is the service unrestricted.
    • tostring

      protected String tostring
      The string representation (cached for reducing memory consumption).
    • tags

      protected Set<String> tags
      The tags.
  • Constructor Details

    • ServiceIdentifier

      public ServiceIdentifier()
      Create a new service identifier.
    • ServiceIdentifier

      public ServiceIdentifier(jadex.core.IComponent provider, Class<?> type, String servicename, ServiceScope scope, Boolean unrestricted)
      Create a new service identifier.
    • ServiceIdentifier

      public ServiceIdentifier(jadex.core.ComponentIdentifier providerid, jadex.common.ClassInfo type, jadex.common.ClassInfo[] supertypes, String servicename, ServiceScope scope, Set<String> networknames, boolean unrestricted)
      Create a new service identifier.
  • Method Details

    • getProviderId

      public jadex.core.ComponentIdentifier getProviderId()
      Get the service provider identifier.
      Specified by:
      getProviderId in interface IServiceIdentifier
      Returns:
      The provider id.
    • setProviderId

      public void setProviderId(jadex.core.ComponentIdentifier providerid)
      Set the providerid.
      Parameters:
      providerid - The providerid to set.
    • getServiceType

      public jadex.common.ClassInfo getServiceType()
      Get the service type.
      Specified by:
      getServiceType in interface IServiceIdentifier
      Returns:
      The service type.
    • setServiceType

      public void setServiceType(jadex.common.ClassInfo type)
      Set the service type.
      Parameters:
      type - The service type.
    • getServiceSuperTypes

      public jadex.common.ClassInfo[] getServiceSuperTypes()
      Get the service super types.
      Specified by:
      getServiceSuperTypes in interface IServiceIdentifier
      Returns:
      The service super types.
    • setServiceSuperTypes

      public void setServiceSuperTypes(jadex.common.ClassInfo[] supertypes)
      Set the service super types.
      Parameters:
      type - The service super types.
    • getServiceName

      public String getServiceName()
      Get the service name.
      Specified by:
      getServiceName in interface IServiceIdentifier
      Returns:
      The service name.
    • setServiceName

      public void setServiceName(String servicename)
      Set the servicename.
      Parameters:
      servicename - The servicename to set.
    • getScope

      public ServiceScope getScope()
      Get the scope.
      Specified by:
      getScope in interface IServiceIdentifier
      Returns:
      The scope.
    • setScope

      public void setScope(ServiceScope scope)
      Set the scope.
      Parameters:
      scope - The scope to set.
    • getNetworkNames

      public Set<String> getNetworkNames()
      Get the network names.
      Returns:
      the network names
    • setNetworkNames

      public void setNetworkNames(Set<String> networknames)
      Set the network names.
      Parameters:
      networknames - The network names to set
    • isUnrestricted

      public boolean isUnrestricted()
      Check if the service has unrestricted access.
      Returns:
      True, if it is unrestricted.
    • setUnrestricted

      public void setUnrestricted(boolean unrestricted)
      Set the unrestricted flag.
      Parameters:
      unrestricted - The unrestricted flag.
    • getTags

      public Set<String> getTags()
      Get the service tags.
      Specified by:
      getTags in interface IServiceIdentifier
      Returns:
      The tags.
    • setTags

      public void setTags(Set<String> tags)
      Set the tags.
      Parameters:
      tags - the tags to set
    • isSystemService

      public static boolean isSystemService(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(Class<?> ctype)
      Method to provide the security level.
    • isUnrestricted

      public static boolean isUnrestricted(jadex.core.impl.Component access, jadex.common.ClassInfo ctype)
      Is the service unrestricted.
      Parameters:
      access - The access.
      ctype - The service interface.
      Returns:
      True, if is unrestricted.
    • isUnrestricted

      public static boolean isUnrestricted(jadex.core.impl.Component access, Class<?> ctype)
      Is the service unrestricted.
      Parameters:
      access - The access.
      ctype - The service interface.
      Returns:
      True, if is unrestricted.
    • getRoles

      public static Set<String> getRoles(Security sec, jadex.core.impl.Component 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 class Object
      Returns:
      The hashcode.
    • equals

      public boolean equals(Object obj)
      Test if an object is equal to this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object.
      Returns:
      True, if equal.
    • toString

      public String toString()
      Get the string representation.
      Overrides:
      toString in class Object