001: /*
002: * Copyright 2001-2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.ws.scout.registry.infomodel;
018:
019: import java.net.URL;
020: import java.util.ArrayList;
021: import java.util.Collection;
022:
023: import javax.xml.registry.JAXRException;
024: import javax.xml.registry.LifeCycleManager;
025: import javax.xml.registry.UnsupportedCapabilityException;
026: import javax.xml.registry.infomodel.Organization;
027: import javax.xml.registry.infomodel.PersonName;
028: import javax.xml.registry.infomodel.User;
029:
030: /**
031: * Implements JAXR Interface.
032: * For futher details, look into the JAXR API Javadoc.
033: *
034: * @author Anil Saldhana <anil@apache.org>
035: */
036: public class UserImpl extends RegistryObjectImpl implements User {
037: private PersonName personName = null;
038:
039: private Collection postalAddresses = new ArrayList();
040: private Collection emailAddresses = new ArrayList();
041: private Collection telnumbers = new ArrayList();
042:
043: private String type = "";
044:
045: private Organization org = null;
046:
047: /**
048: * Creates a new instance of UserImpl
049: */
050: public UserImpl(LifeCycleManager lifeCycleManager) {
051: super (lifeCycleManager);
052: }
053:
054: public Organization getOrganization() throws JAXRException {
055: return org;
056: }
057:
058: public PersonName getPersonName() throws JAXRException {
059: return personName;
060: }
061:
062: public Collection getPostalAddresses() throws JAXRException {
063: return postalAddresses;
064: }
065:
066: public Collection getTelephoneNumbers(String str)
067: throws JAXRException {
068: return telnumbers;
069: }
070:
071: public String getType() throws JAXRException {
072: return type;
073: }
074:
075: public URL getUrl() throws JAXRException {
076: throw new UnsupportedCapabilityException();
077: }
078:
079: public void setEmailAddresses(Collection collection)
080: throws JAXRException {
081: emailAddresses = collection;
082: }
083:
084: public void setPersonName(PersonName pname) throws JAXRException {
085: personName = pname;
086: }
087:
088: public void setPostalAddresses(Collection collection)
089: throws JAXRException {
090: postalAddresses = collection;
091: }
092:
093: public void setTelephoneNumbers(Collection collection)
094: throws JAXRException {
095: telnumbers = collection;
096: }
097:
098: public void setType(String str) throws JAXRException {
099: type = str;
100: }
101:
102: public void setUrl(URL uRL) throws JAXRException {
103: throw new UnsupportedCapabilityException();
104: }
105:
106: public Collection getEmailAddresses() throws JAXRException {
107: return emailAddresses;
108: }
109:
110: //Specific API
111: public void setOrganization(Organization o) {
112: org = o;
113: }
114: }
|