org.ops4j.pax.coin.service.internal.target
Class AbstractConfigTarget

java.lang.Object
  extended by org.ops4j.pax.coin.service.internal.target.AbstractConfigTarget
All Implemented Interfaces:
ConfigTarget
Direct Known Subclasses:
ManagedServiceConfigTarget, ManagedServiceFactoryConfigTarget

public abstract class AbstractConfigTarget
extends Object
implements ConfigTarget

Generic implementation of configuration target that handles callbacks on configuration plugins.

Since:
0.3.0, March 03, 2008
Author:
Alin Dreghiciu

Constructor Summary
AbstractConfigTarget(String groupId, String location, Executor executor, ConfigPluginRepository pluginRepository)
          Constructor.
 
Method Summary
 void delete(String itemId)
          Removes a configuration item.
 String getGroupId()
          Configuration group identifier.
 String getLocation()
          Bundle location of the bundle that published the managed service / managed service factory.
 void update(String itemId, Map<String,Object> properties)
          Updates managed service configuration properties.
If the targeted service is a managed service the item id must be equal with group id (so equal with the pid).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConfigTarget

public AbstractConfigTarget(String groupId,
                            String location,
                            Executor executor,
                            ConfigPluginRepository pluginRepository)
Constructor.

Parameters:
groupId - configuration group identifier (pid or factory pid)
location - bundle location
executor - executor for running updates / deletes against configuration targets
pluginRepository - configuration plugins repository; can be null case when the configuration plugins are not updated
Throws:
org.ops4j.lang.NullArgumentException - - If group id is null or empty - If location is null or empty - If executor is null
Method Detail

getGroupId

public String getGroupId()
Description copied from interface: ConfigTarget
Configuration group identifier. Cannot be null.
/ If the configuration target is a managed service, the id must be equal with the persistent identifier (pid) of targeted managed service.
If the configuration target is a managed service factory, the id must be equal with the factory persistent identifier (factory pid) of targeted managed service factory.

Specified by:
getGroupId in interface ConfigTarget
Returns:
identifier
See Also:
ConfigTarget.getGroupId()

getLocation

public String getLocation()
Description copied from interface: ConfigTarget
Bundle location of the bundle that published the managed service / managed service factory. Canot be null.

Specified by:
getLocation in interface ConfigTarget
Returns:
bundle location
See Also:
ConfigTarget.getLocation()

update

public void update(String itemId,
                   Map<String,Object> properties)
Description copied from interface: ConfigTarget
Updates managed service configuration properties.
If the targeted service is a managed service the item id must be equal with group id (so equal with the pid).
If the targeted service is a managed service factory the item id must be equal with the pid of the configuration to be updated.

Specified by:
update in interface ConfigTarget
Parameters:
itemId - configuration item id; cannot be null
properties - configuration properties; cannot be null
See Also:
ConfigTarget.update(String, Map)

delete

public void delete(String itemId)
Description copied from interface: ConfigTarget
Removes a configuration item. If the targeted service is a managed service the item id must be equal with group id (so equal with the pid).
If the targeted service is a managed service factory the item id must be equal with the pid of the configuration to be deleted.

Specified by:
delete in interface ConfigTarget
Parameters:
itemId - configuration item identifier; cannot be null
See Also:
ConfigTarget.delete(String)


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.