Esri Geoportal Server
1.0

com.esri.gpt.catalog.harvest.protocols
Class HarvestProtocol

java.lang.Object
  extended by com.esri.gpt.catalog.harvest.protocols.HarvestProtocol
All Implemented Interfaces:
Protocol, Serializable
Direct Known Subclasses:
AbstractHTTPHarvestProtocol, HarvestProtocolNone

public abstract class HarvestProtocol
extends Object
implements Protocol, Serializable

Generic harvesting protocol.

See Also:
HrRecord, Serialized Form

Nested Class Summary
static class HarvestProtocol.ProtocolType
          Protocol type.
 
Constructor Summary
HarvestProtocol()
           
 
Method Summary
protected abstract  void applyAttributeMap(StringAttributeMap attributeMap)
          Sets all the attributes.
protected  String chckAttr(StringAttribute attribute)
          Checks attribute.
 void checkConnection(String url)
          Checks connection to the specific server.
protected abstract  StringAttributeMap extractAttributeMap()
          Gets all the attributes.
abstract  HRClient getClient(String hostUrl)
          Gets client associated with particular protocol.
 long getFlags()
          Gets flag set.
 String getKind()
          Gets protocol kind.
 boolean getPingSupported()
          Checks if ping operation is supported.
abstract  HarvestProtocol.ProtocolType getType()
          Gets protocol type.
 void ping(String url)
          Pings resource.
 void setFlags(long flags)
          Sets flag set.
 String toString()
          Gets string representation of the protocol.
 String toXmlString()
          Creates xml string representation of the protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.esri.gpt.control.webharvest.protocol.Protocol
getAttributeMap, newQueryBuilder, setAttributeMap
 

Constructor Detail

HarvestProtocol

public HarvestProtocol()
Method Detail

getPingSupported

public boolean getPingSupported()
Checks if ping operation is supported.

Returns:
true if ping operation is supported
See Also:
HRClient.ping()

getType

public abstract HarvestProtocol.ProtocolType getType()
Gets protocol type.

Returns:
protocol type

getKind

public String getKind()
Description copied from interface: Protocol
Gets protocol kind.

Specified by:
getKind in interface Protocol
Returns:
protocol kind

getClient

public abstract HRClient getClient(String hostUrl)
                            throws HRInvalidProtocolException
Gets client associated with particular protocol.

Parameters:
hostUrl - host URL
Returns:
instance of the harvest repository client
Throws:
HRInvalidProtocolException - if unable to create client for the protocol

checkConnection

public final void checkConnection(String url)
                           throws HRInvalidProtocolException,
                                  HRConnectionException
Checks connection to the specific server.

Parameters:
url - server URL
Throws:
HRInvalidProtocolException - when protocol attributes are invalid
HRConnectionException - if connecting remote repository failed

ping

public final void ping(String url)
                throws Exception
Pings resource.

Parameters:
url - resource URL
Throws:
IllegalArgumentException - if invalid protocol definition
IOException - if error connection resource
Exception

toXmlString

public String toXmlString()
Creates xml string representation of the protocol.

Returns:
xml string representation of the protocol

toString

public String toString()
Gets string representation of the protocol.

Overrides:
toString in class Object
Returns:
string representation of the protocol

extractAttributeMap

protected abstract StringAttributeMap extractAttributeMap()
Gets all the attributes.

Returns:
attributes as attribute map

applyAttributeMap

protected abstract void applyAttributeMap(StringAttributeMap attributeMap)
Sets all the attributes.

Parameters:
attributeMap - attributes as attribute map

chckAttr

protected String chckAttr(StringAttribute attribute)
Checks attribute.

Parameters:
attribute - attributes
Returns:
attribute value

getFlags

public long getFlags()
Description copied from interface: Protocol
Gets flag set.

Specified by:
getFlags in interface Protocol
Returns:
flags set

setFlags

public void setFlags(long flags)
Description copied from interface: Protocol
Sets flag set.

Specified by:
setFlags in interface Protocol
Parameters:
flags - flag set

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.