protected boolean isOperationSupported( String operationName ) { if ( metadata == null ) { return false; } return metadata.getOperation( operationName ) != null; }
/** * Returns the endpoint {@link URL}s for the specified operation and method HTTP-GET. * * @return endpoint URLs, can be empty, but never <code>null</code> */ public List<URL> getGetUrls( String operationName ) { Operation operation = getOperation( operationName ); if ( operation != null ) { return operation.getGetUrls(); } return null; }
/** * Returns the endpoint {@link URL}s for the specified operation and method HTTP-POST. * * @return endpoint URLs, can be empty, but never <code>null</code> */ public List<URL> getPostUrls( String operationName ) { Operation operation = getOperation( operationName ); if ( operation != null ) { return operation.getPostUrls(); } return null; }
private void mergeDescription( Description desc ) { if ( desc != null ) { if ( description.getTitles() == null || description.getTitles().isEmpty() ) { description.setTitles( desc.getTitles() ); } if ( description.getAbstracts() == null || description.getAbstracts().isEmpty() ) { description.setAbstracts( desc.getAbstracts() ); } if ( description.getKeywords() == null || description.getKeywords().isEmpty() ) { description.setKeywords( desc.getKeywords() ); } } }
public static Description fromJaxb( List<LanguageStringType> titles, List<LanguageStringType> abstracts, List<KeywordsType> keywords ) { Description desc = new Description( null, null, null, null ); if ( titles != null ) { desc.setTitles( map( titles, LANG_LANG_MAPPER ) ); } if ( abstracts != null ) { desc.setAbstracts( map( abstracts, LANG_LANG_MAPPER ) ); } if ( keywords != null ) { desc.setKeywords( map( keywords, KW_MAPPER ) ); } return desc; }
/** * Creates a new {@link Description} instance. * * @param name * name of the object, can be <code>null</code> * @param titles * (multilingual) titles for the object, can be <code>null</code> * @param abstracts * (multilingual) abstracts for the object, can be <code>null</code> * @param keywords * (multilingual) keywords for the object, can be <code>null</code> */ public Description( String name, List<LanguageString> titles, List<LanguageString> abstracts, List<Pair<List<LanguageString>, CodeType>> keywords ) { this.name = name; setTitles( titles ); setAbstracts( abstracts ); setKeywords( keywords ); }
private String getServiceUrl() { String url = getUrl; if ( provider != null && provider.getServiceContact() != null && provider.getServiceContact().getContactInfo() != null && provider.getServiceContact().getContactInfo().getOnlineResource() != null ) { url = provider.getServiceContact().getContactInfo().getOnlineResource().toExternalForm(); } return url; }
private void writeServiceIdentificationParts( XMLStreamWriter writer ) throws XMLStreamException { if ( identification != null ) { maybeWriteElementNS( writer, WMSNS, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElementNS( writer, WMSNS, "AccessConstraints", cons ); } } } else { writeElement( writer, WMSNS, "Fees", "none" ); writeElement( writer, WMSNS, "AccessConstraints", "none" ); } }
private void writeMetadataUrls( final XMLStreamWriter writer, final List<MetadataUrl> list ) throws XMLStreamException { if ( list == null ) { return; } for ( final MetadataUrl url : list ) { writer.writeStartElement( WMSNS, "MetadataURL" ); if ( url.getType() == null ) { writer.writeAttribute( "type", "ISO19115:2003" ); } else { writer.writeAttribute( "type", url.getType() ); } if ( url.getFormat() == null ) { writeElement( writer, WMSNS, "Format", "application/xml" ); } else { writeElement( writer, WMSNS, "Format", url.getFormat() ); } writer.writeStartElement( WMSNS, "OnlineResource" ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", url.getUrl() ); writer.writeEndElement(); writer.writeEndElement(); } }
void exportServiceIdentification() throws XMLStreamException { writer.writeStartElement( OWS110_NS, "ServiceIdentification" ); if ( identification == null ) { writeElement( writer, OWS110_NS, "Title", "deegree 3 WMTS" ); writeElement( writer, OWS110_NS, "Abstract", "deegree 3 WMTS implementation" ); } else { LanguageString title = identification.getTitle( null ); writeElement( writer, OWS110_NS, "Title", title == null ? "deegree 3 WMTS" : title.getString() ); LanguageString _abstract = identification.getAbstract( null ); writeElement( writer, OWS110_NS, "Abstract", _abstract == null ? "deegree 3 WMTS implementation" : _abstract.getString() ); } writeElement( writer, OWS110_NS, "ServiceType", "WMTS" ); writeElement( writer, OWS110_NS, "ServiceTypeVersion", "1.0.0" ); writer.writeEndElement(); }
@Override public ServiceProvider parseServiceProvider() throws XMLParsingException { String onlineResource = getNodeAsString( rootElement, new XPath( "wfs:Service/wfs:OnlineResource", nsContext ), "null" ); return new ServiceProvider( null, onlineResource, null ); }
/** * @param si * @return null, if si is null */ public static ServiceIdentification convertFromJAXB( ServiceIdentificationType si ) { if ( si == null ) { return null; } List<Pair<List<LanguageString>, CodeType>> keywords = null; if ( si.getKeywords() != null ) { keywords = map( si.getKeywords(), KW_MAPPER ); } List<LanguageString> titles = map( si.getTitle(), LANG_MAPPER ); List<LanguageString> abstracts = map( si.getAbstract(), LANG_MAPPER ); String fees = si.getFees(); List<String> accessConstraints = si.getAccessConstraints(); return new ServiceIdentification( null, titles, abstracts, keywords, null, null, null, fees, accessConstraints ); }
protected List<URL> getPostUrls( String operationName ) { if ( metadata == null ) { return Collections.emptyList(); } return metadata.getPostUrls( operationName ); }
protected List<URL> getGetUrls( String operationName ) { if ( metadata == null ) { return Collections.emptyList(); } return metadata.getGetUrls( operationName ); }
private void checkCapabilities() { List<Version> supportedVersions = getIdentification().getServiceTypeVersion(); for ( Version version : supportedVersions ) { if ( VERSION_111.equals( version ) || VERSION_130.equals( version ) ) { return; } } throw new IllegalArgumentException( get( "WMSCLIENT.WRONG_VERSION_CAPABILITIES", supportedVersions, VERSION_111 + ", " + VERSION_130 ) ); }
private void ckeckOperationSupported( String operationName ) throws UnsupportedOperationException { OperationsMetadata om = getOperations(); if ( om.getOperation( operationName ) == null ) throw new UnsupportedOperationException( "Operation " + operationName + " is not supported!" ); }
private String getServiceUrl() { String url = getUrl; if ( provider != null && provider.getServiceContact() != null && provider.getServiceContact().getContactInfo() != null && provider.getServiceContact().getContactInfo().getOnlineResource() != null ) { url = provider.getServiceContact().getContactInfo().getOnlineResource().toExternalForm(); } return url; }
private void writeServiceIdentificationParts( XMLStreamWriter writer ) throws XMLStreamException { if ( identification != null ) { maybeWriteElement( writer, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElement( writer, "AccessConstraints", cons ); } } } else { writeElement( writer, "Fees", "none" ); writeElement( writer, "AccessConstraints", "none" ); } } private boolean isGetSupported( WMSConstants.WMSRequestType requestType ) {
/** * @param sp * @return null, if sp is null */ public static ServiceProvider convertFromJAXB( ServiceProviderType sp ) { if ( sp == null ) { return null; } return new ServiceProvider( sp.getProviderName(), sp.getProviderSite(), convertFromJAXB( sp.getServiceContact() ) ); }
@Override public ServiceProvider parseServiceProvider() { OMElement serviceProviderEl = getElement( getRootElement(), new XPath( "ows:ServiceProvider", nsContext ) ); if ( serviceProviderEl == null ) { return null; } String providerName = getNodeAsString( serviceProviderEl, new XPath( "ows:ProviderName", nsContext ), null ); String providerSite = getNodeAsString( serviceProviderEl, new XPath( "ows:ProviderSite/@xlink:href", nsContext ), null ); OMElement serviceContactEl = getElement( serviceProviderEl, new XPath( "ows:ServiceContact", nsContext ) ); ResponsibleParty serviceContact = null; if ( serviceContactEl != null ) { serviceContact = parseServiceContact( serviceContactEl ); } return new ServiceProvider( providerName, providerSite, serviceContact ); }