nl.toolforge.karma.core.module
Interface Module

All Known Implementing Classes:
BaseModule

public interface Module

A module is a collection of files, representing some block of functionality. This definition is probably highly subjective, but for Karma, that's what it is. A module is part of a container, called a Manifest. System's theory tells us that a system is separated into subsystems. Well, that's what we do in the Karma context as well. An application system consists of one or more (generally more) modules.

Karma Modules are maintained in a version management system and grouped together in a Manifest. The manifest is managing the modules.

Version:
$Id: Module.java,v 1.1 2004/11/10 22:25:11 hippe Exp $
Author:
D.A. Smedes

Nested Class Summary
static class Module.State
          Inner class representing the 'state' of a module.
static class Module.Type
          Inner class representing the type of the module, which is determined at runtime by reading the module-descriptor.xml file from the module base directory.
 
Field Summary
static Module.State DYNAMIC
           
static Module.Type JAVA_ENTERPRISE_APPLICATION
          Represents <type>JAVA_ENTERPRISE_APPLICATION</type>.
static Module.Type JAVA_SOURCE_MODULE
          Represents <type>JAVA_SOURCE_MODULE</type>.
static Module.Type JAVA_WEB_APPLICATION
          Represents <type>JAVA_WEB_APPLICATION</type>.
static Module.Type LIBRARY_MODULE
          Represents <type>LIBRARY_MODULE</type>.
static java.lang.String MODULE_DESCRIPTOR
          String identifying the file name for the module descriptor.
static Module.Type OTHER_MODULE
          Represents <type>OTHER-MODULE</type>.
static Module.State STATIC
           
static Module.Type UNKNOWN
          UNKNOWN applies to module which have no local presence.
static Module.State WORKING
           
 
Method Summary
 void createRemote(Authenticator authenticator, java.lang.String createComment)
           
 java.io.File getBaseDir()
          The base directory of the module relative to the active manifest.
 java.util.Set getDependencies()
          Gets a Set of ModuleDependency objects.
 ModuleLayoutTemplate getLayoutTemplate()
          Returns the correct layout template for the module.
 Location getLocation()
          Returns the Location instance, which is derived from the location-attribute.
 java.lang.String getName()
          Retrieves a modules' name, the name attribute of the module in the manifest XML file.
 DevelopmentLine getPatchLine()
          Returns the PatchLine for this module, if the module matches the correct criteria as specified in markPatchLine(boolean).
 Module.Type getType()
          Determines the type of the module.
 Version getVersion()
          If a module has a <version>-attribute, this method returns a Version instance representing the version number of the module.
 java.lang.String getVersionAsString()
          If the module element in the manifest contains a version attribute, this method will return the value of that attribute.
 boolean hasDevelopmentLine()
          Checks if the module - within the current manifest - has development line configuration.
 boolean hasPatchLine()
           
 boolean hasVersion()
          Checks if a module has a <version>-attribute.
 void markDevelopmentLine(boolean mark)
          Marks this modules as being developed in a DevelopmentLine.
 void markPatchLine(boolean mark)
          Marks this module as being developed in a PatchLine.
 void setBaseDir(java.io.File baseDir)
          A module has a base directory, which is relative to the manifest that requires it.
 

Field Detail

UNKNOWN

public static final Module.Type UNKNOWN
UNKNOWN applies to module which have no local presence. The actual type can only be determined when the module-descriptor.xml file is available, which is the case after a checkout of the module.


LIBRARY_MODULE

public static final Module.Type LIBRARY_MODULE
Represents <type>LIBRARY_MODULE</type>.


JAVA_SOURCE_MODULE

public static final Module.Type JAVA_SOURCE_MODULE
Represents <type>JAVA_SOURCE_MODULE</type>.


JAVA_WEB_APPLICATION

public static final Module.Type JAVA_WEB_APPLICATION
Represents <type>JAVA_WEB_APPLICATION</type>.


OTHER_MODULE

public static final Module.Type OTHER_MODULE
Represents <type>OTHER-MODULE</type>.


JAVA_ENTERPRISE_APPLICATION

public static final Module.Type JAVA_ENTERPRISE_APPLICATION
Represents <type>JAVA_ENTERPRISE_APPLICATION</type>.


WORKING

public static final Module.State WORKING

DYNAMIC

public static final Module.State DYNAMIC

STATIC

public static final Module.State STATIC

MODULE_DESCRIPTOR

public static final java.lang.String MODULE_DESCRIPTOR
String identifying the file name for the module descriptor.

See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Retrieves a modules' name, the name attribute of the module in the manifest XML file.

Returns:
The modules' name.

getType

public Module.Type getType()
                    throws ModuleTypeException
Determines the type of the module. This is only possible when the module is checked out locally.

Returns:
The type of the module (see constants defined in Module).
Throws:
ModuleTypeException

getLocation

public Location getLocation()
Returns the Location instance, which is derived from the location-attribute.


setBaseDir

public void setBaseDir(java.io.File baseDir)
A module has a base directory, which is relative to the manifest that requires it. When the manifest is loaded, the base directory can be set.

Parameters:
baseDir - The base directory of the module relative to the active manifest.

getBaseDir

public java.io.File getBaseDir()
The base directory of the module relative to the active manifest.

Returns:
The base directory of the module relative to the active manifest.

getPatchLine

public DevelopmentLine getPatchLine()
Returns the PatchLine for this module, if the module matches the correct criteria as specified in markPatchLine(boolean).

Returns:
null if a PatchLine does not exist for this module, otherwise the PatchLine instance for this module.
See Also:
markPatchLine(boolean)

markPatchLine

public void markPatchLine(boolean mark)
Marks this module as being developed in a PatchLine. This can only happen when the manifest in which the module is used is a ReleaseManifest and the module has a STATIC state. When the manifest is loaded, this method will be called when the module matches the criteria.


hasPatchLine

public boolean hasPatchLine()

hasDevelopmentLine

public boolean hasDevelopmentLine()
Checks if the module - within the current manifest - has development line configuration. When the manifest is a ReleaseManifest, this is true when a PatchLine exists. When the manifest is a DevelopmentManifest, this method returns false, as this feature is not supported.

Returns:

markDevelopmentLine

public void markDevelopmentLine(boolean mark)
Marks this modules as being developed in a DevelopmentLine. This feature is NOT supported as yet.


getVersion

public Version getVersion()
If a module has a <version>-attribute, this method returns a Version instance representing the version number of the module.

Returns:
The version of the module if it has one.

getVersionAsString

public java.lang.String getVersionAsString()
If the module element in the manifest contains a version attribute, this method will return the value of that attribute.

Returns:
The module version, or N/A, when no version number exists.

hasVersion

public boolean hasVersion()
Checks if a module has a <version>-attribute.

Returns:
true if the module has a <version>-attribute or false if it hasn't.

getDependencies

public java.util.Set getDependencies()
Gets a Set of ModuleDependency objects. This method should return an empty set if no dependencies have been specified. Dependencies are not checked to be available.

Returns:
A Set containing all dependencies as ModuleDependency objects.

getLayoutTemplate

public ModuleLayoutTemplate getLayoutTemplate()
Returns the correct layout template for the module.

Returns:
A ModuleLayoutTemplate for the specific module type.

createRemote

public void createRemote(Authenticator authenticator,
                         java.lang.String createComment)
                  throws VersionControlException,
                         AuthenticationException
Throws:
VersionControlException
AuthenticationException


Copyright © 2002-2004 Toolforge. All Rights Reserved.