org.ops4j.pax.radman.gateway.internal.jpa
Class HostGroupServiceImpl

java.lang.Object
  extended by org.ops4j.pax.radman.gateway.internal.jpa.HostGroupServiceImpl
All Implemented Interfaces:
HostGroupService, org.osgi.service.cm.ManagedService

public final class HostGroupServiceImpl
extends java.lang.Object
implements HostGroupService, org.osgi.service.cm.ManagedService


Constructor Summary
HostGroupServiceImpl(org.osgi.framework.BundleContext aContext, RadmanServiceManager aManager)
           
 
Method Summary
 void dispose()
           
 Host getHost(java.lang.String aHostIP, boolean createWhenNotExists)
          Returns the host given its host IP.
 HostGroup getHostGroup(java.lang.String aHostGroupName, boolean createWhenNotExists)
          Returns the host group given its host group name.
 java.util.List<HostGroup> getHostGroups()
          Returns all the host groups assocated to this service.
 java.util.List<Host> getHosts()
          Returns all the host associated to this host group service.
 java.util.List<Host> getOrphanHosts()
          Returns all hosts that are associated to this host group service but does not have any HostGroups.
 boolean removeHost(java.lang.String anId)
          Remove host given the host id.
 boolean removeHostGroup(java.lang.String anId)
          Removes host group given the host group id.
 void start()
           
 void updated(java.util.Dictionary properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HostGroupServiceImpl

public HostGroupServiceImpl(org.osgi.framework.BundleContext aContext,
                            RadmanServiceManager aManager)
Method Detail

start

public final void start()

dispose

public final void dispose()

getHostGroup

public final HostGroup getHostGroup(java.lang.String aHostGroupName,
                                    boolean createWhenNotExists)
                             throws java.lang.IllegalArgumentException
Returns the host group given its host group name.

Specified by:
getHostGroup in interface HostGroupService
Parameters:
aHostGroupName - The host group name. This argument must not be null.
createWhenNotExists - Set to true to create host group when not found.
Returns:
The HostGroup given the specified aHostGroupName.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified aHostGroupName argument is null.
Since:
0.1.0

getHost

public final Host getHost(java.lang.String aHostIP,
                          boolean createWhenNotExists)
                   throws java.lang.IllegalArgumentException
Returns the host given its host IP. Returns a new Host if not found.

Specified by:
getHost in interface HostGroupService
Parameters:
aHostIP - The host group name. This argument must not be null.
createWhenNotExists - A boolean indicator to create the specified host if it does not exists.
Returns:
The host group given the specified hostGroupName.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified hostGroupName argument is null.
Since:
0.1.0

getHostGroups

public final java.util.List<HostGroup> getHostGroups()
Returns all the host groups assocated to this service. Returns an empty list if there is no host group found.

Specified by:
getHostGroups in interface HostGroupService
Returns:
All host group associated to this service instance.
Since:
0.1.0

getHosts

public java.util.List<Host> getHosts()
Returns all the host associated to this host group service. Returns an empty list if there is no host group found.

Specified by:
getHosts in interface HostGroupService
Returns:
All hosts associated to this host group service.
Since:
0.1.0

getOrphanHosts

public java.util.List<Host> getOrphanHosts()
Returns all hosts that are associated to this host group service but does not have any HostGroups. Returns an empty list if there is no hosts found.

Specified by:
getOrphanHosts in interface HostGroupService
Returns:
All hosts that are not associated to any host group.
Since:
0.1.0

removeHostGroup

public boolean removeHostGroup(java.lang.String anId)
                        throws java.lang.IllegalArgumentException
Removes host group given the host group id.

Specified by:
removeHostGroup in interface HostGroupService
Parameters:
anId - The host group id. This argument must not be null.
Returns:
Returns true if the object is removed.
Throws:
java.lang.IllegalArgumentException - Thrown if the anId argument is null.
Since:
0.1.0

removeHost

public boolean removeHost(java.lang.String anId)
                   throws java.lang.IllegalArgumentException
Remove host given the host id.

Specified by:
removeHost in interface HostGroupService
Parameters:
anId - The host id. This argument must not be null.
Returns:
Returns true if the host is removed.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified anId argument is null.
Since:
0.1.0

updated

public void updated(java.util.Dictionary properties)
             throws org.osgi.service.cm.ConfigurationException
Specified by:
updated in interface org.osgi.service.cm.ManagedService
Throws:
org.osgi.service.cm.ConfigurationException


Copyright © 2008. All Rights Reserved.