org.jdesktop.wonderland.common.modules
Class ModuleRepository

java.lang.Object
  extended by org.jdesktop.wonderland.common.modules.ModuleRepository
All Implemented Interfaces:
java.io.Serializable

public class ModuleRepository
extends java.lang.Object
implements java.io.Serializable

A module's repository information, as represented by this class, represents the collection of URLs where assets may be found over the Internet.

This class stores the name of the master repository where the artwork can be downloaded and also a list of mirror repositories. Both the master and mirror repositories are optional. If no master or mirror is specified, then it is assumed the artwork is made available by the Wonderland server in which the module is installed (if use_server is not false).

This class deserializes information distributed from the module service.

Author:
Jordan Slott
See Also:
Serialized Form

Nested Class Summary
static class ModuleRepository.Repository
          The Repository static inner class simply stores the base URL of the repository and whether it is located on the web server itself (if it is, then there is no need to check the checksums).
 
Field Summary
static java.lang.String WL_SERVER
           
 
Constructor Summary
ModuleRepository()
          Default constructor
ModuleRepository(ModuleRepository repository)
          Constructor that takes an existing ModuleRepository and makes a copy
 
Method Summary
static ModuleRepository decode(java.io.Reader r)
          Takes the input reader of the XML file and instantiates an instance of the ModuleRepository class
 void encode(java.io.OutputStream os)
          Writes the ModuleRepository class to an output stream.
 void encode(java.io.Writer w)
          Writes the ModuleRepository class to an output writer.
 ModuleRepository.Repository[] getAllRepositories()
          Returns the set of repository as an array of Repository objects
 ModuleRepository.Repository getMaster()
           
 ModuleRepository.Repository[] getMirrors()
           
 java.lang.String[] getResources()
           
 void setMaster(ModuleRepository.Repository master)
           
 void setMirrors(ModuleRepository.Repository[] mirrors)
           
 void setResources(java.lang.String[] resources)
           
 java.lang.String toString()
          Returns the list of repositories encoded as a string
 void updateRepositoryList()
          Updates the internal linked list of repository objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WL_SERVER

public static final java.lang.String WL_SERVER
See Also:
Constant Field Values
Constructor Detail

ModuleRepository

public ModuleRepository()
Default constructor


ModuleRepository

public ModuleRepository(ModuleRepository repository)
Constructor that takes an existing ModuleRepository and makes a copy

Method Detail

getResources

public java.lang.String[] getResources()

setResources

public void setResources(java.lang.String[] resources)

getMaster

public ModuleRepository.Repository getMaster()

setMaster

public void setMaster(ModuleRepository.Repository master)

getMirrors

public ModuleRepository.Repository[] getMirrors()

setMirrors

public void setMirrors(ModuleRepository.Repository[] mirrors)

getAllRepositories

public ModuleRepository.Repository[] getAllRepositories()
Returns the set of repository as an array of Repository objects

Returns:
An array of Repository objects

updateRepositoryList

public void updateRepositoryList()
Updates the internal linked list of repository objects. This is invoked whenever the set of master and mirror repositories changes.


toString

public java.lang.String toString()
Returns the list of repositories encoded as a string

Overrides:
toString in class java.lang.Object

decode

public static ModuleRepository decode(java.io.Reader r)
                               throws javax.xml.bind.JAXBException
Takes the input reader of the XML file and instantiates an instance of the ModuleRepository class

Parameters:
r - The input stream of the version XML file
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.Writer w)
            throws javax.xml.bind.JAXBException
Writes the ModuleRepository class to an output writer.

Parameters:
w - The output writer to write to
Throws:
javax.xml.bind.JAXBException

encode

public void encode(java.io.OutputStream os)
            throws javax.xml.bind.JAXBException
Writes the ModuleRepository class to an output stream.

Parameters:
os - The output stream to write to
Throws:
javax.xml.bind.JAXBException


Open Wonderland - http://openwonderland.org