Class SortResponseControl

Class SortResponseControl

public final class SortResponseControl
extends BasicControl

요청된 검색 결과 정렬이 성공했는지 여부를 나타내요. 결과 코드가 성공을 나타내면 결과가 요청대로 정렬된 것이에요. 그렇지 않으면 정렬이 실패했으며 서버가 오류 원인에 대한 추가 세부 정보를 제공했을 수 있어요. SortControl의 코드 샘플은 이 클래스의 사용법을 보여줘요. 이 클래스는 RFC 2891에 정의된 서버 측 정렬에 대한 LDAPv3 Response Control을 구현해요. 컨트롤 값은 다음과 같은 ASN.1 정의를 가져요.

SortResult ::= SEQUENCE {
    sortResult ENUMERATED {
        success (0),              -- results are sorted
        operationsError (1),      -- server internal failure
        timeLimitExceeded (3),    -- timelimit reached before
                                  -- sorting was completed
        strongAuthRequired (8),   -- refused to return sorted
                                  -- results via insecure protocol
        adminLimitExceeded (11),  -- too many matching entries
                                  -- for the server to sort
        noSuchAttribute (16),     -- unrecognized attribute type
                                  -- in sort key
        inappropriateMatching (18), -- unrecognized or inappropriate
                                  -- matching rule in sort key
        insufficientAccessRights (50), -- refused to return sorted
                                  -- results to this client
        busy (51),                -- too busy to process
        unwillingToPerform (53),  -- unable to sort
        other (80)
    },
    attributeType [0] AttributeType OPTIONAL }

OID

public static final String OID

서버 측 정렬 응답 컨트롤의 할당된 객체 식별자는 1.2.840.113556.1.4.474예요.

  • See Also: 상수 필드 값(Constant Field Values)

SortResponseControl

public SortResponseControl(String id,
 boolean criticality,
 byte[] value)
                    throws IOException

정렬 요청의 결과를 나타내는 컨트롤을 생성해요.

  • Parameters: id - 컨트롤의 객체 식별자 문자열
  • Throws: IOException - 컨트롤 값을 디코딩하는 동안 오류가 발생했을 때

isSorted

public boolean isSorted()

검색 결과가 성공적으로 정렬되었는지 결정해요. 정렬 중 오류가 발생하면 NamingException이 던져져요.

  • Returns: 검색 결과가 정렬되었으면 true

getResultCode

public int getResultCode()

정렬 연산의 LDAP 결과 코드를 가져와요.

  • Returns: 결과 코드. 0 값은 성공을 나타내요

getAttributeID

public String getAttributeID()

정렬 실패를 초래한 속성의 ID를 가져와요. 서버가 ID를 반환하지 않았으면 null을 반환해요.

  • Returns: 잘못된 속성의, null일 수 있는 ID

getException

public NamingException getException()

결과 코드에 적합한 NamingException을 가져와요.

  • Returns: NamingException 또는 결과 코드가 성공을 나타내면 null