org.umu.macow.common
Class KnowledgeRepository

java.lang.Object
  extended by org.umu.macow.common.KnowledgeRepository

public class KnowledgeRepository
extends java.lang.Object

This utility class acts as an API for PIP-PEP communications. Additionally it acts as a PIP core functionalities and a PEP local store funcionality.

User: jmalcaraz@um.es - University Of Murcia


Constructor Summary
KnowledgeRepository()
           
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model getPEPKnowledgeModel()
          Return CIM represention of PEP elements stored.
 java.lang.String getPIPKnowledge()
          Returns a RDF/XML document composed of all the controlled PEP elements on the system.
 boolean isPEP()
          Get if the API client is acting as PEP or not
 boolean isPIP()
          Get if the API client is acting as PIP or not
 void publishKnowledge(java.lang.String pubsubsURL, java.lang.String mySelfURL)
          A publisher will be subscribed to "NEW PIP" channel and will send frist time, will send knwoledge indemiatelly.
 void requestKnowledge(java.lang.String pubsubsURL, java.lang.String mySelfURL)
          This method will perform a subscription to "KB-BASE" topic.
 void setPEPKnowledge(com.hp.hpl.jena.rdf.model.Model model)
           
 void update(java.lang.String sourceURL, com.hp.hpl.jena.rdf.model.Model knowledege)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnowledgeRepository

public KnowledgeRepository()
Method Detail

getPEPKnowledgeModel

public com.hp.hpl.jena.rdf.model.Model getPEPKnowledgeModel()
Return CIM represention of PEP elements stored.

Returns:
Jena Model representing state of the PEP element.

update

public void update(java.lang.String sourceURL,
                   com.hp.hpl.jena.rdf.model.Model knowledege)

setPEPKnowledge

public void setPEPKnowledge(com.hp.hpl.jena.rdf.model.Model model)

isPEP

public boolean isPEP()
Get if the API client is acting as PEP or not

Returns:
true if client acts as PEP or false otherwise

isPIP

public boolean isPIP()
Get if the API client is acting as PIP or not

Returns:
true if client acts as PIP or false otherwise

publishKnowledge

public void publishKnowledge(java.lang.String pubsubsURL,
                             java.lang.String mySelfURL)
                      throws java.rmi.RemoteException
A publisher will be subscribed to "NEW PIP" channel and will send frist time, will send knwoledge indemiatelly. Then, when entities that want to receive knowledge updated call method "requestKnowledge" will receive that new information updated.

Throws:
java.rmi.RemoteException - In case any error occur during communications

requestKnowledge

public void requestKnowledge(java.lang.String pubsubsURL,
                             java.lang.String mySelfURL)
                      throws java.rmi.RemoteException
This method will perform a subscription to "KB-BASE" topic. Then, a "NEW PIP" notification will be sent and therefore, all the entities registered as "Publisher" (ubscribed on this topic) this send a notification of their information by means of "KB-BASE" topic.

Throws:
java.rmi.RemoteException - In case any error occur during communications.

getPIPKnowledge

public java.lang.String getPIPKnowledge()
Returns a RDF/XML document composed of all the controlled PEP elements on the system.

Returns:
Whole information system knowledge