oracle.panama.alert
Interface Topic

All Superinterfaces:
ModelObject, XMLObject

public interface Topic
extends ModelObject

Interface exposes the Alert Service Topic features. A Topic is created to group a bunch of Alerts or Sub Topics.

A typical usage example:

 MetaLocator m = MetaLocator.getInstance();

 ModelFactory f = m.getModelFactory();

 ModelServices s = m.getModelServices();

 
  Topic A = null;
  Topic B = null;
 
  // create a couple of topics and add one as a subtopic of another
  try {
     
      A = f.createTopic("topicA", null);
      A.save();
      B = f.createTopic("topicB", null);
      B.save();
      A.addSubTopic(B);
  } catch (Exception e) {
       L.e("createTopic failed :"+e.toString());
  }

  ....
  To see if topic has services
  Use : AlertService[] as = A.getServices();

 


Field Summary
TypeField
static int TYPEID
          The type id of the Topic class
static java.lang.String TYPENAME
          The Typename for the topic classs
 
Method Summary
TypeMethod
 void addService(AlertService alert)
          Add an alert service to this topic
 void addSubTopic(Topic subTopic)
          Adds the subtopic to this topic
 Group[] getGroups()
          Returns the groups which can access this Topic
 java.lang.String getName()
          Returns the name of the topic
 Topic getParent()
          Returns the parent topic object
 AlertService[] getServices()
          Returns the alert services based on the topic
 Topic[] getSubTopics()
          Returns all the subtopics under this topic
 boolean isValid()
          Returns true if the topic is valid
 boolean isVisible()
          Returns if the service is visible currently its always visible.
 void removeService(AlertService alert)
          Removes the alert service from this topic
 void removeSubTopic(Topic subTopic)
          Removes the subtopic from this current topic
 void save()
          Commits the changes to the database Any create/update operation must be committed with the save.
 void setName(java.lang.String name)
          Sets the name of the topic
 void setValidity(boolean valid)
          Sets the Topic to valid or invalid
 void setVisible(boolean visibility)
          Sets if the topic is visible currently its always visible
 
Methods inherited from interface oracle.panama.model.ModelObject
delete, getCreatedDate, getId, getLastModifiedDate, getTypeId, getTypeName, isSystem, setSystem, undoAll
 
Methods inherited from interface oracle.panama.model.XMLObject
setXML, toXML
 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
The Typename for the topic classs

TYPEID

public static final int TYPEID
The type id of the Topic class
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the topic
Specified by:
setName in interface ModelObject
Parameters:
name - The name of the topic

isVisible

public boolean isVisible()
Returns if the service is visible currently its always visible.
Returns:
boolean true if visible

setVisible

public void setVisible(boolean visibility)
Sets if the topic is visible currently its always visible
Parameters:
visibility - boolean set to true if visible

isValid

public boolean isValid()
Returns true if the topic is valid
Returns:
boolean true if valid

setValidity

public void setValidity(boolean valid)
Sets the Topic to valid or invalid
Parameters:
valid - boolean set to true if valid

getName

public java.lang.String getName()
Returns the name of the topic
Specified by:
getName in interface ModelObject
Returns:
String name of the topic

getServices

public AlertService[] getServices()
Returns the alert services based on the topic
Returns:
AlertService[] Array of alert service object

addService

public void addService(AlertService alert)
                throws PanamaException
Add an alert service to this topic
Parameters:
alert - the alert service object
Throws:
PanamaException - when adding service failed

removeService

public void removeService(AlertService alert)
                   throws PanamaException
Removes the alert service from this topic
Parameters:
AlertService - The alert service object
Throws:
PanamaException - Exception thrown when the remove service failed

addSubTopic

public void addSubTopic(Topic subTopic)
                 throws PanamaException
Adds the subtopic to this topic
Parameters:
subTopic - The subtopic object
Throws:
PanamaException - thrown when the subtopic addition failed

removeSubTopic

public void removeSubTopic(Topic subTopic)
                    throws PanamaException
Removes the subtopic from this current topic
Parameters:
subTopic - The subtopic object to remove
Throws:
PanamaException - Exception thrown when the sub topic couldn't be removed

getParent

public Topic getParent()
Returns the parent topic object
Returns:
Topic The parent topic object, null if root topic

save

public void save()
          throws PanamaException
Commits the changes to the database Any create/update operation must be committed with the save. Alert objects does not use the wireless caching/persistence framework
Throws:
PanamaException - when commit failed

getSubTopics

public Topic[] getSubTopics()
Returns all the subtopics under this topic
Returns:
Topic[] enum of Topic objects

getGroups

public Group[] getGroups()
Returns the groups which can access this Topic