Trispark JDT
2.50.13

com.archimed.dicom.network
Class ResponsePolicy

java.lang.Object
  extended by com.archimed.dicom.network.ResponsePolicy

public class ResponsePolicy
extends java.lang.Object

This is a convenience class used for creating an Acknowledge object given a Request object and a number of constraints, and for retrieving the result in an Acknowledge object given an abstract syntax and a Request object

Since:
1.00

Nested Class Summary
static class ResponsePolicy.SupportedContext
          This class represents an abstract syntax (aka SOP Class) in combination with a number of transfer syntaxes for which the abstract syntax is supported.
 
Constructor Summary
ResponsePolicy()
           
 
Method Summary
static int getResultForAbstractSyntax(Request request, Acknowledge ack, int asid)
          returns the result in an Acknowledge for a proposed abstract syntax in a Request.
static Response prepareResponse(Request request, java.lang.String calledtitle, java.lang.String[] callingtitles, int[] asids, int[] tsids, boolean rejectnocontext)
          Deprecated. This method is maintained for backwards compatibility. New implementations should use {#prepareResponse(Request,String,String[],SupportedContext[],boolean)}.
static Response prepareResponse(Request request, java.lang.String calledtitle, java.lang.String[] callingtitles, int[] asids, int tsid, boolean rejectnocontext)
          Deprecated. This method is maintained for backwards compatibility. New implementations should use {#prepareResponse(Request,String,String[],SupportedContext[],boolean)}.
static Response prepareResponse(Request request, java.lang.String calledtitle, java.lang.String[] callingtitles, ResponsePolicy.SupportedContext[] contexts, boolean rejectnocontext)
          creates a Response Object that accepts the specified supported contexts and refuses all others.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponsePolicy

public ResponsePolicy()
Method Detail

prepareResponse

public static Response prepareResponse(Request request,
                                       java.lang.String calledtitle,
                                       java.lang.String[] callingtitles,
                                       int[] asids,
                                       int tsid,
                                       boolean rejectnocontext)
                                throws IllegalValueException
Deprecated. This method is maintained for backwards compatibility. New implementations should use {#prepareResponse(Request,String,String[],SupportedContext[],boolean)}.

creates a Response Object that accepts the specified abstract syntaxes with the specified transfer syntax and refuses all others. Acceptable called title and calling titles can also be specified.

Parameters:
request - the Request for which to create an Response
calledtitle - the allowed called title in the request or null if no check on called title is necessary
callingtitles - the allowed calling titles in the request or null if no check on calling title is necessary
asids - the allowed abstract syntaxes
tsid - the allowed transfer syntax.
rejectnocontext - whether or not to return a reject when no proposed presentation context in the request can be accepted
Throws:
IllegalValueException

prepareResponse

public static Response prepareResponse(Request request,
                                       java.lang.String calledtitle,
                                       java.lang.String[] callingtitles,
                                       int[] asids,
                                       int[] tsids,
                                       boolean rejectnocontext)
                                throws IllegalValueException
Deprecated. This method is maintained for backwards compatibility. New implementations should use {#prepareResponse(Request,String,String[],SupportedContext[],boolean)}.

creates a Response Object that accepts the specified abstract syntaxes with the specified transfer syntaxes and refuses all others. Acceptable called title and calling titles can also be specified. If more than one transfer syntax out of the array of transfer syntaxes matches, the one with the lowest array index is used.

Parameters:
request - the Request for which to create an Response
calledtitle - the allowed called title in the request or null if no check on called title is necessary
callingtitles - the allowed calling titles in the request or null if no check on calling title is necessary
asids - the allowed abstract syntaxes.
tsids - the allowed transfer syntaxes.
rejectnocontext - whether or not to return a reject when no proposed presentation context in the request can be accepted
Throws:
IllegalValueException

prepareResponse

public static Response prepareResponse(Request request,
                                       java.lang.String calledtitle,
                                       java.lang.String[] callingtitles,
                                       ResponsePolicy.SupportedContext[] contexts,
                                       boolean rejectnocontext)
                                throws IllegalValueException
creates a Response Object that accepts the specified supported contexts and refuses all others. Acceptable called title and calling titles can also be specified.

Parameters:
request - Request
calledtitle - String
callingtitles - String[]
contexts - SupportedContext[]
rejectnocontext - boolean whether or not to return a reject when no proposed presentation context in the request can be accepted
Returns:
Response
Throws:
IllegalValueException

getResultForAbstractSyntax

public static int getResultForAbstractSyntax(Request request,
                                             Acknowledge ack,
                                             int asid)
                                      throws IllegalValueException
returns the result in an Acknowledge for a proposed abstract syntax in a Request. The result in the Acknowledge ack is returned for the presentation context with a presentation context ID that matches the ID of the request for the specified abstract syntax. If the abstract syntax is proposed in multiple presentation contexts, the result for the presentation context with the lowest presentation context ID is returned.

Parameters:
request - the Request.
ack - the Acknowledge for which to return the result in accordance with the Request request.
asid - the abstract syntax
Throws:
IllegalValueException - is thrown when the abstract syntax was not proposed in the request or when there is no correspondence between the presentation context IDs of request and acknowledge for the specified abstract syntax.

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.