Oracle

com.compoze.collab
Class CollaborationManager

java.lang.Object
  extended by com.compoze.collab.CollaborationManager

public class CollaborationManager
extends java.lang.Object

Maintains a registry of API providers and related information.

Default Locales can be set for the API using this class. By default, the value of Locale.getDefault() is used unless there is no translation available for this locale, in which case Locale.US is used.


Method Summary
 void addDefaultLogListener(ILogListener listener)
          Adds a log listener that is used by default on every session on which the log listeners have not been changed.
 java.util.Map getAllCapabilities()
          Gets all of the capabilities defined that a provider can choose to support.
 java.lang.String getAllProvidersString()
          Gets all of the providers in the provider registry as a comma separated list.
static java.util.Locale getDefaultAdminLocale()
          Gets the default Locale for administrators.
 LogLevel getDefaultLogLevel()
          Gets the default log level.
static java.util.Locale getDefaultProgrammerLocale()
          Gets the default Locale for programmers.
static java.util.Locale getDefaultUserLocale()
          Gets the default Locale for users.
 java.util.Locale[] getLocales()
          Gets the list of locales that API translations are available for.
 IProvider getProvider(java.lang.String sInternalName)
          Gets a provider by its internal name.
 IProvider[] getProviders()
          Gets all of the providers.
 IProvider[] getProviders(java.util.Locale locale)
          Gets all of the providers that have translations for the specified locale.
 IProvider[] getProviders(java.lang.String sSchema)
          Gets all of the providers that support the specified schema.
 Schema getSchema(java.lang.String sInternalName)
          Gets a schema by its internal name.
 Schema[] getSchemas()
          Gets all of the schemas.
static CollaborationManager i()
          Gets the singleton instance of this class.
static void main(java.lang.String[] args)
          Main.
 boolean removeDefaultLogListener(ILogListener listener)
          Removes a log listener from every session.
 void setDefaultAdminLocale(java.util.Locale locale)
          Sets the default Locale for administrators.
 void setDefaultLogLevel(LogLevel level)
          Sets the log level that is used by all sessions that use the default log level.
 void setDefaultProgrammerLocale(java.util.Locale locale)
          Sets the default Locale for programmers.
 void setDefaultUserLocale(java.util.Locale locale)
          Sets the default Locale for users.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDefaultLogLevel

public void setDefaultLogLevel(LogLevel level)
Sets the log level that is used by all sessions that use the default log level. Sessions use the default log level until Logger.setLogLevel(LogLevel) is called on the logger on the session.

Parameters:
level - the default log level (not null)
See Also:
Logger.setDefaultLogLevel(LogLevel)

getDefaultLogLevel

public LogLevel getDefaultLogLevel()
Gets the default log level.

Returns:
the default log level (not null)
See Also:
Logger.getDefaultLogLevel()

addDefaultLogListener

public void addDefaultLogListener(ILogListener listener)
Adds a log listener that is used by default on every session on which the log listeners have not been changed.

Parameters:
listener - the listener to add (not null)

removeDefaultLogListener

public boolean removeDefaultLogListener(ILogListener listener)
Removes a log listener from every session.

Parameters:
listener - the listener to remove
Returns:
true if the listener was removed, or false if it did not exist in the list

setDefaultUserLocale

public void setDefaultUserLocale(java.util.Locale locale)
                          throws CollaborationException
Sets the default Locale for users. When a new Session is instantiated and no Locale is supplied for the user, this is the one that is used.

Parameters:
locale - the default user locale (if null, then the Locale.US (US/English) locale is used)
Throws:
CollaborationException - if there is no API translation available for the supplied locale (use getLocales() to get a list of available locales for the API)

getDefaultUserLocale

public static java.util.Locale getDefaultUserLocale()
Gets the default Locale for users.

Returns:
the user locale (never null)

setDefaultAdminLocale

public void setDefaultAdminLocale(java.util.Locale locale)
                           throws CollaborationException
Sets the default Locale for administrators. When a new Session is instantiated and no Locale is supplied for the administrator, this is the one that is used.

Parameters:
locale - the default admin locale (if null, then the Locale.US (US/English) locale is used)
Throws:
CollaborationException - if there is no API translation available for the supplied locale (use getLocales() to get a list of available locales for the API)

getDefaultAdminLocale

public static java.util.Locale getDefaultAdminLocale()
Gets the default Locale for administrators.

Returns:
the admin locale (never null)

setDefaultProgrammerLocale

public void setDefaultProgrammerLocale(java.util.Locale locale)
                                throws CollaborationException
Sets the default Locale for programmers. When a new Session is instantiated and no Locale is supplied for the programmer, this is the one that is used.

Parameters:
locale - the default programmer locale (if null, then the Locale.US (US/English) locale is used)
Throws:
CollaborationException - if there is no API translation available for the supplied locale (use getLocales() to get a list of available locales for the API)

getDefaultProgrammerLocale

public static java.util.Locale getDefaultProgrammerLocale()
Gets the default Locale for programmers.

Returns:
the programmer locale (never null)

getSchemas

public Schema[] getSchemas()
Gets all of the schemas.

Returns:
a copy of the registered schemas (not null)

getSchema

public Schema getSchema(java.lang.String sInternalName)
Gets a schema by its internal name.

Parameters:
sInternalName - the schema internal name
Returns:
the schema, or null if no schema with the given name is registered

getProviders

public IProvider[] getProviders()
Gets all of the providers.

Returns:
a copy of the registered providers (not null)

getProviders

public IProvider[] getProviders(java.util.Locale locale)
Gets all of the providers that have translations for the specified locale.

Returns:
a copy of the matching providers (not null)

getProviders

public IProvider[] getProviders(java.lang.String sSchema)
Gets all of the providers that support the specified schema.

Parameters:
sSchema - the internal name of the desired schema support (not null)
Returns:
a copy of the matching providers (not null)

getAllProvidersString

public java.lang.String getAllProvidersString()
Gets all of the providers in the provider registry as a comma separated list.

Returns:
a comma separated list of all of the internal names of the providers

getProvider

public IProvider getProvider(java.lang.String sInternalName)
Gets a provider by its internal name.

Parameters:
sInternalName - the provider internal name
Returns:
the provider, or null if no provider with the given name is registered

i

public static CollaborationManager i()
                              throws CollaborationException
Gets the singleton instance of this class.

Returns:
the singleton instance
Throws:
CollaborationException

getLocales

public java.util.Locale[] getLocales()
Gets the list of locales that API translations are available for.

Returns:
an array of the available Locales (not null)

getAllCapabilities

public java.util.Map getAllCapabilities()
Gets all of the capabilities defined that a provider can choose to support.

Returns:
the capabilities

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Main.

Parameters:
args - command line arguments
Throws:
java.lang.Throwable

Oracle

Copyright ©1999-2008 Oracle All rights reserved.