org.eclipse.wst.ws.service.policy
Interface IServicePolicy


public interface IServicePolicy

This interface encapsulates the idea of a service policy


Method Summary
 void addPolicyChildChangeListener(IPolicyChildChangeListener listener)
          Adds a child listener to this service policy.
 void addStatusChangeListener(IStatusChangeListener listener)
          Adds a status change listener to this service policy.
 java.util.List<IServicePolicy> getChildren()
           
 IDescriptor getDescriptor()
          Returns the descriptor for this service policy.
 java.lang.String getId()
          Returns the unique ID for this service policy.
 IServicePolicy getParentPolicy()
          Returns the parent service policy object.
 IPolicyState getPolicyState()
          Returns the policy state for this service policy.
 IPolicyState getPolicyState(org.eclipse.core.resources.IProject project)
          Returns the IPolicyState for a particular project.
 IPolicyStateEnum getPolicyStateEnum()
          Returns the policy state enumeration object.
 IPolicyStateEnum getPolicyStateEnum(org.eclipse.core.resources.IProject project)
          Returns the policy state enumeration object for a particular project.
 java.util.List<IPolicyRelationship> getRelationships()
          Returns a list of relationships to other IServicePolicy objects.
 org.eclipse.core.runtime.IStatus getStatus()
          Returns the status for this service policy.
 boolean isPredefined()
          Returns if this service policy is defined by an extension or not.
 void removeChild(IServicePolicy policy)
          Removes a child service policy from this service policy.
 void removePolicyChildChangeListener(IPolicyChildChangeListener listener)
          Removes a child listener from this service policy.
 void removeStatusChangeListener(IStatusChangeListener listener)
          Removes a status change listener from this service policy.
 void restoreDefaults()
          Restores the policy to its original state.
 void restoreDefaults(org.eclipse.core.resources.IProject project)
          Restores the policy to its original state for a particular project.
 void setRelationships(java.util.List<IPolicyRelationship> relationships)
          Sets the relationships for this service policy.
 void setStatus(org.eclipse.core.runtime.IStatus status)
          Sets the status for this service policy.
 

Method Detail

isPredefined

boolean isPredefined()
Returns if this service policy is defined by an extension or not.

Returns:
returns true if this Service policy is defined in plugin.xml meta data. Otherwise, false is returned.

getId

java.lang.String getId()
Returns the unique ID for this service policy.

Returns:
returns the unique ID for this service policy.

getDescriptor

IDescriptor getDescriptor()
Returns the descriptor for this service policy.

Returns:
returns the descriptor for this service policy.

getRelationships

java.util.List<IPolicyRelationship> getRelationships()
Returns a list of relationships to other IServicePolicy objects.

Returns:
returns a list of relationships to other IServicePolicy objects.

setRelationships

void setRelationships(java.util.List<IPolicyRelationship> relationships)
Sets the relationships for this service policy.

Parameters:
relationships -

restoreDefaults

void restoreDefaults()
Restores the policy to its original state. All locally added child policies will be removed. The state of each policy will be set to is default value. Note: the changes made calling this method can be undone if the platform performs a discardChanges operation. Alternatively, if the plaform performs a commitChanges operation these changes will be saved.


restoreDefaults

void restoreDefaults(org.eclipse.core.resources.IProject project)
Restores the policy to its original state for a particular project. The state of each policy will be set to is default value. Note: the changes made calling this method can be undone if the platform performs a discardChanges operation. Alternatively, if the plaform performs a commitChanges operation these changes will be saved.


getPolicyState

IPolicyState getPolicyState()
Returns the policy state for this service policy.

Returns:
returns the policy state for this service policy.

getPolicyState

IPolicyState getPolicyState(org.eclipse.core.resources.IProject project)
Returns the IPolicyState for a particular project.

Parameters:
project - the project.
Returns:
The IPolicyState for a particular project.

getPolicyStateEnum

IPolicyStateEnum getPolicyStateEnum()
Returns the policy state enumeration object. Note: this is just a wrapper around the policy state object.

Returns:
returns the state enumeration object for this service policy. If this policy is not associated with an enumeration null will be returned.

getPolicyStateEnum

IPolicyStateEnum getPolicyStateEnum(org.eclipse.core.resources.IProject project)
Returns the policy state enumeration object for a particular project. Note: this is just a wrapper around the policy state object.

Parameters:
project - the project
Returns:
returns the state enumeration for a particular project. If no state enumeration is associated with the service policy null will be returned.

getParentPolicy

IServicePolicy getParentPolicy()
Returns the parent service policy object.

Returns:
returns the parent policy for this service policy. If this service policy has no parent then null is returned.

getChildren

java.util.List<IServicePolicy> getChildren()
Returns:
returns the child service policies for this service policy. Changes made to the returned list do not change the underlying number of children for this service policy.

removeChild

void removeChild(IServicePolicy policy)
Removes a child service policy from this service policy. If the policy specified is null or is not a child of this service policy this method will have no effect. Also, if this service policy is predefined calling this method will have no effect.

Parameters:
policy -

addPolicyChildChangeListener

void addPolicyChildChangeListener(IPolicyChildChangeListener listener)
Adds a child listener to this service policy.

Parameters:
listener - the listener

removePolicyChildChangeListener

void removePolicyChildChangeListener(IPolicyChildChangeListener listener)
Removes a child listener from this service policy.

Parameters:
listener -

addStatusChangeListener

void addStatusChangeListener(IStatusChangeListener listener)
Adds a status change listener to this service policy. When the status changes this listener will be notified.

Parameters:
listener -

removeStatusChangeListener

void removeStatusChangeListener(IStatusChangeListener listener)
Removes a status change listener from this service policy.

Parameters:
listener -

getStatus

org.eclipse.core.runtime.IStatus getStatus()
Returns the status for this service policy.

Returns:
returns the status for this service policy.

setStatus

void setStatus(org.eclipse.core.runtime.IStatus status)
Sets the status for this service policy.

Parameters:
status -