Openwings API Documentation (v1.1)

net.openwings.policy
Interface Policy

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ComponentPolicy, ContainerManagerPolicy, EventServicePolicy, InstallableComponentDescriptorPolicy, ManagementPolicy, ProvideServicePolicy, PublishServicePolicy, UseServicePolicy

public interface Policy
extends java.io.Serializable

This interface provides the basis for defining policies in Openwings. Interfaces for custom policies extend this interface.


Method Summary
 java.lang.String getDescription()
          Get the human-readable description for this Policy.
 java.net.URL getLastLoadURL()
          Returns a URL corresponding to the last location from which the policy was loaded.
 java.lang.String getName()
          Get the name of this Policy.
 java.lang.String[] getPolicyAttributes()
          Returns an array of strings that contains the attributes for the policy in the order defined in the schema.
 java.lang.String[] getPolicyElements()
          Returns an array of strings that contains the elements for the policy in the order defined in the schema.
 boolean isPolicyUpdated()
          Determines if this policy has been updated and is in need of being saved.
 void loadPolicy(java.io.File file)
          Load the policy with configuration data from the File.
 void loadPolicy(java.net.URL url)
          Load the policy with configuration data from the URL.
 void savePolicy()
          Save the policy configuration data to the file or URL where it was originally loaded from.
 void savePolicy(java.io.File file)
          Save the policy configuration data to the File.
 void savePolicy(java.net.URL url)
          Save the policy configuration data to the URL.
 void setDescription(java.lang.String description)
          Set a human-readable description for this Policy.
 void setName(java.lang.String name)
          Assign a name to this Policy.
 void setPolicyUpdated(boolean policyUpdated)
          Sets the update status of this policy.
 

Method Detail

loadPolicy

public void loadPolicy(java.net.URL url)
                throws PolicyException
Load the policy with configuration data from the URL. The values from the configuration data overwrite any previous values stored by the Policy object.

Parameters:
url - The location of the policy configuration data.
Throws:
throws - A PolicyException that wraps any exception generated when attempting to load the policy data.
PolicyException

loadPolicy

public void loadPolicy(java.io.File file)
                throws PolicyException
Load the policy with configuration data from the File. The values from the configuration data overwrite any previous values stored by the Policy object.

Parameters:
file - The file for the policy configuration data.
Throws:
throws - A PolicyException that wraps any exception generated when attempting to load the policy data.
PolicyException

savePolicy

public void savePolicy(java.net.URL url)
                throws PolicyException
Save the policy configuration data to the URL.

Parameters:
url - The location for the policy configuration data.
Throws:
throws - A PolicyException that wraps any exception generated when attempting to load the policy data.
PolicyException

savePolicy

public void savePolicy(java.io.File file)
                throws PolicyException
Save the policy configuration data to the File.

Parameters:
file - The file for the policy configuration data.
Throws:
throws - A PolicyException that wraps any exception generated when attempting to load the policy data.
PolicyException

savePolicy

public void savePolicy()
                throws PolicyException
Save the policy configuration data to the file or URL where it was originally loaded from.

Throws:
throws - A PolicyException that wraps any exception generated when attempting to load the policy data.
PolicyException

setName

public void setName(java.lang.String name)
Assign a name to this Policy. Naming is used to distinguish between policies of the same type.

Parameters:
name - The name to be used in identifying the Policy.

getName

public java.lang.String getName()
Get the name of this Policy. Naming is used to distinguish between policies of the same type.

Returns:
The name of the Policy.

setDescription

public void setDescription(java.lang.String description)
Set a human-readable description for this Policy. The description should be suitable for display in a graphical user interface.

Parameters:
description - The text to be used in describing the Policy.

getDescription

public java.lang.String getDescription()
Get the human-readable description for this Policy. The description should be suitable for display in a graphical user interface.

Returns:
The text to be used in describing the Policy.

setPolicyUpdated

public void setPolicyUpdated(boolean policyUpdated)
Sets the update status of this policy.


isPolicyUpdated

public boolean isPolicyUpdated()
Determines if this policy has been updated and is in need of being saved.

Returns:
true if the policy has been updated; false otherwise.

getPolicyAttributes

public java.lang.String[] getPolicyAttributes()
Returns an array of strings that contains the attributes for the policy in the order defined in the schema.

Returns:
array of strings containing attributes

getPolicyElements

public java.lang.String[] getPolicyElements()
Returns an array of strings that contains the elements for the policy in the order defined in the schema.

Returns:
array of strings containing elements

getLastLoadURL

public java.net.URL getLastLoadURL()
Returns a URL corresponding to the last location from which the policy was loaded.

Returns:
The source of the xml file used to populate the policy
Since:
0.9.1

Openwings API Documentation (v1.1)