Change-Id: Ic5526189f5a646a369d43676b287034c0f781ce5
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
<scope>test</scope>
</dependency>
</dependencies>
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<scm>
<connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
<scm>
<connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
* @param entityName the name of the entity used to construct a general-entity InstanceIdentifier
*/
public Entity(@Nonnull String type, @Nonnull String entityName) {
* @param entityName the name of the entity used to construct a general-entity InstanceIdentifier
*/
public Entity(@Nonnull String type, @Nonnull String entityName) {
- super(type, InstanceIdentifier.builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.
- mdsal.core.general.entity.rev150930.Entity.class,
+ super(type, InstanceIdentifier.builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+ .mdsal.core.general.entity.rev150930.Entity.class,
new EntityKey(Preconditions.checkNotNull(entityName, "entityName should not be null"))).build());
}
}
new EntityKey(Preconditions.checkNotNull(entityName, "entityName should not be null"))).build());
}
}
@Beta
public class EntityOwnershipChange extends GenericEntityOwnershipChange<InstanceIdentifier<?>, Entity> {
@Beta
public class EntityOwnershipChange extends GenericEntityOwnershipChange<InstanceIdentifier<?>, Entity> {
- /**
- * {@inheritDoc}
- */
public EntityOwnershipChange(@Nonnull final Entity entity, @Nonnull final EntityOwnershipChangeState state) {
super(entity, state, false);
}
public EntityOwnershipChange(@Nonnull final Entity entity, @Nonnull final EntityOwnershipChangeState state) {
super(entity, state, false);
}
- /**
- * {@inheritDoc}
- */
public EntityOwnershipChange(@Nonnull final Entity entity, @Nonnull final EntityOwnershipChangeState state,
final boolean inJeopardy) {
super(entity, state, inJeopardy);
public EntityOwnershipChange(@Nonnull final Entity entity, @Nonnull final EntityOwnershipChangeState state,
final boolean inJeopardy) {
super(entity, state, inJeopardy);
public interface EntityOwnershipListener extends
GenericEntityOwnershipListener<InstanceIdentifier<?>, EntityOwnershipChange> {
public interface EntityOwnershipListener extends
GenericEntityOwnershipListener<InstanceIdentifier<?>, EntityOwnershipChange> {
- /**
- * {@inheritDoc}
- */
@Override
void ownershipChanged(EntityOwnershipChange ownershipChange);
}
@Override
void ownershipChanged(EntityOwnershipChange ownershipChange);
}
public interface EntityOwnershipService extends
GenericEntityOwnershipService<InstanceIdentifier<?>, Entity, EntityOwnershipListener> {
public interface EntityOwnershipService extends
GenericEntityOwnershipService<InstanceIdentifier<?>, Entity, EntityOwnershipListener> {
- /**
- * {@inheritDoc}
- */
@Override
EntityOwnershipCandidateRegistration registerCandidate(@Nonnull Entity entity)
throws CandidateAlreadyRegisteredException;
@Override
EntityOwnershipCandidateRegistration registerCandidate(@Nonnull Entity entity)
throws CandidateAlreadyRegisteredException;
- /**
- * {@inheritDoc}
- */
@Override
EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType,
@Nonnull EntityOwnershipListener listener);
@Override
EntityOwnershipListenerRegistration registerListener(@Nonnull String entityType,
@Nonnull EntityOwnershipListener listener);
- /**
- * {@inheritDoc}
- */
@Override
Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity);
@Override
Optional<EntityOwnershipState> getOwnershipState(@Nonnull Entity forEntity);
- /**
- * {@inheritDoc}
- */
@Override
boolean isCandidateRegistered(@Nonnull Entity forEntity);
}
@Override
boolean isCandidateRegistered(@Nonnull Entity forEntity);
}
package org.opendaylight.mdsal.eos.binding.api;
import static org.junit.Assert.assertEquals;
package org.opendaylight.mdsal.eos.binding.api;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;
-import org.opendaylight.mdsal.eos.binding.api.Entity;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifier;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifier;
* @author Thomas Pantelis
*/
public class EntityTest {
* @author Thomas Pantelis
*/
public class EntityTest {
static String ENTITY_TYPE1 = "type1";
static String ENTITY_TYPE2 = "type2";
static final InstanceIdentifier<TestDataObject1> ID1 = InstanceIdentifier.create(TestDataObject1.class);
static String ENTITY_TYPE1 = "type1";
static String ENTITY_TYPE2 = "type2";
static final InstanceIdentifier<TestDataObject1> ID1 = InstanceIdentifier.create(TestDataObject1.class);
public void testEntityNameConstructor() {
Entity entity = new Entity(ENTITY_TYPE1, "foo");
public void testEntityNameConstructor() {
Entity entity = new Entity(ENTITY_TYPE1, "foo");
- Identifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.
- mdsal.core.general.entity.rev150930.Entity> keyID = entity.getIdentifier().firstKeyOf(
- org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.Entity.class);
+ Identifier<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
+ .mdsal.core.general.entity.rev150930.Entity> keyID = entity.getIdentifier().firstKeyOf(
+ org.opendaylight.yang.gen.v1.urn
+ .opendaylight.params.xml.ns.yang.mdsal.core.general.entity.rev150930.Entity.class);
assertNotNull("List key not found", keyID);
}
assertNotNull("List key not found", keyID);
}