Class Intent

    • Constructor Detail

      • Intent

        protected Intent()
        Constructor for serializer.
      • Intent

        protected Intent​(ApplicationId appId,
                         Key key,
                         Collection<NetworkResource> resources,
                         int priority,
                         ResourceGroup resourceGroup)
        Creates a new intent.
        Parameters:
        appId - application identifier
        key - optional key
        resources - required network resources (optional)
        priority - flow rule priority
        resourceGroup - the resource group for intent
    • Method Detail

      • id

        public IntentId id()
        Returns the intent object identifier.
        Returns:
        intent fingerprint
      • appId

        public ApplicationId appId()
        Returns the identifier of the application that requested the intent.
        Returns:
        application identifier
      • priority

        public int priority()
        Returns the priority of the intent.
        Returns:
        intent priority
      • resources

        public Collection<NetworkResource> resources()
        Returns the collection of resources required for this intent.
        Returns:
        collection of resources; may be null
      • resourceGroup

        public ResourceGroup resourceGroup()
        Returns the resource group for this intent.
        Returns:
        the resource group; may be null
      • isInstallable

        public boolean isInstallable()
        Indicates whether or not the intent is installable.
        Returns:
        true if installable
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • bindIdGenerator

        public static void bindIdGenerator​(IdGenerator newIdGenerator)
        Binds an id generator for unique intent id generation. Note: A generator cannot be bound if there is already a generator bound.
        Parameters:
        newIdGenerator - id generator
      • unbindIdGenerator

        public static void unbindIdGenerator​(IdGenerator oldIdGenerator)
        Unbinds an id generator. Note: The caller must provide the old id generator to succeed.
        Parameters:
        oldIdGenerator - the current id generator
      • key

        public Key key()
        Returns the key to identify an "Intent".

        When an Intent is updated, (e.g., flow is re-routed in reaction to network topology change) related Intent object's IntentId may change, but the key will remain unchanged.

        Returns:
        key