org.dicom4j.network.dimse.services
Class BaseDimseService

java.lang.Object
  extended by org.dicom4j.network.association.listeners.defaults.DefaultAssociationListener
      extended by org.dicom4j.network.dimse.services.BaseDimseService
All Implemented Interfaces:
AssociationListener, DimseService
Direct Known Subclasses:
ThreadedDimseService

public abstract class BaseDimseService
extends DefaultAssociationListener
implements DimseService

Base implementation of DimseService interface

Since:
Alpha 0.0.0
Author:
Laurent Lecomte

Constructor Summary
BaseDimseService()
           
 
Method Summary
 void associationAborted(Association aAssociation, AssociateAbort aAbort)
          Invoked when the association is aborted
 void bind(int aMessageID, Association aAssociation)
          Bind a service
 void exceptionCaught(Association aAssociation, Throwable cause)
          Invoked when an exception occurs
 DimseServiceConfiguration getConfiguration()
          get the DimseServiceConfiguration
 DimseMessageFactory getFactory()
           
 int getMessageID()
          Return the Message ID
 String getName()
          Return the name of the Service
abstract  void handleMessage(byte aPresentationContextID, AbstractDimseMessage aMessage)
          handle a DimseMessage
 boolean isBinded()
          Return true is the service is binded to a MessageID
 boolean isBinded(Association aAssociation)
           
 boolean isFinished()
          Return true if the service has finish his work, and can be unBind (should not receive messages)
 void setConfiguration(DimseServiceConfiguration aConfiguration)
          set the DimseServiceConfiguration
 void setFactory(DimseMessageFactory aFactory)
           
 void unBind()
          Unbind the service, called when the service said isFinished
 
Methods inherited from class org.dicom4j.network.association.listeners.defaults.DefaultAssociationListener
associateRelease, associationCreated, associationOpened, associationRejected, associationReleased, messageReceived, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseDimseService

public BaseDimseService()
Method Detail

associationAborted

public void associationAborted(Association aAssociation,
                               AssociateAbort aAbort)
                        throws Exception
Description copied from interface: AssociationListener
Invoked when the association is aborted

Specified by:
associationAborted in interface AssociationListener
Specified by:
associationAborted in interface DimseService
Overrides:
associationAborted in class DefaultAssociationListener
Parameters:
aAssociation - the association
Throws:
Exception

bind

public void bind(int aMessageID,
                 Association aAssociation)
Description copied from interface: DimseService
Bind a service

Specified by:
bind in interface DimseService
Parameters:
aMessageID - the message ID
aAssociation - the Association

exceptionCaught

public void exceptionCaught(Association aAssociation,
                            Throwable cause)
Description copied from interface: AssociationListener
Invoked when an exception occurs

Specified by:
exceptionCaught in interface AssociationListener
Overrides:
exceptionCaught in class DefaultAssociationListener
Parameters:
aAssociation - the association
cause - the cause of the error

getConfiguration

public DimseServiceConfiguration getConfiguration()
get the DimseServiceConfiguration

Specified by:
getConfiguration in interface DimseService
Returns:
the Configuration

getMessageID

public int getMessageID()
Return the Message ID

Specified by:
getMessageID in interface DimseService
Returns:

getName

public String getName()
Description copied from interface: DimseService
Return the name of the Service

Specified by:
getName in interface DimseService
Returns:
the name

handleMessage

public abstract void handleMessage(byte aPresentationContextID,
                                   AbstractDimseMessage aMessage)
                            throws Exception
handle a DimseMessage

Specified by:
handleMessage in interface DimseService
Parameters:
aPresentationContextID -
aMessage -
Throws:
Exception

isBinded

public boolean isBinded()
Return true is the service is binded to a MessageID

Specified by:
isBinded in interface DimseService
Returns:
true if bind

isBinded

public boolean isBinded(Association aAssociation)
Specified by:
isBinded in interface DimseService

isFinished

public boolean isFinished()
Return true if the service has finish his work, and can be unBind (should not receive messages)

Specified by:
isFinished in interface DimseService
Returns:
true if finished

setConfiguration

public void setConfiguration(DimseServiceConfiguration aConfiguration)
set the DimseServiceConfiguration

Specified by:
setConfiguration in interface DimseService
Parameters:
aConfiguration - the Configuration

unBind

public void unBind()
Description copied from interface: DimseService
Unbind the service, called when the service said isFinished

Specified by:
unBind in interface DimseService

getFactory

public DimseMessageFactory getFactory()

setFactory

public void setFactory(DimseMessageFactory aFactory)


Copyright © 2009 dicom4j. All Rights Reserved.