medisyn
Class ProxyGenerator

java.lang.Object
  extended by medisyn.ProxyGenerator

public class ProxyGenerator
extends java.lang.Object

Manages the proxies, enables assignment of file categories to proxies, and forms proxy groups based on semantic closeness.

Author:
Leo Bosnjak

Field Summary
private  java.util.Vector<FileCategory> fileCategories
           
private  java.util.Vector<X2XProxy> proxies
           
private  java.util.Vector<ProxyGroup> proxyGroups
           
private  java.util.Vector<Request> requests
           
private  java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles
           
 
Constructor Summary
ProxyGenerator()
          Initialize the ProxyGenerator with default values
 
Method Summary
private  boolean assignAllProxyCategories()
          Assigns semantic Filecategories to all files of all proxies prequisites: this.videoFiles and this.requests and this.proxies must be set before
private  void assignCategoriesToProxyfiles(X2XProxy proxy)
          Assigns semantic Filecategories to all files of 1 proxy prequisites: this.videoFiles and this.requests and this.proxies must be set before
private  void assignFileCategories()
          as medisyn does not retain the info about file-categories: assign a RANDOM category to each file prequisites: this.videoFiles and this.fileCategories must be set before
private  void formGroups(boolean equalNrOfProxiesPerGroup)
          Iterates through proxies and forms groups NOTE: this only works here locally if only semantical closeness is considered! else: -->code must be moved to PlabServers prequisites: this.videoFiles and this.proxies and this.fileCategories must be set before
 java.util.Vector<X2XProxy> generateProxies(boolean equalNrOfProxiesPerGroup)
          generate the proxies according to the requests and videoFiles, calculate the Proxy-Groups prequisites: this.videoFiles and this.requests and this.proxies must be set before
 java.util.Vector<FileCategory> getFileCategories()
           
 java.util.Vector<X2XProxy> getProxies()
           
 java.util.Vector<ProxyGroup> getProxyGroups()
           
 java.util.Vector<Request> getRequests()
           
 java.util.Hashtable<java.lang.Integer,VideoFile> getVideoFiles()
           
static void printProxyGroups(ProxyGroup proxyGroup)
          prints the proxy-grup and its proxies to stdout
static void printProxyGroups(java.util.Vector<ProxyGroup> proxyGroups)
          prints the proxy-grups and their proxies to stdout
 void setFileCategories(java.util.Vector<FileCategory> fileCategories)
           
 void setProxies(java.util.Vector<X2XProxy> proxies)
           
 void setRequests(java.util.Vector<Request> requests)
           
 void setVideoFiles(java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxies

private java.util.Vector<X2XProxy> proxies

requests

private java.util.Vector<Request> requests

videoFiles

private java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles

proxyGroups

private java.util.Vector<ProxyGroup> proxyGroups

fileCategories

private java.util.Vector<FileCategory> fileCategories
Constructor Detail

ProxyGenerator

public ProxyGenerator()
Initialize the ProxyGenerator with default values

Method Detail

assignFileCategories

private void assignFileCategories()
                           throws java.lang.Exception
as medisyn does not retain the info about file-categories: assign a RANDOM category to each file prequisites: this.videoFiles and this.fileCategories must be set before

Throws:
java.lang.Exception

formGroups

private void formGroups(boolean equalNrOfProxiesPerGroup)
                 throws java.lang.Exception
Iterates through proxies and forms groups NOTE: this only works here locally if only semantical closeness is considered! else: -->code must be moved to PlabServers prequisites: this.videoFiles and this.proxies and this.fileCategories must be set before

Parameters:
equalNrOfProxiesPerGroup - - if true, then this function will try to form groups with equal nr of nodes in each group, otherwise, the nodes will be assigned to groups straight ahead.
Throws:
java.lang.Exception

printProxyGroups

public static void printProxyGroups(java.util.Vector<ProxyGroup> proxyGroups)
                             throws java.lang.Exception
prints the proxy-grups and their proxies to stdout

Parameters:
proxyGroups - - Vector containing the groups and proxies
Throws:
java.lang.Exception

printProxyGroups

public static void printProxyGroups(ProxyGroup proxyGroup)
                             throws java.lang.Exception
prints the proxy-grup and its proxies to stdout

Parameters:
proxyGroup - - the group and its proxies
Throws:
java.lang.Exception

assignAllProxyCategories

private boolean assignAllProxyCategories()
                                  throws java.lang.Exception
Assigns semantic Filecategories to all files of all proxies prequisites: this.videoFiles and this.requests and this.proxies must be set before

Throws:
java.lang.Exception

assignCategoriesToProxyfiles

private void assignCategoriesToProxyfiles(X2XProxy proxy)
                                   throws java.lang.Exception,
                                          java.lang.CloneNotSupportedException
Assigns semantic Filecategories to all files of 1 proxy prequisites: this.videoFiles and this.requests and this.proxies must be set before

Parameters:
proxy -
Throws:
java.lang.Exception
java.lang.Exception
java.lang.CloneNotSupportedException

generateProxies

public java.util.Vector<X2XProxy> generateProxies(boolean equalNrOfProxiesPerGroup)
                                           throws java.lang.Exception
generate the proxies according to the requests and videoFiles, calculate the Proxy-Groups prequisites: this.videoFiles and this.requests and this.proxies must be set before

Parameters:
equalNrOfProxiesPerGroup - - if true, then formGroups() will try to form groups with equal nr of nodes in each group, otherwise, the nodes will be assigned to groups straight ahead.
Throws:
java.lang.Exception

getRequests

public java.util.Vector<Request> getRequests()
Returns:
the requests

setRequests

public void setRequests(java.util.Vector<Request> requests)
Parameters:
requests - the requests to set

getVideoFiles

public java.util.Hashtable<java.lang.Integer,VideoFile> getVideoFiles()
Returns:
the videoFiles

setVideoFiles

public void setVideoFiles(java.util.Hashtable<java.lang.Integer,VideoFile> videoFiles)
Parameters:
videoFiles - the videoFiles to set

getProxies

public java.util.Vector<X2XProxy> getProxies()
Returns:
the proxies

getProxyGroups

public java.util.Vector<ProxyGroup> getProxyGroups()
Returns:
the proxyGroups

setProxies

public void setProxies(java.util.Vector<X2XProxy> proxies)
Parameters:
proxies - the proxies to set

getFileCategories

public java.util.Vector<FileCategory> getFileCategories()
Returns:
the fileCategories

setFileCategories

public void setFileCategories(java.util.Vector<FileCategory> fileCategories)
Parameters:
fileCategories - the fileCategories to set