com.ibm.commerce.foundation.rest.resourcehandler

Class OperationRegistry

  • java.lang.Object
    • com.ibm.commerce.foundation.rest.resourcehandler.OperationRegistry


  • public class OperationRegistry
    extends java.lang.Object
    An operation registry registers multiple operation by name so that they may be invoked later on.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      copyright
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear()
      Clear the registry.
      java.lang.Object executeOperation(java.lang.Object handler, java.lang.String operationName, java.lang.Object... parameters)
      Execute an operation.
      Value[] getValues()
      Get the list of valid operation name values.
      void registerOperation(Operation operation)
      Register an operation.
      void registerOperation(java.lang.String name, java.lang.String description, java.lang.reflect.Method method)
      Register an operation.
      java.lang.String toString()
      Returns the string representation of this registery object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • OperationRegistry

        public OperationRegistry()
    • Method Detail

      • clear

        public void clear()
        Clear the registry.
      • registerOperation

        public void registerOperation(java.lang.String name,
                                      java.lang.String description,
                                      java.lang.reflect.Method method)
        Register an operation.
        Parameters:
        name - The operation name.
        description - The description
        method - The method to invoke.
      • registerOperation

        public void registerOperation(Operation operation)
        Register an operation.
        Parameters:
        operation - The operation model.
      • executeOperation

        public java.lang.Object executeOperation(java.lang.Object handler,
                                                 java.lang.String operationName,
                                                 java.lang.Object... parameters)
                                          throws java.lang.Exception
        Execute an operation.
        Parameters:
        handler - The handler on which to call the operation.
        operationName - The operation name.
        parameters - The parameters to send to the operation.
        Returns:
        The operation result.
        Throws:
        java.lang.Exception - if anything goes wrong.
      • getValues

        public Value[] getValues()
        Get the list of valid operation name values.
        Returns:
        the list of valid operation name values.
      • toString

        public java.lang.String toString()
        Returns the string representation of this registery object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The operation registry information.