com.indexdata.torus2.model
Class ParentRealm

java.lang.Object
  extended by com.indexdata.torus2.model.ParentRealm
All Implemented Interfaces:
DOMSerializable

public class ParentRealm
extends Object
implements DOMSerializable

Represents parent realm entity.

Author:
jakub

Constructor Summary
ParentRealm(String id, String name, String url)
           
ParentRealm(String id, String name, URL url)
           
 
Method Summary
static ParentRealm fromDOM(Document doc, String id)
          This method can be safely called on user input as it ignores system controlled fields that end-up serialized in the output document.
static ParentRealm fromStoredDOM(Document doc, String id)
          This method calls ParentRealm#fromDOM and also parses the stored fields that otherwise are ignored from the user request.
 String getId()
           
 Date getLastRefreshed()
           
 String getName()
           
 int getPriority()
           
 int getRefreshAfter()
           
 URL getUrl()
           
 boolean needsRefresh()
           
 URL resolveUrl(String host)
           
 void setId(String id)
           
 void setLastRefreshed(Date lastRefreshed)
           
 void setPriority(int priority)
           
 void setRefreshAfter(int refreshAfter)
           
 void setUrl(URL url)
           
 Element toDOM(Element parentElement)
          Serializes object to a DOM Tree and returns the root element for that Tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParentRealm

public ParentRealm(String id,
                   String name,
                   URL url)

ParentRealm

public ParentRealm(String id,
                   String name,
                   String url)
            throws MalformedURLException
Throws:
MalformedURLException
Method Detail

getId

public String getId()

setId

public void setId(String id)

getName

public String getName()

getUrl

public URL getUrl()

setUrl

public void setUrl(URL url)

resolveUrl

public URL resolveUrl(String host)
               throws InternalIOException
Throws:
InternalIOException

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

getLastRefreshed

public Date getLastRefreshed()

setLastRefreshed

public void setLastRefreshed(Date lastRefreshed)

getRefreshAfter

public int getRefreshAfter()

setRefreshAfter

public void setRefreshAfter(int refreshAfter)

needsRefresh

public boolean needsRefresh()

toDOM

public Element toDOM(Element parentElement)
Description copied from interface: DOMSerializable
Serializes object to a DOM Tree and returns the root element for that Tree. If parentElement is null this method creates a new Document on it's own.

Specified by:
toDOM in interface DOMSerializable
Returns:

fromDOM

public static ParentRealm fromDOM(Document doc,
                                  String id)
                           throws MalformedInputException
This method can be safely called on user input as it ignores system controlled fields that end-up serialized in the output document.

Parameters:
doc -
id -
Returns:
Throws:
MalformedInputException

fromStoredDOM

public static ParentRealm fromStoredDOM(Document doc,
                                        String id)
                                 throws MalformedInputException
This method calls ParentRealm#fromDOM and also parses the stored fields that otherwise are ignored from the user request.

Parameters:
doc - input DOM doc
id - of the entity
Returns:
new instance of ParentRealm
Throws:
MalformedInputException


Copyright © 2008-2013 Index Data. All Rights Reserved.