From 172fcf3d77e35c612a7cd7535554e91233ab1126 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Sun, 2 Mar 2014 16:56:25 +0000 Subject: [PATCH] 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 --- .../admin/RecordsManagementAdminService.java | 286 +++++++++--------- 1 file changed, 143 insertions(+), 143 deletions(-) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminService.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminService.java index 81b1aeec65..30bc4049c3 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminService.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/admin/RecordsManagementAdminService.java @@ -35,64 +35,64 @@ import org.alfresco.service.namespace.QName; /** * 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. - * + * * @author Neil McErlean, janv * @since 2.1 * @see org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService */ public interface RecordsManagementAdminService { - /** - * Initialise the custom model - */ - public void initialiseCustomModel(); - - /** - * Get a list of all registered customisable types and aspects. - * - * @return {@link Set}<{@link QName}> QName's of customisable types and aspects - */ - public Set getCustomisable(); - - /** - * Get a list of all the registered customisable types and aspects present on a given - * node reference. - * - * @param nodeRef node reference - * @return {@link Set}<{@link QName}> QName's of customisable types and aspects, empty if none - */ - public Set getCustomisable(NodeRef nodeRef); - - /** - * Indicates whether a type (or aspect) is customisable. - * - * @param type customisable type {@link QName} - * @return boolean true if type customisable, false otherwise - */ - public boolean isCustomisable(QName type); - - /** - * Makes a type customisable. - * - * @param type type {@link QName} to make customisable - */ - public void makeCustomisable(QName type); - - /** - * Assuming the custom properties are not in use, makes a type no longer customisable. - * - * @param type type {@link QName} to make customisable - */ - public void unmakeCustomisable(QName type); - - /** - * Indicates whether the custom property exists. - * - * @param property properties {@link QName} - * @return boolean true if property exists, false otherwise - */ - public boolean existsCustomProperty(QName property); - + /** + * Initialise the custom model + */ + void initialiseCustomModel(); + + /** + * Get a list of all registered customisable types and aspects. + * + * @return {@link Set}<{@link QName}> QName's of customisable types and aspects + */ + Set getCustomisable(); + + /** + * Get a list of all the registered customisable types and aspects present on a given + * node reference. + * + * @param nodeRef node reference + * @return {@link Set}<{@link QName}> QName's of customisable types and aspects, empty if none + */ + Set getCustomisable(NodeRef nodeRef); + + /** + * Indicates whether a type (or aspect) is customisable. + * + * @param type customisable type {@link QName} + * @return boolean true if type customisable, false otherwise + */ + boolean isCustomisable(QName type); + + /** + * Makes a type customisable. + * + * @param type type {@link QName} to make customisable + */ + void makeCustomisable(QName type); + + /** + * Assuming the custom properties are not in use, makes a type no longer customisable. + * + * @param type type {@link QName} to make customisable + */ + void unmakeCustomisable(QName type); + + /** + * Indicates whether the custom property exists. + * + * @param property properties {@link QName} + * @return boolean true if property exists, false otherwise + */ + boolean existsCustomProperty(QName property); + /** * This method returns the custom properties that have been defined for the specified * customisable RM element. @@ -101,13 +101,13 @@ public interface RecordsManagementAdminService * which is notified of any newly created definitions on transaction commit. * Therefore custom properties created in the current transaction will not appear * in the result of this method. - * + * * @param customisedElement * @return * @see CustomisableRmElement */ - public Map getCustomPropertyDefinitions(QName customisableType); - + Map getCustomPropertyDefinitions(QName customisableType); + /** * This method returns the custom properties that have been defined for all of * the specified customisable RM elements. @@ -115,17 +115,17 @@ public interface RecordsManagementAdminService * which is notified of any newly created definitions on transaction commit. * Therefore custom properties created in the current transaction will not appear * in the result of this method. - * + * * @return * @see CustomisableRmElement */ - public Map getCustomPropertyDefinitions(); - + Map getCustomPropertyDefinitions(); + /** * Add custom property definition - * + * * 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 * within URLs and in QNames. Therefore it must contain URL/QName-valid characters * only. It must also be unique. @@ -136,15 +136,15 @@ public interface RecordsManagementAdminService * @param dataType - mandatory * @param title - optional * @param description - optional - * + * * @return the propId, whether supplied as a parameter or generated. * @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 - * + * * @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 * only. It must also be unique. @@ -160,34 +160,34 @@ public interface RecordsManagementAdminService * @param mandatory - TRUE if mandatory property * @param isProtected - TRUE if protected property * @param lovConstraintQName - optional custom constraint - * + * * @return the propId, whether supplied as a parameter or generated. * @see CustomisableRmElement#getCorrespondingAspect() */ - + // TODO propId string (not QName) ? // TODO remove title (since it is ignored) (or remove label to title) - - public QName addCustomPropertyDefinition(QName propId, - QName typeName, - String label, - QName dataType, - String title, - String description, - String defaultValue, - boolean multiValued, - boolean mandatory, - boolean isProtected, + + QName addCustomPropertyDefinition(QName propId, + QName typeName, + String label, + QName dataType, + String title, + String description, + String defaultValue, + boolean multiValued, + boolean mandatory, + boolean isProtected, QName lovConstraintQName) throws CustomMetadataException; - + /** * Update the custom property definition's label (title). - * + * * @param propQName the qname of the property definition * @param newLabel the new value for the label. * @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. @@ -196,32 +196,32 @@ public interface RecordsManagementAdminService * @return * @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. - * + * * @param propQName the qname of the property definition * @param newLovConstraint the List-Of-Values constraintRef. * @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. - * + * * @param propQName the qname of the property definition * @return the propId. */ - public QName removeCustomPropertyDefinitionConstraints(QName propQName); - + QName removeCustomPropertyDefinitionConstraints(QName propQName); + /** * Remove custom property definition - * + * * @param propQName */ - public void removeCustomPropertyDefinition(QName propQName); - + void removeCustomPropertyDefinition(QName propQName); + /** * This method returns the custom references that have been defined in the custom * model. @@ -229,107 +229,107 @@ public interface RecordsManagementAdminService * which is notified of any newly created definitions on transaction commit. * Therefore custom references created in the current transaction will not appear * in the results. - * + * * @return The Map of custom references (both parent-child and standard). */ - public Map getCustomReferenceDefinitions(); - + Map getCustomReferenceDefinitions(); + /** * Fetches all associations from the given source. - * + * * @param node the node from which the associations start. * @return a List of associations. */ - public List getCustomReferencesFrom(NodeRef node); - + List getCustomReferencesFrom(NodeRef node); + /** * Fetches all child associations of the given source. i.e. all associations where the * given node is the parent. - * + * * @param node * @return */ - public List getCustomChildReferences(NodeRef node); + List getCustomChildReferences(NodeRef node); /** * Returns a List of all associations to the given node. - * + * * @param node the node to which the associations point. * @return a List of associations. */ - public List getCustomReferencesTo(NodeRef node); - + List getCustomReferencesTo(NodeRef node); + /** * Fetches all child associations where the given node is the child. - * + * * @param node * @return */ - public List getCustomParentReferences(NodeRef node); - + List getCustomParentReferences(NodeRef node); + /** * 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 * between two given records. - * + * * @param fromNode * @param toNode * @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 * 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. - * + * * @param fromNode * @param toNode * @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. - * + * * @param label the title of the association definition * @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 * target and using the combined String as the title. - * + * * @param source * @param target * @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. * 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. - * + * * @param refQName qname of the child association. * @param newSource the new value for the source field. * @param newTarget the new value for the target field. * @see #getCompoundIdFor(String, 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. * The label will be stored in the title property. * Label is String metadata for bidirectional custom references. - * + * * @param refQName qname of the child association. * @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 * (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 * in the results. */ - public List getCustomConstraintDefinitions(QName modelQName); - + List getCustomConstraintDefinitions(QName modelQName); + /** * 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 relevant M2Objects for this new constraint. - * + * * param type not included as it would always be RMListOfValuesConstraint for RM. - * + * * @param constraintName the name e.g. rmc:foo * @param title the human-readable title e.g. My foo list * @param caseSensitive * @param allowedValues the allowed values list * @param matchLogic AND (all values must match), OR (at least one values must match) */ - public void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List allowedValues, MatchLogic matchLogic); - + void addCustomConstraintDefinition(QName constraintName, String title, boolean caseSensitive, List allowedValues, MatchLogic matchLogic); + /** * Remove custom constraint definition - if not referenced (by any properties) - * - * + * + * * @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) - * + * * @param constraintName the name e.g. rmc:foo * @param newValues */ - public void changeCustomConstraintValues(QName constraintName, List newValues); - + void changeCustomConstraintValues(QName constraintName, List newValues); + /** - * + * * @param constraintName * @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 * exactly matches that specified. - * + * * @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. */ - public QName getQNameForClientId(String localName); - + QName getQNameForClientId(String localName); + /** * 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 * the source and target IDs separately. - * + * * @param sourceTargetId the compound ID. * @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 * sourceId and targetId. - * + * * @param sourceId * @param targetId * @return */ - public String getCompoundIdFor(String sourceId, String targetId); + String getCompoundIdFor(String sourceId, String targetId); }