com.apelon.dts.client.common
Class CodeAndIDGenerator

java.lang.Object
  extended by com.apelon.dts.client.common.CodeAndIDGenerator
Direct Known Subclasses:
DefaultCodeAndIdGenerator, PromptForCodeAndId

public abstract class CodeAndIDGenerator
extends Object

Base class for Apelon DTS Server code and ID generators.

Copyright: Copyright (c) 2003

Company: Apelon, Inc.

Version:
DTS 3.0.0
Author:
Apelon, Inc.

Field Summary
static String CODE_AND_ID_GENERATOR_FILE_PATH
          Used to find location of code and ID generators in local file system.
static String CODE_AND_ID_GENERATOR_PACKAGE_PATH
          Used to identify the standard, required package location of all CodeAndIdGenerator class files.
static String RELATIVE_CODE_AND_ID_GENERATOR_FILE_PATH
          Use to indicate relative location of code and ID generator class files in file system.
 
Constructor Summary
CodeAndIDGenerator(ServerConnection sc)
          Constructs CodeAndIDGenerator.
 
Method Summary
abstract  String getCode(DTSObject conceptOrTerm)
          Implement to create a code for a new concept or term.
static String getCodeAndIDGeneratorFilePath()
          Returns the path to the code and ID generators on this machine.
static Class getDefaultImplClass()
          Get default code and ID generator class.
abstract  String getDescription()
          Implement to describe how a code and ID is assigned to a concept by this class.
abstract  int getId(DTSObject conceptOrTerm)
          Implement to create an ID for a new concept or term.
protected  ServerConnection getServerConnection()
          Gets server connection for the code and ID generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE_AND_ID_GENERATOR_FILE_PATH

public static String CODE_AND_ID_GENERATOR_FILE_PATH
Used to find location of code and ID generators in local file system. This path cannot be modified.


RELATIVE_CODE_AND_ID_GENERATOR_FILE_PATH

public static final String RELATIVE_CODE_AND_ID_GENERATOR_FILE_PATH
Use to indicate relative location of code and ID generator class files in file system.

See Also:
Constant Field Values

CODE_AND_ID_GENERATOR_PACKAGE_PATH

public static final String CODE_AND_ID_GENERATOR_PACKAGE_PATH
Used to identify the standard, required package location of all CodeAndIdGenerator class files.

See Also:
Constant Field Values
Constructor Detail

CodeAndIDGenerator

public CodeAndIDGenerator(ServerConnection sc)
Constructs CodeAndIDGenerator.

Parameters:
sc - ServerConnection which may be used to instantiate any of the DTS query classes
Method Detail

getServerConnection

protected ServerConnection getServerConnection()
Gets server connection for the code and ID generator. This can be used to instantiate any DTS API query classes needed to implement a code and ID generator.

Returns:
the DTS server connection

getCode

public abstract String getCode(DTSObject conceptOrTerm)
Implement to create a code for a new concept or term. Code must be 32 characters or less, and must be unique in regard to other existing codes.

Parameters:
conceptOrTerm - new concept or term, will be updated with created code
Returns:
code for new concept or term

getId

public abstract int getId(DTSObject conceptOrTerm)
Implement to create an ID for a new concept or term. ID must be a long and must be unique in regards to other existing IDs.

Parameters:
conceptOrTerm - new concept or term, will be updated with created ID
Returns:
ID for new concept or term

getDescription

public abstract String getDescription()
Implement to describe how a code and ID is assigned to a concept by this class.

Returns:
description of code and ID generator

getCodeAndIDGeneratorFilePath

public static String getCodeAndIDGeneratorFilePath()
Returns the path to the code and ID generators on this machine. This path is set internally, and cannot be modified by classes extending the CodeAndIdGenerator.

Returns:
path of code and ID generators

getDefaultImplClass

public static Class getDefaultImplClass()
Get default code and ID generator class.

Returns:
default implementation class


Copyright © 2011. All Rights Reserved.