Interface LogDestinations
-
public interface LogDestinations
This interface represents the log destinations for an IServer. Note that any changes made to an editable log destination (likeFileLogDestination
) can be saved only usingsave()
. For a given IServer, this object refers to all its log destinations. Thus, if one/moreLogDestination
s have been edited, they can be saved in a batch, usingsave()
. Out of the possible log destination types, only two are editable. They areEnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
. These destinations are represented byFileLogDestination
. The collection methods on this interface (add/remove/get/elements/isEmpty/getItemByName/size/clear) only work on editable log destinations. . For log destinations of remaining typesEnumLogDestinationType.LogDestinationTypeDebugOutput
andEnumLogDestinationType.LogDestinationTypeSystemLog
, there are seperate access methods (getDebugOutputDestination()
andgetSystemLogDestination()
).- Since:
- MicroStrategy Web 7.5.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LogDestination
add(java.lang.String name, int type)
Adds a newLogDestination
with the name and type passed.void
clear()
Clears the collection of editable log destinations.java.util.Enumeration
elements()
Returns an enumeration ofLogDestination
objects.LogDestination
get(int index)
Returns the log destination at the index passed.LogDestination
getDebugOutputDestination()
Returns the non-editable LogDestination of typeEnumLogDestinationType.LogDestinationTypeDebugOutput
.LogDestination
getItemByName(java.lang.String name)
Returns the log destination with the name passed.LogDestination
getSystemLogDestination()
Returns the non-editable LogDestination of typeEnumLogDestinationType.LogDestinationTypeSystemLog
.boolean
isEmpty()
Conveys if the log destination collection is empty.LogDestination
remove(int index)
Removes the log destination at the index passed.boolean
remove(LogDestination dest)
Removes the log destination object passed.void
save()
Commits all changes done to this collection.int
size()
Returns the number of log destinations in this collection object.
-
-
-
Method Detail
-
add
LogDestination add(java.lang.String name, int type) throws java.lang.IllegalArgumentException
Adds a newLogDestination
with the name and type passed. The new log destination is only added to this local collection and is saved to IServer only aftersave()
is called. Note that only editable destination types can be added i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
.- Parameters:
name
- the name of the new destination.type
- the type of destination.- Returns:
- LogDestination the newly created LogDestination.
- Throws:
java.lang.IllegalArgumentException
- if a non-editable destination type is passed i.e.EnumLogDestinationType.LogDestinationTypeDebugOutput
andEnumLogDestinationType.LogDestinationTypeSystemLog
-
get
LogDestination get(int index)
Returns the log destination at the index passed. Note that the collection methods as this one only gives access to editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
. For non editable log destination types, there are seperate access methods e.g.getDebugOutputDestination()
andgetSystemLogDestination()
- Parameters:
index
- index of the destination queried.- Returns:
- LogDestination the destination at the index passed.
-
remove
LogDestination remove(int index)
Removes the log destination at the index passed. If this is an existing log destination on IServer, the log destination is removed from IServer only aftersave()
is called. Note that the collection methods as this one only gives access to editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
. For non editable log destination types, there are seperate access methods e.g.getDebugOutputDestination()
andgetSystemLogDestination()
- Parameters:
index
- the index of the editable destination to remove.- Returns:
- LogDestination the removed log destination.
-
elements
java.util.Enumeration elements()
Returns an enumeration ofLogDestination
objects. Note that the collection methods as this one only gives access to editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
. For non editable log destination types, there are seperate access methods e.g.getDebugOutputDestination()
andgetSystemLogDestination()
- Returns:
- Enumeration enumeration of editable destinations.
-
size
int size()
Returns the number of log destinations in this collection object. Note that the collection methods as this one only considers editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
.- Returns:
- int the number of editable log destinations.
-
getItemByName
LogDestination getItemByName(java.lang.String name)
Returns the log destination with the name passed. Note that the collection methods as this one only gives access to editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
. For non editable log destination types, there are seperate access methods e.g.getDebugOutputDestination()
andgetSystemLogDestination()
- Parameters:
name
- the name of the destination queried.- Returns:
- LogDestination The destination with the name passed.
-
remove
boolean remove(LogDestination dest)
Removes the log destination object passed. The object passed is only removed from the local collection and will be removed from IServer only when @link #save is called}. Also, note that the collection methods as this one only allows editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
.- Parameters:
dest
- the destination to remove.- Returns:
- boolean True if the remove operation was successful.
-
isEmpty
boolean isEmpty()
Conveys if the log destination collection is empty. Note that the collection methods as this one only consider editable log destination types i.e.EnumLogDestinationType.LogDestinationTypeDiagnosticsLog
andEnumLogDestinationType.LogDestinationTypePerformanceLog
.- Returns:
- boolean True if there are no editable log destinations in this collection.
-
getDebugOutputDestination
LogDestination getDebugOutputDestination()
Returns the non-editable LogDestination of typeEnumLogDestinationType.LogDestinationTypeDebugOutput
.- Returns:
- LogDestination returns the debug output log destination.
-
getSystemLogDestination
LogDestination getSystemLogDestination()
Returns the non-editable LogDestination of typeEnumLogDestinationType.LogDestinationTypeSystemLog
.- Returns:
- LogDestination returns the system log destination.
-
clear
void clear()
Clears the collection of editable log destinations. The changes are not committed to IServer tillsave()
is invoked.
-
save
void save() throws ServerConfigException
Commits all changes done to this collection. This includes adding/removing/clearing (editable) log destinations or changing their properties.- Throws:
ServerConfigException
- If an error was encountered while saving the changes to IServer.
-
-