return NULL;
}
+bool ContextPublisher::isObservable() const
+{
+ // Most context items are observable, that is, can be used as triggers.
+ return true;
+}
+
bool ContextPublisher::isReadable() const
{
// Most context items are directly readable without subscribing them.
virtual const char* getUri() const = 0;
virtual const char* getPrivilege() const;
- // If not readable, it cannot be used as a requirement
+
+ // If not observable, it cannot be used as a trigger.
+ virtual bool isObservable() const;
+ // If not readable, it cannot be used as a requirement.
virtual bool isReadable() const;
+ // If writable, clients are able to publish their data via this.
virtual bool isWritable() const;
+ // If it is a user context, its instance will be created for each user.
virtual bool isUserContext() const;
virtual bool isReady();
ContextPublisher* pubs = ContextManager::getPublisher(uri, client->getUid());
IF_FAIL_RETURN(pubs, false);
+ if (type == JobContext::Type::TRIGGER && !pubs->isObservable())
+ return false;
+
if (type == JobContext::Type::REQUIREMENT && !pubs->isReadable())
return false;