Class SilverpeasExceptionMessages
- java.lang.Object
-
- org.silverpeas.core.SilverpeasExceptionMessages
-
public class SilverpeasExceptionMessages extends Object
It defines the patterns of the common messages to pass with Silverpeas exceptions when an error is occurring during a treatment in Silverpeas.- Author:
- mmoquillon
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SilverpeasExceptionMessages.LightExceptionMessage
In charge to produce lighter error messages but with a bit of contextualization.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
failureOnAdding(String resource, Object id)
Computes a message about the failure to add a given resource with the specified identifier.static String
failureOnClosingConnectionTo(String service)
Computes a message about the failure to close a connection with a given service.static String
failureOnClosingFile(String resource)
Computes a message about the failure to close the given resource with the specified identifier.static String
failureOnConnecting(String service)
Computes a message about the failure of a connection with a given service.static String
failureOnDeleting(String resource, Object id)
Computes a message about the failure to delete a given resource with the specified identifier.static String
failureOnGetting(String resource, Object id)
Computes a message about the failure to get a given resource with the specified identifier.static String
failureOnIndexing(String resource, Object id)
Computes a message about the failure to index the given resource with the specified identifier.static String
failureOnMoving(String resource, Object id, String target, Object targetId)
Computes a message about the failure to move a given resource with the specified identifier to the specified target with the specified identifier.static String
failureOnOpeningConnectionTo(String service)
Computes a message about the failure to open a connection against a given service.static String
failureOnOpeningFile(String resource)
Computes a message about the failure to open the given resource with the specified identifier.static String
failureOnRemoving(String resource, Object id)
Computes a message about the failure to remove a given resource with the specified identifier.static String
failureOnRendering(String resource, Object id)
Computes a message about the failure to render the given resource with the specified identifier.static String
failureOnRestoring(String resource, Object id)
Computes a message about the failure to restore a given resource with the specified identifier.static String
failureOnSubscribing(String resource, String id)
Computes a message about the failure on the subscription of a user to a given resource.static String
failureOnUnindexing(String resource, Object id)
Computes a message about the failure to unindex the given resource with the specified identifier.static String
failureOnUnsubscribing(String resource, String id)
Computes a message about the failure on the subscription cancelling of a user to a given resource.static String
failureOnUpdate(String resource, Object id)
Computes a message about the failure to update a given resource with the specified identifier.static String
failureOnValidating(String resource, Object id)
Computes a message about the failure to validate the correctness of a given resource with the specified identifier.static String
undefined(String resource)
Computes a message about an asked undefined resource.static String
unknown(String resource, Object id)
Computes a message about an unknown resource with the specified identifier.
-
-
-
Method Detail
-
failureOnAdding
public static String failureOnAdding(String resource, Object id)
Computes a message about the failure to add a given resource with the specified identifier.This message is for when an exception has been caught during the adding of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnUpdate
public static String failureOnUpdate(String resource, Object id)
Computes a message about the failure to update a given resource with the specified identifier.This message is for when an exception has been caught during the update of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnRemoving
public static String failureOnRemoving(String resource, Object id)
Computes a message about the failure to remove a given resource with the specified identifier.This message is for when an exception has been caught during the remove of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnDeleting
public static String failureOnDeleting(String resource, Object id)
Computes a message about the failure to delete a given resource with the specified identifier.This message is for when an exception has been caught during the deletion of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnMoving
public static String failureOnMoving(String resource, Object id, String target, Object targetId)
Computes a message about the failure to move a given resource with the specified identifier to the specified target with the specified identifier.This message is for when an exception has been caught during the move of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)target
- a resource into which the resource is moved (a bin, a folder, a space, ...)targetId
- an identifier of the target (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnRestoring
public static String failureOnRestoring(String resource, Object id)
Computes a message about the failure to restore a given resource with the specified identifier.This message is for when an exception has been caught during the restoration of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnGetting
public static String failureOnGetting(String resource, Object id)
Computes a message about the failure to get a given resource with the specified identifier.This message is for when an exception has been caught during the getting of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnOpeningConnectionTo
public static String failureOnOpeningConnectionTo(String service)
Computes a message about the failure to open a connection against a given service.This message is for when an exception has been caught while opening a connection to the given service.
- Parameters:
service
- the service concerned by the connection.- Returns:
- an exception message.
-
failureOnClosingConnectionTo
public static String failureOnClosingConnectionTo(String service)
Computes a message about the failure to close a connection with a given service.This message is for when an exception has been caught while closing a connection with the given service.
- Parameters:
service
- the service concerned by the connection.- Returns:
- an exception message.
-
failureOnConnecting
public static String failureOnConnecting(String service)
Computes a message about the failure of a connection with a given service.This message is for when an exception has been caught while connecting or accessing an external service.
- Parameters:
service
- the service concerned by the connection.- Returns:
- an exception message.
-
failureOnValidating
public static String failureOnValidating(String resource, Object id)
Computes a message about the failure to validate the correctness of a given resource with the specified identifier.This message is for when an exception has been caught during the validation of the correctness of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnIndexing
public static String failureOnIndexing(String resource, Object id)
Computes a message about the failure to index the given resource with the specified identifier.This message is for when an exception has been caught during the indexation of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnUnindexing
public static String failureOnUnindexing(String resource, Object id)
Computes a message about the failure to unindex the given resource with the specified identifier.This message is for when an exception has been caught during the deletion on the index of a resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnRendering
public static String failureOnRendering(String resource, Object id)
Computes a message about the failure to render the given resource with the specified identifier.This message is for when an exception has been caught during the rendering of resource in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
failureOnOpeningFile
public static String failureOnOpeningFile(String resource)
Computes a message about the failure to open the given resource with the specified identifier.This message is for when an exception has been caught during the opening of file in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...- Returns:
- an exception message.
-
failureOnClosingFile
public static String failureOnClosingFile(String resource)
Computes a message about the failure to close the given resource with the specified identifier.This message is for when an exception has been caught during the closing of file in Silverpeas.
- Parameters:
resource
- the resource concerned by the failure; for example a user, a file, ...- Returns:
- an exception message.
-
failureOnSubscribing
public static String failureOnSubscribing(String resource, String id)
Computes a message about the failure on the subscription of a user to a given resource.- Parameters:
resource
- the resource concerned by the subscription attempt.id
- the unique identifier of the resource.- Returns:
- an exception message.
-
failureOnUnsubscribing
public static String failureOnUnsubscribing(String resource, String id)
Computes a message about the failure on the subscription cancelling of a user to a given resource.- Parameters:
resource
- the resource concerned by the unsubscription attempt.id
- the unique identifier of the resource.- Returns:
- an exception message.
-
unknown
public static String unknown(String resource, Object id)
Computes a message about an unknown resource with the specified identifier.Usually, this message is passed into an exception when the resource required to perform a treatment doesn't exist or isn't found in a peculiar context. It's not necessary resulted from an exception (in that case, we prefer
failureOnGetting
message).- Parameters:
resource
- the resource concerned by the issue; for example a user, a file, ...id
- an identifier of the resource (a name, a unique identifier, ...)- Returns:
- an exception message.
-
undefined
public static String undefined(String resource)
Computes a message about an asked undefined resource. A resource is undefined when its identifier is either empty or null.- Parameters:
resource
- the resource concerned by the issue; for example a user, a file, ...- Returns:
- an exception message.
-
-