Fixed minor issues reported by sonar (Redundant Modifier)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@63497 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2014-03-02 16:56:25 +00:00
parent 90c08059e3
commit 172fcf3d77

View File

@@ -35,64 +35,64 @@ import org.alfresco.service.namespace.QName;
/** /**
* Records management custom model service interface. Implementations of this class are responsible * Records management custom model service interface. Implementations of this class are responsible
* for the creation and maintenance of RM-related custom properties and custom associations. * for the creation and maintenance of RM-related custom properties and custom associations.
* *
* @author Neil McErlean, janv * @author Neil McErlean, janv
* @since 2.1 * @since 2.1
* @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService * @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService
*/ */
public interface RecordsManagementAdminService public interface RecordsManagementAdminService
{ {
/** /**
* Initialise the custom model * Initialise the custom model
*/ */
public void initialiseCustomModel(); void initialiseCustomModel();
/** /**
* Get a list of all registered customisable types and aspects. * Get a list of all registered customisable types and aspects.
* *
* @return {@link Set}<{@link QName}> QName's of customisable types and aspects * @return {@link Set}<{@link QName}> QName's of customisable types and aspects
*/ */
public Set<QName> getCustomisable(); Set<QName> getCustomisable();
/** /**
* Get a list of all the registered customisable types and aspects present on a given * Get a list of all the registered customisable types and aspects present on a given
* node reference. * node reference.
* *
* @param nodeRef node reference * @param nodeRef node reference
* @return {@link Set}<{@link QName}> QName's of customisable types and aspects, empty if none * @return {@link Set}<{@link QName}> QName's of customisable types and aspects, empty if none
*/ */
public Set<QName> getCustomisable(NodeRef nodeRef); Set<QName> getCustomisable(NodeRef nodeRef);
/** /**
* Indicates whether a type (or aspect) is customisable. * Indicates whether a type (or aspect) is customisable.
* *
* @param type customisable type {@link QName} * @param type customisable type {@link QName}
* @return boolean true if type customisable, false otherwise * @return boolean true if type customisable, false otherwise
*/ */
public boolean isCustomisable(QName type); boolean isCustomisable(QName type);
/** /**
* Makes a type customisable. * Makes a type customisable.
* *
* @param type type {@link QName} to make customisable * @param type type {@link QName} to make customisable
*/ */
public void makeCustomisable(QName type); void makeCustomisable(QName type);
/** /**
* Assuming the custom properties are not in use, makes a type no longer customisable. * Assuming the custom properties are not in use, makes a type no longer customisable.
* *
* @param type type {@link QName} to make customisable * @param type type {@link QName} to make customisable
*/ */
public void unmakeCustomisable(QName type); void unmakeCustomisable(QName type);
/** /**
* Indicates whether the custom property exists. * Indicates whether the custom property exists.
* *
* @param property properties {@link QName} * @param property properties {@link QName}
* @return boolean true if property exists, false otherwise * @return boolean true if property exists, false otherwise
*/ */
public boolean existsCustomProperty(QName property); boolean existsCustomProperty(QName property);
/** /**
* This method returns the custom properties that have been defined for the specified * This method returns the custom properties that have been defined for the specified
* customisable RM element. * customisable RM element.
@@ -101,13 +101,13 @@ public interface RecordsManagementAdminService
* which is notified of any newly created definitions on transaction commit. * which is notified of any newly created definitions on transaction commit.
* Therefore custom properties created in the current transaction will not appear * Therefore custom properties created in the current transaction will not appear
* in the result of this method. * in the result of this method.
* *
* @param customisedElement * @param customisedElement
* @return * @return
* @see CustomisableRmElement * @see CustomisableRmElement
*/ */
public Map<QName, PropertyDefinition> getCustomPropertyDefinitions(QName customisableType); Map<QName, PropertyDefinition> getCustomPropertyDefinitions(QName customisableType);
/** /**
* This method returns the custom properties that have been defined for all of * This method returns the custom properties that have been defined for all of
* the specified customisable RM elements. * the specified customisable RM elements.
@@ -115,17 +115,17 @@ public interface RecordsManagementAdminService
* which is notified of any newly created definitions on transaction commit. * which is notified of any newly created definitions on transaction commit.
* Therefore custom properties created in the current transaction will not appear * Therefore custom properties created in the current transaction will not appear
* in the result of this method. * in the result of this method.
* *
* @return * @return
* @see CustomisableRmElement * @see CustomisableRmElement
*/ */
public Map<QName, PropertyDefinition> getCustomPropertyDefinitions(); Map<QName, PropertyDefinition> getCustomPropertyDefinitions();
/** /**
* Add custom property definition * Add custom property definition
* *
* Note: no default value, single valued, optional, not system protected, no constraints * Note: no default value, single valued, optional, not system protected, no constraints
* *
* @param propId - If a value for propId is provided it will be used to identify property definitions * @param propId - If a value for propId is provided it will be used to identify property definitions
* within URLs and in QNames. Therefore it must contain URL/QName-valid characters * within URLs and in QNames. Therefore it must contain URL/QName-valid characters
* only. It must also be unique. * only. It must also be unique.
@@ -136,15 +136,15 @@ public interface RecordsManagementAdminService
* @param dataType - mandatory * @param dataType - mandatory
* @param title - optional * @param title - optional
* @param description - optional * @param description - optional
* *
* @return the propId, whether supplied as a parameter or generated. * @return the propId, whether supplied as a parameter or generated.
* @see CustomisableRmElement#getCorrespondingAspect() * @see CustomisableRmElement#getCorrespondingAspect()
*/ */
public QName addCustomPropertyDefinition(QName propId, QName typeName, String label, QName dataType, String title, String description) throws CustomMetadataException; QName addCustomPropertyDefinition(QName propId, QName typeName, String label, QName dataType, String title, String description) throws CustomMetadataException;
/** /**
* Add custom property definition with one optional constraint reference * Add custom property definition with one optional constraint reference
* *
* @param propId - If a value for propId is provided it will be used to identify property definitions * @param propId - If a value for propId is provided it will be used to identify property definitions
* within URLs and in QNames. Therefore it must contain URL/QName-valid characters * within URLs and in QNames. Therefore it must contain URL/QName-valid characters
* only. It must also be unique. * only. It must also be unique.
@@ -160,34 +160,34 @@ public interface RecordsManagementAdminService
* @param mandatory - TRUE if mandatory property * @param mandatory - TRUE if mandatory property
* @param isProtected - TRUE if protected property * @param isProtected - TRUE if protected property
* @param lovConstraintQName - optional custom constraint * @param lovConstraintQName - optional custom constraint
* *
* @return the propId, whether supplied as a parameter or generated. * @return the propId, whether supplied as a parameter or generated.
* @see CustomisableRmElement#getCorrespondingAspect() * @see CustomisableRmElement#getCorrespondingAspect()
*/ */
// TODO propId string (not QName) ? // TODO propId string (not QName) ?
// TODO remove title (since it is ignored) (or remove label to title) // TODO remove title (since it is ignored) (or remove label to title)
public QName addCustomPropertyDefinition(QName propId, QName addCustomPropertyDefinition(QName propId,
QName typeName, QName typeName,
String label, String label,
QName dataType, QName dataType,
String title, String title,
String description, String description,
String defaultValue, String defaultValue,
boolean multiValued, boolean multiValued,
boolean mandatory, boolean mandatory,
boolean isProtected, boolean isProtected,
QName lovConstraintQName) throws CustomMetadataException; QName lovConstraintQName) throws CustomMetadataException;
/** /**
* Update the custom property definition's label (title). * Update the custom property definition's label (title).
* *
* @param propQName the qname of the property definition * @param propQName the qname of the property definition
* @param newLabel the new value for the label. * @param newLabel the new value for the label.
* @return the propId. * @return the propId.
*/ */
public QName setCustomPropertyDefinitionLabel(QName propQName, String newLabel) throws PropertyAlreadyExistsMetadataException; QName setCustomPropertyDefinitionLabel(QName propQName, String newLabel) throws PropertyAlreadyExistsMetadataException;
/** /**
* Update the name and label of the custom property definition. * Update the name and label of the custom property definition.
@@ -196,32 +196,32 @@ public interface RecordsManagementAdminService
* @return * @return
* @throws CustomMetadataException * @throws CustomMetadataException
*/ */
public QName updateCustomPropertyDefinitionName(QName propQName, String newName) throws CustomMetadataException; QName updateCustomPropertyDefinitionName(QName propQName, String newName) throws CustomMetadataException;
/** /**
* Sets a new list of values constraint on the custom property definition. * Sets a new list of values constraint on the custom property definition.
* *
* @param propQName the qname of the property definition * @param propQName the qname of the property definition
* @param newLovConstraint the List-Of-Values constraintRef. * @param newLovConstraint the List-Of-Values constraintRef.
* @return the propId. * @return the propId.
*/ */
public QName setCustomPropertyDefinitionConstraint(QName propQName, QName newLovConstraint); QName setCustomPropertyDefinitionConstraint(QName propQName, QName newLovConstraint);
/** /**
* Removes all list of values constraints from the custom property definition. * Removes all list of values constraints from the custom property definition.
* *
* @param propQName the qname of the property definition * @param propQName the qname of the property definition
* @return the propId. * @return the propId.
*/ */
public QName removeCustomPropertyDefinitionConstraints(QName propQName); QName removeCustomPropertyDefinitionConstraints(QName propQName);
/** /**
* Remove custom property definition * Remove custom property definition
* *
* @param propQName * @param propQName
*/ */
public void removeCustomPropertyDefinition(QName propQName); void removeCustomPropertyDefinition(QName propQName);
/** /**
* This method returns the custom references that have been defined in the custom * This method returns the custom references that have been defined in the custom
* model. * model.
@@ -229,107 +229,107 @@ public interface RecordsManagementAdminService
* which is notified of any newly created definitions on transaction commit. * which is notified of any newly created definitions on transaction commit.
* Therefore custom references created in the current transaction will not appear * Therefore custom references created in the current transaction will not appear
* in the results. * in the results.
* *
* @return The Map of custom references (both parent-child and standard). * @return The Map of custom references (both parent-child and standard).
*/ */
public Map<QName, AssociationDefinition> getCustomReferenceDefinitions(); Map<QName, AssociationDefinition> getCustomReferenceDefinitions();
/** /**
* Fetches all associations <i>from</i> the given source. * Fetches all associations <i>from</i> the given source.
* *
* @param node the node from which the associations start. * @param node the node from which the associations start.
* @return a List of associations. * @return a List of associations.
*/ */
public List<AssociationRef> getCustomReferencesFrom(NodeRef node); List<AssociationRef> getCustomReferencesFrom(NodeRef node);
/** /**
* Fetches all child associations of the given source. i.e. all associations where the * Fetches all child associations of the given source. i.e. all associations where the
* given node is the parent. * given node is the parent.
* *
* @param node * @param node
* @return * @return
*/ */
public List<ChildAssociationRef> getCustomChildReferences(NodeRef node); List<ChildAssociationRef> getCustomChildReferences(NodeRef node);
/** /**
* Returns a List of all associations <i>to</i> the given node. * Returns a List of all associations <i>to</i> the given node.
* *
* @param node the node to which the associations point. * @param node the node to which the associations point.
* @return a List of associations. * @return a List of associations.
*/ */
public List<AssociationRef> getCustomReferencesTo(NodeRef node); List<AssociationRef> getCustomReferencesTo(NodeRef node);
/** /**
* Fetches all child associations where the given node is the child. * Fetches all child associations where the given node is the child.
* *
* @param node * @param node
* @return * @return
*/ */
public List<ChildAssociationRef> getCustomParentReferences(NodeRef node); List<ChildAssociationRef> getCustomParentReferences(NodeRef node);
/** /**
* This method adds the specified custom reference instance between the specified nodes. * This method adds the specified custom reference instance between the specified nodes.
* Only one instance of any custom reference type is allowed in a given direction * Only one instance of any custom reference type is allowed in a given direction
* between two given records. * between two given records.
* *
* @param fromNode * @param fromNode
* @param toNode * @param toNode
* @param assocId the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567 * @param assocId the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567
* @throws AlfrescoRuntimeException if an instance of the specified reference type * @throws AlfrescoRuntimeException if an instance of the specified reference type
* already exists from fromNode to toNode. * already exists from fromNode to toNode.
*/ */
public void addCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId); void addCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId);
/** /**
* This method removes the specified custom reference instance from the specified node. * This method removes the specified custom reference instance from the specified node.
* *
* @param fromNode * @param fromNode
* @param toNode * @param toNode
* @param assocId the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567 * @param assocId the server-side qname e.g. {http://www.alfresco.org/model/rmcustom/1.0}abcd-12-efgh-4567
*/ */
public void removeCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId); void removeCustomReference(NodeRef fromNode, NodeRef toNode, QName assocId);
/** /**
* This method creates a new custom association, using the given label as the title. * This method creates a new custom association, using the given label as the title.
* *
* @param label the title of the association definition * @param label the title of the association definition
* @return the QName of the newly-created association. * @return the QName of the newly-created association.
*/ */
public QName addCustomAssocDefinition(String label); QName addCustomAssocDefinition(String label);
/** /**
* This method creates a new custom child association, combining the given source and * This method creates a new custom child association, combining the given source and
* target and using the combined String as the title. * target and using the combined String as the title.
* *
* @param source * @param source
* @param target * @param target
* @return the QName of the newly-created association. * @return the QName of the newly-created association.
*/ */
public QName addCustomChildAssocDefinition(String source, String target); QName addCustomChildAssocDefinition(String source, String target);
/** /**
* This method updates the source and target values for the specified child association. * This method updates the source and target values for the specified child association.
* The source and target will be combined into a single string and stored in the title property. * The source and target will be combined into a single string and stored in the title property.
* Source and target are String metadata for RM parent/child custom references. * Source and target are String metadata for RM parent/child custom references.
* *
* @param refQName qname of the child association. * @param refQName qname of the child association.
* @param newSource the new value for the source field. * @param newSource the new value for the source field.
* @param newTarget the new value for the target field. * @param newTarget the new value for the target field.
* @see #getCompoundIdFor(String, String) * @see #getCompoundIdFor(String, String)
* @see #splitSourceTargetId(String) * @see #splitSourceTargetId(String)
*/ */
public QName updateCustomChildAssocDefinition(QName refQName, String newSource, String newTarget); QName updateCustomChildAssocDefinition(QName refQName, String newSource, String newTarget);
/** /**
* This method updates the label value for the specified association. * This method updates the label value for the specified association.
* The label will be stored in the title property. * The label will be stored in the title property.
* Label is String metadata for bidirectional custom references. * Label is String metadata for bidirectional custom references.
* *
* @param refQName qname of the child association. * @param refQName qname of the child association.
* @param newLabel the new value for the label field. * @param newLabel the new value for the label field.
*/ */
public QName updateCustomAssocDefinition(QName refQName, String newLabel); QName updateCustomAssocDefinition(QName refQName, String newLabel);
/** /**
* This method returns ConstraintDefinition objects defined in the given model * This method returns ConstraintDefinition objects defined in the given model
* (note: not property references or in-line defs) * (note: not property references or in-line defs)
@@ -338,72 +338,72 @@ public interface RecordsManagementAdminService
* Therefore custom constraints created in the current transaction will not appear * Therefore custom constraints created in the current transaction will not appear
* in the results. * in the results.
*/ */
public List<ConstraintDefinition> getCustomConstraintDefinitions(QName modelQName); List<ConstraintDefinition> getCustomConstraintDefinitions(QName modelQName);
/** /**
* This method adds a Constraint definition to the custom model. * This method adds a Constraint definition to the custom model.
* The implementation of this method would have to go into the M2Model and insert * The implementation of this method would have to go into the M2Model and insert
* the relevant M2Objects for this new constraint. * the relevant M2Objects for this new constraint.
* *
* param type not included as it would always be RMListOfValuesConstraint for RM. * param type not included as it would always be RMListOfValuesConstraint for RM.
* *
* @param constraintName the name e.g. rmc:foo * @param constraintName the name e.g. rmc:foo
* @param title the human-readable title e.g. My foo list * @param title the human-readable title e.g. My foo list
* @param caseSensitive * @param caseSensitive
* @param allowedValues the allowed values list * @param allowedValues the allowed values list
* @param matchLogic AND (all values must match), OR (at least one values must match) * @param matchLogic AND (all values must match), OR (at least one values must match)
*/ */
public void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List<String> allowedValues, MatchLogic matchLogic); void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List<String> allowedValues, MatchLogic matchLogic);
/** /**
* Remove custom constraint definition - if not referenced (by any properties) * Remove custom constraint definition - if not referenced (by any properties)
* *
* *
* @param constraintName the name e.g. rmc:foo * @param constraintName the name e.g. rmc:foo
*/ */
public void removeCustomConstraintDefinition(QName constraintName); void removeCustomConstraintDefinition(QName constraintName);
/** /**
* Update custom constraint definition with new list of values (replaces existing list, if any) * Update custom constraint definition with new list of values (replaces existing list, if any)
* *
* @param constraintName the name e.g. rmc:foo * @param constraintName the name e.g. rmc:foo
* @param newValues * @param newValues
*/ */
public void changeCustomConstraintValues(QName constraintName, List<String> newValues); void changeCustomConstraintValues(QName constraintName, List<String> newValues);
/** /**
* *
* @param constraintName * @param constraintName
* @param title * @param title
*/ */
public void changeCustomConstraintTitle(QName constraintName, String title); void changeCustomConstraintTitle(QName constraintName, String title);
/** /**
* This method iterates over the custom properties, references looking for one whose id * This method iterates over the custom properties, references looking for one whose id
* exactly matches that specified. * exactly matches that specified.
* *
* @param localName the localName part of the qname of the property or reference definition. * @param localName the localName part of the qname of the property or reference definition.
* @return the QName of the property, association definition which matches, or null. * @return the QName of the property, association definition which matches, or null.
*/ */
public QName getQNameForClientId(String localName); QName getQNameForClientId(String localName);
/** /**
* Given a compound id for source and target strings (as used with parent/child * Given a compound id for source and target strings (as used with parent/child
* custom references), this method splits the String and returns an array containing * custom references), this method splits the String and returns an array containing
* the source and target IDs separately. * the source and target IDs separately.
* *
* @param sourceTargetId the compound ID. * @param sourceTargetId the compound ID.
* @return a String array, where result[0] == sourceId and result[1] == targetId. * @return a String array, where result[0] == sourceId and result[1] == targetId.
*/ */
public String[] splitSourceTargetId(String sourceTargetId); String[] splitSourceTargetId(String sourceTargetId);
/** /**
* This method retrieves a compound ID (client-side) for the specified * This method retrieves a compound ID (client-side) for the specified
* sourceId and targetId. * sourceId and targetId.
* *
* @param sourceId * @param sourceId
* @param targetId * @param targetId
* @return * @return
*/ */
public String getCompoundIdFor(String sourceId, String targetId); String getCompoundIdFor(String sourceId, String targetId);
} }