org.ow2.jonas.security.internal
Class JResources

java.lang.Object
  extended by org.ow2.jonas.security.internal.JResources

public class JResources
extends Object

Author:
Guillaume Sauthier

Field Summary
static String HEADER_XML
          XML Header.
 
Constructor Summary
JResources()
          Create a JResoures list attached to a given SecurityService.
 
Method Summary
 void addJResource(JResource jResource)
          Add the Resource (memory, ldap, datasource,...).
 JResource getJResource(String name)
           
 Enumeration<JResource> getResources()
           
 boolean hasJmxService()
          Allows to chek if the jmx service reference is set.
 JResource remove(String resourceName)
          Removes the named JResource from the JResource list.
 void setDomainName(String domain)
          Set the domain name
 void setJmxService(JmxService jmx)
          Set the jmx service reference
 void setSecurityService(SecurityService service)
          Set the security service reference
 String toXML()
          String representation of the JOnAS realm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEADER_XML

public static final String HEADER_XML
XML Header.

See Also:
Constant Field Values
Constructor Detail

JResources

public JResources()
Create a JResoures list attached to a given SecurityService.

Parameters:
s - the parent SecurityService
Method Detail

addJResource

public void addJResource(JResource jResource)
                  throws Exception
Add the Resource (memory, ldap, datasource,...).

Parameters:
jResource - an instance of JResource or subclasses (JResourceMemory, JResourceDS,...)
Throws:
Exception - if the resource name already exists

remove

public JResource remove(String resourceName)
                 throws Exception
Removes the named JResource from the JResource list.

Parameters:
resourceName - JResource name to be removed
Returns:
the removed JResource
Throws:
Exception - when JResource is not found with given name.

getJResource

public JResource getJResource(String name)
Parameters:
name - the name of the JResource to get.
Returns:
Returns the named JResource

getResources

public Enumeration<JResource> getResources()
Returns:
Returns the JResources Enumeration

toXML

public String toXML()
String representation of the JOnAS realm.

Returns:
the xml representation of the JOnAS realm

setSecurityService

public void setSecurityService(SecurityService service)
Set the security service reference

Parameters:
sec - security service reference

setDomainName

public void setDomainName(String domain)
Set the domain name

Parameters:
domain - the domain name

setJmxService

public void setJmxService(JmxService jmx)
Set the jmx service reference

Parameters:
jmxService - the jmx service reference

hasJmxService

public boolean hasJmxService()
Allows to chek if the jmx service reference is set.

Returns:
true if the jmx service reference set, false otherwise false.


Copyright © 2010 OW2 Consortium. All Rights Reserved.