Class 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 Detail

      • servicename

        protected java.lang.String servicename
        The service name.
      • type

        protected ClassInfo type
        The service type.
      • supertypes

        protected ClassInfo[] supertypes
        The service super types.
      • 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.
    • Method Detail

      • setProviderId

        public void setProviderId​(IComponentIdentifier providerid)
        Set the providerid.
        Parameters:
        providerid - The providerid to set.
      • setServiceType

        public void setServiceType​(ClassInfo type)
        Set the service type.
        Parameters:
        type - The service type.
      • 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 interface IServiceIdentifier
        Returns:
        The service name.
      • setServiceName

        public void setServiceName​(java.lang.String servicename)
        Set the servicename.
        Parameters:
        servicename - The servicename to set.
      • setResourceIdentifier

        public void setResourceIdentifier​(IResourceIdentifier rid)
        Set the resource identifier.
        Parameters:
        rid - The resource identifier.
      • 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 interface IServiceIdentifier
        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 interface IServiceIdentifier
        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 interface IServiceIdentifier
        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 class java.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 class java.lang.Object
        Parameters:
        obj - The object.
        Returns:
        True, if equal.
      • toString

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