Class Condition

All Implemented Interfaces:
DeleteMarkerable, LocalizableOM, Serializable, Comparable<Condition>, ColumnAccessByName, ObjectModel, Persistent

public class Condition extends BaseCondition implements Comparable<Condition>, DeleteMarkerable, LocalizableOM

Transition 이 가능한지 아닌지를 판단하는 조건이다.

정의 : Transition 을 허용하기 위하여는 설정된 모든 Condition 들을 만족하여야 한다.

Condition Matching 의 경우 INCLUDE 와 EXCULE 가 EQUAL 보다 더 효율적이다. 수학적으로 Condition 은 Coverage 의 개념이 더 정확하다.

EQUAL 의 경우 System 의 복잡성으로 인하여 Symmetry 가 깨지기 쉽다.

어떤 Transition 에 2개의 Condition 이 설정되었을때

(case A : ( role EQUAL role_a ), ( role EQUAL role_b )

case B : ( role EQUAL role_a ), ( permission EQUAL permission_a )

case C : ( role INCLUDE role_a), ( role EQUAL role_b )

case A 의 경우 Transition 을 허용하기 위하여는 role_a 와 role_b 를 동시에 만족하여야 한다.

case B 의 경우 Transition 을 허용하기 위하여는 role_a 와 permission_a 를 동시에 만족하여야 한다.

case C 의 경우 Transition 을 허용하기 위하여는 role_a 또는 role_b 이어야 한다.

Condition 의 Override 는 ModuleItemType > ItemType > GlobalAttribute 의 순으로 적용된다.

어떤 Transition 에 다음과 같이 Condition 이 설정되었을때 ( permission EQUAL a ), ( itemType b, permission EQUAL c ), ( ModuleItemType d, permission EQUAL e ) Condition 의 속성중 RoleName 과 PermissionName 은 OR 이다. 즉 두가지가 같이 존재하면 Role 이나 Permission 두가지중 한가지만 허용되면 통과된다. 그러나 그이외의 나머지 속성은 모두 AND 이다.

Version:
$id: Condition.java $Revision$, 12-09-21 1:00:11 PM KST
Author:
YounghoCho
  • Constructor Details

    • Condition

      public Condition()
      새로운 Condition 인스턴스를 생성한다.
  • Method Details

    • save

      public void save() throws Exception
      Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed.
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseCondition
      Throws:
      Exception - 저장 중 오류가 발생한 경우
    • delete

      public boolean delete(EasyDeskUser user) throws Exception
      Checks if user has permission to delete module-item type mapping.
      Specified by:
      delete in interface DeleteMarkerable
      Parameters:
      user - who is acting
      Returns:
      true success false not success
      Throws:
      Exception - 삭제 중 오류가 발생한 경우
    • getTransitionScope

      public TransitionScopeEnum getTransitionScope()
      Condition 의 Module, ItemType, Attribute, DpendType 의 설정 조건으로 Transition 의 Scope 를 결정한다.
      Returns:
      TransitionScopeEnum
    • getModule

      public Module getModule() throws TorqueException
      조건의 적용 Module
      Returns:
      Module, 설정되어 있지 않으면 null
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getItemType

      public ItemType getItemType() throws TorqueException
      조건의 적용 아이템 유형
      Returns:
      ItemType, 설정되어 있지 않으면 null
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttribute

      public Attribute getAttribute() throws TorqueException
      조건의 대상 Attribute 를 구한다.
      Returns:
      attribute same as getAttributeRelatedByAttributeId()
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • setAttribute

      public void setAttribute(Attribute attribute) throws TorqueException
      조건의 대상 Attribute 를 설정한다. same as setAttributeRelatedByAttributeId()
      Parameters:
      attribute - 대상 Attribute
      Throws:
      TorqueException - 설정 중 오류가 발생한 경우
    • getRAttribute

      public Attribute getRAttribute() throws TorqueException
      조건의 적용 속성
      Returns:
      attribute same as getAttributeRelatedByRAttributeId()
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • setRAttribute

      public void setRAttribute(Attribute attribute) throws TorqueException
      조건의 적용 속성을 설정한다. same as setAttributeRelatedByRAttributeId()
      Parameters:
      attribute - 조건의 적용 속성(RAttribute)
      Throws:
      TorqueException - 설정 중 오류가 발생한 경우
    • isSatisfied

      public boolean isSatisfied(String value) throws TorqueException
      주어진 조건이 만족하는지 , 값만을 비교
      Parameters:
      value - test attributeValue
      Returns:
      true or false
      Throws:
      TorqueException
    • isAttributeCondition

      public boolean isAttributeCondition()
      attribute id 가 null 이면 action condition , null 이 아니면 attribute condition 이다.
      Returns:
      true/false about attributeId is null or not
    • compareTo

      public int compareTo(Condition obj)
      DOCUMENT ME!
      Specified by:
      compareTo in interface Comparable<Condition>
      Parameters:
      obj - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getLocalized

      public Localized[] getLocalized(Locale locale) throws TorqueException
      Description copied from interface: LocalizableOM
      locale 에 해당하는 localized 정보를 구한다.
      Specified by:
      getLocalized in interface LocalizableOM
      Parameters:
      locale -
      Returns:
      localized[]
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우