jdcm
Class A_Associate

java.lang.Object
  extended by jdcm.A_Associate

public final class A_Associate
extends java.lang.Object

The A_Associate class represents a connection established between two DICOM application entities. It can be instantiated such that a specified A_Associate will serve the Service Class User (SCU) role and/or the Service Class Provider (SCP) role. The connection (known as an association) supports the exchange of network messages related to specifically negotiated DICOM services.

See Also:
A_Abort, A_Release

Field Summary
static int ASSOCIATION_REJECTED
           
static int REJECTED_PERMANENT
           
static int REJECTED_TRANSIENT
           
static java.lang.String ROLE_BOTH
           
static java.lang.String ROLE_SCP
           
static java.lang.String ROLE_SCU
           
 
Constructor Summary
A_Associate(java.net.Socket socket, A_Associate associate)
          Construct a association for proxy association.
A_Associate(java.net.Socket socket, java.lang.String callingEntity, java.lang.String calledEntity, java.util.HashMap<java.lang.String,java.lang.String[]> vPresContext)
          Construct association for request with presentation contexts and role selection in HashMap.
A_Associate(java.net.Socket socket, java.lang.String callingEntity, java.lang.String calledEntity, java.util.HashMap<java.lang.String,java.lang.String[]> vPresContext, java.util.HashMap<java.lang.String,java.lang.String> vRoleSelection)
          Construct association for request with presentation contexts and role selection in HashMap.
A_Associate(java.net.Socket socket, java.lang.String callingEntity, java.lang.String calledEntity, java.lang.String abstractSyntaxUID, java.lang.String transferSyntaxUID)
          Construct a association for request with abstractSyntaxUID and transferSyntax.
 
Method Summary
 void close()
          Close stream
 java.util.HashMap<java.lang.String,java.lang.String> getAcceptedPresContext()
           
 java.util.HashMap<java.lang.String,java.lang.String> getAcceptedRoleSelection()
           
 java.lang.String getCalledEntity()
          Retrieve the called application entity title of this request
 java.lang.String getCalledImplementationClassUID()
          Retrieve the Implementation Class UID of the called application.
 java.lang.String getCalledImplementationVersion()
          Retrieve the Implementation Version of the called application.
 java.lang.String getCalledMaximunLength()
          Retrieve the largest PDU size the local system is willing to receive
 java.lang.String getCallingEntity()
          Retrieve the called application entity title of this request
 java.lang.String getCallingImplementationClassUID()
          Retrieve the Implementation Class UID of the called application.
 java.lang.String getCallingImplementationVersion()
          Retrieve the Implementation Version of the called application.
 java.lang.String getCallingMaximunLength()
          Retrieve the largest PDU size the local system is willing to receive
 int getPresentationContextID(java.lang.String SOPClassUID)
          Retrieve the first presentation context ID associate with this SOP Class or Meta Class
 int readRPS()
          Read reponse association
 void readRQ()
          Read incoming association
 void reject(int result, int reason)
          Reject an association request sent by a remote association requester application.
 void setCalledEntity(java.lang.String calledEntity)
          Sets the called application entity title of this request.
 void setCallingEntity(java.lang.String callingEntity)
          Sets the calling application entity title of this request.
 java.lang.String toString()
           
 void writeRPS()
          Write reponse association
 void writeRQ()
          Write request association
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASSOCIATION_REJECTED

public static int ASSOCIATION_REJECTED

REJECTED_PERMANENT

public static int REJECTED_PERMANENT

REJECTED_TRANSIENT

public static int REJECTED_TRANSIENT

ROLE_SCU

public static java.lang.String ROLE_SCU

ROLE_SCP

public static java.lang.String ROLE_SCP

ROLE_BOTH

public static java.lang.String ROLE_BOTH
Constructor Detail

A_Associate

public A_Associate(java.net.Socket socket,
                   java.lang.String callingEntity,
                   java.lang.String calledEntity,
                   java.util.HashMap<java.lang.String,java.lang.String[]> vPresContext,
                   java.util.HashMap<java.lang.String,java.lang.String> vRoleSelection)
            throws java.io.IOException
Construct association for request with presentation contexts and role selection in HashMap.

Parameters:
socket - the socket connection
callingEntity - my calling AE Title
calledEntity - called AE title of peer
vPresContext - presentation context
vRoleSelection - role selection
Throws:
java.io.IOException - If an I/O error occurs

A_Associate

public A_Associate(java.net.Socket socket,
                   java.lang.String callingEntity,
                   java.lang.String calledEntity,
                   java.util.HashMap<java.lang.String,java.lang.String[]> vPresContext)
            throws java.io.IOException
Construct association for request with presentation contexts and role selection in HashMap.

Parameters:
socket - the socket connection
callingEntity - my calling AE Title
calledEntity - called AE title of peer
vPresContext - presentation context
Throws:
java.io.IOException - If an I/O error occurs

A_Associate

public A_Associate(java.net.Socket socket,
                   java.lang.String callingEntity,
                   java.lang.String calledEntity,
                   java.lang.String abstractSyntaxUID,
                   java.lang.String transferSyntaxUID)
            throws java.io.IOException
Construct a association for request with abstractSyntaxUID and transferSyntax.

Parameters:
socket - the socket connection
callingEntity - my calling AE Title
calledEntity - called AE title of peer
abstractSyntaxUID -
transferSyntaxUID -
Throws:
java.io.IOException - If an I/O error occurs

A_Associate

public A_Associate(java.net.Socket socket,
                   A_Associate associate)
            throws java.io.IOException
Construct a association for proxy association.

Parameters:
socket - the socket connection
associate -
Throws:
java.io.IOException - If an I/O error occurs
Method Detail

setCallingEntity

public void setCallingEntity(java.lang.String callingEntity)
Sets the calling application entity title of this request.


getCallingEntity

public java.lang.String getCallingEntity()
Retrieve the called application entity title of this request


getCallingImplementationClassUID

public java.lang.String getCallingImplementationClassUID()
Retrieve the Implementation Class UID of the called application.

Returns:
Implementation Class UID

getCallingImplementationVersion

public java.lang.String getCallingImplementationVersion()
Retrieve the Implementation Version of the called application.

Returns:
Implementation Version Name

getCallingMaximunLength

public java.lang.String getCallingMaximunLength()
Retrieve the largest PDU size the local system is willing to receive

Returns:
Maximun PDU receive

setCalledEntity

public void setCalledEntity(java.lang.String calledEntity)
Sets the called application entity title of this request.


getCalledEntity

public java.lang.String getCalledEntity()
Retrieve the called application entity title of this request


getCalledImplementationClassUID

public java.lang.String getCalledImplementationClassUID()
Retrieve the Implementation Class UID of the called application.

Returns:
Implementation Class UID

getCalledImplementationVersion

public java.lang.String getCalledImplementationVersion()
Retrieve the Implementation Version of the called application.

Returns:
Implementation Version Name

getCalledMaximunLength

public java.lang.String getCalledMaximunLength()
Retrieve the largest PDU size the local system is willing to receive

Returns:
Maximun PDU receive

getAcceptedPresContext

public java.util.HashMap<java.lang.String,java.lang.String> getAcceptedPresContext()

getAcceptedRoleSelection

public java.util.HashMap<java.lang.String,java.lang.String> getAcceptedRoleSelection()

getPresentationContextID

public int getPresentationContextID(java.lang.String SOPClassUID)
Retrieve the first presentation context ID associate with this SOP Class or Meta Class

Parameters:
SOPClassUID - SOP Class UID or Meta SOP Class
Returns:
presentation ContextID number if the UID argument exists in the association -1 otherwise

writeRQ

public void writeRQ()
             throws java.io.IOException
Write request association

Throws:
java.io.IOException - If an I/O error occurs

readRPS

public int readRPS()
            throws java.io.IOException
Read reponse association

Returns:
ASSOCIATION_REJECTED if the association is not accepted
Throws:
java.io.IOException - If an I/O error occurs

readRQ

public void readRQ()
            throws java.io.IOException
Read incoming association

Throws:
java.io.IOException - If an I/O error occurs

writeRPS

public void writeRPS()
              throws java.io.IOException
Write reponse association

Throws:
java.io.IOException - If an I/O error occurs

reject

public void reject(int result,
                   int reason)
Reject an association request sent by a remote association requester application.

Parameters:
result -

One of the following values shall be used:

  • 1 - REJECTED_PERMANENT
  • 2 - REJECTED_TRANSIENT
reason -

Reason specifies why the association is being rejected. it shall take one of the following:

  • 1 - NO_REASON_GIVEN
  • 2 - APPLICATION_CONTEXT_NOT_SUPPORTED
  • 3 - CALLING_AET_NOT_RECOGNIZED
  • 7 - CALLED_AET_NOT_RECOGNIZED

close

public void close()
           throws java.io.IOException
Close stream

Throws:
java.io.IOException - If an I/O error occurs

toString

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