Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.jdeveloper.audit.service
Class Profile

java.lang.Object
  extended by oracle.jdeveloper.audit.service.Profile
Direct Known Subclasses:
DefaultProfile

public abstract class Profile
extends java.lang.Object

A set of analyzers with category, rule, and metric bean properties configured to specific values. A profile is essentially a bag of JavaBeans.

A profile specifies a set of beans to define, a name, and a set of properties with which to configure the beans. A profile can be created with or without a URL:

The Audit framework manages a set of predefined profiles that are registered with Audit by extensions using the Audit profile hook, and which are explicitly documented and always available to the user. These are created with an id in addition to a URL. The id is used by the Audit framework to maintain the association of the file as it evolves over time with the named profile known to the user.

See Also:
AuditManager.createProfile(java.lang.String), DefaultProfile.DefaultProfile(oracle.jdeveloper.audit.extension.ProfileDefinition, java.lang.String, java.net.URL, oracle.jdeveloper.audit.extension.BeanDefinition[])

Constructor Summary
Profile()
           
 
Method Summary
abstract  void addChangeListener(javax.swing.event.ChangeListener listener)
          Adds a change listener to be notified when changes are applied to this profile.
abstract  void applyChanges(ProfileTransaction transaction)
          Apply the changes in a transaction to this profile.
abstract  ExtensionBean createBean(BeanDefinition definition, boolean force, java.util.Map<java.lang.String,ExtensionBean> context)
          Creates an instance of a bean in this profile.
abstract  java.util.Map<java.lang.String,ExtensionBean> createBeans(boolean force)
          Creates instances of all beans in this profile.
abstract  ProfileTransaction createTransaction()
          Creates a transaction for this profile.
abstract  ValueHandle getChangedValue(java.lang.String id, java.lang.String propertyName)
          Gets the value of a property of a bean of this profile changed from its default value, null if not changed.
abstract  MultiMap<java.lang.String,ValueHandle> getChangedValues()
          Gets the properties of beans of this profile changed from their default values.
abstract  java.lang.Object getDefaultValue(BeanDefinition definition, java.lang.String propertyName)
          Gets the default value of a property of a bean of this profile.
abstract  ProfileDefinition getDefinition()
          Gets the definition of this profile, or null if not a predefined profile.
abstract  BeanDefinition getDefinition(java.lang.String id)
          Gets the definition of a specified bean in this profile, or null if none.
abstract  java.util.Collection<BeanDefinition> getDefinitions()
          Gets the definitions of all beans in this profile.
abstract  java.lang.String getId()
          Gets the id of this profile, or null if not a predefined profile.
abstract  java.lang.String getName()
          Gets the name of this profile.
abstract  java.net.URL getURL()
          Gets the URL from which to load properties of this profile, or null if this profile is not associated with a file.
abstract  boolean isEnabled(java.lang.String id)
          Gets whether a bean in this profile is enabled.
abstract  void removeChangeListener(javax.swing.event.ChangeListener listener)
          Adds a change listener to be notified when changes are applied to this profile.
abstract  void save(java.net.URL url)
          Saves this profile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Profile

public Profile()
Method Detail

getDefinition

public abstract ProfileDefinition getDefinition()
Gets the definition of this profile, or null if not a predefined profile.


getId

public abstract java.lang.String getId()
Gets the id of this profile, or null if not a predefined profile.


getName

public abstract java.lang.String getName()
Gets the name of this profile.


getURL

public abstract java.net.URL getURL()
Gets the URL from which to load properties of this profile, or null if this profile is not associated with a file.


getDefinitions

public abstract java.util.Collection<BeanDefinition> getDefinitions()
Gets the definitions of all beans in this profile.


getDefinition

public abstract BeanDefinition getDefinition(java.lang.String id)
Gets the definition of a specified bean in this profile, or null if none.

Parameters:
id - the id of the bean.

createBeans

public abstract java.util.Map<java.lang.String,ExtensionBean> createBeans(boolean force)
Creates instances of all beans in this profile.

When force is true, loading classes is first tried with the Audit class loader before an unloaded extension is loaded.

Parameters:
force - Whether to load the extension defining this bean if needed.
Throws:
java.lang.IllegalStateException - if profile properties are not configured.

createBean

public abstract ExtensionBean createBean(BeanDefinition definition,
                                         boolean force,
                                         java.util.Map<java.lang.String,ExtensionBean> context)
Creates an instance of a bean in this profile.

When force is true, loading classes is first tried with the Audit class loader before an unloaded extension is loaded.

The created bean is added to the context map, referenced beans are taken from the context map if present, otherwise they are created and added to the context map.

Parameters:
definition - The definition of the bean to load.
force - Whether to load the extension defining this bean if needed.
context - Context map for the created bean.
Throws:
java.lang.IllegalStateException - if profile properties are not configured.

isEnabled

public abstract boolean isEnabled(java.lang.String id)
Gets whether a bean in this profile is enabled. The extension defining the bean need not be loaded and will not be loaded by this method.

Parameters:
id - the id of the bean.
Throws:
java.lang.IllegalStateException - if profile properties are not loaded.
java.lang.IllegalStateException - if the bean is not defined or does not support the enabled property.

getDefaultValue

public abstract java.lang.Object getDefaultValue(BeanDefinition definition,
                                                 java.lang.String propertyName)
                                          throws java.beans.IntrospectionException,
                                                 java.lang.reflect.InvocationTargetException,
                                                 java.lang.IllegalAccessException
Gets the default value of a property of a bean of this profile.

Parameters:
definition - The definition of the bean.
propertyName - The name of the property.
Returns:
The default value of the property.
Throws:
java.lang.IllegalStateException - if the extension defining the bean is not loaded.
java.beans.IntrospectionException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException

getChangedValue

public abstract ValueHandle getChangedValue(java.lang.String id,
                                            java.lang.String propertyName)
Gets the value of a property of a bean of this profile changed from its default value, null if not changed.

Parameters:
id - the id of the bean.
propertyName - the name of the property.
Throws:
java.lang.IllegalStateException - if profile properties are not configured.

getChangedValues

public abstract MultiMap<java.lang.String,ValueHandle> getChangedValues()
Gets the properties of beans of this profile changed from their default values.

Throws:
java.lang.IllegalStateException - if profile properties are not configured.

createTransaction

public abstract ProfileTransaction createTransaction()
Creates a transaction for this profile.

Throws:
java.lang.IllegalStateException - if profile properties are not configured.

addChangeListener

public abstract void addChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener to be notified when changes are applied to this profile.


removeChangeListener

public abstract void removeChangeListener(javax.swing.event.ChangeListener listener)
Adds a change listener to be notified when changes are applied to this profile.


applyChanges

public abstract void applyChanges(ProfileTransaction transaction)
Apply the changes in a transaction to this profile. For beans defined by unloaded extensions, only the enabled property can be changed.

Throws:
java.lang.IllegalStateException - if profile properties are not configured.

save

public abstract void save(java.net.URL url)
                   throws java.io.IOException
Saves this profile.

Throws:
java.io.IOException

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.