eu.xtreemos.xosd.localallocmgr.attributes.operations
Class OperationTranslator

java.lang.Object
  extended by eu.xtreemos.xosd.localallocmgr.attributes.operations.OperationTranslator

public class OperationTranslator
extends java.lang.Object

translates the commands to the handlers methods

Author:
urosjovanovic

Field Summary
static AttrHandlerStorage attrHandlers
           
 
Constructor Summary
OperationTranslator()
           
 
Method Summary
static void cloneAttributes(AttributeStorage elm1, AttributeStorage elm2, ExcludeAttributes exclAttr)
          clone attributes from elm1 to elm2, if an attribute exists, it is overwritten!
static boolean translate(OperationTypes operation, AttributeStorage elm1attr, AttributeStorage elm2attr, ExcludeAttributes exclAttr)
          TODO: check if this is needed at all!
static boolean translate(OperationTypes operation, IAttribute<?> elm1attr, AttributeStorage elm2attrs, java.lang.Class<?> attr2type)
          performs an operation on an attribute type where the type differs from the type of the argument
static boolean translate(OperationTypes operation, IAttributeHandler handler, IAttribute<?> op1, IAttribute<?> op2)
          Returns false if the handler for the attribute does not exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attrHandlers

public static AttrHandlerStorage attrHandlers
Constructor Detail

OperationTranslator

public OperationTranslator()
Method Detail

translate

public static boolean translate(OperationTypes operation,
                                IAttributeHandler handler,
                                IAttribute<?> op1,
                                IAttribute<?> op2)
Returns false if the handler for the attribute does not exists. TODO: check if this is ok in all scenarios?

Parameters:
operation -
op1 -
op2 -
Returns:
true if the operation on the attributes succeed, otherwise false

translate

public static boolean translate(OperationTypes operation,
                                IAttribute<?> elm1attr,
                                AttributeStorage elm2attrs,
                                java.lang.Class<?> attr2type)
performs an operation on an attribute type where the type differs from the type of the argument

Parameters:
operation -
attrType -
elm2 -
Returns:

translate

public static boolean translate(OperationTypes operation,
                                AttributeStorage elm1attr,
                                AttributeStorage elm2attr,
                                ExcludeAttributes exclAttr)
TODO: check if this is needed at all!

Parameters:
operation -
elm1attr -
elm2attr -
Returns:

cloneAttributes

public static void cloneAttributes(AttributeStorage elm1,
                                   AttributeStorage elm2,
                                   ExcludeAttributes exclAttr)
clone attributes from elm1 to elm2, if an attribute exists, it is overwritten!

Parameters:
elm1 -
elm2 -
exclAttr -