org.dicom4j.network.association.support
Class AssociationImpl

java.lang.Object
  extended by org.apache.mina.common.IoFilterAdapter
      extended by org.dicom4j.network.association.support.AssociationImpl
All Implemented Interfaces:
org.apache.mina.common.IoFilter, Association

public class AssociationImpl
extends org.apache.mina.common.IoFilterAdapter
implements Association

Default Association implementation implements TransportConnectionListener to be notify of TransportConnectionListener events

Since:
0.0.0
Author:
Laurent Lecomte

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.mina.common.IoFilter
org.apache.mina.common.IoFilter.NextFilter, org.apache.mina.common.IoFilter.WriteRequest
 
Constructor Summary
AssociationImpl()
           
AssociationImpl(AssociationConfiguration aConfiguration)
           
 
Method Summary
 void closeTransportConnection(boolean aWaitARTIM)
           
 boolean containsAttribute(String key)
          Returns true if this Association contains the attribute with the specified key.
 void exceptionCaught(Throwable cause)
           
 AssociateRequest getAssociateRequest()
           
 AssociateResponseHandler getAssociateResponseListener()
           
 AssociateSession getAssociateSession()
           Return the AssociateSession of this association.
 AssociationListener getAssociationListener()
           
 AsynOperationsWindow getAsynOperationsWindow()
          the AsynOperationsWindow
 Object getAttachment()
          Returns an attachment of this Association.
 Object getAttribute(String key)
          Returns the value of user-defined attribute of this Association.
 Set<String> getAttributeKeys()
          Returns the set of keys of all user-defined attributes.
 AssociationConfiguration getConfiguration()
          get the AssociationConfiguration
 AssociationMonitor getMonitor()
           
 String getTransferSyntaxFromPresentationID(byte aPresentationID)
           
 boolean isEstablished()
          Determine if an association is established
 boolean isReleased()
          Indicates that the association is in release State and can be disposed
 void messageReceived(org.apache.mina.common.IoFilter.NextFilter nextFilter, org.apache.mina.common.IoSession session, Object message)
           
 void messageSent(org.apache.mina.common.IoFilter.NextFilter nextFilter, org.apache.mina.common.IoSession session, Object message)
           
 Object removeAttribute(String key)
          Removes a user-defined attribute with the specified key.
 void sendAbort(AssociateAbort aAbort)
          Send an AssociateAbort request to a remote peer
 void sendAssociate(AssociateRequest aRequest)
          Send an A-ASSOCIATE request to a remote peer
 void sendMessage(byte aPresentationContextID, AbstractDimseMessage aMessage)
          Send a DimseMessage to a remote peer
 void sendReject(AssociateReject aAssociateReject)
          send a A-ASSOCIATE REJECT
 void sendReject(byte aResult, byte aSource, byte aReason)
          send a A-ASSOCIATE REJECT
 void sendReleaseRequest()
          Send an A-RELEASE request to a remote peer
 void sendReleaseResponse()
          Send an A-RELEASE response to a remote peer
 void sessionClosed(org.apache.mina.common.IoFilter.NextFilter nextFilter, org.apache.mina.common.IoSession session)
           
 void sessionCreated(org.apache.mina.common.IoFilter.NextFilter nextFilter, org.apache.mina.common.IoSession session)
           
 void sessionOpened(org.apache.mina.common.IoFilter.NextFilter nextFilter, org.apache.mina.common.IoSession session)
           
 void setAssociateRequest(AssociateRequest aRequest)
           
 void setAssociateRequestListener(AssociateRequestHandler aListener)
           
 void setAssociateResponseListener(AssociateResponseHandler aHandler)
           
 void setAssociationListener(AssociationListener aHandler)
           
 Object setAttachment(Object attachment)
          Sets an attachment of this session.
 Object setAttribute(String key)
          Sets a user defined attribute without a value.
 Object setAttribute(String key, Object value)
          Sets a user-defined attribute.
 void setConfiguration(AssociationConfiguration aConfiguration)
          set the AssociationConfiguration
 void setMonitor(AssociationMonitor aAssociationMonitor)
           
 String toString()
           
 void waitAssociate()
          Wait an AssociateRequest from a remote peer
 
Methods inherited from class org.apache.mina.common.IoFilterAdapter
destroy, exceptionCaught, filterClose, filterWrite, init, onPostAdd, onPostRemove, onPreAdd, onPreRemove, sessionIdle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssociationImpl

public AssociationImpl()
                throws Exception
Throws:
Exception

AssociationImpl

public AssociationImpl(AssociationConfiguration aConfiguration)
                throws Exception
Throws:
Exception
Method Detail

closeTransportConnection

public void closeTransportConnection(boolean aWaitARTIM)
                              throws AssociationException
Specified by:
closeTransportConnection in interface Association
Throws:
AssociationException

containsAttribute

public boolean containsAttribute(String key)
Description copied from interface: Association
Returns true if this Association contains the attribute with the specified key.

Specified by:
containsAttribute in interface Association

exceptionCaught

public void exceptionCaught(Throwable cause)
                     throws Exception
Throws:
Exception

getAssociateRequest

public AssociateRequest getAssociateRequest()

getAssociateResponseListener

public AssociateResponseHandler getAssociateResponseListener()
Specified by:
getAssociateResponseListener in interface Association

getAssociateSession

public AssociateSession getAssociateSession()
Description copied from interface: Association

Return the AssociateSession of this association.


If isEstablished return false, getAssociateSession will return a null session

Specified by:
getAssociateSession in interface Association
Returns:
the AssociateSession

getAssociationListener

public AssociationListener getAssociationListener()
Specified by:
getAssociationListener in interface Association

getAsynOperationsWindow

public AsynOperationsWindow getAsynOperationsWindow()
Description copied from interface: Association
the AsynOperationsWindow

Specified by:
getAsynOperationsWindow in interface Association
Returns:
the AsynOperationsWindow

getAttachment

public Object getAttachment()
Description copied from interface: Association
Returns an attachment of this Association. This method is identical with getAttribute( "" ).

Specified by:
getAttachment in interface Association

getAttribute

public Object getAttribute(String key)
Description copied from interface: Association
Returns the value of user-defined attribute of this Association.

Specified by:
getAttribute in interface Association
Parameters:
key - the key of the attribute
Returns:
null if there is no attribute with the specified key

getAttributeKeys

public Set<String> getAttributeKeys()
Description copied from interface: Association
Returns the set of keys of all user-defined attributes.

Specified by:
getAttributeKeys in interface Association

getConfiguration

public AssociationConfiguration getConfiguration()
Description copied from interface: Association
get the AssociationConfiguration

Specified by:
getConfiguration in interface Association
Returns:
the configuration

getMonitor

public AssociationMonitor getMonitor()
Specified by:
getMonitor in interface Association
Returns:
the AssociationMonitor

getTransferSyntaxFromPresentationID

public String getTransferSyntaxFromPresentationID(byte aPresentationID)
Specified by:
getTransferSyntaxFromPresentationID in interface Association

isEstablished

public boolean isEstablished()
Determine if an association is established

Specified by:
isEstablished in interface Association
Returns:
True if open

isReleased

public boolean isReleased()
Description copied from interface: Association
Indicates that the association is in release State and can be disposed

Specified by:
isReleased in interface Association
Returns:
thue is released

messageReceived

public void messageReceived(org.apache.mina.common.IoFilter.NextFilter nextFilter,
                            org.apache.mina.common.IoSession session,
                            Object message)
Specified by:
messageReceived in interface org.apache.mina.common.IoFilter
Overrides:
messageReceived in class org.apache.mina.common.IoFilterAdapter

messageSent

public void messageSent(org.apache.mina.common.IoFilter.NextFilter nextFilter,
                        org.apache.mina.common.IoSession session,
                        Object message)
Specified by:
messageSent in interface org.apache.mina.common.IoFilter
Overrides:
messageSent in class org.apache.mina.common.IoFilterAdapter

removeAttribute

public Object removeAttribute(String key)
Description copied from interface: Association
Removes a user-defined attribute with the specified key.

Specified by:
removeAttribute in interface Association
Returns:
The old value of the attribute. null if not found.

sendAbort

public void sendAbort(AssociateAbort aAbort)
               throws Exception
Description copied from interface: Association
Send an AssociateAbort request to a remote peer

Specified by:
sendAbort in interface Association
Parameters:
aAbort - the Abort request
Throws:
Exception - if error occurs

sendAssociate

public void sendAssociate(AssociateRequest aRequest)
                   throws Exception
Description copied from interface: Association
Send an A-ASSOCIATE request to a remote peer

Specified by:
sendAssociate in interface Association
Parameters:
aRequest - the AssociateRequest
Throws:
Exception - if error occurs

sendMessage

public void sendMessage(byte aPresentationContextID,
                        AbstractDimseMessage aMessage)
                 throws Exception
Description copied from interface: Association
Send a DimseMessage to a remote peer

Specified by:
sendMessage in interface Association
Parameters:
aPresentationContextID - the Presentation Context ID to use
aMessage - the DimseMessage to send
Throws:
Exception - if error occurs

sendReject

public void sendReject(AssociateReject aAssociateReject)
                throws Exception
Description copied from interface: Association
send a A-ASSOCIATE REJECT

Specified by:
sendReject in interface Association
Throws:
Exception - if error occurs

sendReject

public void sendReject(byte aResult,
                       byte aSource,
                       byte aReason)
                throws Exception
Description copied from interface: Association
send a A-ASSOCIATE REJECT

Specified by:
sendReject in interface Association
Throws:
Exception - if error occurs

sendReleaseRequest

public void sendReleaseRequest()
                        throws Exception
Description copied from interface: Association
Send an A-RELEASE request to a remote peer

Specified by:
sendReleaseRequest in interface Association
Throws:
Exception - if error occurs

sendReleaseResponse

public void sendReleaseResponse()
                         throws Exception
Description copied from interface: Association
Send an A-RELEASE response to a remote peer

Specified by:
sendReleaseResponse in interface Association
Throws:
Exception

sessionClosed

public void sessionClosed(org.apache.mina.common.IoFilter.NextFilter nextFilter,
                          org.apache.mina.common.IoSession session)
Specified by:
sessionClosed in interface org.apache.mina.common.IoFilter
Overrides:
sessionClosed in class org.apache.mina.common.IoFilterAdapter

sessionCreated

public void sessionCreated(org.apache.mina.common.IoFilter.NextFilter nextFilter,
                           org.apache.mina.common.IoSession session)
Specified by:
sessionCreated in interface org.apache.mina.common.IoFilter
Overrides:
sessionCreated in class org.apache.mina.common.IoFilterAdapter

sessionOpened

public void sessionOpened(org.apache.mina.common.IoFilter.NextFilter nextFilter,
                          org.apache.mina.common.IoSession session)
Specified by:
sessionOpened in interface org.apache.mina.common.IoFilter
Overrides:
sessionOpened in class org.apache.mina.common.IoFilterAdapter

setAssociateRequest

public void setAssociateRequest(AssociateRequest aRequest)

setAssociateRequestListener

public void setAssociateRequestListener(AssociateRequestHandler aListener)
Specified by:
setAssociateRequestListener in interface Association

setAssociateResponseListener

public void setAssociateResponseListener(AssociateResponseHandler aHandler)
Specified by:
setAssociateResponseListener in interface Association
Parameters:
aHandler - the listener

setAssociationListener

public void setAssociationListener(AssociationListener aHandler)
Specified by:
setAssociationListener in interface Association
Parameters:
aHandler - the listener

setAttachment

public Object setAttachment(Object attachment)
Description copied from interface: Association
Sets an attachment of this session. This method is identical with setAttribute( "", attachment ).

Specified by:
setAttachment in interface Association
Returns:
Old attachment. null if it is new.

setAttribute

public Object setAttribute(String key)
Description copied from interface: Association
Sets a user defined attribute without a value. This is useful when you just want to put a 'mark' attribute. Its value is set to Boolean.TRUE.

Specified by:
setAttribute in interface Association
Parameters:
key - the key of the attribute
Returns:
The old value of the attribute. null if it is new.

setAttribute

public Object setAttribute(String key,
                           Object value)
Description copied from interface: Association
Sets a user-defined attribute.

Specified by:
setAttribute in interface Association
Parameters:
key - the key of the attribute
value - the value of the attribute
Returns:
The old value of the attribute. null if it is new.

setConfiguration

public void setConfiguration(AssociationConfiguration aConfiguration)
Description copied from interface: Association
set the AssociationConfiguration

Specified by:
setConfiguration in interface Association
Parameters:
aConfiguration - the configuration

setMonitor

public void setMonitor(AssociationMonitor aAssociationMonitor)
Specified by:
setMonitor in interface Association
Parameters:
aAssociationMonitor - the monitor

toString

public String toString()
Overrides:
toString in class Object

waitAssociate

public void waitAssociate()
                   throws Exception
Description copied from interface: Association
Wait an AssociateRequest from a remote peer

Specified by:
waitAssociate in interface Association
Throws:
Exception - if error occurs


Copyright © 2009 dicom4j. All Rights Reserved.