|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.connector.federation.contribution.Contribution
@Immutable public abstract class Contribution
The contribution of a source to the information for a single federated node. Users of this interface should treat contributions
as generally being immutable, since some implementation will be immutable and will return immutable properties
and children
containers. Thus, rather than make changes to an existing contribution, a new
contribution is created to replace the previous contribution.
Method Summary | |
---|---|
static Contribution |
create(String sourceName,
String workspaceName,
DateTime expirationTime)
Create an empty contribution from the named source. |
static Contribution |
create(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
Collection<Property> properties,
List<Location> children)
Create a contribution of the supplied properties and children from the named source. |
static Contribution |
create(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
Location child)
Create a contribution of a single child from the named source. |
static Contribution |
create(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
Location child1,
Location child2)
Create a contribution of a single child from the named source. |
static Contribution |
create(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
Property property)
Create a contribution of a single property from the named source. |
static Contribution |
createPlaceholder(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
List<Location> children)
Create a placeholder contribution of the supplied properties and children from the named source. |
static Contribution |
createPlaceholder(String sourceName,
String workspaceName,
Location locationInSource,
DateTime expirationTime,
Location child)
Create a placeholder contribution of a single child from the named source. |
boolean |
equals(Object obj)
This implementation only compares the source name . |
Iterator<Location> |
getChildren()
Get the children that make up this contribution. |
int |
getChildrenCount()
Get the number of children that make up this contribution. |
DateTime |
getExpirationTimeInUtc()
Get the expiration time, already in UTC. |
abstract Location |
getLocationInSource()
Get the source-specific location of this information. |
Iterator<Property> |
getProperties()
Get the properties that are in this contribution. |
Property |
getProperty(Name name)
Get the contributed property with the supplied name. |
int |
getPropertyCount()
Get the number of properties that are in this contribution. |
String |
getSourceName()
Get the name of the source that made this contribution. |
String |
getString(NamespaceRegistry registry)
|
String |
getWorkspaceName()
Get the name of the workspace in the source from which this contribution came. |
int |
hashCode()
This implementation returns the hash code of the source name , and is compatible with the
implementation of equals(Object) . |
boolean |
isEmpty()
Return whether this contribution is an empty contribution. |
boolean |
isExpired(DateTime utcTime)
Determine whether this contribution has expired given the supplied current time. |
boolean |
isPlaceholder()
Determine whether this contribution is considered a placeholder necessary solely because the same source has contributions at or below the children. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Contribution create(String sourceName, String workspaceName, DateTime expirationTime)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blankexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration time
public static Contribution create(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, Property property)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the location in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timeproperty
- the property from the source; may not be null
public static Contribution create(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, Location child)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the path in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timechild
- the child from the source; may not be null or empty
public static Contribution create(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, Location child1, Location child2)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the path in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timechild1
- the first child from the source; may not be null or emptychild2
- the second child from the source; may not be null or empty
public static Contribution create(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, Collection<Property> properties, List<Location> children)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the path in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timeproperties
- the properties from the source; may not be nullchildren
- the children from the source; may not be null or empty
public static Contribution createPlaceholder(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, Location child)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the path in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timechild
- the child from the source; may not be null or empty
public static Contribution createPlaceholder(String sourceName, String workspaceName, Location locationInSource, DateTime expirationTime, List<Location> children)
sourceName
- the name of the source, which may not be null or blankworkspaceName
- the name of the workspace, which may not be null or blanklocationInSource
- the path in the source for this contributed information; may not be nullexpirationTime
- the time (in UTC) after which this contribution should be considered expired, or null if there is no
expiration timechildren
- the children from the source; may not be null or empty
public String getSourceName()
public String getWorkspaceName()
source
from which this contribution came.
public abstract Location getLocationInSource()
EmptyContribution
public boolean isExpired(DateTime utcTime)
utcTime
- the current time expressed in UTC; may not be null
public DateTime getExpirationTimeInUtc()
public Iterator<Property> getProperties()
removal
.
public int getPropertyCount()
public Property getProperty(Name name)
name
- the name of the property
public Iterator<Location> getChildren()
removal
.
public int getChildrenCount()
public boolean isEmpty()
public boolean isPlaceholder()
public int hashCode()
This implementation returns the hash code of the source name
, and is compatible with the
implementation of equals(Object)
.
hashCode
in class Object
public String toString()
toString
in class Object
Object.toString()
public String getString(NamespaceRegistry registry)
public boolean equals(Object obj)
This implementation only compares the source name
.
equals
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |