com.sas.services.information
Class RepositoryGroup

com.sas.services.information.RepositoryGroup
All Implemented Interfaces:
ConsumedResourceInterface, java.io.Serializable, java.lang.Cloneable

public class RepositoryGroup
implements java.lang.Cloneable, ConsumedResourceInterface, java.io.Serializable

Repository group.

Since:
1.1.0
See Also:
Serialized Form

Constructor Summary
RepositoryGroup()
          Default constructor.
RepositoryGroup(java.lang.String name)
          Constructor with name.
RepositoryGroup(java.lang.String name, java.util.List group)
          Create a new group with the name a List of repository names.
RepositoryGroup(java.lang.String name, java.lang.String description)
          Constructor with name.
RepositoryGroup(java.lang.String uid, java.lang.String name, java.lang.String description, java.util.List group)
          Create a new group with the name a List of repository names.
 
Method Summary
 void addRepository(java.lang.String name)
          Add a repository definition name to the list for this group.
 java.lang.Object clone()
          Clones this RepositoryGroup.
 RepositoryGroup copyTo(java.lang.String name)
          Make a writable copy of this group with a new name.
 boolean equals(java.lang.Object o)
          Determines if the object is equal to this repository group.
 java.lang.String getDescription()
          Get the description for this group.
 java.util.List getGroupNames()
          Get a copy of the list of repository definition names for this group.
 java.lang.String getLocalizedResourceType()
          Gets a localized value describing the resource's type.
 java.lang.String getLocalizedResourceTypeAndValue()
          Gets a localized value describing the resource's type and value.
 java.lang.String getName()
          Get the name of this group.
 java.lang.String getResourceID()
          Gets the unique ID.
 java.lang.String getResourceType()
          Gets a value describing the resource's type.
 int getResourceTypeCode()
          Gets the code describing the resource's type.
 java.lang.String getResourceValue()
          Gets the value used to identify the service configuration resource.
 int hashCode()
          Gets the hash code.
 boolean isRequired()
          Determines if this resource is required by the service's configuration.
 void removeRepository(java.lang.String name)
          Remove a repository definition name from this group.
 void setDescription(java.lang.String description)
          Set the description for this group.
 void setName(java.lang.String name)
          Set the name of this group.
 void setProtected()
          Set this group to be protected.
 java.lang.String toString()
          Gets a string representing this repository group composed of its name and description.
 

Constructor Detail

RepositoryGroup

public RepositoryGroup()
Default constructor.


RepositoryGroup

public RepositoryGroup(java.lang.String name)
Constructor with name. A new repository group is created with the given name.

Parameters:
name - The name of the new group.

RepositoryGroup

public RepositoryGroup(java.lang.String name,
                       java.lang.String description)
Constructor with name. A new repository group is created with the given name.

Parameters:
name - The name of the new group.
description - A string describing this group's use.

RepositoryGroup

public RepositoryGroup(java.lang.String name,
                       java.util.List group)
Create a new group with the name a List of repository names.

Parameters:
name - The group name.
group - A List of repository names as Strings.

RepositoryGroup

public RepositoryGroup(java.lang.String uid,
                       java.lang.String name,
                       java.lang.String description,
                       java.util.List group)
Create a new group with the name a List of repository names.

Parameters:
uid - Unique identifier.
name - The group's name.
description - A string describing this group's use.
group - A List of String repository names or null.
Method Detail

setDescription

public void setDescription(java.lang.String description)
Set the description for this group.

Parameters:
description - A string describing this group's use.

getDescription

public java.lang.String getDescription()
Get the description for this group.

Returns:
A String describing this group's use.

getResourceID

public java.lang.String getResourceID()
Gets the unique ID.

Specified by:
getResourceID in interface ConsumedResourceInterface
Returns:
Unique ID.

getResourceValue

public java.lang.String getResourceValue()
Description copied from interface: ConsumedResourceInterface
Gets the value used to identify the service configuration resource.

Specified by:
getResourceValue in interface ConsumedResourceInterface
Returns:
Service configuration resource's value.

getLocalizedResourceType

public java.lang.String getLocalizedResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type.

Specified by:
getLocalizedResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for "Context", "Output", and "Renderer".

getLocalizedResourceTypeAndValue

public java.lang.String getLocalizedResourceTypeAndValue()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type and value.

Specified by:
getLocalizedResourceTypeAndValue in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for
  • "Context : com.sas.services"
  • "Output : A1"
  • "Renderer: com.sas.MyRenderer"

getResourceType

public java.lang.String getResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a value describing the resource's type.

Specified by:
getResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be "Context", "Output", and "Renderer".

getResourceTypeCode

public int getResourceTypeCode()
Description copied from interface: ConsumedResourceInterface
Gets the code describing the resource's type.

Specified by:
getResourceTypeCode in interface ConsumedResourceInterface
Returns:
Resource's type code.

isRequired

public boolean isRequired()
Description copied from interface: ConsumedResourceInterface
Determines if this resource is required by the service's configuration.

Specified by:
isRequired in interface ConsumedResourceInterface
Returns:
true if this resource is required by the service's configuration.

addRepository

public void addRepository(java.lang.String name)
Add a repository definition name to the list for this group.

Parameters:
name - The repository definition name to add to this group.
Throws:
java.lang.IllegalStateException - if this group has been set to protected.

removeRepository

public void removeRepository(java.lang.String name)
Remove a repository definition name from this group.

Parameters:
name - the repository definition name to remove from this group.
Throws:
java.lang.IllegalStateException - if this group has been set to protected.

getGroupNames

public java.util.List getGroupNames()
Get a copy of the list of repository definition names for this group.

Returns:
A List of String objects with repository definition names.

getName

public java.lang.String getName()
Get the name of this group.

Returns:
The group name.

setName

public void setName(java.lang.String name)
Set the name of this group.

Parameters:
name - The new name of this group.
Throws:
java.lang.IllegalStateException - if this group has been set to protected.

setProtected

public void setProtected()
Set this group to be protected. Attempts to change it after this call is made will result in an IllegalStateException.


copyTo

public RepositoryGroup copyTo(java.lang.String name)
Make a writable copy of this group with a new name.

Parameters:
name - The name of the new group.
Returns:
The new group.

toString

public java.lang.String toString()
Gets a string representing this repository group composed of its name and description.

Overrides:
toString in class java.lang.Object
Returns:
Repository group's name and description.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones this RepositoryGroup.

Specified by:
clone in interface ConsumedResourceInterface
Overrides:
clone in class java.lang.Object
Returns:
Clone of this RepositoryGroup.
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object o)
Determines if the object is equal to this repository group.

Overrides:
equals in class java.lang.Object
Returns:
true if the object is equal or false otherwise.

hashCode

public int hashCode()
Gets the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.