net.handle.hdllib
Class AbstractRequest

java.lang.Object
  extended by net.handle.hdllib.AbstractMessage
      extended by net.handle.hdllib.AbstractRequest
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AddValueRequest, ChallengeAnswerRequest, CreateHandleRequest, DeleteHandleRequest, DumpHandlesRequest, GenericRequest, HomeNaRequest, ListHandlesRequest, ListNAsRequest, ModifyValueRequest, RemoveValueRequest, ResolutionRequest, RetrieveTxnRequest, SessionExchangeKeyRequest, SessionSetupRequest, UnhomeNaRequest, VerifyAuthRequest

public abstract class AbstractRequest
extends AbstractMessage

Base class for all request types. Holds the Handle to which the request applies as well as the HS_NAMESPACE information that was acquired during the resolution process


Field Summary
 AuthenticationInfo authInfo
           
 java.util.concurrent.atomic.AtomicBoolean completed
           
 java.util.concurrent.locks.ReentrantLock connectionLock
           
 byte[] handle
           
 boolean isAdminRequest
           
 boolean multithread
           
 boolean requiresConnection
           
 ClientSideSessionInfo sessionInfo
           
 ClientSessionTracker sessionTracker
           
 int siteInfoSerial
           
 java.util.concurrent.atomic.AtomicReference<java.net.Socket> socketRef
           
 boolean streaming
           
 
Fields inherited from class net.handle.hdllib.AbstractMessage
authoritative, cacheCertify, certify, continuous, doNotRefer, encodedMessage, encrypt, expiration, ignoreRestrictedValues, keepAlive, majorProtocolVersion, messageBody, minorProtocolVersion, mintNewSuffix, OC_ADD_VALUE, OC_BACKUP_SERVER, OC_CREATE_HANDLE, OC_DELETE_HANDLE, OC_DUMP_HANDLES, OC_GET_NEXT_TXN_ID, OC_GET_SITE_INFO, OC_HOME_NA, OC_LIST_HANDLES, OC_LIST_HOMED_NAS, OC_MODIFY_VALUE, OC_REMOVE_VALUE, OC_RESERVED, OC_RESOLUTION, OC_RESPONSE_TO_CHALLENGE, OC_RETRIEVE_TXN_LOG, OC_SESSION_EXCHANGEKEY, OC_SESSION_SETUP, OC_SESSION_TERMINATE, OC_UNHOME_NA, OC_VERIFY_CHALLENGE, opCode, overwriteWhenExists, RC_AUTHEN_ERROR, RC_AUTHEN_TIMEOUT, RC_AUTHENTICATION_FAILED, RC_AUTHENTICATION_NEEDED, RC_ERROR, RC_HANDLE_ALREADY_EXISTS, RC_HANDLE_NOT_FOUND, RC_INSUFFICIENT_PERMISSIONS, RC_INVALID_ADMIN, RC_INVALID_CREDENTIAL, RC_INVALID_HANDLE, RC_INVALID_SESSION_KEY, RC_INVALID_SESSIONSETUP_REQUEST, RC_INVALID_VALUE, RC_NEED_RSAKEY_FOR_SESSIONEXCHANGE, RC_OPERATION_NOT_SUPPORTED, RC_OUT_OF_DATE_SITE_INFO, RC_PREFIX_REFERRAL, RC_PROTOCOL_ERROR, RC_RECURSION_COUNT_TOO_HIGH, RC_RESERVED, RC_SERVER_BACKUP, RC_SERVER_NOT_RESP, RC_SERVER_TOO_BUSY, RC_SERVICE_REFERRAL, RC_SESSION_FAILED, RC_SESSION_MESSAGE_REJECTED, RC_SESSION_TIMEOUT, RC_SUCCESS, RC_VALUE_ALREADY_EXISTS, RC_VALUES_NOT_FOUND, rdHashType, recursionCount, recursive, requestDigest, requestId, responseCode, returnRequestDigest, sessionCounter, sessionId, signature, signerHdl, signerHdlIdx, suggestMajorProtocolVersion, suggestMinorProtocolVersion
 
Constructor Summary
AbstractRequest(byte[] handle, int opCode, AuthenticationInfo authInfo)
           
 
Method Summary
 void clearBuffers()
          Override the clearing of buffers to also clear the namespace information
 AbstractRequest clone()
           
 net.handle.hdllib.NamespaceInfo getNamespace()
          Returns the information for the most specific namespace that was encountered when performing this resolution.
 void setNamespace(net.handle.hdllib.NamespaceInfo namespace)
          Set the most specific namespace containing the identifier being resolved.
 void setNamespaceExactly(net.handle.hdllib.NamespaceInfo namespace)
          Set the most exact namespace containing the identifier being resolved.
 void signMessageForSession()
           
 java.lang.String toString()
           
 
Methods inherited from class net.handle.hdllib.AbstractMessage
getEncodedMessage, getEncodedMessageBody, getResponseCodeMessage, hasEqualOrGreaterVersion, hasEqualOrGreaterVersion, setSupportedProtocolVersion, setSupportedProtocolVersion, setSupportedProtocolVersion, shouldEncrypt, signatureIsMac, signMessage, signMessage, takeValuesFrom, verifyMessage, verifyMessage
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

handle

public byte[] handle

isAdminRequest

public boolean isAdminRequest

requiresConnection

public boolean requiresConnection

multithread

public boolean multithread

connectionLock

public java.util.concurrent.locks.ReentrantLock connectionLock

completed

public java.util.concurrent.atomic.AtomicBoolean completed

socketRef

public java.util.concurrent.atomic.AtomicReference<java.net.Socket> socketRef

authInfo

public AuthenticationInfo authInfo

siteInfoSerial

public int siteInfoSerial

sessionInfo

public ClientSideSessionInfo sessionInfo

sessionTracker

public ClientSessionTracker sessionTracker

streaming

public boolean streaming
Constructor Detail

AbstractRequest

public AbstractRequest(byte[] handle,
                       int opCode,
                       AuthenticationInfo authInfo)
Method Detail

clone

public AbstractRequest clone()
Overrides:
clone in class AbstractMessage

getNamespace

public net.handle.hdllib.NamespaceInfo getNamespace()
Returns the information for the most specific namespace that was encountered when performing this resolution. Higher level namespaces can be accessed using the getParentNamespace() method of NamespaceInfo.


setNamespace

public void setNamespace(net.handle.hdllib.NamespaceInfo namespace)
Set the most specific namespace containing the identifier being resolved. This will set the parent of the given namespace to the current namespace.


setNamespaceExactly

public void setNamespaceExactly(net.handle.hdllib.NamespaceInfo namespace)
Set the most exact namespace containing the identifier being resolved. The current namespace is discarded and the entire hierarchy of the given namespace is retained.


clearBuffers

public void clearBuffers()
Override the clearing of buffers to also clear the namespace information

Overrides:
clearBuffers in class AbstractMessage

toString

public java.lang.String toString()
Overrides:
toString in class AbstractMessage

signMessageForSession

public void signMessageForSession()
                           throws HandleException
Throws:
HandleException