com.cougaarsoftware.common.plugin
Class AdvancedComponentPlugin

java.lang.Object
  extended byorg.cougaar.util.GenericStateModelAdapter
      extended byorg.cougaar.core.blackboard.BlackboardClientComponent
          extended byorg.cougaar.core.plugin.ComponentPlugin
              extended bycom.cougaarsoftware.common.plugin.AdvancedComponentPlugin
All Implemented Interfaces:
org.cougaar.core.blackboard.BlackboardClient, org.cougaar.core.component.Component, org.cougaar.util.GenericStateModel, org.cougaar.core.plugin.PluginBase
Direct Known Subclasses:
WorkflowExecutionPlugin

public abstract class AdvancedComponentPlugin
extends org.cougaar.core.plugin.ComponentPlugin

Support variables and functions for the Cougaar Software Collaborative Supply Chain Management family of applications. This helps ensure consistent verb definition and referencing.

Version:
1.0
Author:
Todd M. Carrico, ttschampel, soster

Nested Class Summary
 
Nested classes inherited from class org.cougaar.core.blackboard.BlackboardClient
org.cougaar.core.blackboard.BlackboardClient.Local
 
Field Summary
 
Fields inherited from interface org.cougaar.core.plugin.PluginBase
INSERTION_POINT
 
Fields inherited from interface org.cougaar.util.GenericStateModel
ACTIVE, IDLE, LOADED, UNINITIALIZED, UNLOADED
 
Fields inherited from interface org.cougaar.core.blackboard.BlackboardClient
current
 
Constructor Summary
AdvancedComponentPlugin()
          Creates new AdvancedComponentPlugIn
 
Method Summary
static java.util.Date createDate(int year, int month, int day)
           
 org.cougaar.core.service.AgentContainmentService getAgentContainmentService()
          Get AgentContainmentService
 org.cougaar.core.service.community.CommunityService getCommunityService()
          Get a reference to the community service
 org.cougaar.core.service.DomainService getDomainService()
          Get DomainService
 long getEndTime(org.cougaar.planning.ldm.plan.Task t)
          Get the END_TIME preference for the task
 org.cougaar.core.service.LoggingService getLoggingService()
          Get LoggingService
 org.cougaar.core.service.NamingService getNamingService()
          get NamingService
 org.cougaar.core.node.NodeIdentificationService getNodeIdentificationService()
          Get Node Identification Service at load time
 org.cougaar.planning.ldm.plan.Preference getPreference(org.cougaar.planning.ldm.plan.Task task, int aspect_type)
          Return the preference for the given aspect
 org.cougaar.planning.ldm.plan.PrepositionalPhrase getPreposition(org.cougaar.planning.ldm.plan.Task task, java.lang.String phrase)
          Return the preference for the given aspect
 java.lang.String getPrepositionValue(org.cougaar.planning.ldm.plan.Task task, java.lang.String phrase)
          Conveinence method to get the IndirectObject from the task for the named PrepositionalPhrase
 org.cougaar.planning.service.PrototypeRegistryService getPrototypeRegistryService()
          get PrototypeRegistryService
 long getStartTime(org.cougaar.planning.ldm.plan.Task t)
          Get the START_TIME preference for the task
 org.cougaar.core.service.UIDService getUIDService()
          Get UIDService
 boolean joinCommunity(java.lang.String community)
          Helper method to join the specified community.
 boolean leaveCommunity(java.lang.String community)
          Helper method to leave the specified community.
 void load()
          Load the plugin an setup logging.
 void setAgentContainmentService(org.cougaar.core.service.AgentContainmentService service)
          Set AgentContainmentService at load time
 void setCommunityService(org.cougaar.core.service.community.CommunityService service)
          Set community service at load time
 void setDomainService(org.cougaar.core.service.DomainService service)
          set DomainService at load time
 void setLoggingService(org.cougaar.core.service.LoggingService service)
          Set LoggingService at load time
 void setNamingService(org.cougaar.core.service.NamingService service)
          set NamingService at load time
 void setNodeIdentificationService(org.cougaar.core.node.NodeIdentificationService service)
          Get node identification service at load time
 void setPrototypeRegistryService(org.cougaar.planning.service.PrototypeRegistryService service)
          set PrototypeRegistryService at load time
 void setTimePreferences(org.cougaar.planning.ldm.plan.NewTask new_task, long duration, long deadline)
          Conveinence method to setup end and duration time preferences with strict scoring functions.
 void setTimePreferences(org.cougaar.planning.ldm.plan.NewTask new_task, long start, long duration, long deadline)
          Conveinence method to setup start, end, and duration time preferences with strict scoring functions.
 void setUIDService(org.cougaar.core.service.UIDService service)
          set UIDService at load time
 void unload()
          Release all services
 
Methods inherited from class org.cougaar.core.blackboard.BlackboardClientComponent
currentTimeMillis, getBlackboardClientName, getParameter, getParameters, halt, initialize, resume, setAgentIdentificationService, setAlarmService, setBindingSite, setBlackboardService, setParameter, setSchedulerService, start, stop, suspend, toString
 
Methods inherited from class org.cougaar.util.GenericStateModelAdapter
getModelState
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cougaar.util.GenericStateModel
getModelState, halt, initialize, resume, start, stop, suspend
 

Constructor Detail

AdvancedComponentPlugin

public AdvancedComponentPlugin()
Creates new AdvancedComponentPlugIn

Method Detail

setUIDService

public void setUIDService(org.cougaar.core.service.UIDService service)
set UIDService at load time

Parameters:
service - UIDService

getUIDService

public org.cougaar.core.service.UIDService getUIDService()
Get UIDService

Returns:
UIDService

setPrototypeRegistryService

public void setPrototypeRegistryService(org.cougaar.planning.service.PrototypeRegistryService service)
set PrototypeRegistryService at load time

Parameters:
service - PrototypeRegistryService

getPrototypeRegistryService

public org.cougaar.planning.service.PrototypeRegistryService getPrototypeRegistryService()
get PrototypeRegistryService

Returns:
PrototypeRegistryService

setDomainService

public void setDomainService(org.cougaar.core.service.DomainService service)
set DomainService at load time

Parameters:
service - DomainService

getDomainService

public org.cougaar.core.service.DomainService getDomainService()
Get DomainService

Returns:
DomainService

setNamingService

public void setNamingService(org.cougaar.core.service.NamingService service)
set NamingService at load time

Parameters:
service - NamingService

getNamingService

public org.cougaar.core.service.NamingService getNamingService()
get NamingService

Returns:
NamingService

setLoggingService

public void setLoggingService(org.cougaar.core.service.LoggingService service)
Set LoggingService at load time

Parameters:
service - LoggingService

getLoggingService

public org.cougaar.core.service.LoggingService getLoggingService()
Get LoggingService

Returns:
LoggingService

getCommunityService

public org.cougaar.core.service.community.CommunityService getCommunityService()
Get a reference to the community service

Returns:
the community service

setCommunityService

public void setCommunityService(org.cougaar.core.service.community.CommunityService service)
Set community service at load time

Parameters:
service - CommunityService

setNodeIdentificationService

public void setNodeIdentificationService(org.cougaar.core.node.NodeIdentificationService service)
Get node identification service at load time

Parameters:
service - NodeIdentificationService

getNodeIdentificationService

public org.cougaar.core.node.NodeIdentificationService getNodeIdentificationService()
Get Node Identification Service at load time

Returns:
NodeIdentificationService

setAgentContainmentService

public void setAgentContainmentService(org.cougaar.core.service.AgentContainmentService service)
Set AgentContainmentService at load time

Parameters:
service - AgentContainmentService

getAgentContainmentService

public org.cougaar.core.service.AgentContainmentService getAgentContainmentService()
Get AgentContainmentService

Returns:
AgentContainmentService

unload

public void unload()
Release all services


getEndTime

public long getEndTime(org.cougaar.planning.ldm.plan.Task t)
Get the END_TIME preference for the task

Parameters:
t - the task
Returns:
the END_TIME preference for the task

getStartTime

public long getStartTime(org.cougaar.planning.ldm.plan.Task t)
Get the START_TIME preference for the task

Parameters:
t - the task
Returns:
the START_TIME preference for the task or 0

getPreference

public org.cougaar.planning.ldm.plan.Preference getPreference(org.cougaar.planning.ldm.plan.Task task,
                                                              int aspect_type)
Return the preference for the given aspect

Parameters:
task - for which to return given preference
aspect_type - aspect type
Returns:
Preference (or null) from task for given aspect

getPreposition

public org.cougaar.planning.ldm.plan.PrepositionalPhrase getPreposition(org.cougaar.planning.ldm.plan.Task task,
                                                                        java.lang.String phrase)
Return the preference for the given aspect

Parameters:
task - for which to return given preference
phrase - aspect type
Returns:
Preference (or null) from task for given aspect

getPrepositionValue

public java.lang.String getPrepositionValue(org.cougaar.planning.ldm.plan.Task task,
                                            java.lang.String phrase)
Conveinence method to get the IndirectObject from the task for the named PrepositionalPhrase

Parameters:
task - the task
phrase - the phrase of the PrepositionalPhrase
Returns:
the IndirectObject

setTimePreferences

public void setTimePreferences(org.cougaar.planning.ldm.plan.NewTask new_task,
                               long start,
                               long duration,
                               long deadline)
Conveinence method to setup start, end, and duration time preferences with strict scoring functions.

Parameters:
new_task - the task to attach the preferences to
start - the start time in milliseconds
duration - the duration in milliseconds
deadline - the end time in milliseconds
Throws:
java.lang.IllegalArgumentException - throw if start > deadline or duration > (deadline - start)

setTimePreferences

public void setTimePreferences(org.cougaar.planning.ldm.plan.NewTask new_task,
                               long duration,
                               long deadline)
Conveinence method to setup end and duration time preferences with strict scoring functions.

Parameters:
new_task - the task to attach the preferences to
duration - the duration in milliseconds
deadline - the end time in milliseconds

createDate

public static java.util.Date createDate(int year,
                                        int month,
                                        int day)

load

public void load()
Load the plugin an setup logging.


joinCommunity

public boolean joinCommunity(java.lang.String community)
Helper method to join the specified community. Handles lazy creation of communities (will create comm if request to join non-existant comm). Agent is joined as EntityType="Agent" and has the Role "Member"

Parameters:
community - the community name
Returns:
success

leaveCommunity

public boolean leaveCommunity(java.lang.String community)
Helper method to leave the specified community.

Parameters:
community - the community name
Returns:
success