Class Checksum_PCM_10
- java.lang.Object
-
- org.palladiosimulator.analyzer.quality.util.Checksum_PCM_10
-
- All Implemented Interfaces:
SpecificationChecksumCalculator
public class Checksum_PCM_10 extends Object implements SpecificationChecksumCalculator
Checksum calculation algorithm for PCM.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHECKSUM_PCM_10_IDENTIFIER
Identifier for version 1.0 of the PCM checksum calculation algorithm.static Logger
LOGGER
Logger for this class.protected static String
SEPARATOR
Separator character for the same hierarchy level.protected static String
SEPARATOR_HIERARCHY_END
Separator character for closing a hierarchy level.protected static String
SEPARATOR_HIERARCHY_START
Separator character for the opening a new hierarchy level.
-
Constructor Summary
Constructors Constructor Description Checksum_PCM_10()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
calculate(ServiceSpecification specification)
Calculates the checksum for the provided specification.String
identify()
void
update(ServiceSpecification specification)
Updates the checksum of the provided specification.static void
updateChecksum(Checksum checksum, String string)
Updates checksum with the given string.protected void
updateChecksumWithSignature(Checksum checksum, org.palladiosimulator.pcm.repository.Signature signature)
Updates the checksum with details about the signatures.protected void
updateChecksumWithSignature(Checksum checksum, org.palladiosimulator.pcm.resourcetype.ResourceSignature signature)
Updates the checksum with details about the signatures.
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
Logger for this class.
-
CHECKSUM_PCM_10_IDENTIFIER
public static final String CHECKSUM_PCM_10_IDENTIFIER
Identifier for version 1.0 of the PCM checksum calculation algorithm.- See Also:
- Constant Field Values
-
SEPARATOR
protected static final String SEPARATOR
Separator character for the same hierarchy level. Improves readability for humans. Technically not necessary.- See Also:
- Constant Field Values
-
SEPARATOR_HIERARCHY_START
protected static final String SEPARATOR_HIERARCHY_START
Separator character for the opening a new hierarchy level. Improves readability for humans. Technically not necessary.- See Also:
- Constant Field Values
-
SEPARATOR_HIERARCHY_END
protected static final String SEPARATOR_HIERARCHY_END
Separator character for closing a hierarchy level. Improves readability for humans. Technically not necessary.- See Also:
- Constant Field Values
-
-
Method Detail
-
update
public void update(ServiceSpecification specification)
Description copied from interface:SpecificationChecksumCalculator
Updates the checksum of the provided specification. Throws a runtime exception if the calculation fails, e.g. the specification language is not supported.- Specified by:
update
in interfaceSpecificationChecksumCalculator
- Parameters:
specification
- The performance specification.
-
calculate
public long calculate(ServiceSpecification specification)
Description copied from interface:SpecificationChecksumCalculator
Calculates the checksum for the provided specification. Throws a runtime exception if the calculation fails, e.g. the specification language is not supported.- Specified by:
calculate
in interfaceSpecificationChecksumCalculator
- Parameters:
specification
- The performance specification.
-
updateChecksumWithSignature
protected void updateChecksumWithSignature(Checksum checksum, org.palladiosimulator.pcm.repository.Signature signature)
Updates the checksum with details about the signatures.- Parameters:
checksum
- The checksum.signature
- The signature.
-
updateChecksumWithSignature
protected void updateChecksumWithSignature(Checksum checksum, org.palladiosimulator.pcm.resourcetype.ResourceSignature signature)
Updates the checksum with details about the signatures.- Parameters:
checksum
- The checksum.signature
- The signature.
-
identify
public String identify()
- Specified by:
identify
in interfaceSpecificationChecksumCalculator
- Returns:
- The unique identifier for this algorithm.
-
-