/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This subclass is used by LDAP to implement the schema calls.
* Basically, it keeps track of which context it is an attribute of
* so it can get the schema for that cotnext.
*
* @author Jon Ruiz
*/
// these two are used to reconstruct the baseCtx if this attribute has
// been serialized (
return attr;
}
/**
* Adds a new value to this attribute.
*
* @param attrVal The value to be added. If null, a null value is added to
* the attribute.
* @return true Always returns true.
*/
// LDAP attributes don't contain duplicate values so there's no need
// to check if the value already exists before adding it.
return true;
}
/**
* Constructs a new instance of an attribute.
*
* @param id The attribute's id. It cannot be null.
*/
super(id);
}
/**
* Constructs a new instance of an attribute.
*
* @param id The attribute's id. It cannot be null.
* @param baseCtx the baseCtx object of this attribute
* @param rdn the RDN of the entry (relative to baseCtx)
*/
super(id);
}
/**
* Sets the baseCtx and rdn used to find the attribute's schema
* Used by LdapCtx.setParents().
*/
}
/**
* returns the ctx this attribute came from. This call allows
* LDAPAttribute to be serializable. 'baseCtx' is transient so if
* it is null, the `baseCtxURL` is used to reconstruct the context
* to which calls are made.
*/
if (baseCtxEnv == null) {
}
"com.sun.jndi.ldap.LdapCtxFactory");
}
return baseCtx;
}
/**
* This is called when the object is serialized. It is
* overridden so that the appropriate class variables can be set
* to re-construct the baseCtx when deserialized. Setting these
* variables is costly, so it is only done if the object
* is actually serialized.
*/
throws IOException {
// setup internal state
this.setBaseCtxInfo();
// let the ObjectOutpurStream do the real work of serialization
}
/**
* sets the information needed to reconstruct the baseCtx if
* we are serialized. This must be called _before_ the object is
* serialized!!!
*/
private void setBaseCtxInfo() {
}
// remove any security credentials - otherwise the serialized form
// would store them in the clear
while(keys.hasMoreElements()) {
//if we need to remove props, we must do it to a clone
//of the environment. cloning is expensive, so we only do
//it if we have to.
}
}
}
}
// set baseCtxEnv depending on whether we removed props or not
}
/**
* Retrieves the syntax definition associated with this attribute.
* @return This attribute's syntax definition.
*/
// get the syntax id from the attribute def
throw new NameNotFoundException(
getID() + "does not have a syntax associated with it");
}
// look in the schema tree for the syntax definition
}
/**
* Retrieves this attribute's schema definition.
*
* @return This attribute's schema definition.
*/
}
}