org.universAAL.support.utils.context.mid
Class UtilPublisher

Package class diagram package UtilPublisher
java.lang.Object
  extended by org.universAAL.middleware.bus.member.BusMember
      extended by org.universAAL.middleware.bus.member.Publisher
          extended by org.universAAL.middleware.context.ContextPublisher
              extended by org.universAAL.middleware.context.DefaultContextPublisher
                  extended by org.universAAL.support.utils.context.mid.UtilPublisher

public class UtilPublisher
extends DefaultContextPublisher

Class that can be used to easily create a Context Publisher that can be used in almost all situations. This simple Publisher extends the DefaultContextPublisher included in the MW, but allows specifying everything it needs in its constructor. Also because of this it can be used as well with the native API to apply further restrictions and configuration over it.

Example: A publisher that gives events about status of a Heater Actuator.

publisher = new UtilPublisher(context, DEVICE_INSTANCE_URI,

ContextProviderType.controller,

new HeaterActuator(DEVICE_INSTANCE_URI),

HeaterActuator.PROP_STATUS,

TypeMapper.getDatatypeURI(Boolean.class));

Author:
alfiva

Field Summary
 
Fields inherited from class org.universAAL.middleware.bus.member.BusMember
busResourceURI, owner, theBus
 
Constructor Summary
UtilPublisher(ModuleContext context, String uri)
          Create a simple gauge Context Publisher which provided events can be of any type and is identified with the given URI.
UtilPublisher(ModuleContext context, String uri, ContextProviderType type)
          Create a simple Context Publisher of the given type which provided events can be of any type and is identified with the given URI.
UtilPublisher(ModuleContext context, String uri, ContextProviderType type, ContextEventPattern[] pattern)
          Create a simple Context Publisher of the given type which provided events are described by a pattern and is identified with the given URI.
UtilPublisher(ModuleContext context, String uri, ContextProviderType type, ManagedIndividual sub, String predicate, String objTypeURI)
          Create a simple Context Publisher of the given type which provided events are described by the arguments and is identified with the given URI.
UtilPublisher(ModuleContext context, String uri, ContextProviderType type, String subjTypeURI, String predicate, String objTypeURI)
          Create a simple Context Publisher of the given type which provided events are described by the arguments and is identified with the given URI.
 
Method Summary
 
Methods inherited from class org.universAAL.middleware.context.DefaultContextPublisher
communicationChannelBroken
 
Methods inherited from class org.universAAL.middleware.context.ContextPublisher
busDyingOut, getMyID, publish
 
Methods inherited from class org.universAAL.middleware.bus.member.BusMember
close, getType, getURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilPublisher

public UtilPublisher(ModuleContext context,
                     String uri)
Create a simple gauge Context Publisher which provided events can be of any type and is identified with the given URI.

Parameters:
context - The universAAL module context.
uri - The URI that identifies the Context Provider.

UtilPublisher

public UtilPublisher(ModuleContext context,
                     String uri,
                     ContextProviderType type)
Create a simple Context Publisher of the given type which provided events can be of any type and is identified with the given URI.

Parameters:
context - The universAAL module context.
uri - The URI that identifies the Context Provider.
type - The type of Context Provider, one of Gauge, Controller or Reasoner.

UtilPublisher

public UtilPublisher(ModuleContext context,
                     String uri,
                     ContextProviderType type,
                     ContextEventPattern[] pattern)
Create a simple Context Publisher of the given type which provided events are described by a pattern and is identified with the given URI.

Parameters:
context - The universAAL module context.
uri - The URI that identifies the Context Provider.
type - The type of Context Provider, one of Gauge, Controller or Reasoner.
pattern - Array of Patterns describing the provided events, as normally used in the native API.

UtilPublisher

public UtilPublisher(ModuleContext context,
                     String uri,
                     ContextProviderType type,
                     String subjTypeURI,
                     String predicate,
                     String objTypeURI)
Create a simple Context Publisher of the given type which provided events are described by the arguments and is identified with the given URI.

Parameters:
context - The universAAL module context.
uri - The URI that identifies the Context Provider.
type - The type of Context Provider, one of Gauge, Controller or Reasoner.
subjTypeURI - The type URI that the provided events subject must have. Null for any.
predicate - The exact predicate that the provided events must equal. Null for any.
objTypeURI - The type URI that the provided events object must have. Null for any.

UtilPublisher

public UtilPublisher(ModuleContext context,
                     String uri,
                     ContextProviderType type,
                     ManagedIndividual sub,
                     String predicate,
                     String objTypeURI)
Create a simple Context Publisher of the given type which provided events are described by the arguments and is identified with the given URI.

Parameters:
context - The universAAL module context.
uri - The URI that identifies the Context Provider.
type - The type of Context Provider, one of Gauge, Controller or Reasoner.
sub - The exact instance that the provided events subject must equal. Null for any.
predicate - The exact predicate that the provided events must equal. Null for any.
objTypeURI - The type URI that the provided events object must have. Null for any.


Copyright © 2014 universAAL Consortium. All Rights Reserved.